/* ============================================================
   GraziShop — Design System (Neutro/Profissional)
   ============================================================ */

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

:root {
    --gs-primary: #2563EB;
    --gs-primary-dark: #1D4ED8;
    --gs-primary-light: #DBEAFE;
    --gs-success: #16A34A;
    --gs-success-light: #DCFCE7;
    --gs-warning: #D97706;
    --gs-warning-light: #FEF3C7;
    --gs-danger: #DC2626;
    --gs-danger-light: #FEE2E2;
    --gs-purple: #7C3AED;
    --gs-purple-light: #EDE9FE;
    --gs-sidebar-w: 240px;
    --gs-bg: #F8FAFC;
    --gs-surface: #FFFFFF;
    --gs-border: #E2E8F0;
    --gs-text: #1E293B;
    --gs-text-muted: #64748B;
    --gs-text-light: #94A3B8;
    --gs-radius: 10px;
    --gs-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --gs-shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--gs-bg);
    color: var(--gs-text);
    font-size: 14px;
    line-height: 1.5;
}

/* ── Shell ── */
.app-shell { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
    width: var(--gs-sidebar-w);
    background: #1E293B;
    color: #CBD5E1;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 18px 16px;
    border-bottom: 1px solid #334155;
}

.brand-icon { font-size: 22px; flex-shrink: 0; }
.brand-info { display: flex; flex-direction: column; gap: 2px; }
.brand-name { font-size: 17px; font-weight: 700; color: #F1F5F9; letter-spacing: -.3px; line-height: 1.2; }
.brand-version {
    font-size: 10px;
    font-weight: 600;
    color: #475569;
    letter-spacing: .8px;
    display: block;
}

.nav-links { list-style: none; padding: 12px 0; flex: 1; }

.nav-links li a,
.nav-links li .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    color: #94A3B8;
    text-decoration: none;
    font-size: 13.5px;
    border-radius: 0;
    transition: all .15s;
    border-left: 3px solid transparent;
}

