/* ============================================================
   MARGEMLAB — Design System v4
   Refatoração de v3: tokens unificados, dark mode consistente,
   duplicatas removidas, acessibilidade reforçada.

   Sumário de mudanças em relação à v3 (ver notas inline com "FIX:"):
   1. --primary e --accent deixam de ser hex duplicados: --accent é a
      fonte da verdade, --primary vira alias (compat com CSS existente).
   2. Tokens --rel-* (módulo Relatórios) passam a referenciar os tokens
      globais --green/--yellow/--red, ganhando dark mode automaticamente.
   3. Blocos duplicados de .sku-dropdown/.sku-item e .seg/.seg-btn
      (definidos 2-3x no arquivo original) foram unificados.
   4. Badges de logística (.badge-full/.badge-flex/...) ganharam
      variantes dark, deixaram de ser cor sólida fixa.
   5. --text3 ajustado para contraste mínimo AA sobre --bg/--surface.
   6. .stat-card.green renomeado semanticamente (mantendo alias).
   7. prefers-reduced-motion adicionado.
   8. Tooltips (.info-tip, sidebar collapsed) respondem a :focus além
      de :hover.
   9. Escala de espaçamento (--space-*) e z-index (--z-*) introduzidas.
   10. Comentário HTML malformado e mojibake de encoding corrigidos.
   ============================================================ */

.logo-img {
    max-width: 100%;
    max-height: 200px;
    height: auto;
    display: block;
    object-fit: contain;
}

/* ============================================================
   TOKENS — LIGHT (padrão)
   ============================================================ */
:root {
    /* --- Cor de marca ---------------------------------------
       FIX: --accent é a fonte da verdade. --primary é mantido só
       como alias de compatibilidade para seletores existentes que
       ainda usam var(--primary) — não redefinir os dois separado. */
    --accent:         #FFC107;
    --accent-hover:   #FFB300;
    --accent-dark:    #FF8F00;
    --accent-glow:    rgba(255,193,7,0.30);
    --accent-dim:     rgba(255,193,7,0.12);
    --accent2:        #FFB300;
    --accent-blue:    #1A1F71;
    --accent-green:   #00c85396;

    --primary:        var(--accent);
    --primary-hover:  var(--accent-hover);
    --primary-dark:   var(--accent-dark);
    --primary-glow:   var(--accent-glow);
    --primary-dim:    var(--accent-dim);

    /* --- Cores semânticas ------------------------------------ */
    --red:            #DC2626;
    --red-dim:        rgba(220,38,38,0.12);
    --blue:           #2C8AF0;
    --blue-dim:       rgba(44,138,240,0.10);
    --yellow:         #B45309;
    --yellow-dim:     rgba(255,193,7,0.18);
    --green:          #00662ab2;
    --green-dim:      rgba(0,200,83,0.12);

    /* --- Superfícies -------------------------------------------
       FIX: --bg e --surface eram idênticos no light (perdiam a
       hierarquia de elevação que existe no dark). Agora --surface
       fica um tom acima de --bg, como no dark mode. */
    --bg:            #F4F6F8;
    --surface:       #FFFFFF;
    --surface2:      #F6F8FA;
    --surface3:      #EDF0F4;
    --border:        #E8ECF0;
    --border2:       #D6DBE3;
    /* --- Texto ---------------------------------------------------
       FIX: --text3 estava a #9CA3AF, contraste insuficiente sobre
       --bg/--surface claros. Escurecido para atingir AA em uso
       normal (labels pequenos, timestamps). */
    --text:           #0F0F0F;
    --text2:          #6B7280;
    --text3:          #5B6270;

    --font:           'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono:           'JetBrains Mono', monospace;

    /* --- Raio / sombra ------------------------------------------ */
    --r:              12px;
    --r2:             10px;
    --r-sm:           6px;
    --r-lg:           20px;
    --shadow-sm:     0 1px 2px rgba(16,24,40,0.05);
    --shadow-md:     0 6px 18px rgba(16,24,40,0.07);
    --shadow-lg:     0 18px 48px rgba(16,24,40,0.12);

    --sidebar-w:      260px;
    --header-h:       72px;

    /* --- Escala de espaçamento (FIX: nova) ----------------------
       Cobre a maioria dos valores hardcoded do arquivo original
       (6/8/10/12/14/16/20/24/28/32px). Usar nas novas regras; a
       migração das antigas pode ser feita gradualmente. */
    --space-1:  4px;
    --space-2:  6px;
    --space-3:  8px;
    --space-4:  10px;
    --space-5:  12px;
    --space-6:  16px;
    --space-7:  20px;
    --space-8:  24px;
    --space-9:  28px;
    --space-10: 32px;

    /* --- Escala de z-index (FIX: nova) ---------------------------
       Substitui valores "mágicos" (50/99/100/1000/9000/9999)
       espalhados pelo arquivo por uma escala nomeada e previsível. */
    --z-sticky:    50;
    --z-dropdown:  60;
    --z-sidebar:   100;
    --z-backdrop:  99;
    --z-modal:     1000;
    --z-login:     9000;
    --z-toast:     9999;

    /* --- Módulo Relatórios (FIX: deixa de duplicar hex) ----------
       Antes: --rel-verde/--rel-amarelo/--rel-vermelho tinham valores
       próprios (#22c55e/#f59e0b/#ef4444) diferentes de --green/
       --yellow/--red e SEM override no dark mode. Agora apontam
       para os tokens globais e herdam o tema automaticamente.
       --rel-border deixa de ser um roxo-escuro fixo (que só fazia
       sentido em fundo escuro) e passa a referenciar --border. */
    --rel-verde:    var(--green);
    --rel-amarelo:  var(--yellow);
    --rel-vermelho: var(--red);
    --rel-border:   var(--border);
}

/* ============================================================
   TOKENS — DARK
   ============================================================ */
[data-theme="dark"] {
    --accent:         #FFD600;
    --accent-hover:   #FFC107;
    --accent-dark:    #FFB300;
    --accent-glow:    rgba(255,214,0,0.25);
    --accent-dim:     rgba(255,214,0,0.10);
    --accent2:        #FFC107;
    --accent-blue:    #818CF8;
    --accent-green:   #1DE9B6;

    --primary:        var(--accent);
    --primary-hover:  var(--accent-hover);
    --primary-dark:   var(--accent-dark);
    --primary-glow:   var(--accent-glow);
    --primary-dim:    var(--accent-dim);

    --red:            #F87171;
    --red-dim:        rgba(248,113,113,0.12);
    --green:          #34D399;
    --green-dim:      rgba(52,211,153,0.12);
    --yellow:         #FBBF24;
    --yellow-dim:     rgba(251,191,36,0.15);

    --bg:             #0A0A0F;
    --surface:        #15151F;
    --surface2:       #1C1C28;
    --surface3:       #252533;
    --border:         #2A2A35;
    --border2:        #353545;

    --text:           #F5F5F7;
    --text2:          #9CA3AF;
    --text3:          #6B7280;

    --shadow-sm:      0 2px 8px rgba(0,0,0,0.3);
    --shadow-md:      0 4px 20px rgba(0,0,0,0.4);
    --shadow-lg:      0 12px 40px rgba(0,0,0,0.5);

    /* --rel-* herda automaticamente por já serem var(--green) etc. */
    --rel-border:     var(--border2);
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    transition: background .25s, color .25s;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* FIX: respeita preferência de movimento reduzido do usuário.
   Aplica-se globalmente, sobrepondo as transições/animações
   declaradas ao longo do arquivo. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app { display: none; min-height: 100vh; }
.app.visible { display: flex; animation: fadeIn .35s ease; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: var(--font);
    flex-shrink: 0;
    transition: width .25s ease;
}
.sidebar.collapsed { width: 72px; }

/* BRAND */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-6) var(--space-5);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.sidebar-brand .brand-icon {
    width: 100%; height: 60px;
    border-radius: 9px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.sidebar-brand .brand-icon img { width: 100%; height: 100%; object-fit: contain; }
.sidebar-brand .brand-name {
    font-size: 16px; font-weight: 800;
    color: var(--accent); letter-spacing: -0.5px;
    white-space: nowrap; overflow: hidden;
    transition: opacity .2s, width .2s;
    flex: 1;
}
.sidebar.collapsed .brand-name { opacity: 0; width: 0; flex: 0; }
.sidebar.collapsed .sidebar-brand { padding: var(--space-6) 0; justify-content: center; gap: 0; }
.sidebar.collapsed .brand-icon { display: none; }

.sidebar-collapse-btn {
    width: 28px; height: 28px;
    border: none; background: transparent;
    color: var(--text3); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--r-sm); flex-shrink: 0; transition: all .15s;
}
.sidebar-collapse-btn:hover,
.sidebar-collapse-btn:focus-visible { background: var(--surface2); color: var(--text); }
.sidebar-collapse-btn svg { width: 16px; height: 16px; transition: transform .25s; }
.sidebar.collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }

