/* ============================================================
   Fiscal Vinicom — Admin UI
   Identidade visual Vinicom (roxo #722AA6 / #7C3AED)
   Ver docs/identidade-visual/IDENTIDADE-VISUAL-VINICOM.md
   ============================================================ */
:root {
    /* --- Cores de marca Vinicom --- */
    --vnc-roxo: #722AA6;        /* roxo do logotipo */
    --vnc-roxo-vivo: #7C3AED;   /* roxo primário do site */
    --vnc-roxo-claro: #A855F7;  /* fim do gradiente */
    --vnc-lilas: #C4B5FD;
    --vnc-cinza-logo: #6C6C6E;  /* cinza do wordmark */

    --bg: #f5f4f8;
    --surface: #ffffff;
    --surface-2: #faf9fc;
    --sidebar-bg: #0A0A0F;
    --sidebar-bg-2: #14101c;
    --sidebar-text: #9A97A8;
    --sidebar-text-hover: #F2F1F7;
    --sidebar-active: var(--vnc-roxo-claro);

    --primary: #6D28D9;
    --primary-hover: #5B21B6;
    --primary-soft: #f3edfd;
    --primary-border: #e2d5f8;
    --primary-ink: #5B21B6;

    --text: #1c1824;
    --text-muted: #6b6577;
    --muted: #6b6577;
    --border: #e8e5ee;
    --border-strong: #d5d0de;

    --success: #16a34a;
    --danger: #e11d48;
    --warning: #d97706;

    /* estados semânticos (badges e alerts) */
    --ok-bg: #ecfdf3;   --ok-ink: #15803d;   --ok-bd: #d1fadf;
    --warn-bg: #fffbeb; --warn-ink: #b45309; --warn-bd: #fef3c7;
    --bad-bg: #fef2f2;  --bad-ink: #b91c1c;  --bad-bd: #fee2e2;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(45, 30, 95, .05);
    --shadow: 0 1px 3px rgba(45, 30, 95, .08), 0 1px 2px rgba(45, 30, 95, .04);
    --shadow-md: 0 4px 12px rgba(45, 30, 95, .10);
    --ring: 0 0 0 3px rgba(124, 58, 237, .15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Instrument Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 13px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* ---------------- Layout ---------------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 244px;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    overflow-y: auto;
    z-index: 20;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #3b2f52; border-radius: 3px; }

.sidebar .brand {
    padding: 20px 18px;
    color: #fff;
    display: flex; align-items: center; gap: 11px;
}
/* símbolo roxo da marca — usado sozinho porque o wordmark cinza (#6C6C6E)
   não tem contraste suficiente sobre o sidebar escuro */
.sidebar .brand { text-decoration: none; }
.sidebar .brand:hover { color: #fff; }
.sidebar .brand .brand-logo {
    height: 28px; width: 28px; display: block; flex: none;
}
.sidebar .brand .brand-text { display: block; line-height: 1; }
/* lockup igual ao site vinicom.com.br (wordmark uppercase + descritor).
   O site usa peso 800 em Poppins; a Instrument Sans só é servida até 700,
   então 700 é o peso real mais próximo — pedir 800 cairia para 700 sem aviso. */
.sidebar .brand .brand-name {
    display: block; font-size: 16px; font-weight: 700;
    letter-spacing: 2px; text-transform: uppercase; color: #fff;
}
.sidebar .brand .brand-sub {
    display: block; font-size: 8.5px; font-weight: 600; letter-spacing: .19em;
    text-transform: uppercase; color: var(--vnc-lilas); margin-top: 4px;
}

.sidebar nav { padding: 8px 12px; flex: 1; }
.sidebar .nav-label {
    font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
    color: #6b5f80; padding: 16px 10px 6px; font-weight: 600;
}
.sidebar a.nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 11px; border-radius: var(--radius-sm); color: var(--sidebar-text);
    font-weight: 500; font-size: 13px; margin-bottom: 1px;
    transition: background .12s ease, color .12s ease;
}
.sidebar a.nav-item:hover { background: rgba(255, 255, 255, .06); color: var(--sidebar-text-hover); }
.sidebar a.nav-item.active {
    background: linear-gradient(135deg, rgba(124, 58, 237, .28), rgba(168, 85, 247, .16));
    color: #fff;
    box-shadow: inset 2px 0 0 var(--sidebar-active);
}
.sidebar a.nav-item .ico { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; opacity: .9; }
.sidebar a.nav-item .ico .lucide { width: 17px; height: 17px; }
.sidebar a.nav-item:hover .ico, .sidebar a.nav-item.active .ico { opacity: 1; }
.lucide { display: inline-block; vertical-align: middle; }

.sidebar .sidebar-footer { padding: 14px; border-top: 1px solid rgba(255, 255, 255, .06); }
.sidebar .sidebar-footer .user { font-size: 12px; color: #cbd5e1; margin-bottom: 9px; font-weight: 500; padding-left: 2px; }

.content { margin-left: 244px; flex: 1; display: flex; flex-direction: column; min-width: 0; }
.main { padding: 24px 30px; flex: 1; }

/* ---------------- Topbar ---------------- */
.topbar {
    height: 58px; background: rgba(255, 255, 255, .85); backdrop-filter: saturate(160%) blur(8px);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 30px; position: sticky; top: 0; z-index: 15;
}
.topbar-right { display: flex; align-items: center; gap: 16px; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip .avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, var(--vnc-roxo-vivo), var(--vnc-roxo-claro)); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 13px; box-shadow: 0 2px 6px rgba(124, 58, 237, .38);
}
.user-chip .user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-chip .user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-chip .user-mail { font-size: 11px; color: var(--text-muted); }

/* ---------------- Page header (no body) ---------------- */
.page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.page-head h1 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; color: var(--text); }
.page-head .page-sub { color: var(--text-muted); font-size: 13px; margin-top: 3px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------------- Cards ---------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.card + .card { margin-top: 18px; }
.card-header {
    padding: 14px 18px; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: var(--surface);
}
.card-header h2 { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.card-body { padding: 18px; }

/* ---------------- Tables (compactas) ---------------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td {
    padding: 6px 14px; text-align: left; white-space: nowrap;
    border-bottom: 1px solid var(--border);
}
table.data thead th {
    background: var(--surface-2);
    font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--text-muted); font-weight: 600;
    padding-top: 9px; padding-bottom: 9px;
    position: sticky; top: 0; z-index: 1;
}
table.data tbody td { font-size: 12.5px; line-height: 1.45; vertical-align: middle; }
table.data tbody tr { transition: background .1s ease; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 38px; text-align: center; color: var(--text-muted); }

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 7px 13px; border-radius: var(--radius-sm); border: 1px solid transparent;
    font-size: 12.5px; font-weight: 500; cursor: pointer; line-height: 1;
    background: var(--surface); color: var(--text); text-decoration: none;
    transition: background .12s ease, border-color .12s ease, box-shadow .12s ease, color .12s ease;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(.5px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(109, 40, 217, .3); }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-outline { border-color: var(--border-strong); background: var(--surface); color: var(--text); }
.btn-outline:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--border-strong); }
.btn-danger:hover { background: var(--bad-bg); border-color: var(--bad-bd); color: var(--danger); }
.btn-ghost { background: rgba(255, 255, 255, .04); color: var(--sidebar-text); border-color: rgba(255, 255, 255, .12); }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.btn-sm { padding: 5px 9px; font-size: 12px; border-radius: 7px; }
.actions { display: flex; gap: 5px; align-items: center; }

/* ---------------- Badges ---------------- */
.badge {
    display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px;
    font-size: 11px; font-weight: 600; line-height: 1.5; white-space: nowrap;
    border: 1px solid transparent;
}
.badge-blue { background: var(--primary-soft); color: var(--primary-ink); border-color: var(--primary-border); }
.badge-green { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-bd); }
.badge-gray { background: var(--surface-2); color: var(--text-muted); border-color: var(--border); }
.badge-amber { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-bd); }
.badge-red { background: var(--bad-bg); color: var(--bad-ink); border-color: var(--bad-bd); }

/* ---------------- Forms ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: 12.5px; font-weight: 500; color: #374151; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
select, textarea {
    padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    font-size: 13px; font-family: inherit; background: var(--surface); width: 100%; color: var(--text);
    transition: border-color .12s ease, box-shadow .12s ease;
}
input::placeholder, textarea::placeholder { color: #9ca3af; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
select { cursor: pointer; }
.form-actions { display: flex; gap: 10px; margin-top: 22px; }
.help { font-size: 11.5px; color: var(--text-muted); }
.error { color: var(--danger); font-size: 11.5px; }
.input-error { border-color: var(--danger) !important; }
.input-error:focus { box-shadow: 0 0 0 3px rgba(225, 29, 72, .15) !important; }

/* ---------------- Alerts ---------------- */
.alert { padding: 11px 15px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: 13px; border: 1px solid transparent; }
.alert-success { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-bd); }
.alert-error { background: var(--bad-bg); color: var(--bad-ink); border-color: var(--bad-bd); }
.alert-warning { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-bd); }