.nav-links li a:hover,
.nav-links li .nav-link:hover { background: #334155; color: #F1F5F9; }

.nav-links li a.active,
.nav-links li .nav-link.active {
    background: #1e3a5f;
    color: #93C5FD;
    border-left-color: #3B82F6;
    font-weight: 600;
}

.nav-icon { font-size: 15px; width: 18px; text-align: center; }

.nav-divider { height: 1px; background: #334155; margin: 8px 18px; }

.nav-category {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #475569;
    padding: 6px 18px 2px;
}

/* ── Main Content ── */
.main-content {
    margin-left: var(--gs-sidebar-w);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-wrapper { padding: 28px 32px; max-width: 1280px; width: 100%; }

/* ── Page Header ── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.page-title { font-size: 22px; font-weight: 700; color: var(--gs-text); line-height: 1.2; }
.page-subtitle { color: var(--gs-text-muted); margin-top: 2px; font-size: 13px; }

/* ── Buttons ── */
.btn-primary, .btn-secondary, .btn-ghost, .btn-danger, .btn-success {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all .15s;
    white-space: nowrap;
}

.btn-primary { background: var(--gs-primary); color: white; }
.btn-primary:hover { background: var(--gs-primary-dark); }

.btn-secondary { background: var(--gs-surface); color: var(--gs-text); border: 1px solid var(--gs-border); }
.btn-secondary:hover { background: #F1F5F9; }

.btn-ghost { background: transparent; color: var(--gs-text-muted); border: 1px solid var(--gs-border); }
.btn-ghost:hover { background: #F1F5F9; }

.btn-danger { background: var(--gs-danger); color: white; }
.btn-danger:hover { background: #B91C1C; }

.btn-success { background: var(--gs-success); color: white; }
.btn-success:hover { background: #15803D; }

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px; height: 30px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    background: transparent;
    transition: all .15s;
}

.btn-icon.edit:hover { background: var(--gs-primary-light); }
.btn-icon.delete:hover { background: var(--gs-danger-light); }

/* ── Stats Grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--gs-surface);
    border: 1px solid var(--gs-border);
    border-radius: var(--gs-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--gs-shadow);
    border-left: 4px solid transparent;
}

.stat-card.accent-blue   { border-left-color: var(--gs-primary); }
.stat-card.accent-green  { border-left-color: var(--gs-success); }
.stat-card.accent-purple { border-left-color: var(--gs-purple); }
.stat-card.accent-orange { border-left-color: var(--gs-warning); }

.stat-icon { font-size: 28px; line-height: 1; }
.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 22px; font-weight: 700; color: var(--gs-text); line-height: 1.1; }
.stat-label { font-size: 12px; color: var(--gs-text-muted); margin-top: 2px; }

/* ── Dashboard Layout ── */
.dashboard-row {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
}

.dashboard-card {
    background: var(--gs-surface);
    border: 1px solid var(--gs-border);
    border-radius: var(--gs-radius);
    padding: 20px;
    box-shadow: var(--gs-shadow);
}

.card-title { font-size: 15px; font-weight: 700; margin-bottom: 16px; color: var(--gs-text); }

.cadastro-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.cadastro-list li {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; background: var(--gs-bg);
    border-radius: 8px; border: 1px solid var(--gs-border);
}
.cad-icon { font-size: 20px; }
.cad-label { flex: 1; font-size: 13.5px; color: var(--gs-text-muted); }
.cad-count { font-size: 20px; font-weight: 700; color: var(--gs-text); }

/* ── Tables ── */
.table-card {
    background: var(--gs-surface);
    border: 1px solid var(--gs-border);
    border-radius: var(--gs-radius);
    box-shadow: var(--gs-shadow);
    overflow: hidden;
}

.table-summary {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 20px; background: var(--gs-bg);
    border-bottom: 1px solid var(--gs-border);
    font-size: 13px; color: var(--gs-text-muted);
}

.gs-table { width: 100%; border-collapse: collapse; }

.gs-table th {
    text-align: left; padding: 11px 16px;
    font-size: 11px; font-weight: 700; letter-spacing: .5px;
    text-transform: uppercase; color: var(--gs-text-muted);
    background: var(--gs-bg); border-bottom: 1px solid var(--gs-border);
    white-space: nowrap;
}

.gs-table td {
    padding: 11px 16px; border-bottom: 1px solid var(--gs-border);
    vertical-align: middle; font-size: 13.5px;
}

.gs-table tbody tr:last-child td { border-bottom: none; }
.gs-table tbody tr:hover { background: #F8FAFC; }

.col-id { color: var(--gs-text-light); font-size: 12px; width: 48px; }
.col-actions { width: 90px; text-align: center; }
.col-desc { color: var(--gs-text-muted); max-width: 300px; }
.text-center { text-align: center !important; }

/* ── Badge ── */
.badge {
    display: inline-block; padding: 2px 10px; border-radius: 20px;
    font-size: 11.5px; font-weight: 600;
    background: var(--gs-primary-light); color: var(--gs-primary-dark);
}

/* ── Filter Bar ── */
.filter-bar {
    display: flex; align-items: flex-end; gap: 12px;
    background: var(--gs-surface); border: 1px solid var(--gs-border);
    border-radius: var(--gs-radius); padding: 16px 20px;
    margin-bottom: 20px; box-shadow: var(--gs-shadow); flex-wrap: wrap;
}

.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label {
    font-size: 11px; font-weight: 600; color: var(--gs-text-muted);
    text-transform: uppercase; letter-spacing: .5px;
}

/* ── Forms ── */
.form-card {
    background: var(--gs-surface); border: 1px solid var(--gs-border);
    border-radius: var(--gs-radius); padding: 28px;
    box-shadow: var(--gs-shadow); margin-bottom: 24px;
}

.form-title { font-size: 16px; font-weight: 700; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--gs-border); }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 16px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--gs-text); }

.form-input {
    padding: 8px 12px; border: 1px solid var(--gs-border); border-radius: 8px;
    font-size: 13.5px; color: var(--gs-text); background: var(--gs-surface);
    transition: border-color .15s, box-shadow .15s; width: 100%; font-family: inherit;
}

.form-input:focus { outline: none; border-color: var(--gs-primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
select.form-input { cursor: pointer; }
textarea.form-input { resize: vertical; min-height: 80px; }

.total-display {
    background: var(--gs-primary-light); color: var(--gs-primary-dark);
    font-weight: 700; font-size: 16px; border: 1px solid #BFDBFE;
    min-height: 38px; display: flex; align-items: center;
}

.form-actions { display: flex; gap: 12px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--gs-border); }

/* ── Validation ── */
.validation-message { color: var(--gs-danger); font-size: 12px; margin-top: 2px; }
.field-validation-error { color: var(--gs-danger); font-size: 12px; }
.alert-error { background: var(--gs-danger-light); color: var(--gs-danger); border: 1px solid #FECACA; border-radius: 8px; padding: 10px 14px; margin-top: 12px; font-size: 13px; }

/* ── Modal ── */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(15,23,42,.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 999; backdrop-filter: blur(2px);
}

.modal {
    background: var(--gs-surface); border-radius: 12px; padding: 28px;
    width: 420px; max-width: 90vw; box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

.modal h3 { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.modal p { color: var(--gs-text-muted); font-size: 13.5px; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; }

/* ── Empty / Loading ── */
.empty-card {
    background: var(--gs-surface); border: 1px dashed var(--gs-border);
    border-radius: var(--gs-radius); padding: 48px; text-align: center; color: var(--gs-text-muted);
}
.empty-card span { font-size: 40px; display: block; margin-bottom: 12px; }
.loading-state { background: var(--gs-surface); border: 1px solid var(--gs-border); border-radius: var(--gs-radius); padding: 40px; text-align: center; color: var(--gs-text-muted); font-size: 14px; }

/* ── Charts / Dashboard Cards ── */
.charts-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 20px; }

.chart-card { background: var(--gs-surface); border: 1px solid var(--gs-border); border-radius: var(--gs-radius); padding: 20px; box-shadow: var(--gs-shadow); }

.top-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.top-item { display: flex; align-items: center; gap: 10px; }
.top-rank { width: 24px; height: 24px; background: var(--gs-primary-light); color: var(--gs-primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.top-bar-wrap { flex: 1; }
.top-name { font-size: 13px; font-weight: 600; color: var(--gs-text); }
.top-bar-track { height: 6px; background: #F1F5F9; border-radius: 3px; margin-top: 4px; overflow: hidden; }
.top-bar { height: 100%; background: var(--gs-primary); border-radius: 3px; transition: width .5s ease; }
.top-val { font-size: 13px; font-weight: 700; color: var(--gs-text); min-width: 60px; text-align: right; white-space: nowrap; }

.dist-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.dist-item { display: flex; align-items: center; gap: 8px; }
.dist-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dist-name { flex: 1; font-size: 13px; color: var(--gs-text-muted); }
.dist-pct { font-size: 13px; font-weight: 700; color: var(--gs-text); }

/* ── Misc ── */
.invalid { border-color: var(--gs-danger) !important; }
.valid.modified:not([type=checkbox]) { border-color: var(--gs-success) !important; }

.blazor-error-boundary { background: var(--gs-danger-light); color: var(--gs-danger); padding: 12px 16px; border-radius: 8px; font-size: 13px; }
.blazor-error-boundary::after { content: "Ocorreu um erro. Recarregue a página."; }

#blazor-error-ui {
    background: var(--gs-warning-light); bottom: 0; box-shadow: var(--gs-shadow-md);
    display: none; left: 0; padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

/* ── Rastreamento ── */
.rastreamento-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
}

.rastreamento-wrap .form-input {
    flex: 1;
}

.btn-rastrear {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    background: var(--gs-success);
    color: white;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s;
}
.btn-rastrear:hover { background: #15803D; }

.field-hint {
    font-size: 11px;
    color: var(--gs-text-light);
    margin-top: 3px;
}

.rastreio-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--gs-primary);
    text-decoration: none;
    padding: 3px 8px;
    background: var(--gs-primary-light);
    border-radius: 6px;
    transition: all .15s;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rastreio-link:hover {
    background: #BFDBFE;
    color: var(--gs-primary-dark);
}

.sem-rastreio {
    color: var(--gs-text-light);
    font-size: 13px;
}

/* ── Bling Integration ── */
.bling-status-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-radius: var(--gs-radius);
    border: 1px solid var(--gs-border);
    margin-bottom: 20px;
    box-shadow: var(--gs-shadow);
}

.status-ok  { background: var(--gs-success-light); border-color: #86EFAC; }
.status-off { background: var(--gs-surface); }

.bling-status-icon { font-size: 28px; flex-shrink: 0; }
.bling-status-info { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.bling-status-label { font-weight: 700; font-size: 15px; color: var(--gs-text); }
.bling-status-desc  { font-size: 13px; color: var(--gs-text-muted); }

.bling-op-card {
    background: var(--gs-surface);
    border: 1px solid var(--gs-border);
    border-radius: var(--gs-radius);
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: var(--gs-shadow);
}

.bling-op-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 0;
}

.bling-op-icon  { font-size: 24px; flex-shrink: 0; margin-top: 2px; }
.bling-op-title { font-size: 15px; font-weight: 700; color: var(--gs-text); margin-bottom: 3px; }
.bling-op-desc  { font-size: 13px; color: var(--gs-text-muted); flex: 1; }

.bling-op-msg {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
}

.msg-ok   { background: var(--gs-success-light); color: var(--gs-success); border: 1px solid #86EFAC; }
.msg-erro { background: var(--gs-danger-light); color: var(--gs-danger); border: 1px solid #FECACA; }

.bling-preview { margin-top: 16px; border-top: 1px solid var(--gs-border); padding-top: 14px; }
.bling-preview-title { font-size: 13px; font-weight: 600; color: var(--gs-text-muted); margin-bottom: 10px; }

.bling-envio-form { margin-top: 16px; border-top: 1px solid var(--gs-border); padding-top: 16px; }

/* ── Responsivo Mobile ── */
@media (max-width: 768px) {

    /* Sidebar vira menu top */
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        flex-direction: row;
        flex-wrap: wrap;
        padding-bottom: 8px;
    }

    .sidebar-brand {
        flex: 1;
        padding: 14px 16px;
        border-bottom: none;
    }

    .nav-links {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 4px 8px 8px;
        gap: 2px;
        width: 100%;
        border-top: 1px solid #334155;
    }

    .nav-links li a,
    .nav-links li .nav-link {
        padding: 6px 10px;
        border-left: none;
        border-radius: 6px;
        font-size: 12px;
    }

    .nav-links li a.active,
    .nav-links li .nav-link.active {
        border-left: none;
        background: #1e3a5f;
    }

    .nav-category { display: none; }
    .nav-divider  { display: none; }

    /* Main content sem margem lateral */
    .main-content { margin-left: 0; }
    .page-wrapper { padding: 16px; }

    /* Page header empilha */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    /* Stats em 2 colunas */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card { padding: 14px; }
    .stat-value { font-size: 18px; }

    /* Dashboard em coluna única */
    .dashboard-row   { grid-template-columns: 1fr; }
    .charts-row      { grid-template-columns: 1fr; }

    /* Tabelas com scroll horizontal */
    .table-card { overflow-x: auto; }
    .gs-table   { min-width: 600px; }

    /* Formulários em coluna única */
    .form-row { grid-template-columns: 1fr; }
    .form-card { padding: 16px; }

    /* Filter bar empilha */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .filter-group { width: 100%; }
    .filter-group .form-input { width: 100%; }

    /* Bling cards */
    .bling-op-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .bling-status-card {
        flex-wrap: wrap;
        gap: 10px;
    }

    /* Botões full width em mobile */
    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn-primary,
    .form-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    /* Rastreamento */
    .rastreamento-wrap { flex-direction: column; }
    .btn-rastrear { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .page-title { font-size: 18px; }
    .stat-value { font-size: 16px; }
}

/* ── Sidebar Responsivo (mobile-first overlay) ── */

/* Botão hamburguer — só aparece no mobile */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 14px;
    left: 16px;
    z-index: 200;
    background: #1E293B;
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.sidebar-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #F1F5F9;
    border-radius: 2px;
    transition: all .25s;
}

/* Botão X dentro do sidebar — só no mobile */
.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: #94A3B8;
    font-size: 18px;
    cursor: pointer;
    margin-left: auto;
    padding: 4px 8px;
    line-height: 1;
}

.sidebar-close:hover { color: #F1F5F9; }

/* Overlay escuro atrás do sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 99;
    opacity: 0;
    transition: opacity .25s;
    pointer-events: none;
}

.sidebar-overlay.open {
    display: block;
    opacity: 1;
    pointer-events: all;
}

@media (max-width: 768px) {

    /* Mostra o botão hamburguer */
    .sidebar-toggle { display: flex; }
    .sidebar-close  { display: block; }
    /* Overlay só visível quando aberto — pointer-events controlado por JS */
    .sidebar-overlay { display: block; }

    /* Sidebar some da tela por padrão */
    .sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: 260px;
        transform: translateX(-100%);
        transition: transform .25s ease;
        z-index: 100;
    }

    /* Sidebar aparece quando tem classe .open */
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,.35);
    }

    /* Conteúdo principal ocupa tela toda */
    .main-content {
        margin-left: 0;
    }

    /* Topo com espaço para o botão hamburguer */
    .page-wrapper {
        padding: 64px 16px 24px;
    }

    /* Page header empilha */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    /* Stats 2 colunas */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card  { padding: 14px; gap: 10px; }
    .stat-value { font-size: 17px; }
    .stat-icon  { font-size: 22px; }

    /* Dashboard e charts em coluna */
    .dashboard-row { grid-template-columns: 1fr; }
    .charts-row    { grid-template-columns: 1fr; }

    /* Tabelas scroll horizontal */
    .table-card  { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .gs-table    { min-width: 580px; }

    /* Formulários coluna única */
    .form-row  { grid-template-columns: 1fr; }
    .form-card { padding: 16px; }

    /* Filter bar empilha */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group       { width: 100%; }
    .filter-group .form-input { width: 100%; }

    /* Bling */
    .bling-op-header    { flex-wrap: wrap; }
    .bling-status-card  { flex-wrap: wrap; }
    .bling-envio-form .form-row { grid-template-columns: 1fr; }

    /* Botões de ação empilhados */
    .form-actions {
        flex-direction: column;
    }
    .form-actions .btn-primary,
    .form-actions .btn-secondary,
    .form-actions .btn-ghost {
        width: 100%;
        justify-content: center;
    }

    /* Rastreamento */
    .rastreamento-wrap  { flex-direction: column; }
    .btn-rastrear       { width: 100%; justify-content: center; }

    /* Modal */
    .modal { width: 92vw; padding: 20px; }

    /* Relatorios */
    .relatorio-filtros  { flex-direction: column; }
    .relatorio-acoes    { flex-wrap: wrap; }
}

@media (max-width: 420px) {
    .stats-grid { grid-template-columns: 1fr; }
    .page-title { font-size: 17px; }
}

/* ── Comprovante / Dropzone ── */
.dropzone {
    border: 2px dashed var(--gs-border);
    border-radius: var(--gs-radius);
    background: var(--gs-bg);
    transition: all .2s;
    cursor: pointer;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropzone.dragover {
    border-color: var(--gs-primary);
    background: var(--gs-primary-light);
}

.dropzone-idle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 24px;
    text-align: center;
}

.dropzone-icon { font-size: 36px; }
.dropzone-text { font-size: 14px; font-weight: 600; color: var(--gs-text); }
.dropzone-sub  { font-size: 12px; color: var(--gs-text-muted); }
.dropzone-hint { font-size: 11px; color: var(--gs-text-light); margin-top: 4px; }

/* Preview do arquivo selecionado */
.dropzone-preview {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    width: 100%;
}

.preview-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--gs-border);
    flex-shrink: 0;
}

.preview-pdf {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    background: var(--gs-danger-light);
    border-radius: 8px;
    flex-shrink: 0;
}

.preview-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.preview-nome     { font-size: 13px; font-weight: 600; color: var(--gs-text); word-break: break-all; }
.preview-tamanho  { font-size: 12px; color: var(--gs-text-muted); }

.preview-remover {
    background: none;
    border: 1px solid var(--gs-border);
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--gs-text-muted);
    flex-shrink: 0;
}
.preview-remover:hover { background: var(--gs-danger-light); color: var(--gs-danger); border-color: var(--gs-danger); }

/* Comprovante já salvo */
.comprovante-atual {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    background: var(--gs-success-light);
    border: 1px solid #86EFAC;
    border-radius: var(--gs-radius);
}

.comprovante-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--gs-border);
    flex-shrink: 0;
}

.comprovante-pdf-icon {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    background: var(--gs-danger-light);
    border-radius: 8px;
    flex-shrink: 0;
}

.comprovante-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comprovante-nome   { font-size: 13px; font-weight: 600; color: var(--gs-text); word-break: break-all; }
.comprovante-acoes  { display: flex; gap: 8px; flex-wrap: wrap; }

/* Coluna comprovante na listagem */
.comprovante-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: var(--gs-success-light);
    color: var(--gs-success);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all .15s;
}
.comprovante-badge:hover { background: #86EFAC; }

/* ── Seleção múltipla Compras ── */
.row-selected { background: var(--gs-primary-light) !important; }

.bling-envio-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--gs-primary-light);
    border: 1px solid #BFDBFE;
    border-radius: var(--gs-radius);
    margin-bottom: 16px;
    font-weight: 600;
    color: var(--gs-primary-dark);
    flex-wrap: wrap;
}