/* NAV */
.sidebar-nav {
    flex: 1; display: flex; flex-direction: column;
    padding: var(--space-4) var(--space-3); overflow-y: auto; overflow-x: hidden;
}
.nav-section { margin-bottom: 4px; }
.nav-section-title {
    display: block; font-size: 10px; font-weight: 700;
    color: var(--text3); text-transform: uppercase;
    letter-spacing: .1em; padding: 0 var(--space-4);
    margin: var(--space-4) 0 4px; white-space: nowrap; overflow: hidden;
    transition: opacity .15s;
}
.sidebar.collapsed .nav-section-title { opacity: 0; }

/* NAV ITEM */
.sidebar .nav-item {
    display: flex; align-items: center; gap: var(--space-4);
    padding: 9px var(--space-4); border-radius: 9px;
    color: var(--text2); font-size: 13px; font-weight: 500;
    cursor: pointer; transition: background .15s, color .15s;
    margin-bottom: 1px; border: none; background: transparent;
    white-space: nowrap; position: relative;
    border-left: 3px solid transparent;
    text-decoration: none;
}
.sidebar .nav-item:hover,
.sidebar .nav-item:focus-visible { background: var(--surface2); color: var(--text); }
.sidebar .nav-item i, .sidebar .nav-item svg {
    width: 18px; height: 18px; stroke-width: 2; flex-shrink: 0;
}
.sidebar .nav-item > span:not(.nav-badge) {
    flex: 1; overflow: hidden; transition: opacity .15s;
}
.sidebar.collapsed .nav-item > span:not(.nav-badge) { opacity: 0; width: 0; flex: 0; }
.sidebar.collapsed .nav-badge { display: none !important; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 9px 0; }

/* ACTIVE */
.sidebar .nav-item.active {
    background: var(--accent-dim); color: var(--text);
    font-weight: 600; border-left-color: var(--accent);
}
.sidebar .nav-item.active:hover { background: var(--accent-dim); }
.sidebar .nav-item.active i,
.sidebar .nav-item.active svg { color: var(--accent2); }

/* EM BREVE */
.sidebar .nav-item-soon {
    opacity: .45; cursor: default; pointer-events: none;
}
.nav-badge-soon {
    font-size: 9px !important; padding: 2px 5px !important;
    background: var(--surface3) !important; color: var(--text3) !important;
    border-radius: 4px !important; white-space: nowrap;
}

/* BADGES */
.sidebar .nav-badge {
    font-size: 11px; font-weight: 700;
    padding: 2px 7px; border-radius: 999px;
    background: var(--surface2); color: var(--text2);
    min-width: 22px; text-align: center; flex-shrink: 0;
}
.badge-yellow { background: var(--accent) !important; color: #000 !important; }

/* ADMIN */
.nav-admin-item { color: var(--red) !important; }

/* TOOLTIP (sidebar colapsada)
   FIX: agora dispara também em :focus-visible, não só :hover —
   navegação por teclado precisa do mesmo tooltip. O texto ainda
   depende de attr(data-tooltip); reforçar com aria-label no HTML,
   pois leitores de tela não leem conteúdo gerado via ::after. */
.sidebar.collapsed .nav-item[data-tooltip]:hover::after,
.sidebar.collapsed .nav-item[data-tooltip]:focus-visible::after {
    content: attr(data-tooltip);
    position: absolute; left: calc(100% + 10px); top: 50%;
    transform: translateY(-50%);
    background: var(--text); color: var(--surface);
    font-size: 12px; font-weight: 600;
    padding: 5px 10px; border-radius: 6px;
    white-space: nowrap; z-index: var(--z-dropdown);
    pointer-events: none;
}

/* FOOTER */
.sidebar-footer {
    padding: var(--space-4) var(--space-3); border-top: 1px solid var(--border); flex-shrink: 0;
}
.sidebar-user {
    display: flex; align-items: center; gap: var(--space-4);
    padding: 6px 4px; border-radius: 9px;
}
.sidebar-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--accent); color: #000;
    font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; text-transform: uppercase;
}
.sidebar-user-info { flex: 1; min-width: 0; overflow: hidden; transition: opacity .15s; }
.sidebar.collapsed .sidebar-user-info { opacity: 0; width: 0; flex: 0; }
.sidebar-user-name {
    font-size: 13px; font-weight: 600; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-logout-btn {
    width: 28px; height: 28px; border: none; background: transparent;
    color: var(--text3); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--r-sm); flex-shrink: 0; transition: all .15s;
}
.sidebar-logout-btn:hover,
.sidebar-logout-btn:focus-visible { background: var(--red-dim); color: var(--red); }
.sidebar-logout-btn svg { width: 15px; height: 15px; }
.sidebar.collapsed .sidebar-logout-btn { display: none; }

@media (min-width: 769px) {
    .sidebar { position: sticky; top: 0; height: 100vh; }
}

/* ============================================================
   ACESSIBILIDADE
   ============================================================ */
