/* ============================================================
   MARGEMLAB - Calculadora do Milh�o
   Design System v3 (visual do preview + 100% compat�vel)
   ============================================================ */
.logo-img {
    max-width: 100%;
    max-height: 200px;
    height: auto;
    display: block;
    object-fit: contain;
}


/* ---------- VARI�VEIS LIGHT ---------- */
:root {
    --primary:        #FFC107;
    --primary-hover:  #FFB300;
    --primary-dark:   #FF8F00;
    --primary-glow:   rgba(255,193,7,0.30);
    --primary-dim:    rgba(255,193,7,0.12);

    --accent:         #FFC107;
    --accent2:        #FFB300;
    --accent-dim:     rgba(255,193,7,0.12);
    --accent-glow:    rgba(255,193,7,0.25);
    --accent-blue:    #1A1F71;
    --accent-green:   #00C853;

    --red:            #DC2626;
    --red-dim:        rgba(239,68,68,0.12);
    --blue:           #2C8AF0;
    --blue-dim:       rgba(44,138,240,0.10);
    --yellow:         #B45309;
    --yellow-dim:     rgba(255,193,7,0.18);
    --green:          #00C853;
    --green-dim:      rgba(0,200,83,0.12);

    --bg:             #F7F8FA;
    --surface:        #FFFFFF;
    --surface2:       #F7F8FA;
    --surface3:       #E5E7EB;
    --border:         #E5E7EB;
    --border2:        #D1D5DB;

    --text:           #0F0F0F;
    --text2:          #6B7280;
    --text3:          #9CA3AF;

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

    --r:              12px;
    --r2:             10px;
    --r-lg:           20px;
    --shadow-sm:      0 2px 8px rgba(0,0,0,0.04);
    --shadow-md:      0 4px 20px rgba(0,0,0,0.06);
    --shadow-lg:      0 12px 40px rgba(0,0,0,0.10);

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

[data-theme="dark"] {
    --primary:        #FFD600;
    --primary-hover:  #FFC107;
    --primary-dark:   #FFB300;
    --primary-glow:   rgba(255,214,0,0.25);
    --primary-dim:    rgba(255,214,0,0.10);

    --accent:         #FFD600;
    --accent2:        #FFC107;
    --accent-dim:     rgba(255,214,0,0.12);
    --accent-blue:    #818CF8;
    --accent-green:   #1DE9B6;

    --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);
}

/* ---------- 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; }

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

/* ============================================================
 /* ============================================
   SIDEBAR � NOVO DESIGN
   ============================================ */
.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: 10px;
    padding: 16px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.sidebar-brand .brand-icon {
    width: 34px; height: 34px;
    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: 16px 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: 6px; flex-shrink: 0; transition: all .15s;
}
.sidebar-collapse-btn:hover { 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: 10px 8px; 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 10px;
    margin: 10px 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: 10px;
    padding: 9px 10px; 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;
}
.sidebar .nav-item:hover { 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) */
.sidebar.collapsed .nav-item[data-tooltip]:hover::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: 1000;
    pointer-events: none;
}

/* FOOTER */
.sidebar-footer {
    padding: 10px 8px; border-top: 1px solid var(--border); flex-shrink: 0;
}
.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    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: 6px; flex-shrink: 0; transition: all .15s;
}
.sidebar-logout-btn:hover { background: var(--red-dim, #fee2e2); color: var(--red); }
.sidebar-logout-btn svg { width: 15px; height: 15px; }
.sidebar.collapsed .sidebar-logout-btn { display: none; }
/* SIDEBAR STICKY DESKTOP */
@media (min-width: 769px) {
    .sidebar { position: sticky; top: 0; height: 100vh; }
}

/* ============================================================
   ACESSIBILIDADE
   ============================================================ */

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

/* Focus global — respeita preferência de mouse (pointer) */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Botões/nav que já têm estilo próprio: mantém outline sem box-shadow sobreposto */
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 32px;
    position: sticky; top: 0; z-index: 50;
}

.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: 12px; }

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

/* ============================================================
   BOT�ES
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    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(--primary);
    color: #0F0F0F;
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px var(--primary-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(239,68,68,0.2); }

.btn-sm { padding: 6px 12px; font-size: 12px; }

/* Estilo refinado do checkbox-switch */
.switch-row:hover {
    background: var(--surface3, var(--surface2));
    border-color: var(--accent);
    transition: all .15s ease;
}