/* ── Badge Exportado Bling ── */
.exportado-badge {
    font-size: 18px;
    cursor: default;
    display: inline-block;
}

/* ══════════════════════════════════════════════
   DateRangePicker — estilo Bling
   ══════════════════════════════════════════════ */

.drp-wrapper {
    position: relative;
    display: inline-block;
}

/* Trigger */
.drp-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--gs-surface);
    border: 1.5px solid var(--gs-border);
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--gs-text);
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.drp-trigger:hover,
.drp-trigger--open {
    border-color: var(--gs-success);
    box-shadow: 0 0 0 3px rgba(22,163,74,.1);
}

.drp-trigger-icon { font-size: 15px; }
.drp-trigger-label { color: var(--gs-text); }

.drp-clear {
    background: none;
    border: none;
    color: var(--gs-text-muted);
    cursor: pointer;
    font-size: 13px;
    padding: 0 2px;
    line-height: 1;
    margin-left: 2px;
}
.drp-clear:hover { color: var(--gs-danger); }

/* Dropdown */
.drp-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: auto;
    z-index: 1000;
    background: var(--gs-surface);
    border: 1px solid var(--gs-border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.15);
    min-width: 720px;
    overflow: hidden;
}

/* Quando o wrapper estiver na metade direita da tela, abre para a esquerda */
.drp-wrapper {
    position: relative;
}