.skip-link {
    position: absolute; top: -100%; left: 8px;
    background: var(--accent); color: #000;
    font-weight: 700; font-size: 13px;
    padding: var(--space-3) var(--space-6); border-radius: 0 0 var(--r2) var(--r2);
    z-index: var(--z-toast); text-decoration: none;
    transition: top .15s;
}
.skip-link:focus { top: 0; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

button:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ============================================================
   MAIN + TOPBAR
   ============================================================ */
.main {
    flex: 1;
    display: flex; flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

.topbar {
    height: var(--header-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 var(--space-10);
    position: sticky; top: 0; z-index: var(--z-sticky);
}

.topbar-title { font-size: 15px; font-weight: 700; }
.topbar-breadcrumb {
    font-size: 15px; font-weight: 700; color: var(--text);
    display: flex; align-items: center; gap: 6px;
}
.topbar-breadcrumb span { color: var(--text2); }
.topbar-right { display: flex; align-items: center; gap: var(--space-5); }

.theme-toggle {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: var(--r2);
    background: var(--bg);
    border: none;
    color: var(--text);
    transition: all .15s;
}
.theme-toggle:hover,
.theme-toggle:focus-visible { background: var(--border); }
.theme-toggle svg { width: 18px; height: 18px; }

/* ============================================================
   BOTÕES
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; gap: var(--space-3);
    padding: 10px var(--space-7);
    border-radius: var(--r2);
    font-family: var(--font);
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    border: 1px solid transparent;
    white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }

.btn-primary {
    background: var(--accent);
    color: #0F0F0F;
}
.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-ghost {
    background: var(--bg);
    color: var(--text);
}
.btn-ghost:hover { background: var(--border); }

.btn-danger {
    background: var(--red-dim);
    color: var(--red);
}
.btn-danger:hover { background: rgba(220,38,38,0.2); }

.btn-sm { padding: 6px var(--space-5); font-size: 12px; }

.switch-row:hover {
    background: var(--surface3);
    border-color: var(--accent);
    transition: all .15s ease;
}
.switch-row input[type="checkbox"] {
    accent-color: var(--accent);
}

.modal-importar {
    width: 680px !important;
    max-width: 95vw !important;
    transition: width .25s ease;
}
.modal-importar.is-wide {
    width: 1100px !important;
}

/* ============================================================
   CONTENT / PAGE
   ============================================================ */
.content { flex: 1; padding: var(--space-10); }

.page { display: none; animation: fadeIn .25s ease; }
.page.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.section-header {
    display: flex; align-items: flex-end; justify-content: space-between;
    margin-bottom: var(--space-8);
    gap: var(--space-6); flex-wrap: wrap;
}
.section-title {
    font-size: 28px; font-weight: 700;
    letter-spacing: -0.5px;
}
.section-sub {
    font-size: 14px; color: var(--text2); margin-top: 4px;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--space-8);
    box-shadow: var(--shadow-sm);
    transition: transform .2s, box-shadow .2s;
    overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: var(--space-6);
    gap: var(--space-5);
    flex-wrap: wrap;
}
.card-title { font-size: 16px; font-weight: 600; color: var(--text); }
.card-subtitle { font-size: 13px; color: var(--text2); margin-top: 4px; }

/* ============================================================
   STAT CARDS (KPIs)
   ============================================================ */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--space-8);
    display: flex; flex-direction: column; gap: var(--space-3);
    position: relative; overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .2s, box-shadow .2s;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* FIX: a classe original ".stat-card.green" renderiza em amarelo/âmbar
   — nome e cor não batem, o que confunde manutenção futura.
   ".stat-card.featured" é o nome semanticamente correto; ".green"
   é mantido como alias para não quebrar HTML existente. Ao migrar
   o HTML, trocar "green" por "featured" e remover o alias abaixo. */
.stat-card.featured,
.stat-card.green {
    background: linear-gradient(135deg, var(--accent) 0%, #FFD600 100%);
    border-color: transparent;
    color: #0F0F0F;
}
.stat-card.featured .stat-label,
.stat-card.green .stat-label { color: rgba(0,0,0,0.6); }
.stat-card.featured .stat-value,
.stat-card.green .stat-value { color: #0F0F0F !important; }
.stat-card.featured .stat-pill,
.stat-card.green .stat-pill {
    background: rgba(0,0,0,0.12);
    color: #0F0F0F;
}
.stat-card.blue   { background: linear-gradient(135deg, rgba(44,138,240,0.06) 0%, transparent 60%); }
.stat-card.yellow { background: linear-gradient(135deg, rgba(255,193,7,0.10) 0%, transparent 60%); }

.stat-label {
    font-size: 13px; font-weight: 500;
    color: var(--text2);
}
.stat-value {
    font-size: 32px; font-weight: 700;
    line-height: 1.1;
    letter-spacing: -1px;
    margin-top: 4px;
}
.stat-meta { font-size: 12px; color: var(--text2); margin-top: 4px; }

.stat-pill {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; font-weight: 600;
    padding: 4px var(--space-4); border-radius: 999px;
    width: fit-content;
}
.pill-green  { background: var(--green-dim);  color: var(--green);  }
.pill-red    { background: var(--red-dim);    color: var(--red);    }
.pill-blue   { background: var(--blue-dim);   color: var(--blue);   }
.pill-yellow { background: var(--yellow-dim); color: var(--yellow); }

/* ============================================================
   GRID
   ============================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-7); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-7); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-7); }
.gap-16 { gap: var(--space-6); }

/* ============================================================
   FORM
   ============================================================ */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
    font-size: 12px; font-weight: 600;
    color: var(--text2);
}
.form-control {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r2);
    padding: 10px var(--space-6);
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    outline: none;
    transition: all .15s;
    width: 100%;
}
.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
    background: var(--surface);
}
.form-control:disabled { opacity: .65; cursor: not-allowed; background: var(--surface2); }
.form-control option { background: var(--surface); color: var(--text); }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-5);
}

.input-prefix {
    display: flex; align-items: stretch;
    border: 1px solid var(--border);
    border-radius: var(--r2);
    overflow: hidden;
    background: var(--bg);
    transition: all .15s;
}
.input-prefix:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
.input-prefix span {
    background: var(--surface3);
    padding: 10px var(--space-5);
    font-size: 13px; color: var(--text2);
    font-weight: 600;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
    display: flex; align-items: center;
}
.input-prefix .form-control {
    border: none; border-radius: 0; background: transparent;
}
.input-prefix .form-control:focus { box-shadow: none; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }

thead th {
    text-align: left;
    padding: var(--space-5);
    background: transparent;
    border-bottom: 1px solid var(--border);
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.6px;
    color: var(--text2);
    white-space: nowrap;
}
tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background .1s;
}
tbody tr:last-child { border-bottom: 0; }
tbody tr:hover td { background: var(--bg); }
tbody td { padding: 14px var(--space-5); vertical-align: middle; }
tbody td.mono { font-family: var(--mono); }

/* ============================================================
   BADGES / TAGS
   ============================================================ */
.tag {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 600;
    padding: 4px var(--space-4); border-radius: 999px;
}

/* ============================================================
   SEGMENTED CONTROL
   FIX: no arquivo original, ".seg"/".seg-btn" apareciam com 3
   definições divergentes (uma com active em cor sólida branca,
   outras herdando --accent). Unificado em uma única definição.
   ".toggle-group" e ".col-toggle-btn" resolvem casos de uso
   ligeiramente diferentes (toggle binário / filtro de coluna) e
   foram mantidos como componentes à parte — mas são bons
   candidatos a consolidar com ".seg" numa futura passada de
   limpeza de markup.
   ============================================================ */
.toggle-group {
    display: flex;
    background: var(--bg);
    border-radius: var(--r2);
    padding: 3px; gap: 2px;
}
.toggle-btn {
    padding: 7px var(--space-6); border-radius: 7px;
    font-size: 13px; font-weight: 600;
    color: var(--text2);
    transition: all .15s;
    border: none; background: none;
    font-family: var(--font);
    cursor: pointer;
}
.toggle-btn.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.seg {
    display: inline-flex;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--r2);
    padding: 3px; gap: 3px;
}
.seg-btn {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text2);
    padding: 7px var(--space-4);
    border-radius: calc(var(--r2) - 3px);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all .15s;
    font-family: var(--font);
    white-space: nowrap;
}
.seg-btn.active {
    background: var(--accent);
    color: #0F0F0F;
}
.seg-control { display: inline-flex; }
.seg-control .seg-btn { flex: 1; }

.divider { border: none; border-top: 1px solid var(--border); margin: var(--space-7) 0; }

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-7);
}
.tab-btn {
    padding: var(--space-5) var(--space-6);
    font-family: var(--font);
    font-size: 14px; font-weight: 600;
    color: var(--text2);
    background: none; border: none; cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all .15s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Toggle switch */
.toggle-switch {
    position: relative; display: inline-block;
    width: 44px; height: 24px; cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0;
    background: var(--surface3);
    border-radius: 24px;
    transition: .25s;
}
.toggle-slider:before {
    content: '';
    position: absolute; width: 18px; height: 18px;
    left: 3px; top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: .25s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
    background: #0F0F0F;
}
.toggle-switch input:focus-visible + .toggle-slider {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15,19,32,0.55);
    backdrop-filter: blur(6px);
    z-index: var(--z-modal);
    display: none; align-items: center; justify-content: center;
    padding: var(--space-7);
}
.modal-overlay.open { display: flex; animation: fadeIn .2s ease; }
.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--space-9);
    width: 480px; max-width: 95vw;
    max-height: 90vh; overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn .25s cubic-bezier(.4,0,.2,1);
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.modal-sub { font-size: 13px; color: var(--text2); margin-bottom: var(--space-8); }
.modal-actions {
    display: flex; gap: var(--space-4); justify-content: flex-end;
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    border-top: 1px solid var(--border);
}
.modal-close {
    background: none; border: none;
    font-size: 20px; cursor: pointer;
    color: var(--text2);
    padding: 4px var(--space-3);
}

