/* ==========================================================================
   ISP Control Panel — Portal do cliente (Voler)
   Complementos ao tema Voler (voler-main/dist), sem mudar a identidade dele.
   Cores em variáveis: o tema escuro (html[data-theme=dark]) só troca os valores
   e sobrescreve os componentes do Voler/Bootstrap 5.0, que não têm modo escuro.
   ========================================================================== */

:root {
    --sc-primary: #5a8dee;
    --sc-primary-dark: #3d6fd6;
    --sc-radius: .75rem;

    --sc-bg: #f7faff;
    --sc-surface: #ffffff;
    --sc-surface-2: #f2f5fb;
    --sc-surface-hover: #f5f9ff;
    --sc-heading: #25396f;
    --sc-text: #3e4b5b;
    --sc-muted: #7c8db5;
    --sc-border: #e9ecf3;
    --sc-input-border: #dfe5f1;
    --sc-shadow: 0 6px 20px rgba(25, 42, 70, .07);
    --sc-shadow-lg: 0 10px 30px rgba(25, 42, 70, .15);

    --sc-tint-primary-bg: #e8efff;  --sc-tint-primary: #3d6fd6;
    --sc-tint-success-bg: #e2f8ef;  --sc-tint-success: #1e9e62;
    --sc-tint-warning-bg: #fff3e1;  --sc-tint-warning: #c47a12;
    --sc-tint-danger-bg: #ffe8e8;   --sc-tint-danger: #d43c3d;
    --sc-tint-info-bg: #e0f7fa;     --sc-tint-info: #0393a3;
    --sc-tint-secondary-bg: #eef1f6; --sc-tint-secondary: #66758f;
    --sc-tint-purple-bg: #f0edff;   --sc-tint-purple: #6a5ae0;
}

html[data-theme=dark] {
    --sc-primary: #6c9cf2;
    --sc-primary-dark: #5a8dee;

    --sc-bg: #0e1522;
    --sc-surface: #162131;
    --sc-surface-2: #1d2a3e;
    --sc-surface-hover: #1b283b;
    --sc-heading: #e7edf7;
    --sc-text: #c2ccdb;
    --sc-muted: #8797b3;
    --sc-border: #253348;
    --sc-input-border: #2c3c55;
    --sc-shadow: 0 6px 20px rgba(0, 0, 0, .35);
    --sc-shadow-lg: 0 10px 30px rgba(0, 0, 0, .5);

    --sc-tint-primary-bg: rgba(108, 156, 242, .16);  --sc-tint-primary: #8fb3f5;
    --sc-tint-success-bg: rgba(57, 218, 138, .14);   --sc-tint-success: #5fe0a2;
    --sc-tint-warning-bg: rgba(253, 172, 65, .15);   --sc-tint-warning: #fdbb63;
    --sc-tint-danger-bg: rgba(255, 91, 92, .15);     --sc-tint-danger: #ff8384;
    --sc-tint-info-bg: rgba(0, 207, 221, .14);       --sc-tint-info: #4fdce6;
    --sc-tint-secondary-bg: rgba(160, 175, 200, .12); --sc-tint-secondary: #a8b5ca;
    --sc-tint-purple-bg: rgba(140, 125, 245, .16);   --sc-tint-purple: #aea4f8;
    color-scheme: dark;
}

body { color: var(--sc-text); background: var(--sc-bg); }
#main { background-color: var(--sc-bg); }
a { color: var(--sc-primary); }
a:hover { color: var(--sc-primary-dark); }
h1, h2, h3, h4, h5, h6 { color: var(--sc-heading); }