.switch-row input[type="checkbox"] {
    accent-color: var(--accent);
}

/* Largura padrão do modal de importação */
.modal-importar {
    width: 680px !important;
    max-width: 95vw !important;
    transition: width .25s ease;
}

/* Quando há erro: alarga para caber a tabela */
.modal-importar.is-wide {
    width: 1100px !important;
}


/* ============================================================
   CONTENT / PAGE
   ============================================================ */
.content { flex: 1; padding: 32px; }

.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: 24px;
    gap: 16px; 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: 24px;
    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: 16px;
    gap: 12px;
    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: 24px;
    display: flex; flex-direction: column; gap: 8px;
    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);
}

/* KPI destaque amarelo (gradiente) */
.stat-card.green {
    background: linear-gradient(135deg, #FFC107 0%, #FFD600 100%);
    border-color: transparent;
    color: #0F0F0F;
}
.stat-card.green .stat-label { color: rgba(0,0,0,0.6); }
.stat-card.green .stat-value { color: #0F0F0F !important; }
.stat-card.green .stat-pill {
    background: rgba(0,0,0,0.12);
    color: #0F0F0F;
}

.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 10px; 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); }

[data-theme="dark"] .pill-yellow { color: var(--primary); }




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

/* ============================================================
   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 14px;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    outline: none;
    transition: all .15s;
    width: 100%;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
    background: var(--surface);
}
.form-control option { background: var(--surface); color: var(--text); }

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

.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(--primary);
    box-shadow: 0 0 0 3px var(--primary-dim);
}
.input-prefix span {
    background: var(--surface3);
    padding: 10px 12px;
    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: 12px;
    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 12px; 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 10px; border-radius: 999px;
}

/* ============================================================
   TOGGLE / TABS / etc (mant�m compat)
   ============================================================ */
.toggle-group {
    display: flex;
    background: var(--bg);
    border-radius: var(--r2);
    padding: 3px; gap: 2px;
}
.toggle-btn {
    padding: 7px 14px; 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);
}

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

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}
.tab-btn {
    padding: 12px 18px;
    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(--primary);
}
.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(--primary); }
.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
    background: #0F0F0F;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15,19,32,0.55);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: none; align-items: center; justify-content: center;
    padding: 20px;
}
.modal-overlay.open { display: flex; animation: fadeIn .2s ease; }
.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 28px;
    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: 22px; }
.modal-actions {
    display: flex; gap: 10px; justify-content: flex-end;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.modal-close {
    background: none; border: none;
    font-size: 20px; cursor: pointer;
    color: var(--text2);
    padding: 4px 8px;
}

/* ============================================================
   MARKETPLACE CARDS / EMPTY / TOAST
   ============================================================ */
.mkt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 16px;
}
.mkt-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px;
    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: 12px;
    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 8px; border-radius: 6px;
    text-transform: uppercase;
}
.mkt-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px;
}
.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: 12px 0; }
.mkt-mc {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--primary-dim);
    border-radius: var(--r2);
    padding: 12px;
    margin-top: 12px;
}
.mkt-mc-label {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; color: var(--yellow);
}
[data-theme="dark"] .mkt-mc-label { color: var(--primary); }
.mkt-mc-val {
    font-size: 20px; font-weight: 700;
    color: var(--yellow);
}
[data-theme="dark"] .mkt-mc-val { color: var(--primary); }
.mkt-badge-best {
    position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
    background: var(--primary);
    color: #0F0F0F;
    font-size: 10px; font-weight: 800;
    padding: 4px 12px; border-radius: 999px;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text2);
}
.empty-icon { font-size: 44px; margin-bottom: 14px; opacity: 0.6; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-sub { font-size: 13px; }

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

/* ============================================================
   HELPERS / BAR CHART / DROP-ZONE / SEM�FORO
   ============================================================ */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-24 { gap: 24px; }
.mt-16 { margin-top: 16px; }
.mt-8 { margin-top: 8px; }
.mb-16 { margin-bottom: 16px; }
.w-full { width: 100%; }
.text-accent { color: var(--yellow); }
[data-theme="dark"] .text-accent { color: var(--primary); }
.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 { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: flex; align-items: center; gap: 12px; 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: 10px; justify-content: flex-end;
    transition: width .5s cubic-bezier(.4,0,.2,1);
    background: linear-gradient(90deg, var(--primary) 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 24px;
    text-align: center; cursor: pointer;
    transition: all .2s;
    background: var(--bg);
}
.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-dim);
}
.drop-zone .drop-icon { font-size: 40px; margin-bottom: 12px; }
.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);
}