/* ============================================================
   MARKETPLACE CARDS / EMPTY / TOAST
   ============================================================ */
.mkt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-6);
    margin-top: var(--space-6);
}
.mkt-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--space-7);
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: all .15s;
}
.mkt-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.mkt-card.positive { border-color: rgba(0,200,83,0.35); }
.mkt-card.negative { border-color: rgba(239,68,68,0.35); }
.mkt-name {
    font-size: 14px; font-weight: 700; margin-bottom: var(--space-5);
    display: flex; align-items: center; justify-content: space-between;
}
.mkt-tipo {
    font-size: 10px; font-weight: 700;
    color: var(--text2); background: var(--border);
    padding: 3px var(--space-3); border-radius: 6px;
    text-transform: uppercase;
}
.mkt-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: var(--space-3);
}
.mkt-row-label { font-size: 12px; color: var(--text2); }
.mkt-row-val { font-size: 13px; font-weight: 600; }
.mkt-divider { border: none; border-top: 1px solid var(--border); margin: var(--space-5) 0; }
.mkt-mc {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--accent-dim);
    border-radius: var(--r2);
    padding: var(--space-5);
    margin-top: var(--space-5);
}
.mkt-mc-label {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; color: var(--yellow);
}
[data-theme="dark"] .mkt-mc-label { color: var(--accent); }
.mkt-mc-val {
    font-size: 20px; font-weight: 700;
    color: var(--yellow);
}
[data-theme="dark"] .mkt-mc-val { color: var(--accent); }
.mkt-badge-best {
    position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
    background: var(--accent);
    color: #0F0F0F;
    font-size: 10px; font-weight: 800;
    padding: 4px var(--space-5); border-radius: 999px;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.empty-state {
    text-align: center;
    padding: 60px var(--space-7);
    color: var(--text2);
}
.empty-icon { margin-bottom: var(--space-5); opacity: 0.6; }
.empty-icon svg, .empty-icon i[data-lucide] { width: 44px; height: 44px; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-sub { font-size: 13px; }

#toast {
    position: fixed; bottom: var(--space-8); right: var(--space-8);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: var(--space-5) var(--space-7);
    font-size: 14px; font-weight: 500;
    z-index: var(--z-toast);
    display: none; align-items: center; gap: var(--space-4);
    box-shadow: var(--shadow-lg);
}
#toast.show { display: flex; }

/* ============================================================
   HELPERS
   ============================================================ */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: var(--space-3); }
.gap-12 { gap: var(--space-5); }
.gap-24 { gap: var(--space-8); }
.mt-16 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-3); }
.mb-16 { margin-bottom: var(--space-6); }
.mb-20 { margin-bottom: var(--space-7); }
.w-full { width: 100%; }
.text-accent { color: var(--yellow); }
[data-theme="dark"] .text-accent { color: var(--accent); }
.text-red { color: var(--red); }
.text-blue { color: var(--blue); }
.text-muted { color: var(--text2); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.font-mono { font-family: var(--mono); }
.font-bold { font-weight: 700; }
.mono { font-family: var(--mono); }

/* ============================================================
   BAR CHART / DROP-ZONE / SEMÁFORO GENÉRICO
   ============================================================ */
.bar-chart { display: flex; flex-direction: column; gap: var(--space-5); }
.bar-row { display: flex; align-items: center; gap: var(--space-5); font-size: 13px; }
.bar-name {
    width: 160px; flex-shrink: 0;
    font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar-track {
    flex: 1; height: 24px;
    background: var(--bg);
    border-radius: 6px;
    overflow: hidden; position: relative;
}
.bar-fill {
    height: 100%; border-radius: 6px;
    display: flex; align-items: center;
    padding-right: var(--space-4); justify-content: flex-end;
    transition: width .5s cubic-bezier(.4,0,.2,1);
    background: linear-gradient(90deg, var(--accent) 0%, #FFD600 100%);
}
.bar-val {
    font-size: 11px; font-weight: 700;
    white-space: nowrap; color: #0F0F0F;
}

.drop-zone {
    border: 2px dashed var(--border2);
    border-radius: var(--r-lg);
    padding: 44px var(--space-8);
    text-align: center; cursor: pointer;
    transition: all .2s;
    background: var(--bg);
}
.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-dim);
}
.drop-zone .drop-icon { margin-bottom: var(--space-5); }
.drop-zone .drop-icon svg, .drop-zone .drop-icon i[data-lucide] { width: 40px; height: 40px; }
.drop-zone .drop-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.drop-zone .drop-sub { font-size: 13px; color: var(--text2); }

.import-preview {
    overflow-x: auto; max-height: 280px; overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--r2);
}

/* Semáforo genérico (usado fora do módulo de relatórios).
   FIX de acessibilidade: cor não é o único sinal — o texto do
   badge (ex.: "Saudável" / "Atenção") já comunica o estado, então
   manter sempre o texto visível junto da bolinha, nunca só a cor. */
.semaforo-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px var(--space-4); border-radius: 999px;
    font-size: 12px; font-weight: 700;
    font-family: var(--mono);
}
.semaforo-badge::before {
    content: ''; width: 8px; height: 8px;
    border-radius: 50%; background: currentColor;
    box-shadow: 0 0 6px currentColor;
}
.semaforo-verde { background: var(--green-dim); color: var(--green); }
.semaforo-amarelo { background: var(--yellow-dim); color: var(--yellow); }
.semaforo-vermelho { background: var(--red-dim); color: var(--red); }
.semaforo-cinza { background: rgba(107,114,128,0.12); color: var(--text2); }

.margem-cell { font-weight: 700; font-size: 14px; }

/* Badges de frete/logística
   FIX: eram cores pastel fixas (ex. #dcfce7/#15803d), sem variante
   dark — ficavam "estourados" (claros demais) sobre fundo escuro.
   Agora usam a mesma técnica dim/solid dos outros badges do sistema
   e ganham override no dark mode. */
.badge-frete  { font-size:10px; padding:2px 7px; border-radius:4px; font-weight:600; white-space:nowrap; }
.badge-full   { background: var(--blue-dim);   color: var(--blue); }
.badge-flex   { background: var(--green-dim);  color: var(--green); }
.badge-gratis { background: var(--yellow-dim); color: var(--yellow); }
.badge-cobrar { background: var(--surface3);   color: var(--text2); }

/* Fonte do custo (comissão/frete) na coluna Custos: verde = valor real da
   API do marketplace, cinza = estimado pela tabela interna. Mesmo padrão
   visual do .badge-source de anuncios.css (modal de Preço Sugerido). */
.badge-source {
  display: inline-block; font-size: 9px; padding: 1px 5px;
  border-radius: 4px; font-weight: 600; vertical-align: middle;
  margin-left: 4px; white-space: nowrap;
  background: var(--green-dim); color: var(--green);
}
.badge-source.est { background: var(--surface3); color: var(--text2); }

/* Indicador de "atualizando" ao lado do badge de custo — some sozinho quando o
   enrich em background termina (ver _mlMesclarCustosPendentes em ml/anuncios.js) */
.ml-custos-atualizando { animation: spin 1.2s linear infinite; opacity: .55; color: var(--text3); }

/* ============================================================
   MARKETPLACE — CANAIS
   ============================================================ */