/* ---------------- Stats ---------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); opacity: .8; }
.stat .label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 6px; letter-spacing: -.02em; }

/* ---------------- Stat cards clicáveis (filtros por situação) ----------------
   Usados na tela de custos do Pricebot: cada card filtra a lista. Cores por
   severidade via classes .stat-ok/.stat-alerta/.stat-risco/.stat-neutro, todas
   apoiadas nos tokens de tema (funcionam em claro/escuro/mesclado). */
.stat-card {
    display: flex; align-items: center; gap: 14px;
    text-decoration: none; color: inherit;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.stat-card:hover {
    transform: translateY(-2px); box-shadow: var(--shadow-md);
    text-decoration: none; border-color: var(--border-strong);
}
.stat-card .stat-ico {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; font-size: 21px; line-height: 1;
}
.stat-card .stat-corpo { min-width: 0; }
.stat-card .stat-label {
    font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-muted); line-height: 1.25;
}
.stat-card .stat-value { font-size: 32px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; margin-top: 2px; }
.stat-card .stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* zerado: número perde destaque, o card deixa de puxar atenção */
.stat-card.is-zero .stat-value { color: var(--text-muted); opacity: .55; }
.stat-card.is-zero .stat-ico { opacity: .45; }

.stat-card.stat-risco::before  { background: var(--bad-ink); opacity: 1; }
.stat-card.stat-risco .stat-ico  { background: var(--bad-bg); color: var(--bad-ink); }
.stat-card.stat-risco .stat-value { color: var(--bad-ink); }