.drp-dropdown-right {
    left: auto;
    right: 0;
}

/* Calendários */
.drp-calendars {
    display: flex;
    gap: 0;
    padding: 20px;
    gap: 24px;
    border-bottom: 1px solid var(--gs-border);
}

.drp-cal { flex: 1; }

.drp-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.drp-cal-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--gs-text);
    text-transform: capitalize;
}

.drp-nav {
    background: none;
    border: 1px solid var(--gs-border);
    border-radius: 6px;
    width: 28px; height: 28px;
    cursor: pointer;
    font-size: 13px;
    color: var(--gs-text-muted);
    display: flex; align-items: center; justify-content: center;
    transition: all .15s;
}
.drp-nav:hover { background: var(--gs-bg); color: var(--gs-text); }

/* Grid do calendário */
.drp-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.drp-weekday {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--gs-text-muted);
    padding: 4px 0 8px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.drp-day {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--gs-text);
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all .1s;
    width: 100%;
}

.drp-day:hover {
    background: var(--gs-success-light);
    color: var(--gs-success);
}

.drp-day--hoje {
    font-weight: 700;
    color: var(--gs-success);
}

.drp-day--range {
    background: var(--gs-success-light);
    border-radius: 0;
    color: var(--gs-success);
}

.drp-day--inicio,
.drp-day--fim {
    background: var(--gs-success) !important;
    color: white !important;
    border-radius: 6px !important;
    font-weight: 700;
}

/* Atalhos */
.drp-atalhos {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 160px;
    padding-left: 16px;
    border-left: 1px solid var(--gs-border);
}

.drp-atalho {
    text-align: left;
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--gs-text-muted);
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.drp-atalho:hover { background: var(--gs-success-light); color: var(--gs-success); }
.drp-atalho--ativo { background: var(--gs-success-light) !important; color: var(--gs-success) !important; font-weight: 600; }

/* Rodapé */
.drp-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--gs-bg);
    gap: 16px;
    flex-wrap: wrap;
}

.drp-inputs { display: flex; gap: 16px; }

.drp-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.drp-input-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gs-text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.drp-input {
    padding: 6px 12px;
    border: 1px solid var(--gs-border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--gs-text);
    background: var(--gs-surface);
    width: 130px;
    cursor: default;
}

.drp-footer-acoes { display: flex; gap: 8px; }

.drp-btn-cancelar {
    padding: 8px 18px;
    border: 1px solid var(--gs-border);
    border-radius: 8px;
    background: var(--gs-surface);
    color: var(--gs-text-muted);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}
.drp-btn-cancelar:hover { background: var(--gs-bg); }

.drp-btn-filtrar {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    background: var(--gs-success);
    color: white;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}