.mkt-channel-card { padding: var(--space-7); transition: box-shadow .15s; }
.mkt-card-head    { display: flex; align-items: center; gap: var(--space-5); margin-bottom: var(--space-6); }
.mkt-logo         { width: 40px; height: 40px; border-radius: var(--r2); display: flex;
                    align-items: center; justify-content: center; font-weight: 900;
                    font-size: 13px; flex-shrink: 0; }
.mkt-canal-nome   { font-weight: 700; font-size: 15px; line-height: 1.2; }
.mkt-desc         { font-size: 12px; color: var(--text2); margin: 0 0 14px; line-height: 1.5; }
.mkt-token-info   { font-size: 11px; color: var(--text2); margin-bottom: var(--space-5); min-height: 14px; }
.mkt-metrics      { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin-bottom: 14px; }
.mkt-metric       { padding: 10px var(--space-5); background: var(--bg); border: 1px solid var(--border);
                    border-radius: var(--r2); }
.mkt-metric-label { font-size: 10px; color: var(--text2); text-transform: uppercase;
                    letter-spacing: .05em; font-weight: 600; }
.mkt-metric-val   { font-size: 22px; font-weight: 700; color: var(--text); margin-top: 2px; }
.mkt-actions      { display: flex; gap: var(--space-3); }
.ml-conta-row     { display: flex; align-items: center; justify-content: space-between;
                    padding: 6px var(--space-4); background: var(--bg); border: 1px solid var(--border);
                    border-radius: var(--r2); font-size: 12px; }
.ml-conta-nick    { display: flex; align-items: center; gap: 6px; font-weight: 600;
                    color: var(--text); min-width: 0; overflow: hidden;
                    text-overflow: ellipsis; white-space: nowrap; }

.ml-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-5);
}
.ml-stat {
    padding: 14px var(--space-6);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r2);
}
.ml-stat-label {
    font-size: 11px; color: var(--text2);
    text-transform: uppercase; letter-spacing: 0.06em;
    font-weight: 600;
}
.ml-stat-value {
    font-size: 24px; font-weight: 700;
    color: var(--text); margin-top: 4px;
}
.ml-thumb {
    width: 48px; height: 48px;
    object-fit: cover;
    border-radius: var(--r2);
    border: 1px solid var(--border);
}
.ml-spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ml-spin .8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes ml-spin { to { transform: rotate(360deg); } }

/* ============================================================
   COLUNAS / PREÇO MANUAL / TABELA MULTI-MARKETPLACE
   ============================================================ */
.col-toggle-btn {
    padding: 6px 13px;
    border-radius: var(--r2);
    font-size: 12px; font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text2);
}
.col-toggle-btn:hover { color: var(--text); }
.col-toggle-btn.active {
    background: var(--accent-dim);
    color: var(--yellow);
    border-color: var(--accent);
}
[data-theme="dark"] .col-toggle-btn.active { color: var(--accent); }
.col-hidden { display: none !important; }

.pv-manual-input {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r2);
    padding: 6px 9px;
    font-family: var(--mono);
    font-size: 12px; font-weight: 600;
    color: var(--text);
    width: 100px; outline: none;
}
.pv-manual-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-dim);
}
.pv-manual-input.has-value {
    border-color: var(--accent);
    color: var(--yellow);
    background: var(--accent-dim);
    font-weight: 700;
}
[data-theme="dark"] .pv-manual-input.has-value { color: var(--accent); }
.pv-overridden {
    text-decoration: line-through;
    color: var(--red) !important;
    opacity: 0.7;
}

.tr-produto-header td {
    background: var(--bg);
    border-top: 2px solid var(--accent);
    font-weight: 700; font-size: 14px;
    cursor: pointer;
}
.tr-produto-header:hover td { background: var(--border); }
.tr-produto-header .sku-cell {
    color: var(--yellow);
    font-family: var(--mono);
}
[data-theme="dark"] .tr-produto-header .sku-cell { color: var(--accent); }
.tr-mkt-row td {
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.tr-mkt-row td:first-child { padding-left: var(--space-8); }
.tr-mkt-row.hidden-row { display: none; }
.mkt-name-cell { display: flex; align-items: center; gap: var(--space-3); }
.collapse-icon {
    font-size: 10px; color: var(--text3);
    transition: transform .2s;
}
.collapsed .collapse-icon { transform: rotate(-90deg); }

/* ============================================================
   LOGIN
   ============================================================ */
#login-screen {
    position: fixed; inset: 0; z-index: var(--z-login);
    background: var(--bg);
    display: flex; align-items: stretch;
}
.login-spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--surface2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.login-left {
    flex: 1; position: relative; overflow: hidden;
    background: linear-gradient(145deg, #0F0F0F 0%, #1F1F2E 50%, #2A2A40 100%);
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 52px;
}
.login-left-bg {
    position: absolute; inset: 0;
    background:
        linear-gradient(135deg, rgba(10,15,30,0.25) 0%, rgba(20,30,55,0.15) 50%, rgba(15,15,15,0.45) 100%),
        url('/imagens/panel.png') center/cover no-repeat;
}
.login-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,193,7,0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,193,7,0.06) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 80% at 30% 40%, black 20%, transparent 80%);
}
.login-left-content { position: relative; z-index: 1; }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 40px; }
.login-brand-icon {
    width: 52px; height: 52px;
    background: var(--accent);
    border-radius: 14px;
    display: grid; place-items: center;
    font-size: 24px; font-weight: 800; color: #0F0F0F;
    box-shadow: 0 8px 24px var(--accent-glow);
}
.login-brand-name { font-size: 22px; font-weight: 700; color: #fff; line-height: 1.15; }
.login-brand-sub {
    font-size: 11px; color: rgba(255,193,7,0.8);
    letter-spacing: 0.12em; text-transform: uppercase;
    margin-top: 3px; font-weight: 600;
}
.login-tagline {
    font-size: 40px; font-weight: 700;
    line-height: 1.1; margin-bottom: 18px;
    letter-spacing: -0.02em; color: #fff;
}
.login-tagline em { color: var(--accent); font-style: normal; }
.login-desc {
    font-size: 14px; color: rgba(255,255,255,0.7);
    line-height: 1.6; max-width: 400px;
}
.login-stats { display: flex; gap: 36px; margin-top: 44px; }
.login-stat-val { font-size: 26px; font-weight: 700; color: var(--accent); }
.login-stat-label {
    font-size: 11px; color: rgba(255,255,255,0.55);
    margin-top: 4px; text-transform: uppercase; letter-spacing: 0.05em;
}
.login-right {
    width: 440px; flex-shrink: 0; position: relative;
    background: var(--surface);
    display: flex; flex-direction: column; justify-content: center;
    padding: 52px 48px;
}
.login-form-wrap { width: 100%; }
.login-title { font-size: 26px; font-weight: 700; margin-bottom: 6px; }
.login-subtitle { font-size: 13px; color: var(--text2); margin-bottom: var(--space-10); }
.login-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: var(--space-6); }
.login-label {
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text2);
}
.login-input-wrap { position: relative; }
.login-input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r2);
    padding: 13px 14px 13px 44px;
    font-size: 14px;
    color: var(--text);
    outline: none;
    transition: all .2s;
}
.login-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
    background: var(--surface);
}
.login-input-icon {
    position: absolute; left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--text3);
    pointer-events: none;
    display: flex; align-items: center;
}
.login-input-icon svg { width: 18px; height: 18px; }
.login-input.error { border-color: var(--red); }
.login-eye {
    position: absolute; right: 12px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none; cursor: pointer;
    color: var(--text3);
    padding: 4px;
    display: flex; align-items: center;
}
.login-eye svg { width: 18px; height: 18px; }
.login-error-msg {
    font-size: 12px; color: var(--red);
    font-weight: 500;
    display: none; margin-top: -8px; margin-bottom: 4px;
}
.login-error-msg.show { display: block; }
.login-banner {
    font-size: 12px; font-weight: 500;
    padding: 10px 14px; border-radius: var(--r2);
    margin-bottom: 16px;
}
.login-banner.ok {
    background: var(--accent-dim); color: var(--accent);
    border: 1px solid rgba(108,140,255,0.25);
}
.login-banner.warn {
    background: rgba(220,38,38,0.08); color: var(--red);
    border: 1px solid rgba(220,38,38,0.25);
}
.login-options {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: var(--space-8);
}
.login-remember {
    display: flex; align-items: center; gap: var(--space-3);
    font-size: 13px; color: var(--text2);
    cursor: pointer; user-select: none;
}
.login-remember input { accent-color: var(--accent); }
.login-forgot {
    font-size: 13px; color: var(--yellow);
    cursor: pointer; font-weight: 600;
}
[data-theme="dark"] .login-forgot { color: var(--accent); }
.login-forgot:hover { text-decoration: underline; }
.login-btn {
    width: 100%; padding: 14px;
    background: var(--accent);
    color: #0F0F0F;
    border: none;
    border-radius: var(--r2);
    font-size: 14px; font-weight: 700;
    cursor: pointer;
    transition: all .15s;
    box-shadow: 0 4px 14px var(--accent-glow);
}
.login-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}
.login-footer {
    margin-top: var(--space-10); text-align: center;
    font-size: 11px; color: var(--text3);
}
.btn-ml {
    background: #FFE600;
    color: #333;
    font-weight: 700;
    padding: 12px var(--space-8);
    border: none;
    border-radius: var(--r2);
    cursor: pointer;
    width: 100%;
    font-size: 14px;
    transition: all .15s;
}
.btn-ml:hover { background: #FFD700; transform: translateY(-1px); }

/* Menu mobile */
.menu-toggle {
    display: none;
    background: var(--bg); border: none; cursor: pointer;
    color: var(--text);
    padding: var(--space-3); border-radius: var(--r2);
    width: 40px; height: 40px;
    align-items: center; justify-content: center;
}
.menu-toggle svg { width: 20px; height: 20px; }
.sidebar-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15,19,32,0.50);
    backdrop-filter: blur(2px);
    z-index: var(--z-backdrop);
}
.sidebar-backdrop.open { display: block; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ============================================================
   RESPONSIVE — layout geral
   ============================================================ */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .content { padding: var(--space-8); }
    .section-title { font-size: 24px; }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0;
        z-index: var(--z-sidebar); width: var(--sidebar-w) !important;
        transform: translateX(-100%);
        transition: transform .25s ease;
        box-shadow: var(--shadow-lg);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-collapse-btn { display: none; }
    .main { margin-left: 0; }
    .topbar { padding: 0 var(--space-6); height: 60px; }
    .menu-toggle { display: flex; }
    .content { padding: var(--space-6); }
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .section-header { flex-direction: column; align-items: flex-start; }
    .modal { width: 100% !important; }
    table { min-width: 500px; }
    .form-row { grid-template-columns: 1fr; }
    .section-title { font-size: 20px; }
}