/* ---------- Botões ---------- */
.btn { border-radius: .5rem; font-weight: 500; }
.btn-lg { border-radius: .65rem; }
/* Voler deixa texto preto/branco onde não deveria: corrige o contraste */
.btn-primary, .btn-primary:hover, .btn-primary:focus { color: #fff; }
.btn-primary:hover { background-color: var(--sc-primary-dark); border-color: var(--sc-primary-dark); }
.btn-success, .btn-success:hover, .btn-danger, .btn-danger:hover, .btn-info, .btn-info:hover { color: #fff; }
.btn.btn-light { color: var(--sc-heading); background-color: var(--sc-surface-2); border-color: var(--sc-surface-2); }
.btn.btn-light:hover, .btn.btn-light:focus { color: var(--sc-heading); background-color: var(--sc-border); border-color: var(--sc-border); }
.btn-outline-primary { color: var(--sc-primary); border-color: var(--sc-primary); }
.btn-outline-primary:hover { background-color: var(--sc-primary); border-color: var(--sc-primary); color: #fff; }

/* ---------- Sidebar ---------- */
.sidebar-wrapper { background-color: var(--sc-surface); border-right-color: var(--sc-border); box-shadow: none; overflow-y: auto; display: flex; flex-direction: column; }
.sc-sidebar-header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 1.5rem 1.25rem 1rem; }
.sc-logo { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; min-width: 0; }
.sc-logo-mark {
    display: inline-grid; place-items: center; flex-shrink: 0; width: 2.4rem; height: 2.4rem; border-radius: .7rem;
    background: var(--sc-brand-grad, linear-gradient(135deg, #25a6f1, #5a8dee)); color: #fff; font-size: 1.25rem;
}
.sc-logo-text { font-size: 1.15rem; font-weight: 700; color: var(--sc-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-sidebar-close { display: none; flex-shrink: 0; padding: .25rem .4rem; font-size: 1.1rem; color: var(--sc-muted); }
.sidebar-wrapper .sidebar-menu { flex: 1; display: flex; flex-direction: column; }
.sidebar-wrapper .menu { padding: 0 .75rem; margin-bottom: 1rem; list-style: none; }
.sidebar-wrapper .menu > li { list-style: none; }
.sidebar-title { padding: 1.1rem 1rem .35rem; font-size: .72rem; letter-spacing: .04em; color: var(--sc-muted); }
.sidebar-item { margin-top: .2rem; }
.sidebar-link { border-radius: .6rem; padding: .65rem 1rem; color: var(--sc-heading); text-decoration: none; }
#sidebar .sidebar-link > span { color: var(--sc-heading); opacity: .9; }
.sidebar-link i { font-size: 1.1rem; color: var(--sc-muted); width: 1.25rem; text-align: center; }
.sidebar-link:hover { background: var(--sc-surface-hover); }
#sidebar .sidebar-item.active .sidebar-link { background-color: var(--sc-primary); box-shadow: 0 4px 12px rgba(90, 141, 238, .35); }
#sidebar .sidebar-item.active .sidebar-link:before { display: none; }
#sidebar .sidebar-item.active .sidebar-link i,
#sidebar .sidebar-item.active .sidebar-link > span { color: #fff; opacity: 1; }
.sc-help-card { margin: auto 1rem 1rem; padding: 1rem; border-radius: var(--sc-radius); background: var(--sc-surface-2); }

/* ---------- Barra superior ---------- */
.sc-topnav { padding: .75rem 1.5rem; background: transparent; gap: .75rem; }
.sc-burger { display: none; width: 2.5rem; height: 2.5rem; padding: 0; border-radius: .6rem; background: var(--sc-surface); border: 1px solid var(--sc-border); color: var(--sc-heading); }
.sc-burger .bi { font-size: 1.4rem; line-height: 1; }
.sc-topnav-brand { font-weight: 700; color: var(--sc-heading); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-topnav-brand i { color: var(--sc-primary); }
.navbar-header .dropdown > a, .navbar-light .navbar-nav .nav-link { color: var(--sc-text); }
.sc-avatar {
    display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%;
    background: var(--sc-brand-grad, linear-gradient(135deg, #25a6f1, #5a8dee)); color: #fff; font-size: .8rem; font-weight: 700;
}
.dropdown-menu { background-color: var(--sc-surface); border: 1px solid var(--sc-border); border-radius: var(--sc-radius); box-shadow: var(--sc-shadow-lg); }
.dropdown-item { color: var(--sc-text); }
.dropdown-item:hover, .dropdown-item:focus { background-color: var(--sc-surface-2); color: var(--sc-heading); }
.dropdown-divider { border-top-color: var(--sc-border); }

/* ---------- Switch claro/escuro ---------- */
.sc-theme-switch { display: inline-flex; align-items: center; gap: .35rem; margin: 0; padding: .3rem .55rem; border-radius: 2rem; cursor: pointer; user-select: none; color: var(--sc-muted); background: var(--sc-surface); border: 1px solid var(--sc-border); }
.sc-theme-switch .form-check { min-height: 0; margin: 0; padding-left: 2.25em; }
.sc-theme-switch .form-check-input { cursor: pointer; margin-top: .15em; }
html[data-theme=dark] .sc-theme-switch .bi-moon-stars, html:not([data-theme=dark]) .sc-theme-switch .bi-sun { color: var(--sc-primary); }

/* ---------- Menu no celular/tablet: sobreposto, com fundo escurecido ---------- */
.sc-backdrop { display: none; }
@media (min-width: 992px) { #app .sidebar-wrapper { transition: none; } }
@media (max-width: 991.98px) {
    #app #main { margin-left: 0; }
    #app #sidebar .sidebar-wrapper { left: -280px; transition: left .25s ease; z-index: 1050; }
    #app #sidebar.is-open .sidebar-wrapper { left: 0; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
    #app #sidebar.is-open ~ .sc-backdrop { display: block; position: fixed; inset: 0; z-index: 1040; background: rgba(5, 10, 20, .55); }
    .sc-burger { display: inline-grid; place-items: center; }
    .sc-sidebar-close { display: inline-block; }
    body.sidebar-open { overflow: hidden; }
}

/* ---------- Conteúdo ---------- */
#main .main-content { padding: .5rem 1.5rem 2rem; }
.sc-page-title { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
#main .main-content .sc-page-title h3 { font-size: 1.6rem; font-weight: 700; color: var(--sc-heading); margin-bottom: .2rem; }
.text-subtitle, .text-muted { color: var(--sc-muted) !important; }
.sc-page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
@media (max-width: 575.98px) {
    #main .main-content { padding: .25rem 1rem 1.5rem; }
    .sc-topnav { padding: .75rem 1rem; gap: .5rem; }
    #main .main-content .sc-page-title h3 { font-size: 1.3rem; }
    .sc-page-actions, .sc-page-actions .btn { width: 100%; }
    .sc-theme-switch .bi-sun { display: none; }
}

.card { background-color: var(--sc-surface); color: var(--sc-text); border: 0; border-radius: var(--sc-radius); box-shadow: var(--sc-shadow); margin-bottom: 1.5rem; }
.card-header { background: transparent; border-bottom: 1px solid var(--sc-border); padding: 1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.card-header h4, .card-header .card-title { font-size: 1.05rem; font-weight: 700; color: var(--sc-heading); margin: 0; }
.card-body { padding: 1.25rem; }
.card-body.border-top, .border-top { border-top-color: var(--sc-border) !important; }
.card-footer { background: transparent; border-top: 1px solid var(--sc-border); }

/* Cards de destaque no estilo Voler (gradiente com gráfico) */
.card.card-statistic { overflow: hidden; color: #fff; min-height: 9.5rem; }
.card-statistic .sc-stat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; padding: 1.1rem 1.25rem .25rem; }
.card-statistic .sc-stat-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; opacity: .9; }
.card-statistic .sc-stat-value { font-size: 1.55rem; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.card-statistic .sc-stat-hint { font-size: .8rem; opacity: .9; }
.card-statistic .sc-stat-icon { font-size: 1.6rem; opacity: .85; }
.card-statistic .sc-stat-chart { height: 56px; margin-top: auto; }
.card-statistic a { color: #fff; }
.card-statistic.is-green { background: linear-gradient(180deg, #2fcf8a, #39da8a); box-shadow: 1px 2px 5px rgba(57, 218, 138, .5); }
.card-statistic.is-orange { background: linear-gradient(180deg, #fd9a3d, #fdac41); box-shadow: 1px 2px 5px rgba(253, 172, 65, .5); }
.card-statistic.is-red { background: linear-gradient(180deg, #ff5b5c, #ff7879); box-shadow: 1px 2px 5px rgba(255, 91, 92, .5); }
.card-statistic.is-purple { background: linear-gradient(180deg, #7367f0, #9e95f5); box-shadow: 1px 2px 5px rgba(115, 103, 240, .5); }
html[data-theme=dark] .card.card-statistic { box-shadow: none; filter: saturate(.9) brightness(.92); }

/* ---------- Selos suaves ---------- */
.sc-badge { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .6rem; border-radius: 2rem; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.sc-badge-success { background: var(--sc-tint-success-bg); color: var(--sc-tint-success); }
.sc-badge-warning { background: var(--sc-tint-warning-bg); color: var(--sc-tint-warning); }
.sc-badge-danger  { background: var(--sc-tint-danger-bg); color: var(--sc-tint-danger); }
.sc-badge-info    { background: var(--sc-tint-info-bg); color: var(--sc-tint-info); }
.sc-badge-primary { background: var(--sc-tint-primary-bg); color: var(--sc-tint-primary); }
.sc-badge-secondary { background: var(--sc-tint-secondary-bg); color: var(--sc-tint-secondary); }
.sc-badge-purple, .sc-badge-orange { background: var(--sc-tint-purple-bg); color: var(--sc-tint-purple); }
.sc-hero-badge { background: rgba(255, 255, 255, .22); color: #fff; }

/* ---------- Listas ---------- */
.sc-list { list-style: none; margin: 0; padding: 0; }
.sc-list > li, .sc-list > a { display: flex; align-items: center; gap: .9rem; padding: .9rem 1.25rem; border-bottom: 1px solid var(--sc-border); color: inherit; text-decoration: none; }
.sc-list > li:last-child, .sc-list > a:last-child { border-bottom: 0; }
.sc-list > a:hover { background: var(--sc-surface-hover); }
.sc-list-icon { display: inline-grid; place-items: center; flex-shrink: 0; width: 2.5rem; height: 2.5rem; border-radius: .7rem; font-size: 1.1rem; }
.sc-list-main { flex: 1; min-width: 0; }
.sc-list-title { font-weight: 600; color: var(--sc-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-list-sub { font-size: .8rem; color: var(--sc-muted); }
.sc-tint-primary { background: var(--sc-tint-primary-bg); color: var(--sc-tint-primary); }
.sc-tint-success { background: var(--sc-tint-success-bg); color: var(--sc-tint-success); }
.sc-tint-warning { background: var(--sc-tint-warning-bg); color: var(--sc-tint-warning); }
.sc-tint-danger  { background: var(--sc-tint-danger-bg); color: var(--sc-tint-danger); }
.sc-tint-info    { background: var(--sc-tint-info-bg); color: var(--sc-tint-info); }

/* ---------- Definições ---------- */
.sc-dl { display: grid; grid-template-columns: minmax(8rem, 40%) 1fr; gap: .6rem 1rem; margin: 0; }
.sc-dl dt { font-weight: 400; color: var(--sc-muted); }
.sc-dl dd { margin: 0; font-weight: 600; color: var(--sc-heading); overflow-wrap: anywhere; }
@media (max-width: 575.98px) { .sc-dl { grid-template-columns: 1fr; gap: .1rem; } .sc-dl dd { margin-bottom: .55rem; } }

/* ---------- Plano em destaque ---------- */
.sc-plan-hero { position: relative; overflow: hidden; border-radius: var(--sc-radius); color: #fff; background: var(--sc-brand-grad, linear-gradient(135deg, #25a6f1 0%, #5a8dee 60%, #7367f0 100%)); }
.sc-plan-hero h4 { color: #fff; }
.sc-plan-hero .card-body { position: relative; z-index: 1; }
.sc-plan-hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.sc-plan-hero .sc-speed { font-size: 2.4rem; font-weight: 800; line-height: 1; }
.sc-plan-hero .sc-speed small { font-size: 1rem; font-weight: 600; opacity: .85; }
.sc-plan-hero .btn.btn-light { color: var(--sc-primary-dark); background: #fff; border-color: #fff; }
.sc-plan-card { border: 1px solid var(--sc-border); border-radius: .85rem; }
.sc-plan-card.is-current { border-color: var(--sc-primary); }

/* ---------- Fatura ---------- */
.sc-amount { font-size: 2.2rem; font-weight: 800; color: var(--sc-heading); line-height: 1.1; }
.sc-copy { display: flex; gap: .5rem; }
.sc-copy code, .sc-copy input {
    flex: 1; min-width: 0; padding: .6rem .8rem; border-radius: .5rem; background: var(--sc-surface-2); border: 1px dashed var(--sc-input-border);
    font-size: .82rem; color: var(--sc-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* O QR Code fica sempre em fundo branco (leitura pelo app do banco) */
.sc-qr { display: grid; place-items: center; padding: 1rem; background: #fff; border: 1px solid var(--sc-border); border-radius: var(--sc-radius); }
.sc-qr canvas, .sc-qr img { max-width: 100%; height: auto; }

/* ---------- Tabelas ---------- */
.table { color: var(--sc-text); border-color: var(--sc-border); }
.table > :not(caption) > * > * { padding: .8rem 1rem; vertical-align: middle; border-bottom-color: var(--sc-border); background-color: transparent; }
.table > :not(:last-child) > :last-child > * { border-bottom-color: var(--sc-border); }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--sc-muted); font-weight: 600; border-bottom-width: 1px; }
@media (max-width: 575.98px) { .table .sc-hide-xs { display: none; } }

/* ---------- Estado vazio ---------- */
.sc-empty { text-align: center; padding: 2.5rem 1rem; color: var(--sc-muted); }
.sc-empty i { display: block; font-size: 2.6rem; margin-bottom: .5rem; color: var(--sc-border); }
.sc-empty strong { display: block; color: var(--sc-heading); margin-bottom: .25rem; }

/* ---------- Alertas ---------- */
.sc-alert { display: flex; align-items: flex-start; gap: .75rem; border: 0; border-radius: var(--sc-radius); }
.sc-alert > i { font-size: 1.2rem; line-height: 1.3; }
.sc-alert.alert-dismissible { padding-right: 3rem; }

/* ---------- Formulários ---------- */
.form-control, .form-select { border-radius: .55rem; border-color: var(--sc-input-border); padding: .6rem .85rem; background-color: var(--sc-surface); color: var(--sc-heading); }
.form-control::placeholder { color: var(--sc-muted); opacity: .8; }
.form-control:focus, .form-select:focus { border-color: var(--sc-primary); box-shadow: 0 0 0 .2rem rgba(90, 141, 238, .18); background-color: var(--sc-surface); color: var(--sc-heading); }
.form-control:disabled, .form-control[readonly] { background-color: var(--sc-surface-2); color: var(--sc-muted); }
.input-group-text { background-color: var(--sc-surface); border-color: var(--sc-input-border); color: var(--sc-muted); }
.form-label { font-weight: 600; font-size: .85rem; color: var(--sc-heading); }
.form-text { color: var(--sc-muted); }
.form-check-label { color: var(--sc-text); }

/* ---------- Abas de filtro ---------- */
.sc-tabs { display: flex; gap: .4rem; flex-wrap: wrap; }
.sc-tabs a { padding: .45rem .9rem; border-radius: 2rem; background: var(--sc-surface); color: var(--sc-text); text-decoration: none; font-size: .85rem; font-weight: 600; box-shadow: var(--sc-shadow); }
.sc-tabs a.active { background: var(--sc-primary); color: #fff; }

/* ---------- Paginação ---------- */
.page-link { background-color: var(--sc-surface); border-color: var(--sc-border); color: var(--sc-primary); }
.page-link:hover { background-color: var(--sc-surface-2); border-color: var(--sc-border); }
.page-item.disabled .page-link { background-color: var(--sc-surface); border-color: var(--sc-border); color: var(--sc-muted); }
.page-item.active .page-link { background-color: var(--sc-primary); border-color: var(--sc-primary); color: #fff; }

/* ---------- Rodapé ---------- */
.sc-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding: 1rem 1.5rem 1.5rem; font-size: .8rem; color: var(--sc-muted); }

/* ---------- Telas de acesso (login/cadastro) ---------- */
.sc-auth { min-height: 100vh; display: grid; grid-template-columns: 1fr; background: var(--sc-bg); }
@media (min-width: 992px) { .sc-auth { grid-template-columns: minmax(420px, 5fr) 7fr; } }
.sc-auth-form { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 2.5rem 1.5rem; background: var(--sc-surface); }
.sc-auth-form > div { width: 100%; max-width: 400px; margin: 0 auto; }
.sc-auth-form > .sc-auth-theme { position: absolute; top: 1rem; right: 1rem; width: auto; max-width: none; margin: 0; }
.sc-auth-side {
    display: none; position: relative; overflow: hidden; color: #fff; padding: 3rem;
    background: var(--sc-brand-grad, linear-gradient(135deg, #25a6f1 0%, #5a8dee 55%, #7367f0 100%));
}
html[data-theme=dark] .sc-auth-side { background: linear-gradient(135deg, #12507a 0%, #2c4f9a 55%, #3d3590 100%); }
@media (min-width: 992px) { .sc-auth-side { display: flex; flex-direction: column; justify-content: flex-end; } }
.sc-auth-side::before, .sc-auth-side::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.sc-auth-side::before { width: 520px; height: 520px; right: -160px; top: -140px; }
.sc-auth-side::after { width: 300px; height: 300px; left: -80px; bottom: 120px; }
.sc-auth-side > * { position: relative; z-index: 1; }
.sc-auth-side h2 { color: #fff; }
.sc-auth-feature { display: flex; gap: .85rem; align-items: flex-start; margin-bottom: 1rem; }
.sc-auth-feature i { font-size: 1.3rem; width: 2.5rem; height: 2.5rem; display: inline-grid; place-items: center; border-radius: .7rem; background: rgba(255, 255, 255, .18); flex-shrink: 0; }
.sc-auth h1 { font-size: 1.6rem; font-weight: 800; color: var(--sc-heading); }

/* ---------- Conversa do chamado ---------- */
.sc-chat { display: flex; flex-direction: column; gap: 1rem; background: var(--sc-surface-hover); }
.sc-msg { max-width: 85%; }
.sc-msg.is-mine { align-self: flex-end; text-align: right; }
.sc-msg-meta { font-size: .75rem; color: var(--sc-muted); margin-bottom: .25rem; }
.sc-msg-bubble { display: inline-block; text-align: left; padding: .75rem 1rem; border-radius: 1rem 1rem 1rem .25rem; background: var(--sc-surface); color: var(--sc-text); box-shadow: var(--sc-shadow); }
.sc-msg.is-mine .sc-msg-bubble { background: var(--sc-primary); color: #fff; border-radius: 1rem 1rem .25rem 1rem; }

/* ==========================================================================
   Tema escuro: componentes do Voler/Bootstrap 5.0 com cores fixas
   ========================================================================== */
html[data-theme=dark] .bg-white { background-color: var(--sc-surface) !important; }
html[data-theme=dark] .bg-light { background-color: var(--sc-surface-2) !important; }
html[data-theme=dark] .text-dark { color: var(--sc-heading) !important; }
html[data-theme=dark] .border, html[data-theme=dark] .border-bottom, html[data-theme=dark] .border-start, html[data-theme=dark] .border-end { border-color: var(--sc-border) !important; }
html[data-theme=dark] hr { border-color: var(--sc-border); opacity: 1; }
html[data-theme=dark] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
html[data-theme=dark] .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23c2ccdb' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}
html[data-theme=dark] .form-check-input { background-color: var(--sc-surface-2); border-color: var(--sc-input-border); }
html[data-theme=dark] .form-check-input:checked { background-color: var(--sc-primary); border-color: var(--sc-primary); }
html[data-theme=dark] .form-switch .form-check-input:not(:checked) {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%238797b3'/%3e%3c/svg%3e");
}
html[data-theme=dark] code { color: #ff8fb8; }
html[data-theme=dark] .sc-copy code { color: var(--sc-heading); }
html[data-theme=dark] .apexcharts-legend-text { color: var(--sc-text) !important; }
html[data-theme=dark] .btn-check + .btn-outline-primary { color: var(--sc-tint-primary); }
html[data-theme=dark] .btn-check:checked + .btn-outline-primary { color: #fff; }

/* Logo da marca: azul no tema claro, branca no escuro (e no menu escuro do painel) */
.sc-brand-logo { width: auto; max-width: 100%; display: inline-block; vertical-align: middle; }
.sc-brand-logo-dark { display: none; }
[data-bs-theme=dark] .sc-brand-logo-light, html[data-theme=dark] .sc-brand-logo-light { display: none; }
[data-bs-theme=dark] .sc-brand-logo-dark, html[data-theme=dark] .sc-brand-logo-dark { display: inline-block; }

/* Atendimento online (public/js/chat.js) */
.sc-chat-log { height: min(60vh, 34rem); overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .75rem; }
.sc-chat-msg { max-width: 82%; align-self: flex-start; }
.sc-chat-msg.is-mine { align-self: flex-end; text-align: right; }
.sc-chat-meta { font-size: .75rem; opacity: .65; margin: 0 .25rem .15rem; }
.sc-chat-bubble { display: inline-block; text-align: left; padding: .55rem .8rem; border-radius: 1rem; white-space: pre-line; overflow-wrap: anywhere; background: rgba(127, 127, 127, .12); }
.sc-chat-msg.is-mine .sc-chat-bubble { background: var(--sc-brand, #1e5bd6); color: #fff; border-bottom-right-radius: .3rem; }
.sc-chat-msg:not(.is-mine) .sc-chat-bubble { border-bottom-left-radius: .3rem; }
.sc-chat-ai .sc-chat-bubble { background: rgba(30, 91, 214, .1); }
.sc-chat-system { align-self: center; max-width: 92%; text-align: center; }
.sc-chat-system .sc-chat-bubble { background: transparent; border: 1px dashed rgba(127, 127, 127, .35); font-size: .85rem; opacity: .85; }
.sc-chat-typing { padding: 0 1rem .5rem; font-size: .8rem; opacity: .7; }
.sc-chat-typing span { display: inline-block; width: .35rem; height: .35rem; margin-right: .1rem; border-radius: 50%; background: currentColor; animation: sc-chat-dot 1s infinite ease-in-out; }
.sc-chat-typing span:nth-child(2) { animation-delay: .15s; }
.sc-chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes sc-chat-dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.sc-chat-form { display: flex; gap: .5rem; align-items: flex-end; padding: .75rem 1rem 1rem; border-top: 1px solid rgba(127, 127, 127, .15); }
.sc-chat-form textarea { resize: none; max-height: 8rem; }
.sc-chat-form.is-sending { opacity: .6; pointer-events: none; }
.sc-chat-fab { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1040; border-radius: 2rem; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }
@media (prefers-reduced-motion: reduce) { .sc-chat-typing span { animation: none; } }

/* Respostas formatadas da IA (ChatFormatter): parágrafos, listas, tabelas e botões */
.sc-chat-bubble.is-rich { white-space: normal; }
.sc-chat-bubble.is-rich > :last-child, .sc-chat-bubble.is-rich p:last-child { margin-bottom: 0; }
.sc-chat-bubble.is-rich p { margin: 0 0 .5rem; }
.sc-chat-bubble.is-rich ul, .sc-chat-bubble.is-rich ol { margin: .25rem 0 .5rem; padding-left: 1.2rem; }
.sc-chat-bubble.is-rich table { width: 100%; margin: .35rem 0 .5rem; border-collapse: collapse; font-size: .875rem; display: block; overflow-x: auto; }
.sc-chat-bubble.is-rich th, .sc-chat-bubble.is-rich td { padding: .35rem .6rem; border-bottom: 1px solid rgba(127, 127, 127, .25); text-align: left; white-space: nowrap; }
.sc-chat-bubble.is-rich th { font-weight: 600; opacity: .8; }
.sc-chat-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.sc-chat-actions .btn { border-radius: 2rem; }
.sc-chat-avatar { width: 44px; height: 44px; border-radius: 50%; background: #fff; padding: 3px; box-shadow: 0 0 0 1px rgba(127, 127, 127, .2); flex-shrink: 0; }

/* Emilly: avatar nas mensagens, no "escrevendo…" e no botão flutuante */
.sc-chat-msg.sc-chat-ai { display: flex; align-items: flex-end; gap: .5rem; }
.sc-chat-msg-avatar { width: 30px; height: 30px; border-radius: 50%; background: #fff; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(127, 127, 127, .2); }
.sc-chat-content { min-width: 0; }
.sc-chat-typing img { width: 20px; height: 20px; border-radius: 50%; background: #fff; vertical-align: middle; margin-right: .25rem; }
.sc-chat-avatar { padding: 0; }
.sc-chat-hero { text-align: center; padding: 1rem 1rem 0; }
.sc-chat-hero img { width: 170px; height: auto; max-width: 60%; }
.sc-chat-fab { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem 1rem .35rem .35rem; font-weight: 600; }
.sc-chat-fab img { width: 34px; height: 34px; border-radius: 50%; background: #fff; }