.drp-btn-filtrar:hover { background: #15803D; }

@media (max-width: 768px) {
    .drp-dropdown { min-width: 95vw; left: 50%; transform: translateX(-50%); }
    .drp-calendars { flex-direction: column; }
    .drp-atalhos { flex-direction: row; flex-wrap: wrap; border-left: none; border-top: 1px solid var(--gs-border); padding-left: 0; padding-top: 12px; }
}

/* ── Análise de Preços ── */
.grafico-container {
    background: var(--gs-bg);
    border-radius: var(--gs-radius);
    padding: 16px;
    border: 1px solid var(--gs-border);
}

.variacao-alta  { color: var(--gs-danger); font-weight: 600; }
.variacao-baixa { color: var(--gs-success); font-weight: 600; }
.variacao-neutra{ color: var(--gs-text-muted); font-weight: 600; }

/* ── Simulador de Preços ── */
.sim-layout {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 24px;
    align-items: start;
}

.sim-left, .sim-right { display: flex; flex-direction: column; gap: 20px; }

.input-prefix-wrap {
    display: flex;
    align-items: center;
    border: 1px solid var(--gs-border);
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow .15s, border-color .15s;
}
.input-prefix-wrap:focus-within {
    border-color: var(--gs-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.input-prefix, .input-suffix {
    padding: 8px 10px;
    background: var(--gs-bg);
    color: var(--gs-text-muted);
    font-size: 13px;
    font-weight: 600;
    border: none;
    white-space: nowrap;
}
.input-prefix { border-right: 1px solid var(--gs-border); }
.input-suffix  { border-left: 1px solid var(--gs-border); }
.input-with-prefix { border: none !important; box-shadow: none !important; border-radius: 0 !important; }

.sim-custo-card {
    background: var(--gs-primary);
    color: white;
    border-radius: var(--gs-radius);
    padding: 20px;
    text-align: center;
}
.sim-custo-label  { font-size: 12px; opacity: .8; margin-bottom: 4px; }
.sim-custo-valor  { font-size: 32px; font-weight: 800; margin-bottom: 4px; }
.sim-custo-detalhe{ font-size: 12px; opacity: .7; }

/* Plataformas */
.plataforma-config {
    background: var(--gs-bg);
    border-radius: 8px;
    padding: 14px;
    border: 1px solid var(--gs-border);
}

.plataforma-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 700;
    font-size: 14px;
}

.plataforma-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
}
.ml-logo { background: #FFE600; color: #1a1a1a; }
.sh-logo { background: #EE4D2D; }

.taxas-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.taxa-item { display: flex; flex-direction: column; gap: 4px; }
.taxa-item label { font-size: 11px; font-weight: 600; color: var(--gs-text-muted); }
.taxa-item .form-input { padding: 6px 10px; font-size: 13px; }

.faixa-config {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--gs-border);
}
.faixa-config:last-child { border-bottom: none; }
.faixa-label { font-size: 12px; color: var(--gs-text-muted); min-width: 110px; }
.faixa-inputs { display: flex; gap: 8px; flex: 1; }
.faixa-inputs .taxa-item { flex: 1; }
.faixa-inputs .form-input { padding: 5px 8px; font-size: 12px; }

/* Resultados */
.plataforma-resultado {
    background: var(--gs-surface);
    border: 1px solid var(--gs-border);
    border-radius: var(--gs-radius);
    padding: 20px;
    box-shadow: var(--gs-shadow);
}
.pr-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.pr-titulo  { font-size: 16px; font-weight: 700; }

.pr-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.pr-card {
    background: var(--gs-bg);
    border: 1px solid var(--gs-border);
    border-radius: 8px;
    padding: 14px;
    position: relative;
}
.pr-card-destaque {
    background: #F0FDF4;
    border-color: #86EFAC;
}
.pr-card-badge {
    font-size: 10px;
    font-weight: 700;
    color: var(--gs-success);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.pr-card-titulo { font-size: 12px; color: var(--gs-text-muted); margin-bottom: 6px; }
.pr-preco {
    font-size: 26px;
    font-weight: 800;
    color: var(--gs-text);
    margin-bottom: 12px;
    line-height: 1;
}
.pr-detalhes { display: flex; flex-direction: column; gap: 5px; }
.pr-linha {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--gs-text-muted);
}
.pr-custo { color: var(--gs-danger); }
.pr-linha-total { border-top: 1px solid var(--gs-border); padding-top: 5px; margin-top: 2px; }
.pr-lucro {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    color: var(--gs-success);
    background: var(--gs-success-light);
    padding: 6px 8px;
    border-radius: 6px;
    margin-top: 4px;
}

.text-success { color: var(--gs-success) !important; font-weight: 600; }

@media (max-width: 768px) {
    .sim-layout  { grid-template-columns: 1fr; }
    .pr-cards    { grid-template-columns: 1fr; }
    .taxas-grid  { grid-template-columns: 1fr; }
}

/* ── Simulador modo toggle ── */
.sim-modo-toggle {
    display: flex;
    gap: 0;
    background: var(--gs-bg);
    border: 1px solid var(--gs-border);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 0;
}

.sim-modo-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--gs-text-muted);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    text-align: center;
}

.sim-modo-ativo {
    background: var(--gs-surface);
    color: var(--gs-primary);
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
}

/* ROI badges */
.roi-bom  { color: var(--gs-success); font-weight: 700; }
.roi-ok   { color: var(--gs-warning); font-weight: 700; }
.roi-ruim { color: var(--gs-danger);  font-weight: 700; }

.pr-roi {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    color: var(--gs-text-muted);
    background: var(--gs-bg);
    padding: 5px 8px;
    border-radius: 6px;
    margin-top: 4px;
}

.pr-lucro-neg {
    background: var(--gs-danger-light) !important;
    color: var(--gs-danger) !important;
}

/* ══════════════════════════════════════
   Responsividade — Análise e Simulador
   ══════════════════════════════════════ */
@media (max-width: 768px) {

    /* ── Análise de Preços ── */
    .grafico-container { padding: 8px; overflow-x: auto; }
    .grafico-container svg { min-width: 480px; }

    /* ── Simulador ── */
    .sim-layout {
        grid-template-columns: 1fr;
    }

    .sim-modo-toggle {
        flex-direction: column;
        gap: 4px;
    }

    .sim-modo-btn { width: 100%; }

    .pr-cards {
        grid-template-columns: 1fr;
    }

    .pr-preco { font-size: 20px; }

    .taxas-grid { grid-template-columns: 1fr 1fr; }

    .faixa-config { flex-direction: column; gap: 6px; }
    .faixa-label { min-width: unset; }
    .faixa-inputs { width: 100%; }

    /* Comparativo scroll horizontal */
    .form-card .gs-table { min-width: 500px; }
    .form-card { overflow-x: auto; }

    /* Custo card menor */
    .sim-custo-card { padding: 14px; }
    .sim-custo-valor { font-size: 24px; }

    /* DateRangePicker — dropdown menor */
    .drp-dropdown {
        min-width: unset;
        width: 95vw;
        left: 50%;
        transform: translateX(-50%);
    }

    .drp-calendars {
        flex-direction: column;
        padding: 12px;
        gap: 16px;
    }

    /* Ocultar calendário direito no mobile — só mostra 1 mês */
    .drp-calendars .drp-cal:last-of-type {
        display: none;
    }

    .drp-atalhos {
        flex-direction: row;
        flex-wrap: wrap;
        border-left: none;
        border-top: 1px solid var(--gs-border);
        padding: 8px 0 0;
        min-width: unset;
    }

    .drp-atalho { font-size: 12px; padding: 5px 8px; }

    .drp-footer {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .drp-inputs { flex-direction: column; gap: 8px; }
    .drp-input { width: 100%; }
    .drp-footer-acoes { justify-content: flex-end; }

    /* Análise — stats grid 2 colunas */
    .stats-grid { grid-template-columns: 1fr 1fr; }

    /* Plataforma resultado mobile */
    .plataforma-resultado { padding: 14px; }
    .pr-header { margin-bottom: 10px; }
}

@media (max-width: 420px) {
    .taxas-grid { grid-template-columns: 1fr; }
    .pr-preco { font-size: 18px; }
    .sim-custo-valor { font-size: 20px; }
    .drp-atalho { font-size: 11px; padding: 4px 6px; }
}

/* ── Login ── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    padding: 20px;
}

.login-card {
    background: var(--gs-surface);
    border-radius: 16px;
    padding: 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 24px 64px rgba(0,0,0,.4);
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--gs-border);
}

.login-icon  { font-size: 40px; }
.login-title { font-size: 24px; font-weight: 800; color: var(--gs-text); margin: 0; }
.login-subtitle { font-size: 12px; color: var(--gs-text-muted); margin: 2px 0 0; }

.senha-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.senha-wrap .form-input { padding-right: 40px; }

.senha-toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    line-height: 1;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 11px;
    color: var(--gs-text-light);
}

/* ── Usuário no sidebar ── */
.nav-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin: 8px 8px 0;
    background: #0F172A;
    border-radius: 8px;
    border: 1px solid #1E293B;
}