@media (max-width: 860px) {
    #login-screen { flex-direction: column; overflow-y: auto; }
    .login-left { padding: var(--space-10) var(--space-9); }
    .login-tagline { font-size: 28px; }
    .login-right { width: 100%; padding: var(--space-10) var(--space-9); }
}

/* Tooltip ⓘ
   FIX: mesmo tratamento de acessibilidade do tooltip da sidebar —
   dispara em :focus-visible além de :hover, para navegação por
   teclado. Reforçar com aria-label no HTML (attr()/::after não é
   lido por leitores de tela). */
.info-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    font-size: 10px;
    border-radius: 50%;
    background: var(--text3);
    color: var(--surface);
    cursor: help;
    margin-left: 3px;
    position: relative;
    font-weight: 700;
}
.info-tip:hover::after,
.info-tip:focus-visible::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%);
    width: 230px;
    padding: var(--space-3) var(--space-4);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--text);
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--r2);
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
    z-index: var(--z-dropdown);
    white-space: normal;
    text-align: left;
}

/* ============================================================
   DROPDOWN DE BUSCA DE SKU
   FIX: existia duplicado (definido duas vezes, quase idêntico) —
   consolidado numa única definição.
   ============================================================ */
.sku-search { position: relative; }
.sku-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: var(--z-dropdown);
    max-height: 260px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r2);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    margin-top: 4px;
}
.sku-dropdown.open { display: block; }
.sku-item {
    padding: var(--space-3) var(--space-5);
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.12s;
}
.sku-item:last-child { border-bottom: none; }
.sku-item:hover,
.sku-item.active { background: var(--surface2); }
.sku-item-sku { font-weight: 700; font-size: 13px; color: var(--text); }
.sku-item-desc { font-size: 12px; color: var(--text2); }
.sku-empty { padding: var(--space-5); text-align: center; color: var(--text2); font-size: 13px; }

/* Bloco de destaque preço/margem */
.sim-precobox {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--r2);
    padding: var(--space-5);
}
.calc-tag { font-size: 10px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .3px; }

/* ============================================================
   DASHBOARD
   ============================================================ */
.dash-header {
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: var(--space-5);
}
.dash-greeting { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.2; }
.dash-date     { font-size: 13px; color: var(--text2); margin-top: 3px; text-transform: capitalize; }
.dash-controls { display: flex; align-items: center; gap: var(--space-3); }

.dash-periodo-wrap {
  display: flex; background: var(--surface2);
  border-radius: var(--r2); padding: 3px; gap: 2px;
}
.dash-periodo-btn {
  padding: 6px var(--space-6); border: none; background: transparent;
  border-radius: 7px; font-size: 12px; font-weight: 600;
  color: var(--text2); cursor: pointer; transition: all .15s;
  font-family: var(--font); white-space: nowrap;
}
.dash-periodo-btn:hover { background: var(--border); color: var(--text); }
.dash-periodo-btn.active-dash {
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm);
}

/* KPI CARDS */
.dash-kpi-card { gap: 6px; }
.dash-kpi-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px; flex-shrink: 0;
}
.dash-kpi-icon svg { width: 20px; height: 20px; }
.dash-kpi-value { font-size: 26px !important; letter-spacing: -.5px; }
.dash-delta { margin-top: 2px; }

/* SECONDARY KPI (em breve) */
.dash-kpi-sec { opacity: .6; position: relative; overflow: hidden; }
.dash-kpi-sec::after {
  content: 'Em breve';
  position: absolute; top: 10px; right: 12px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--text3); background: var(--surface2);
  padding: 2px var(--space-4); border-radius: 999px; border: 1px solid var(--border);
}