.semaforo-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; 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: rgba(0,200,83,0.12); color: #00C853; }
.semaforo-amarelo { background: rgba(255,193,7,0.18); color: #B45309; }
.semaforo-vermelho { background: rgba(239,68,68,0.12); color: #DC2626; }
.semaforo-cinza { background: rgba(107,114,128,0.12); color: #6B7280; }
[data-theme="dark"] .semaforo-amarelo { color: #FBBF24; }
.margem-cell { font-weight: 700; font-size: 14px; }

/* ML stats */
.ml-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}
.ml-stat {
    padding: 14px 16px;
    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); } }

/* Coluna toggles / pv manual / tabela multi-mkt (mantidos) */
.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(--primary-dim);
    color: var(--yellow);
    border-color: var(--primary);
}
[data-theme="dark"] .col-toggle-btn.active { color: var(--primary); }
.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(--primary);
    box-shadow: 0 0 0 2px var(--primary-dim);
}
.pv-manual-input.has-value {
    border-color: var(--primary);
    color: var(--yellow);
    background: var(--primary-dim);
    font-weight: 700;
}
[data-theme="dark"] .pv-manual-input.has-value { color: var(--primary); }
.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(--primary);
    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(--primary); }
.tr-mkt-row td {
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.tr-mkt-row td:first-child { padding-left: 32px; }
.tr-mkt-row.hidden-row { display: none; }
.mkt-name-cell { display: flex; align-items: center; gap: 8px; }
.collapse-icon {
    font-size: 10px; color: var(--text3);
    transition: transform .2s;
}
.collapsed .collapse-icon { transform: rotate(-90deg); }

/* ============================================================
   LOGIN (mant�m estilo original, ajustado pra paleta nova)
   ============================================================ */
#login-screen {
    position: fixed; inset: 0; z-index: 9000;
    background: var(--bg);
    display: flex; align-items: stretch;
}
.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(--primary);
    border-radius: 14px;
    display: grid; place-items: center;
    font-size: 24px; font-weight: 800; color: #0F0F0F;
    box-shadow: 0 8px 24px var(--primary-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(--primary); 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(--primary); }
.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;
    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: 32px; }
.login-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.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(--primary);
    box-shadow: 0 0 0 3px var(--primary-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-options {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px;
}
.login-remember {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--text2);
    cursor: pointer; user-select: none;
}
.login-remember input { accent-color: var(--primary); }
.login-forgot {
    font-size: 13px; color: var(--yellow);
    cursor: pointer; font-weight: 600;
}
[data-theme="dark"] .login-forgot { color: var(--primary); }
.login-forgot:hover { text-decoration: underline; }
.login-btn {
    width: 100%; padding: 14px;
    background: var(--primary);
    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(--primary-glow);
}
.login-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}
.login-footer {
    margin-top: 32px; text-align: center;
    font-size: 11px; color: var(--text3);
}
.btn-ml {
    background: #FFE600;
    color: #333;
    font-weight: 700;
    padding: 12px 24px;
    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: 8px; 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: 99;
}
.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
   ============================================================ */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .content { padding: 24px; }
    .section-title { font-size: 24px; }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed; left: 0; top: 0; bottom: 0;
        z-index: 100; 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 16px; height: 60px; }
    .menu-toggle { display: flex; }
    .content { padding: 16px; }
    .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: 32px 28px; }
    .login-tagline { font-size: 28px; } 
    .login-right { width: 100%; padding: 32px 28px; }

}
/* Segmented control */
.seg {
    display: 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 10px;
    border-radius: calc(var(--r2) - 3px);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all .15s;
}
.seg-btn.active {
    background: var(--primary, var(--accent));
    color: #fff;
}