.nav-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.nav-user-icon  { font-size: 18px; flex-shrink: 0; }
.nav-user-nome  { font-size: 12px; font-weight: 600; color: #CBD5E1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.nav-user-perfil{ font-size: 10px; color: #475569; }

.nav-logout {
    color: #475569;
    font-size: 18px;
    text-decoration: none;
    padding: 4px;
    border-radius: 4px;
    transition: color .15s;
    flex-shrink: 0;
}
.nav-logout:hover { color: var(--gs-danger); }

/* Badges usuário */
.badge-admin { background: #FEF3C7; color: #92400E; }
.status-ativo   { color: var(--gs-success); font-size: 13px; font-weight: 600; }
.status-inativo { color: var(--gs-danger);  font-size: 13px; font-weight: 600; }

/* ── Banner sessão expirando ── */
.sessao-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--gs-warning);
    color: white;
    text-align: center;
    padding: 10px 20px;
    font-size: 13.5px;
    font-weight: 600;
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0,0,0,.2);
}

/* ── Input com erro ── */
.input-erro {
    border-color: var(--gs-danger) !important;
    box-shadow: 0 0 0 3px rgba(220,38,38,.1) !important;
}

/* ── Status Badge Logístico ── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Status Logístico Dashboard ── */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.status-kpi-card {
    border: 1.5px solid;
    border-radius: 10px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform .15s;
}
.status-kpi-card:hover { transform: translateY(-2px); }

.status-kpi-icone { font-size: 24px; flex-shrink: 0; }
.status-kpi-info  { display: flex; flex-direction: column; gap: 1px; }
.status-kpi-qtd   { font-size: 22px; font-weight: 800; line-height: 1; }
.status-kpi-desc  { font-size: 11px; font-weight: 600; color: var(--gs-text-muted); }
.status-kpi-total { font-size: 11px; color: var(--gs-text-light); }

/* ── Alerta de Atraso ── */
.alerta-atraso {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #FEF3C7;
    border: 1.5px solid #FCD34D;
    border-radius: var(--gs-radius);
    padding: 12px 16px;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.alerta-atraso-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
    color: #92400E;
}

.alerta-icon { font-size: 20px; flex-shrink: 0; }