.stat-card.stat-alerta::before { background: var(--warn-ink); opacity: 1; }
.stat-card.stat-alerta .stat-ico { background: var(--warn-bg); color: var(--warn-ink); }
.stat-card.stat-alerta .stat-value { color: var(--warn-ink); }

.stat-card.stat-ok::before     { background: var(--ok-ink); opacity: 1; }
.stat-card.stat-ok .stat-ico     { background: var(--ok-bg); color: var(--ok-ink); }
.stat-card.stat-ok .stat-value   { color: var(--ok-ink); }

.stat-card.stat-neutro::before { background: var(--border-strong); opacity: 1; }
.stat-card.stat-neutro .stat-ico { background: var(--surface-2); color: var(--text-muted); }

/* card selecionado (filtro ativo) */
.stat-card.is-ativo {
    border-color: var(--primary); box-shadow: var(--ring);
}

/* ---------------- Toolbar / filtros ---------------- */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.toolbar .filtro { display: flex; flex-direction: column; gap: 4px; }
.toolbar .filtro-titulo { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.toolbar .filtro-titulo .help { font-weight: 400; text-transform: none; letter-spacing: 0; }
.toolbar input, .toolbar select { padding: 7px 10px; font-size: 12.5px; }

/* ---------------- Filter bar ---------------- */
.filterbar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 18px;
    overflow: visible;
}
.filterbar-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 16px; border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #fbf9ff, #f5f1fb);
    border-radius: var(--radius) var(--radius) 0 0;
}
.filterbar-title { font-size: 12px; font-weight: 700; letter-spacing: .02em; color: var(--primary-ink); }
.filterbar-count { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.filterbar-grid { display: flex; flex-wrap: wrap; gap: 12px 14px; padding: 16px; align-items: flex-end; }
.filterbar .field { display: flex; flex-direction: column; gap: 5px; }
.filterbar .field > label {
    font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted);
}
.filterbar .field > input,
.filterbar .field > select,
.filterbar .ms > summary {
    height: 38px; min-width: 140px;
}
.filterbar .field-actions { flex-direction: row; gap: 8px; align-items: flex-end; }
.filterbar .field-actions .btn { height: 38px; }