/* SKELETON */
.skeleton-pulse {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--surface3) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.4s infinite;
  color: transparent !important;
  border-radius: 6px; pointer-events: none; user-select: none; min-height: 1em;
}
@keyframes skeletonPulse {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* EM BREVE BLOCK */
.dash-soon-block {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 40px var(--space-7); gap: var(--space-3);
}
.dash-soon-block i     { width: 32px; height: 32px; opacity: .25; color: var(--text3); }
.dash-soon-title       { font-size: 13px; font-weight: 600; color: var(--text3); }
.dash-soon-sub         { font-size: 12px; color: var(--text3); }

/* CANAL CHART */
.dash-canal-row {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-3) 0; border-bottom: 1px solid var(--border);
}
.dash-canal-row:last-child { border-bottom: none; }
.dash-canal-label {
  display: flex; align-items: center; gap: 6px;
  width: 150px; flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--text);
}
.dash-canal-dot   { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dash-canal-pct   { font-size: 11px; color: var(--text3); margin-left: auto; }
.dash-canal-track { flex: 1; height: 8px; background: var(--surface2); border-radius: 999px; overflow: hidden; }
.dash-canal-fill  { height: 100%; border-radius: 999px; transition: width .5s ease; }
.dash-canal-val   {
  width: 90px; text-align: right; font-size: 12px; font-weight: 600;
  font-family: var(--mono); color: var(--text2); flex-shrink: 0;
}

/* ALERTAS */
.dash-alerta {
  display: flex; align-items: center; gap: var(--space-5);
  padding: 11px var(--space-6); border-radius: var(--r2);
  border: 1px solid var(--border); margin-bottom: var(--space-3);
  font-size: 13px; font-weight: 500; background: var(--surface);
}
.dash-alerta-yellow { background: var(--yellow-dim); border-color: rgba(180,83,9,.25); }
.dash-alerta-yellow i { color: var(--yellow); }
.dash-alerta-blue   { background: var(--blue-dim); border-color: rgba(44,138,240,.2); }
.dash-alerta-blue   i { color: var(--blue); }
.dash-alerta-red    { background: var(--red-dim); border-color: rgba(220,38,38,.2); }
.dash-alerta-red    i { color: var(--red); }
.dash-alerta-green  { background: var(--green-dim); border-color: rgba(0,200,83,.2); }

/* EVOLUÇÃO FATURAMENTO x LUCRO */
.dash-evolucao-legend {
  display: flex; gap: var(--space-6); align-items: center;
  padding: 0 4px var(--space-4); font-size: 11px; color: var(--text2);
}
.dash-evolucao-legend span { display: inline-flex; align-items: center; gap: 5px; }
.dash-evolucao-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* TOP PRODUTOS (Mais Lucrativos / Menor Margem) */
.dash-top-row {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-3) 4px; border-bottom: 1px solid var(--border);
  cursor: pointer; border-radius: var(--r-sm); transition: background .12s;
}
.dash-top-row:last-child { border-bottom: none; }
.dash-top-row:hover { background: var(--surface2); }
.dash-top-pos {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; background: var(--surface3); color: var(--text2);
}
.dash-top-pos.dash-top-pos-accent { background: var(--accent-dim); color: var(--accent2); }
.dash-top-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dash-top-nome {
  font-weight: 600; color: var(--text); font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-top-sub { font-size: 11px; color: var(--text3); }
.dash-top-margem { font-family: var(--mono); font-size: 12px; color: var(--text); white-space: nowrap; }
.dash-top-alerta { color: var(--red); margin-right: 3px; }
.dash-top-aviso {
  font-size: 11px; color: var(--text3); padding: 4px 4px var(--space-4);
  text-align: center;
}

/* SECTION LABEL */
.dash-section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text2); margin-bottom: var(--space-5);
}

/* ATALHOS RÁPIDOS */
.dash-shortcut {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: var(--space-4); padding: var(--space-8) var(--space-6);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); cursor: pointer; transition: all .15s;
  text-align: center; box-shadow: var(--shadow-sm);
}
.dash-shortcut:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.dash-shortcut:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dash-shortcut-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--accent-dim); color: var(--accent2);
  display: flex; align-items: center; justify-content: center;
}
.dash-shortcut-icon svg { width: 24px; height: 24px; }
.dash-shortcut-label { font-size: 13px; font-weight: 600; color: var(--text); }
.dash-shortcut-sub   { font-size: 11px; color: var(--text2); }

@media (max-width: 768px) {
  .dash-header    { flex-direction: column; align-items: flex-start; }
  .dash-greeting  { font-size: 18px; }
  .dash-periodo-wrap { flex-wrap: wrap; }
  .dash-canal-label { width: 110px; }
  .dash-canal-val   { width: 70px; }
}

/* ================================================================
   MÓDULO — RELATÓRIOS DE VENDAS
   Hierarquia tipográfica, cores dinâmicas de MC%, busca e paginação.
   FIX: este módulo usava um subsistema de cor próprio (--rel-verde/
   amarelo/vermelho/border) desalinhado do resto do app e sem dark
   mode. Agora consome os tokens globais (ver bloco :root no topo).
   ================================================================ */

/* Linha principal */
.rel-main-row { transition: background .12s; cursor: pointer; }
.rel-main-row:hover { background: var(--surface2) !important; }
.rel-main-row.rel-row-negativo { background: var(--red-dim) !important; }
.rel-main-row.rel-row-negativo:hover { background: rgba(220,38,38,0.10) !important; }

/* Botão expandir */
.rel-expand-cell { padding: 6px var(--space-3) !important; text-align: center; }
.rel-expand-btn  {
  background: none; border: none; cursor: pointer;
  color: var(--text3); font-size: 11px; padding: 2px 5px;
  border-radius: 4px; transition: color .12s, background .12s;
  line-height: 1;
}
.rel-expand-btn:hover,
.rel-expand-btn:focus-visible { color: var(--text); background: var(--surface3); }
.rel-expand-btn.expanded      { color: var(--accent); }