.alerta-ver {
    background: #F59E0B;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.alerta-ver:hover { background: #D97706; }

.alerta-fechar {
    background: none;
    border: none;
    color: #92400E;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 4px;
}
.alerta-fechar:hover { background: #FCD34D; }

/* ── Sino NavMenu ── */
.nav-sino {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 8px;
    padding: 8px 12px;
    background: #FEF3C7;
    border: 1px solid #FCD34D;
    border-radius: 8px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    color: #92400E;
    transition: background .15s;
    position: relative;
}
.nav-sino:hover { background: #FCD34D; }

.nav-sino-badge {
    background: #DC2626;
    color: white;
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 700;
}

.nav-sino-label { font-size: 11px; }

@media (max-width: 768px) {
    .status-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Dashboard Grid ── */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.card-section {
    background: var(--gs-surface);
    border: 1px solid var(--gs-border);
    border-radius: var(--gs-radius);
    padding: 20px;
    box-shadow: var(--gs-shadow);
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--gs-text);
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gs-border);
}

/* Ranking */
.ranking-list { display: flex; flex-direction: column; gap: 10px; }

.ranking-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ranking-pos {
    width: 24px;
    height: 24px;
    background: var(--gs-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--gs-text-muted);
    flex-shrink: 0;
}

.ranking-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ranking-nome {
    font-size: 13px;
    font-weight: 600;
    color: var(--gs-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ranking-bar {
    height: 4px;
    background: var(--gs-border);
    border-radius: 2px;
    overflow: hidden;
}

.ranking-fill {
    height: 100%;
    background: var(--gs-primary);
    border-radius: 2px;
    transition: width .4s ease;
}

.ranking-fill-purple { background: #7C3AED; }

.ranking-valor {
    font-size: 12px;
    font-weight: 700;
    color: var(--gs-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Pagamento */
.pgto-list { display: flex; flex-direction: column; gap: 10px; }

.pgto-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.pgto-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gs-primary);
    flex-shrink: 0;
}

.pgto-dot:nth-child(1) { background: var(--gs-primary); }

.pgto-nome { flex: 1; color: var(--gs-text); font-weight: 500; }
.pgto-pct  { font-weight: 700; color: var(--gs-text); min-width: 36px; text-align: right; }
.pgto-valor{ color: var(--gs-text-muted); min-width: 80px; text-align: right; font-size: 12px; }

@media (max-width: 768px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

/* ── Status card clicável ── */
.status-kpi-clickable {
    cursor: pointer;
    transition: transform .15s, box-shadow .15s !important;
    position: relative;
}

.status-kpi-clickable:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
}

.status-kpi-arrow {
    font-size: 18px;
    font-weight: 700;
    margin-left: auto;
    opacity: 0;
    transition: opacity .15s, transform .15s;
}

.status-kpi-clickable:hover .status-kpi-arrow {
    opacity: 1;
    transform: translateX(4px);
}

/* ── Rastreamento múltiplo ── */
.rastreio-multi {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.rastreio-badge {
    background: var(--gs-primary);
    color: white;
    border-radius: 10px;
    padding: 1px 5px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
}

/* ── Rastreamento múltiplo ── */
.rastreio-multi {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: transform .15s;
}
.rastreio-multi:hover { transform: scale(1.15); }

.rastreio-badge {
    background: var(--gs-primary);
    color: white;
    border-radius: 10px;
    padding: 0px 5px;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
}

/* ── Painel de Vendas ── */
.canal-item { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--gs-border); }
.canal-item:last-child { border-bottom: none; margin-bottom: 0; }
.canal-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.canal-icone  { font-size: 18px; }
.canal-nome   { font-weight: 700; font-size: 14px; flex: 1; }
.canal-qtd    { font-size: 12px; color: var(--gs-text-muted); }

.novo-pedido-badge {
    background: var(--gs-success);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%   { opacity: 1; }
    50%  { opacity: .6; }
    100% { opacity: 1; }
}

.pedido-novo { background: #F0FDF4 !important; }

/* Configurações do appsettings */

/* ── Radar de Preços ── */
.radar-meu-preco {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--gs-border);
    font-size: 13px;
}
.radar-meu-preco:last-child { border-bottom: none; }

/* ── Submenu colapsável ── */
.nav-group { list-style: none; }

.nav-group-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: #94A3B8;
    font-size: 13.5px;
    font-weight: 500;
    text-align: left;
    border-radius: 6px;
    transition: background .15s, color .15s;
}

.nav-group-toggle:hover,
.nav-group-toggle.aberto {
    background: rgba(255,255,255,.06);
    color: #F1F5F9;
}

.nav-group-arrow {
    margin-left: auto;
    font-size: 11px;
    opacity: .7;
}

.nav-submenu {
    list-style: none;
    padding: 0;
    margin: 0 0 4px 0;
    border-left: 2px solid #2563EB;
    margin-left: 24px;
}

.nav-submenu li a,
.nav-submenu li .nav-link {
    padding: 8px 12px 8px 14px !important;
    font-size: 13px !important;
}

/* ── Submenu accordion ── */
.nav-submenu {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.submenu-aberto {
    max-height: 400px;
    opacity: 1;
}

.submenu-fechado {
    max-height: 0 !important;
    opacity: 0;
    pointer-events: none;
}

.nav-group-toggle .nav-group-arrow {
    transition: transform 0.3s ease;
    display: inline-block;
}

.nav-group-toggle.aberto .nav-group-arrow {
    transform: rotate(180deg);
}

/* ── Simulador: seletor de produto ─────────────────────────── */
.sim-produto-card { margin-bottom: 0; }

.sim-produto-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.sim-produto-select-wrap { flex: 1; min-width: 220px; }
.sim-produto-select { width: 100%; font-size: 14px; }

.sim-produto-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

/* Badge status do produto */
.spb {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
}
.spb-blue  { background: #DBEAFE; color: #1D4ED8; }
.spb-gray  { background: var(--gs-bg); color: var(--gs-text-muted); border: 1px solid var(--gs-border); }
.spb-red   { background: #FEE2E2; color: #DC2626; }
.spb-green { background: #DCFCE7; color: #16A34A; }

/* Painel histórico de custo */
.sim-historico {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--gs-border);
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.sim-hist-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 120px;
}

.sim-hist-label {
    font-size: 11px;
    color: var(--gs-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.sim-hist-valor {
    font-size: 16px;
    font-weight: 700;
    color: var(--gs-text);
}

.sim-hist-destaque {
    font-size: 20px;
    color: var(--gs-primary);
}

.sim-hist-data {
    font-size: 11px;
    color: var(--gs-text-light);
}

.sim-hist-acoes {
    margin-left: auto;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.sim-hist-btn {
    font-size: 12px;
    padding: 6px 14px;
    white-space: nowrap;
}

/* Input preenchido automaticamente */
.sim-input-auto {
    border-color: var(--gs-primary) !important;
    background: color-mix(in srgb, var(--gs-primary) 6%, transparent) !important;
}

/* Label "preenchido automaticamente" */
.sim-custo-origem {
    font-size: 11px;
    font-weight: 400;
    color: var(--gs-primary);
    margin-left: 8px;
}

/* Alerta de custo desatualizado */
.sim-alerta-custo {
    background: #FEF3C7;
    border: 1px solid #FCD34D;
    border-radius: var(--gs-radius);
    padding: 10px 14px;
    font-size: 13px;
    color: #92400E;
    margin-bottom: 16px;
}

@media (max-width: 640px) {
    .sim-historico { flex-direction: column; align-items: stretch; }
    .sim-hist-acoes { margin-left: 0; }
    .sim-produto-row { flex-direction: column; align-items: stretch; }
}

/* ── Painel Vendas: botões de filtro rápido ─────────────────── */
.pv-filtro-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.pv-fbtn {
    flex: 1;
    min-width: 60px;
    padding: 6px 10px;
    border-radius: var(--gs-radius);
    border: 1px solid var(--gs-border);
    background: var(--gs-bg);
    color: var(--gs-text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    text-align: center;
}

.pv-fbtn:hover {
    border-color: var(--gs-primary);
    color: var(--gs-primary);
    background: color-mix(in srgb, var(--gs-primary) 6%, transparent);
}

.pv-fbtn-ativo {
    background: var(--gs-primary);
    color: #fff;
    border-color: var(--gs-primary);
}

.pv-fbtn-ativo:hover {
    background: var(--gs-primary);
    color: #fff;
}

/* ── Dashboard: seção título ────────────────────────────────── */
.dash-secao-titulo {
    font-size: 13px;
    font-weight: 700;
    color: var(--gs-text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gs-border);
}

/* ── Dashboard: card de margem ──────────────────────────────── */
.dash-margem-card {
    background: var(--gs-card);
    border: 1px solid var(--gs-border);
    border-radius: var(--gs-radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.dash-margem-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 130px;
}

.dash-margem-label {
    font-size: 11px;
    color: var(--gs-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.dash-margem-valor {
    font-size: 16px;
    font-weight: 700;
    color: var(--gs-text);
}

.dash-margem-sep {
    font-size: 22px;
    font-weight: 300;
    color: var(--gs-text-muted);
    padding: 0 4px;
}

.dash-margem-canais {
    margin-left: auto;
    border-left: 1px solid var(--gs-border);
    padding-left: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 200px;
}

.dash-canal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    gap: 12px;
    color: var(--gs-text-muted);
}

/* ── Dashboard: mini feed pedidos ───────────────────────────── */
.dash-pedidos-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dash-pedido-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--gs-bg);
    border-radius: var(--gs-radius);
    border: 1px solid var(--gs-border);
    gap: 12px;
}

.dash-pedido-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dash-pedido-num {
    font-weight: 700;
    font-size: 13px;
    color: var(--gs-primary);
    min-width: 50px;
}

.dash-pedido-canal {
    font-size: 12px;
    color: var(--gs-text);
}

.dash-pedido-data {
    font-size: 11px;
    color: var(--gs-text-muted);
}

@media (max-width: 640px) {
    .dash-margem-card { flex-direction: column; align-items: stretch; }
    .dash-margem-sep  { display: none; }
    .dash-margem-canais { margin-left: 0; border-left: none; padding-left: 0;
                          border-top: 1px solid var(--gs-border); padding-top: 12px; }
}

/* ── Dashboard: grid vendas lado a lado ─────────────────────── */
.dash-vendas-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
    width: 100%;
}

.dash-vendas-grid > .card-section {
    min-width: 0; /* evita overflow em grid */
}

@media (max-width: 768px) {
    .dash-vendas-grid { grid-template-columns: 1fr; }
}

/* ── Dashboard: margem vertical ─────────────────────────────── */
.dash-margem-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dash-mv-linha {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.dash-mv-destaque {
    padding: 8px 0;
}

.dash-mv-destaque .dash-mv-valor {
    font-size: 18px !important;
}

.dash-mv-label {
    color: var(--gs-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.dash-mv-valor {
    font-weight: 700;
    font-size: 14px;
    text-align: right;
}

.dash-mv-pct {
    font-size: 11px;
    font-weight: 400;
    opacity: .75;
    margin-left: 4px;
}

.dash-mv-divisor {
    height: 1px;
    background: var(--gs-border);
    margin: 2px 0;
}

/* ── Notificações: Banner de permissão ──────────────────────── */
.notif-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gs-card);
    border: 1px solid var(--gs-primary);
    border-radius: var(--gs-radius);
    box-shadow: 0 8px 32px rgba(0,0,0,.15);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    max-width: 600px;
    width: calc(100% - 48px);
    animation: notif-slide-up .3s ease;
}

.notif-banner-icone { font-size: 22px; flex-shrink: 0; }
.notif-banner-txt   { flex: 1; font-size: 13px; color: var(--gs-text); }
.notif-banner-btn   { flex-shrink: 0; font-size: 12px; padding: 6px 14px; }

/* ── Notificações: Toast in-app ─────────────────────────────── */
.notif-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: var(--gs-card);
    border: 1px solid var(--gs-border);
    border-left: 4px solid var(--gs-primary);
    border-radius: var(--gs-radius);
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    max-width: 360px;
    cursor: pointer;
    transition: opacity .4s, transform .4s;
}

.notif-toast-in  { animation: notif-toast-in .35s cubic-bezier(.21,1.02,.73,1) forwards; }
.notif-toast-out { animation: notif-toast-out .3s ease forwards; }

.notif-toast-icone { font-size: 26px; flex-shrink: 0; }

.notif-toast-corpo { flex: 1; min-width: 0; }
.notif-toast-titulo { font-size: 13px; font-weight: 700; color: var(--gs-text); }
.notif-toast-msg    { font-size: 12px; color: var(--gs-text-muted); margin-top: 2px; }

.notif-toast-link {
    font-size: 12px;
    font-weight: 700;
    color: var(--gs-primary);
    text-decoration: none;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--gs-primary) 10%, transparent);
}

.notif-toast-fechar {
    background: none;
    border: none;
    color: var(--gs-text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    flex-shrink: 0;
    line-height: 1;
}

.notif-toast-fechar:hover { color: var(--gs-text); }

/* ── Animações ───────────────────────────────────────────────── */
@keyframes notif-slide-up {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes notif-toast-in {
    from { opacity: 0; transform: translateX(60px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes notif-toast-out {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(60px); }
}

/* ── Relatório de Pedidos ────────────────────────────────────── */
.rp-filtros {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.rp-resumo-filtros {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--gs-text-muted);
    padding-top: 10px;
    border-top: 1px solid var(--gs-border);
}

.rp-tag {
    background: color-mix(in srgb, var(--gs-primary) 10%, transparent);
    color: var(--gs-primary);
    border-radius: 20px;
    padding: 2px 10px;
    font-weight: 600;
    font-size: 11px;
}

/* Toggle modo */
.rp-modo-toggle { display: flex; gap: 6px; }
.rp-modo-btn {
    flex: 1;
    padding: 7px 10px;
    border-radius: var(--gs-radius);
    border: 1px solid var(--gs-border);
    background: var(--gs-bg);
    color: var(--gs-text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all .15s;
}
.rp-modo-ativo {
    background: var(--gs-primary);
    color: #fff;
    border-color: var(--gs-primary);
}

/* Tabela */
.rp-table { font-size: 13px; }
.rp-num      { font-weight: 700; color: var(--gs-primary); white-space: nowrap; }
.rp-num-plat { font-size: 11px; color: var(--gs-text-muted); white-space: nowrap; }
.rp-cliente  { font-weight: 600; max-width: 150px; }
.rp-itens    { min-width: 200px; }

.rp-item-linha {
    display: flex;
    align-items: baseline;
    gap: 4px;
    padding: 1px 0;
    font-size: 12px;
}
.rp-item-qtd  { font-weight: 700; color: var(--gs-primary); min-width: 24px; }
.rp-item-nome { color: var(--gs-text); }
.rp-item-sku  { color: var(--gs-text-muted); font-size: 11px; }

/* Canal badges */
.rp-canal-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}
.rp-ml { background: #FEF9C3; color: #854D0E; }
.rp-sh { background: #FEE2E2; color: #991B1B; }

/* Status badges coloridos */
.rp-status-badge { font-size: 11px; }
.rp-status-em-aberto     { background: #DBEAFE; color: #1D4ED8; }
.rp-status-em-andamento  { background: #FEF3C7; color: #92400E; }
.rp-status-em-digitação  { background: #F3E8FF; color: #6B21A8; }
.rp-status-verificado    { background: #DCFCE7; color: #14532D; }
.rp-status-atendido      { background: #DCFCE7; color: #166534; }
.rp-status-cancelado     { background: #FEE2E2; color: #991B1B; }

/* Rodapé totais */
.rp-total-row td {
    background: var(--gs-bg);
    border-top: 2px solid var(--gs-border);
    font-size: 13px;
}

/* ── Impressão ───────────────────────────────────────────────── */
.print-only { display: none; }

.rp-print-header {
    margin-bottom: 20px;
}
.rp-print-titulo {
    font-size: 18px;
    font-weight: 700;
}
.rp-print-sub {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

@media print {
    .no-print { display: none !important; }
    .print-only { display: block !important; }

    /* Ocultar sidebar e nav */
    .app-sidebar, .nav-sidebar, nav, .sidebar { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .page-wrapper { padding: 0 !important; }

    /* Tabela limpa para impressão */
    .rp-table { font-size: 11px; }
    .gs-table th { background: #f0f0f0 !important; color: #000 !important; }
    .gs-table td, .gs-table th { border: 1px solid #ccc !important; padding: 6px 8px !important; }

    /* Quebra de página automática para relatórios grandes */
    tr { page-break-inside: avoid; }

    /* Ocultar botões e filtros */
    button, .form-card, .drp-wrapper { display: none !important; }

    body { background: white !important; color: black !important; }
}