/* Tooltip ⓘ */
.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 {
    content: attr(data-tip);
    position: absolute;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%);
    width: 230px;
    padding: 8px 10px;
    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: 100;
    white-space: normal;
    text-align: left;
}
/* Dropdown de busca de SKU */
.sku-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    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: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--border); }
.sku-item:last-child { border-bottom: none; }
.sku-item:hover { background: var(--surface2); }
.sku-item-sku { font-weight: 600; font-size: 13px; color: var(--text); }
.sku-item-desc { font-size: 12px; color: var(--text2); }
.sku-empty { padding: 12px; 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: 12px;
}
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r2); padding: 2px; gap: 2px; }
.seg-btn { border: none; background: transparent; padding: 6px 14px; border-radius: calc(var(--r2) - 2px); font-size: 13px; font-weight: 600; color: var(--text2); cursor: pointer; transition: all .15s; }
.seg-btn.active { background: var(--accent); color: #fff; }
.calc-tag { font-size: 10px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .3px; }

/* Campo "calculado" (disabled) */
.form-control:disabled { opacity: .65; cursor: not-allowed; background: var(--surface2); }


// ---- Carregar canais ---- (vers�o usando CSS, sem inline)
async function carregarCanaisEmpresa() {
    const container = document.getElementById('emp-canais');
    try {
        const res = await fetch(_empApi('/api/empresa/canais'), { headers: _empHeaders() });
        const canais = await res.json();
        if (!res.ok) throw new Error(canais.erro || 'Erro ao carregar canais');

        if (!Array.isArray(canais) || canais.length === 0) {
            container.innerHTML = '<div style="color:var(--text2);padding:12px">Nenhum canal cadastrado.</div>';
            return;
        }

        container.innerHTML = canais.map(c => `
            <label class="canal-chip ${c.habilitado ? 'on' : ''}" data-id="${c.id}">
                <input type="checkbox" ${c.habilitado ? 'checked' : ''}>
                <span>${c.icon || '??'} ${c.nome}</span>
            </label>
        `).join('');

        // Toggle visual via classe .on
        container.querySelectorAll('.canal-chip').forEach(chip => {
            const input = chip.querySelector('input');
            chip.addEventListener('click', (e) => {
                if (e.target.tagName !== 'INPUT') input.checked = !input.checked;
                chip.classList.toggle('on', input.checked);
            });
        });
    } catch (err) {
        container.innerHTML = `<div style="color:var(--red);padding:12px">${err.message}</div>`;
    }
}
/* ===== Busca de SKU ===== */
.sku-search {
    position: relative;
}
.sku-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 50;
    max-height: 240px;
    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);
    display: none;
}
.sku-dropdown.open {
    display: block;
}
.sku-item {
    padding: 8px 12px;
    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: 12px;
    text-align: center;
    font-size: 12px;
    color: var(--text3);
}

/* ===== Segmento Modo de Cálculo ===== */
.seg-control {
    display: flex;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--r2);
    padding: 3px;
    gap: 3px;
}
.seg-btn {
    flex: 1;
    padding: 7px 8px;
    border: none;
    background: transparent;
    border-radius: calc(var(--r2) - 3px);
    font-size: 12px;
    font-weight: 600;
    color: var(--text2);
    cursor: pointer;
    transition: all 0.15s;
}
.seg-btn.active {
    background: var(--accent);
    color: #fff;
}

/* ============================================================
   DASHBOARD MODERNO
   ============================================================ */
.dash-header {
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 12px;
}
.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: 8px; }

.dash-periodo-wrap {
  display: flex; background: var(--surface2);
  border-radius: var(--r2); padding: 3px; gap: 2px;
}
.dash-periodo-btn {
  padding: 6px 14px; 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 8px; 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 20px; gap: 8px;
}
.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: 10px;
  padding: 8px 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: 12px;
  padding: 11px 16px; border-radius: var(--r2);
  border: 1px solid var(--border); margin-bottom: 8px;
  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); }

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

/* ATALHOS RÁPIDOS */
.dash-shortcut {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; padding: 24px 16px;
  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); }

/* UTILITY */
.mb-20 { margin-bottom: 20px; }

@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; }
}