/* Células da linha principal */
.rel-td-data      { font-size: 12px; color: var(--text2); white-space: nowrap; }
.rel-td-order     { font-size: 11px; }
.rel-td-sku       { font-size: 11px; }
.rel-td-produto   { max-width: 220px; }
.rel-td-qtd       { text-align: center !important; font-size: 13px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.rel-td-num       { text-align: right !important; font-size: 12px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.rel-td-logistica { text-align: center !important; }
.rel-td-mc        { text-align: center !important; }
.rel-td-analise   { white-space: nowrap; }
.rel-td-muted     { font-size: 12px; color: var(--text2); white-space: nowrap; }
.rel-td-uf        { text-align: center; }
.rel-td-status    { white-space: nowrap; }

.rel-produto-nome { font-weight: 600; color: var(--text); font-size: 13px; }
.rel-mono { font-family: var(--mono); letter-spacing: -.02em; }
.rel-muted { color: var(--text3); }

.rel-comissao-wrap { display: inline-flex; align-items: center; gap: 4px; }
.rel-estorno-badge {
  font-size: 9px; font-weight: 700; padding: 1px 4px; border-radius: 3px;
  background: color-mix(in srgb, var(--green) 15%, transparent);
  color: var(--green); white-space: nowrap; cursor: default;
}
.rel-detalhe-estorno .rel-det-val { color: var(--green); }
.rel-billing-pending {
  font-size: 11px; line-height: 1; cursor: default; opacity: 0.7;
}

.rel-empty {
  text-align: center !important;
  padding: 40px var(--space-7) !important;
  color: var(--text2);
  font-size: 13px;
  line-height: 1.8;
}

.rel-badge-estimado {
  color: var(--text3); font-size: 10px;
  cursor: help; margin-right: 3px;
  font-family: var(--mono);
}

/* Badge MC% com cor dinâmica */
.rel-mc-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  padding: 2px 7px; border-radius: 999px;
}
.rel-mc-verde   { background: var(--green-dim);  color: var(--green);   }
.rel-mc-amarelo { background: var(--yellow-dim); color: var(--yellow);  }
.rel-mc-vermelho{ background: var(--red-dim);    color: var(--red);     }
.rel-mc-cinza   { background: rgba(148,163,184,.13); color: var(--text2); }
.rel-mc-arrow   { font-size: 9px; opacity: .75; }

/* Badges de logística */
.rel-badge-logistica {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 2px var(--space-3); border-radius: 999px; letter-spacing: .03em;
  text-transform: uppercase; white-space: nowrap;
}
.rel-logi-full   { background: rgba(129,140,248,.18); color: #818cf8; }
.rel-logi-flex   { background: rgba(34,211,238,.14);  color: #22d3ee; }
.rel-logi-coleta { background: var(--yellow-dim);     color: var(--yellow); }
.rel-logi-ml     { background: var(--surface3);       color: var(--text2); }

/* Linha de detalhe expandida */
.rel-detalhe-row { animation: relFadeIn .15s ease; }
@keyframes relFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rel-detalhe-td {
  padding: 14px var(--space-9) !important;
  background: var(--surface2) !important;
  border-bottom: 2px solid var(--rel-border) !important;
}
.rel-detalhe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px var(--space-9);
}
.rel-detalhe-grupo { display: flex; flex-direction: column; gap: 6px; }
.rel-detalhe-resultado { min-width: 160px; }
.rel-detalhe-titulo {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text3); margin-bottom: 2px;
  border-bottom: 1px solid var(--rel-border); padding-bottom: 4px;
}
.rel-det-item {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: var(--space-3); font-size: 12px;
}
.rel-det-label { color: var(--text3); flex-shrink: 0; }
.rel-det-val   { color: var(--text); font-weight: 500; text-align: right; }
.rel-det-qty-hint { font-size: 10px; font-weight: 400; color: var(--text3); margin-left: 4px; }
.rel-det-resultado-val { font-size: 14px !important; font-weight: 700 !important; }
.rel-detalhe-aviso {
  grid-column: 1 / -1; font-size: 11px;
  color: var(--yellow); padding: 6px var(--space-4);
  background: var(--yellow-dim); border-radius: 6px;
  border: 1px solid rgba(251,191,36,.2);
}
.rel-det-destaque .rel-det-label { font-weight: 700; color: var(--text); }
.rel-det-destaque .rel-det-val   { font-weight: 700; }

/* Painel de comparação de margem */
.rel-cmp-wrap {
  margin: var(--space-5) 0 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.rel-cmp-header {
  display: flex; align-items: center; gap: var(--space-5);
  padding: 10px var(--space-6);
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.rel-cmp-titulo {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text2);
}
.rel-cmp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.rel-cmp-col { padding: 14px var(--space-6); display: flex; flex-direction: column; gap: 5px; }
.rel-cmp-col + .rel-cmp-col { border-left: 1px solid var(--border); }
.rel-cmp-col-titulo {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text3);
  margin-bottom: 6px;
}
.rel-cmp-divider { height: 1px; background: var(--border); margin: 6px 0; }
.rel-cmp-sugerido {
  margin-top: 10px; padding: 8px var(--space-4);
  background: rgba(99,102,241,.08); border-radius: 7px;
  border: 1px solid rgba(99,102,241,.2);
  font-size: 12px; color: var(--text2);
}
.rel-cmp-sugerido strong { color: var(--accent); }
.rel-cmp-aviso { padding: var(--space-5) var(--space-6); font-size: 12px; color: var(--text2); font-style: italic; }

/* Status badges */
.rel-cmp-status { font-size: 12px; font-weight: 600; padding: 3px var(--space-4); border-radius: 20px; }
.rel-cmp-ok      { background: var(--green-dim);  color: var(--green); }
.rel-cmp-atencao { background: var(--yellow-dim); color: var(--yellow); }
.rel-cmp-prejuizo{ background: var(--red-dim);    color: var(--red); }
.rel-cmp-sem      { background: var(--surface3); color: var(--text3); }
.rel-cmp-sem-meta { background: var(--surface3); color: var(--text3); }
.rel-uf-badge {
  display:inline-block; font-size:11px; font-weight:700;
  padding:1px 6px; border-radius:4px;
  background: var(--blue-dim); color: var(--blue);
}

/* Semáforo de análise de margem (coluna Análise da tabela)
   FIX de acessibilidade: bolinha sozinha falha para daltonismo
   (verde/vermelho é a combinação mais comum de confundir). Manter
   sempre acompanhada de texto ou aria-label no HTML — a cor aqui
   é reforço visual, não a única informação. */
.rel-semaforo {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  vertical-align: middle;
  cursor: default;
}
.rel-semaforo-verde    { background: var(--green);  box-shadow: 0 0 4px var(--green-dim); }
.rel-semaforo-amarelo  { background: var(--yellow); box-shadow: 0 0 4px var(--yellow-dim); }
.rel-semaforo-vermelho { background: var(--red);    box-shadow: 0 0 4px var(--red-dim); }
.rel-semaforo-cinza    { background: var(--text3); }

/* Badges de status do pedido (order_status / shipping_status do ML) */
.rel-os-badge {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px var(--space-4); border-radius: 20px; white-space: nowrap;
}
.rel-os-paid      { background: var(--green-dim);  color: var(--green); }
.rel-os-pending   { background: var(--yellow-dim); color: var(--yellow); }
.rel-os-shipped   { background: var(--blue-dim);   color: var(--blue); }
.rel-os-delivered { background: rgba(16,185,129,.12); color: #10b981; }
.rel-os-cancelled { background: var(--red-dim);    color: var(--red); }
.rel-os-other     { background: var(--surface3);   color: var(--text2); }

@media (max-width: 700px) {
  .rel-cmp-cols { grid-template-columns: 1fr; }
  .rel-cmp-col + .rel-cmp-col { border-left: none; border-top: 1px solid var(--border); }
}

/* Campo de busca */
.rel-search-wrap {
  display: flex; align-items: center; gap: var(--space-5);
  padding: 10px var(--space-7) 6px; flex-wrap: wrap;
}
.rel-search-inner {
  position: relative; display: flex; align-items: center;
  flex: 1; max-width: 420px; min-width: 200px;
}
.rel-search-icon {
  position: absolute; left: 10px; width: 14px; height: 14px;
  color: var(--text3); pointer-events: none; flex-shrink: 0;
}
.rel-search-input {
  width: 100%; padding: var(--space-3) 32px var(--space-3) 32px;
  background: var(--surface2); border: 1px solid var(--rel-border);
  border-radius: 8px; color: var(--text); font-size: 13px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.rel-search-input::placeholder { color: var(--text3); }
.rel-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.rel-search-clear {
  position: absolute; right: 8px;
  background: none; border: none; cursor: pointer;
  color: var(--text3); font-size: 13px; padding: 2px 4px;
  border-radius: 4px; line-height: 1; transition: color .12s;
}
.rel-search-clear:hover,
.rel-search-clear:focus-visible { color: var(--text); }
.rel-contador { font-size: 12px; color: var(--text3); margin-left: auto; white-space: nowrap; }

/* Paginação */
.rel-paginacao-wrap {
  display: flex; align-items: center; gap: var(--space-5);
  padding: 10px var(--space-7); border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.rel-por-pagina-wrap { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text3); }
.rel-muted-label { white-space: nowrap; }
.rel-por-pagina-select {
  background: var(--surface2); border: 1px solid var(--rel-border);
  color: var(--text); border-radius: 6px; padding: 4px var(--space-3);
  font-size: 12px; cursor: pointer; outline: none;
}
.rel-por-pagina-select:focus { border-color: var(--accent); }
.rel-paginacao-info { font-size: 12px; color: var(--text3); white-space: nowrap; }
.rel-paginacao { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.rel-pag-btn {
  background: var(--surface2); border: 1px solid var(--rel-border);
  color: var(--text2); border-radius: 6px;
  padding: 5px 11px; font-size: 12px; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
  font-family: var(--mono); min-width: 36px; text-align: center;
  white-space: nowrap;
}
.rel-pag-btn:hover:not(:disabled),
.rel-pag-btn:focus-visible:not(:disabled) { background: var(--surface3); color: var(--text); }
.rel-pag-btn.active { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 700; }
.rel-pag-btn.rel-pag-disabled,
.rel-pag-btn:disabled { opacity: .35; cursor: not-allowed; }
.rel-pag-ellipsis { color: var(--text3); padding: 0 4px; font-size: 13px; }

/* Responsivo — módulo Relatórios */
@media (max-width: 640px) {
  .rel-search-inner { max-width: 100%; }
  .rel-paginacao    { margin-left: 0; }
  .rel-paginacao-info { display: none; }
  .rel-pag-btn:not(.active):not(:first-child):not(:last-child) { display: none; }
  .rel-detalhe-grid { grid-template-columns: 1fr 1fr; }
}