/* Multiselect (details/summary) — alinhado com os demais campos */
.ms { position: relative; }
.ms > summary {
    list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 0 11px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--surface); font-size: 12.5px; color: var(--text); user-select: none;
}
.ms > summary::-webkit-details-marker { display: none; }
.ms > summary::after { content: '▾'; color: var(--text-muted); font-size: 11px; }
.ms[open] > summary { border-color: var(--primary); box-shadow: var(--ring); }
.ms-panel {
    position: absolute; z-index: 30; top: calc(100% + 5px); left: 0;
    min-width: 220px; max-height: 260px; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
    box-shadow: var(--shadow-md); padding: 6px;
}
.ms-opt {
    display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 6px;
    font-size: 12.5px; font-weight: 400; cursor: pointer; color: var(--text); white-space: nowrap;
}
.ms-opt:hover { background: var(--surface-2); }
.ms-opt input { width: auto; margin: 0; accent-color: var(--primary); }

/* Chips de período */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
    display: inline-flex; align-items: center; height: 38px; padding: 0 13px;
    border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface);
    font-size: 12.5px; font-weight: 500; color: var(--text); cursor: pointer; white-space: nowrap;
    transition: background .12s ease, border-color .12s ease, color .12s ease, box-shadow .12s ease;
}
.chip:hover { background: var(--surface-2); border-color: var(--border-strong); }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.chip.active {
    background: var(--primary); border-color: var(--primary); color: #fff;
    box-shadow: 0 1px 3px rgba(109, 40, 217, .35);
}

/* ---------------- Definition list ---------------- */
.dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 22px; }
.dl .item .k { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.dl .item .v { font-size: 13.5px; font-weight: 500; margin-top: 3px; color: var(--text); }

/* ---------------- Pagination ---------------- */
.pagination { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; margin-top: 16px; list-style: none; }
.pagination svg { width: 15px; height: 15px; }
.pagination a, .pagination span {
    padding: 6px 11px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface);
    color: var(--text); font-size: 12.5px; font-weight: 500; line-height: 1.4; transition: background .1s ease;
}
.pagination a:hover { background: var(--surface-2); text-decoration: none; }
.pagination [aria-current] span, .pagination .active span { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination [aria-disabled] span { color: #cbd5e1; }

/* ---------------- Login ---------------- */
.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
    /* escuro à esquerda clareando à direita; roxo azulado da marca, sem viés rosa */
    background:
        radial-gradient(ellipse 700px 520px at 88% 82%, rgba(124, 58, 237, .10), transparent 66%),
        linear-gradient(90deg, #2a1b52 0%, #43308a 34%, #6b4fc0 64%, #a894e0 100%);
    padding: 24px;
}
/* marca d'água: símbolo da marca diluído, inteiro dentro da tela */
.login-wrap::before {
    content: ''; position: absolute; z-index: 0;
    width: 400px; height: 400px;
    right: 6%; bottom: 8%;
    /* símbolo em branco: sobre o degradê roxo o SVG roxo original não apareceria */
    background: #fff;
    -webkit-mask: url('../vinicom-simbolo.svg') no-repeat center / contain;
    mask: url('../vinicom-simbolo.svg') no-repeat center / contain;
    opacity: .10;
    transform: rotate(-12deg);
    pointer-events: none;
}
.login-split { position: relative; z-index: 1; }
/* duas colunas: foto do CD à esquerda, autenticação à direita */
.login-split {
    display: grid; grid-template-columns: 1.05fr .95fr;
    width: 100%; max-width: 880px;
    background: var(--surface); border-radius: 18px; overflow: hidden;
    box-shadow: 0 28px 60px -16px rgba(20, 10, 45, .48), 0 2px 10px rgba(20, 10, 45, .14);
}
.login-visual { position: relative; min-height: 480px; background: #14101c; }
.login-visual img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover; object-position: 50% 22%;  /* mantém a fachada/marca no enquadramento */
    display: block;
}
/* véu roxo para a legenda ter contraste sobre a foto */
.login-visual::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(10, 10, 15, .10) 40%, rgba(10, 10, 15, .82) 100%);
}
.login-visual-cap {
    position: absolute; left: 26px; right: 26px; bottom: 24px; z-index: 1;
    display: flex; flex-direction: column; gap: 3px; color: #fff;
}
.login-visual-cap strong { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.login-visual-cap span { font-size: 12px; color: var(--vnc-lilas); }

.login-card {
    background: var(--surface); padding: 44px 40px; width: 100%;
    display: flex; flex-direction: column; justify-content: center;
    border-top: 3px solid var(--vnc-roxo-vivo);
}
.login-card .logo { text-align: center; margin-bottom: 4px; }
.login-card .logo img { height: 38px; width: auto; display: inline-block; }
.login-card .subtitle { text-align: center; color: var(--text-muted); margin: 8px 0 26px; font-size: 13px; }

@media (max-width: 760px) {
    .login-split { grid-template-columns: 1fr; max-width: 420px; }
    .login-visual { min-height: 170px; }
    .login-visual img { object-position: 50% 18%; }
    .login-card { padding: 32px 26px; border-top: none; }
}
.login-card .btn-primary {
    background: linear-gradient(135deg, var(--vnc-roxo-vivo), var(--vnc-roxo-claro));
    border: none;
}
.login-card .btn-primary:hover { background: linear-gradient(135deg, var(--primary), var(--vnc-roxo-vivo)); }
.login-card .form-group { margin-bottom: 15px; }
.login-card .btn { width: 100%; padding: 11px; font-size: 14px; margin-top: 4px; }

/* ---------------- Utils ---------------- */
.section-title { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.text-muted { color: var(--text-muted); }
.mt-4 { margin-top: 16px; } .mb-4 { margin-bottom: 16px; }

@media (max-width: 820px) {
    .sidebar { width: 64px; }
    .sidebar .brand .brand-text, .sidebar .nav-item span:not(.ico), .sidebar .nav-label, .sidebar-footer .user { display: none; }
    .sidebar .brand { padding: 18px 8px; justify-content: center; }
    .sidebar .brand .brand-logo { height: 24px; }
    .sidebar .nav-item { justify-content: center; }
    .content { margin-left: 64px; }
    .main { padding: 18px; }
}

/* ============================================================
   TEMA MESCLADO — menu escuro, conteúdo claro (layout original)
   É o padrão do portal.
   ============================================================ */
html[data-tema="mesclado"] {
    --bg: #f5f4f8;
    --surface: #ffffff;
    --surface-2: #faf9fc;

    --sidebar-bg: #0A0A0F;
    --sidebar-bg-2: #14101c;
    --sidebar-text: #9A97A8;
    --sidebar-text-hover: #F2F1F7;
    --sidebar-active: var(--vnc-roxo-claro);
}

/* ============================================================
   TEMA CLARO — menu branco
   Alternado por [data-tema] no <html>; a preferência fica no
   localStorage e é aplicada antes da pintura (evita flash).
   ============================================================ */
html[data-tema="claro"] {
    --bg: #f5f4f8;
    --surface: #ffffff;
    --surface-2: #faf9fc;

    --sidebar-bg: #ffffff;
    --sidebar-bg-2: #ffffff;
    --sidebar-text: #575166;
    --sidebar-text-hover: #1c1824;
    --sidebar-active: var(--primary);
}
html[data-tema="claro"] .sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border);
    color: var(--text-muted);
}
html[data-tema="claro"] .sidebar::-webkit-scrollbar-thumb { background: #d5d0de; }
html[data-tema="claro"] .sidebar .brand { color: var(--text); }
html[data-tema="claro"] .sidebar .brand .brand-name,
html[data-tema="claro"] .sidebar .brand:hover { color: var(--text); }
html[data-tema="claro"] .sidebar .brand .brand-sub { color: var(--primary); }
html[data-tema="claro"] .sidebar .nav-label { color: #948da5; }
html[data-tema="claro"] .sidebar a.nav-item { color: var(--text-muted); }
html[data-tema="claro"] .sidebar a.nav-item:hover {
    background: var(--surface-2); color: var(--text);
}
html[data-tema="claro"] .sidebar a.nav-item.active {
    background: var(--primary-soft); color: var(--primary-ink);
    box-shadow: inset 2px 0 0 var(--primary);
}
html[data-tema="claro"] .sidebar .sidebar-footer { border-top-color: var(--border); }
html[data-tema="claro"] .btn-ghost {
    background: var(--surface); color: var(--text); border-color: var(--border-strong);
}
html[data-tema="claro"] .btn-ghost:hover { background: var(--surface-2); color: var(--text); }

/* ============================================================
   TEMA ESCURO
   ============================================================ */
html[data-tema="escuro"] {
    --bg: #131020;
    --surface: #1c1829;
    --surface-2: #232032;

    --text: #f2f1f7;
    --text-muted: #a49eb4;
    --muted: #a49eb4;
    --border: #302b40;
    --border-strong: #413b54;

    --primary: #a274f0;
    --primary-hover: #b78ff5;
    --primary-soft: #2a2140;
    --primary-border: #3d3057;
    --primary-ink: #c9aff8;

    --sidebar-bg: #0A0A0F;
    --sidebar-bg-2: #14101c;
    --sidebar-text: #9A97A8;
    --sidebar-text-hover: #F2F1F7;
    --sidebar-active: var(--vnc-roxo-claro);

    --ok-bg: #16281e;   --ok-ink: #5fd48b;   --ok-bd: #24422f;
    --warn-bg: #2c2216; --warn-ink: #e8b465; --warn-bd: #4a3820;
    --bad-bg: #2e1a1f;  --bad-ink: #f08a9c;  --bad-bd: #4b2831;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .30);
    --shadow: 0 1px 3px rgba(0, 0, 0, .38), 0 1px 2px rgba(0, 0, 0, .24);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .42);
    --ring: 0 0 0 3px rgba(162, 116, 240, .22);
}
html[data-tema="escuro"] .topbar { background: rgba(28, 24, 41, .85); }
html[data-tema="escuro"] .btn-primary { color: #17102b; font-weight: 600; }
html[data-tema="escuro"] .btn-primary:hover { color: #17102b; }
html[data-tema="escuro"] .chip.active,
html[data-tema="escuro"] .pagination [aria-current] span,
html[data-tema="escuro"] .pagination .active span { color: #17102b; }
html[data-tema="escuro"] .filterbar-head {
    background: linear-gradient(180deg, #241f36, #1f1b2e);
}
html[data-tema="escuro"] input::placeholder,
html[data-tema="escuro"] textarea::placeholder { color: #7b7490; }
html[data-tema="escuro"] label { color: #cfc9dc; }
html[data-tema="escuro"] .pagination [aria-disabled] span { color: #565069; }

/* ---------------- Seletor de tema ---------------- */
.tema-toggle {
    display: inline-flex; align-items: center; gap: 2px;
    padding: 3px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--border);
}
.tema-toggle button {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 24px; padding: 0;
    border: none; border-radius: 999px; background: transparent;
    color: var(--text-muted); cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
.tema-toggle button:hover { color: var(--text); }
.tema-toggle button[aria-pressed="true"] {
    background: var(--surface); color: var(--primary);
    box-shadow: var(--shadow-sm);
}
.tema-toggle button:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.tema-toggle svg { width: 15px; height: 15px; }
