/*
 * CLASS CIGAR STOCK — Interface V2
 * Camada final de design para desktop, tablet e mobile.
 */

:root {
    --v2-bg: #0b0e13;
    --v2-surface: #151922;
    --v2-surface-raised: #1a1f29;
    --v2-surface-soft: #202631;
    --v2-border: #2b3340;
    --v2-border-soft: #232a35;
    --v2-text: #f1f4f8;
    --v2-muted: #929daf;
    --v2-gold: #e1b82f;
    --v2-gold-soft: rgba(225, 184, 47, .12);
    --v2-danger: #ff6b72;
    --v2-success: #31d17c;
    --v2-blue: #3b91d1;
    --v2-radius: 10px;
    --v2-shadow: 0 14px 36px rgba(0, 0, 0, .2);
}

body {
    background: var(--v2-bg);
    color: var(--v2-text);
}

.app-nav {
    background: rgba(21, 25, 34, .96);
    border-color: var(--v2-border);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .16);
}

.app-container {
    max-width: 1440px;
}

.page-header h1,
.welcome-section h1 {
    color: var(--v2-text);
    font-weight: 700;
    letter-spacing: -.025em;
}

.app-card,
.section-box,
.chart-container,
.kpi-card {
    background: var(--v2-surface);
    border-color: var(--v2-border);
    border-radius: var(--v2-radius);
    box-shadow: var(--v2-shadow);
}

.card-header,
.section-header {
    color: var(--v2-gold);
    border-color: var(--v2-border);
}

.input-padrao,
.select-limite {
    background: #10141b;
    border-color: #394351;
    color: var(--v2-text);
    border-radius: 7px;
}

.input-padrao:focus,
.select-limite:focus {
    border-color: var(--v2-gold);
    box-shadow: 0 0 0 3px var(--v2-gold-soft);
    outline: 0;
}

.btn-padrao {
    border-radius: 7px;
}

.app-table {
    border-collapse: separate;
    border-spacing: 0;
}

.app-table th {
    background: rgba(255, 255, 255, .018);
    color: var(--v2-muted);
    border-color: var(--v2-border);
    font-size: 12px;
    letter-spacing: .02em;
}

.app-table td {
    border-color: var(--v2-border-soft);
}

.app-table tbody tr {
    transition: background-color .18s ease;
}

.app-table tbody tr:hover {
    background: rgba(255, 255, 255, .018);
}

.btn-acao-tabela {
    border-radius: 6px;
}

@media (min-width: 769px) {
    .app-card,
    .section-box {
        padding: 24px;
    }

    .app-table td,
    .app-table th {
        padding-block: 13px;
    }
}

@media (max-width: 768px) {
    body {
        width: 100%;
        min-width: 0;
        overflow-x: hidden;
        background: var(--v2-bg);
    }

    .app-nav {
        width: 100%;
        padding: 10px 12px;
        border-radius: 0;
    }

    .nav-brand-container {
        min-width: 0;
    }

    .nav-logo h2 {
        font-size: 16px;
    }

    .nav-right-zone {
        background: #11151c;
        border: 1px solid var(--v2-border);
        border-radius: 8px;
        padding: 6px;
    }

    .app-container {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 16px 12px 30px !important;
    }

    .welcome-section,
    .page-header {
        margin-bottom: 15px;
    }

    .welcome-section h1,
    .page-header h1 {
        font-size: 20px;
        line-height: 1.25;
    }

    .welcome-section p {
        font-size: 13px;
        line-height: 1.45;
    }

    .app-card,
    .section-box,
    .chart-container,
    .kpi-card {
        width: 100% !important;
        min-width: 0 !important;
        padding: 15px !important;
        margin-bottom: 16px !important;
        border-radius: 9px;
        box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
    }

    .section-header,
    .card-header {
        font-size: 15px;
        line-height: 1.25;
        padding-bottom: 11px;
        margin-bottom: 13px;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
        margin-bottom: 18px;
    }

    .kpi-grid .app-card {
        min-height: 105px;
        margin: 0 !important;
        padding: 13px !important;
    }

    .kpi-title {
        font-size: 10px;
        line-height: 1.3;
    }

    .kpi-value {
        font-size: clamp(18px, 6vw, 24px);
        overflow-wrap: anywhere;
    }

    .dashboard-sections,
    .dashboard-grid,
    .main-grid,
    .report-grid,
    .form-grid {
        width: 100%;
        min-width: 0;
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .form-grid {
        display: grid !important;
    }

    .input-padrao,
    select.input-padrao,
    textarea.input-padrao {
        min-height: 46px !important;
        padding: 11px 12px;
        font-size: 16px;
    }

    .table-filter-bar {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        padding: 0;
        margin-bottom: 13px;
    }

    .table-filter-bar .card-header {
        margin: 0;
        padding: 0;
        border: 0;
    }

    .filter-group {
        width: auto;
        display: grid;
        grid-template-columns: auto;
        gap: 4px;
        justify-items: end;
        font-size: 10px;
    }

    .select-limite {
        min-width: 92px;
        min-height: 38px;
    }

    /*
     * Cartões de dados: duas colunas reais.
     * Campos descritivos usam a largura total; métricas ficam lado a lado.
     */
    .app-table,
    .app-table tbody {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        overflow: visible !important;
    }

    .app-table thead {
        display: none !important;
    }

    .app-table tbody {
        display: grid !important;
        gap: 10px;
    }

    .app-table tbody tr {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 10px !important;
        background: var(--v2-surface-raised) !important;
        border: 1px solid var(--v2-border) !important;
        border-radius: 9px;
        box-shadow: none;
    }

    .app-table tbody td {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        gap: 4px;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 58px;
        margin: 0 !important;
        padding: 9px 10px !important;
        background: rgba(9, 12, 17, .28);
        border: 1px solid var(--v2-border-soft) !important;
        border-radius: 7px;
        color: var(--v2-text);
        text-align: left !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
    }

    .app-table tbody td::before {
        content: attr(data-label) !important;
        display: block;
        position: static !important;
        color: var(--v2-muted);
        font-size: 9px;
        font-weight: 700;
        line-height: 1.2;
        letter-spacing: .06em;
        text-transform: uppercase;
        text-align: left;
    }

    .app-table .mobile-cell-value {
        display: block;
        width: 100%;
        min-width: 0;
        color: var(--v2-text);
        font-size: 13px;
        line-height: 1.35;
        text-align: left;
    }

    .app-table .mobile-cell-value > small {
        display: block;
        margin-top: 2px;
        font-size: 10px;
        line-height: 1.3;
    }

    .app-table td[data-label*="Cliente"],
    .app-table td[data-label*="Empresa"],
    .app-table td[data-label="Nome"],
    .app-table td[data-label*="Descrição"] {
        grid-column: 1 / -1;
        min-height: 62px;
        background: #171c25;
    }

    .app-table td[data-label*="Cliente"] .mobile-cell-value,
    .app-table td[data-label*="Empresa"] .mobile-cell-value,
    .app-table td[data-label="Nome"] .mobile-cell-value {
        font-size: 14px;
        font-weight: 650;
    }

    .app-table td[data-label*="Ações"],
    .app-table td[data-label="Ação"] {
        grid-column: 1 / -1;
        min-height: 0;
        background: transparent;
        border: 0 !important;
        padding: 2px 0 0 !important;
    }

    .app-table td[data-label*="Ações"]::before,
    .app-table td[data-label="Ação"]::before {
        display: none;
    }

    .app-table td[data-label*="Ações"] .mobile-cell-value,
    .app-table td[data-label="Ação"] .mobile-cell-value {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .app-table td[data-label*="Ações"] form,
    .app-table td[data-label="Ação"] form {
        width: 100%;
    }

    .app-table .btn-acao-tabela {
        width: 100% !important;
        min-width: 0;
        min-height: 40px;
        margin: 0 !important;
        padding: 9px 8px !important;
    }

    .app-table td[data-label="Estado"] {
        justify-content: center;
    }

    .app-table td[data-label*="Produto"] .mobile-cell-value {
        font-weight: 650;
    }

    .app-table td.mobile-empty-state {
        grid-column: 1 / -1;
        display: block !important;
        min-height: 0;
        padding: 20px 12px !important;
        text-align: center !important;
    }

    .app-table td.mobile-empty-state::before {
        display: none;
    }

    .app-table td.mobile-empty-state .mobile-cell-value {
        text-align: center;
    }

    .badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 28px;
        padding: 5px 8px;
    }

    .carrinho-tabela {
        border: 0;
    }

    .carrinho-tabela th,
    .carrinho-tabela td {
        min-width: 94px;
    }

    .carrinho-tabela th:first-child,
    .carrinho-tabela td:first-child {
        min-width: min(250px, 75vw);
    }

    .modal-content-cigar,
    .modal-cliente-conteudo,
    #modalEditarUsuario > .app-card,
    .modalsaida .invoice-box,
    .modal-content {
        border-radius: 10px !important;
    }
}

/* Imagens do catálogo */
.catalog-image-input {
    display: block;
    width: 100%;
    padding: 9px;
    color: var(--cm-text);
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 9px;
    font-size: 12px;
}
.catalog-image-input::file-selector-button {
    margin-right: 10px;
    padding: 7px 10px;
    color: var(--cm-blue);
    background: var(--cm-blue-soft);
    border: 0;
    border-radius: 7px;
    font-weight: 700;
    cursor: pointer;
}
.form-hint { display: block; margin-top: 6px; color: var(--cm-muted); font-size: 10px; }
.catalog-thumb, .catalog-placeholder {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid var(--cm-line);
    border-radius: 10px;
}
.catalog-thumb { background: #fff; object-fit: contain; }
.cigar-thumb { object-fit: cover; }
.catalog-placeholder { color: var(--cm-blue); background: var(--cm-blue-soft); font-size: 15px; font-weight: 800; }
.cigar-placeholder { color: #8b96a7; background: #f5f7fa; }
.inline-upload-form { display: inline; }
.upload-action { cursor: pointer; }
.upload-action input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.catalog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.catalog-actions form { display: inline-flex !important; margin: 0; }
.catalog-action-button { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 6px 9px; color: #526176; background: #fff; border: 1px solid var(--cm-line); border-radius: 7px; font: inherit; font-size: 10px; font-weight: 700; cursor: pointer; }
.action-logo { color: var(--cm-blue); background: var(--cm-blue-soft); border-color: #d8e4fd; }
.action-remove-logo:hover { color: #b74155; background: #fff4f5; border-color: #efcbd1; }
.action-disable { color: #7d8795; background: #f8fafc; }
.action-disable:hover { color: #b74155; border-color: #efcbd1; }

@media (max-width: 768px) {
    .catalog-actions { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .catalog-actions form, .catalog-action-button { width: 100%; }
}

/* Dashboard orientado a decisões */
.dashboard-welcome { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.dashboard-welcome h1 { margin-bottom: 4px; }
.dashboard-welcome p { margin: 0; color: var(--cm-muted); font-size: 13px; }
.dashboard-quick-actions { display: flex; gap: 9px; }
.quick-action { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 14px; border: 1px solid var(--cm-line); border-radius: 9px; font-size: 12px; font-weight: 750; text-decoration: none; }
.quick-action.secondary { color: var(--cm-text); background: #fff; }
.quick-action.primary { color: #fff; background: var(--cm-blue); border-color: var(--cm-blue); box-shadow: 0 5px 14px rgba(79,126,232,.18); }
.dashboard-overview-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(360px, .9fr); gap: 18px; margin: 18px 0; }
.dashboard-overview-grid .section-box { min-width: 0; padding: 0; overflow: hidden; }
.dashboard-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; border-bottom: 1px solid var(--cm-line); }
.dashboard-card-heading span { display: block; color: var(--cm-blue); font-size: 8px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.dashboard-card-heading h2 { margin: 4px 0 0; color: var(--cm-ink); font-size: 15px; font-weight: 760; }
.dashboard-card-heading > small { color: var(--cm-muted); font-size: 10px; }
.dashboard-card-heading a, .dashboard-section-header a { color: var(--cm-blue); font-size: 11px; font-weight: 700; text-decoration: none; }
.sales-chart { display: grid; grid-template-columns: repeat(6, minmax(48px, 1fr)); align-items: end; gap: clamp(9px, 2vw, 20px); height: 270px; padding: 30px 24px 20px; }
.sales-bar-item { display: grid; grid-template-rows: 22px 1fr 18px; gap: 7px; height: 100%; text-align: center; }
.sales-bar-value { overflow: hidden; color: var(--cm-muted); font-size: 8px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.sales-bar-track { position: relative; align-self: stretch; overflow: hidden; background: #f0f3f7; border-radius: 8px 8px 4px 4px; }
.sales-bar-track span { position: absolute; right: 0; bottom: 0; left: 0; display: block; min-height: 3px; background: linear-gradient(180deg, #6c94ed, var(--cm-blue)); border-radius: 8px 8px 4px 4px; transition: height .35s ease; }
.sales-bar-item strong { color: #7e8b9e; font-size: 10px; }
.buyer-list { padding: 5px 20px 8px; }
.buyer-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 12px 0; border-bottom: 1px solid #edf0f4; }
.buyer-row:last-child { border-bottom: 0; }
.buyer-avatar { display: grid; place-items: center; width: 36px; height: 36px; color: var(--cm-blue); background: var(--cm-blue-soft); border-radius: 10px; font-size: 11px; font-weight: 800; }
.buyer-main, .buyer-stats { min-width: 0; }
.buyer-main strong, .buyer-main small, .buyer-stats strong, .buyer-stats small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.buyer-main strong { color: var(--cm-ink); font-size: 11px; }
.buyer-main small { margin-top: 3px; color: var(--cm-muted); font-size: 9px; }
.buyer-stats { text-align: right; }
.buyer-stats strong { color: var(--cm-text); font-size: 10px; }
.buyer-stats small { margin-top: 3px; color: #9aa5b4; font-size: 8px; }
.dashboard-empty { padding: 30px 10px; color: var(--cm-muted); font-size: 12px; text-align: center; }
.dashboard-section-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dashboard-section-header span { color: var(--cm-ink); }
.dashboard-section-header small { margin-left: 7px; color: var(--cm-muted); font-size: 9px; font-weight: 650; }
.dashboard-link-button { padding: 0; color: var(--cm-blue); background: none; border: 0; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.critical-extra-row { display: none; }
tbody.show-all-critical .critical-extra-row { display: table-row; }

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

@media (max-width: 768px) {
    .dashboard-welcome { align-items: stretch; flex-direction: column; }
    .dashboard-quick-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .dashboard-overview-grid { gap: 14px; margin: 14px 0; }
    .sales-chart { gap: 7px; height: 230px; padding: 24px 12px 16px; }
    .sales-bar-value { font-size: 7px; }
    .buyer-list { padding: 4px 14px 7px; }
    .buyer-row { grid-template-columns: 34px minmax(0, 1fr); }
    .buyer-stats { grid-column: 2; margin-top: -5px; text-align: left; }
    tbody.show-all-critical .critical-extra-row { display: block; }
}

/* Indicadores compactos do dashboard */
.dashboard-welcome + .kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 12px !important;
}
.dashboard-welcome + .kpi-grid .app-card,
.dashboard-welcome + .kpi-grid .app-card:nth-child(even) {
    min-width: 0;
    min-height: 98px;
    padding: 16px 18px !important;
}
.dashboard-welcome + .kpi-grid .kpi-title {
    max-width: 100%;
    overflow: hidden;
    font-size: 8px !important;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dashboard-welcome + .kpi-grid .kpi-value {
    margin-top: 10px;
    overflow: hidden;
    font-size: clamp(19px, 1.8vw, 25px) !important;
    line-height: 1.05;
    letter-spacing: -.035em;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dashboard-welcome + .kpi-grid small {
    margin-top: 5px !important;
    overflow: hidden;
    font-size: 8px !important;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .dashboard-welcome + .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (max-width: 520px) {
    .dashboard-welcome + .kpi-grid { grid-template-columns: 1fr !important; }
}

/* Logo oficial na autenticação */
.login-header .login-logo {
    display: block;
    width: auto;
    max-width: min(250px, 82%);
    height: auto;
    max-height: 72px;
    margin: 0 auto 22px;
    object-fit: contain;
    object-position: center;
}
.login-request-link { display:block; margin:16px 0 0; color:var(--cm-blue); font-size:12px; font-weight:700; text-align:center; text-decoration:none; }

/* Cabeçalho e navegação mobile */
.mobile-topbar-logo { display: none; }

@media (max-width: 768px) {
    .mobile-topbar-logo { display: flex; align-items: center; height: 42px; text-decoration: none; }
    .mobile-topbar-logo img { display: block; width: auto; max-width: 158px; max-height: 38px; object-fit: contain; object-position: left center; }
    .app-topbar .topbar-page-title { display: none; }
    .app-topbar .nav-right-zone { display: flex; align-items: center; gap: 8px; }
    .app-topbar .mobile-menu-toggle { order: 2; margin: 0; }
    .app-topbar .topbar-currency { order: 1; min-width: 43px; justify-content: center; }
    .mobile-bottom-nav .mobile-primary-action { color: var(--cm-blue); }
    .mobile-bottom-nav .mobile-primary-action svg { width: 34px; height: 34px; padding: 8px; color: #fff; background: var(--cm-blue); border-radius: 11px; box-shadow: 0 5px 13px rgba(79,126,232,.25); }

    /* Alertas de stock em apenas duas faixas */
    .critical-stock-table tbody tr {
        grid-template-columns: minmax(0, 1fr) 56px 42px !important;
        gap: 6px !important;
        padding: 8px !important;
    }
    .critical-stock-table td[data-label="Marca"] {
        grid-column: 1 / -1;
        min-height: 42px;
        padding: 7px 9px !important;
        background: #f7f9fc !important;
    }
    .critical-stock-table td[data-label="Produto (Linha/Vitola)"] {
        grid-column: 1;
        min-height: 54px;
        padding: 7px 9px !important;
    }
    .critical-stock-table td[data-label="Mínimo"] { display: none !important; }
    .critical-stock-table td[data-label="Atual"] {
        grid-column: 2;
        min-height: 54px;
        padding: 7px 5px !important;
        align-items: center;
        text-align: center !important;
    }
    .critical-stock-table td[data-label="Atual"]::before { text-align: center; }
    .critical-stock-table td[data-label="Atual"] .mobile-cell-value { text-align: center; }
    .critical-stock-table td[data-label="Estado"] {
        grid-column: 3;
        min-height: 54px;
        padding: 7px 4px !important;
        align-items: center;
        background: transparent !important;
        border: 0 !important;
    }
    .critical-stock-table td[data-label="Estado"]::before { display: none !important; }
    .critical-stock-table td[data-label="Estado"] .mobile-cell-value { display: grid; place-items: center; text-align: center; }
    .critical-stock-table td[data-label="Estado"] .badge {
        display: grid;
        place-items: center;
        width: 28px;
        height: 28px;
        padding: 0 !important;
        overflow: hidden;
        border: 0 !important;
        border-radius: 50%;
        font-size: 0 !important;
    }
    .critical-stock-table td[data-label="Estado"] .badge::before { color: currentColor; font-size: 14px; font-weight: 900; }
    .critical-stock-table td[data-label="Estado"] .badge-danger::before { content: "×"; }
    .critical-stock-table td[data-label="Estado"] .badge-warning::before { content: "!"; }
}

/* Lista de faturas — hierarquia leve e ações claras */
.invoices-card { margin-bottom: 40px; overflow: hidden; }
.invoices-card .table-filter-bar {
    margin: 0;
    padding: 18px 24px;
    background: #fff;
    border: 0;
    border-bottom: 1px solid var(--sa-border);
    border-radius: 0;
}
.invoice-list-heading { display: flex; flex-direction: column; gap: 3px; }
.invoice-list-heading strong { color: var(--sa-text); font-size: 15px; font-weight: 750; }
.invoice-list-heading span { color: var(--sa-muted); font-size: 12px; }
.invoices-card .filter-group { color: var(--sa-muted); font-size: 12px; }
.invoices-card .select-limite {
    min-height: 34px;
    color: var(--sa-text);
    background: #f8fafc;
    border: 1px solid var(--sa-border);
    border-radius: 7px;
}
.invoices-card .app-table { margin: 0; }
.invoices-card .app-table th { padding-top: 12px; padding-bottom: 12px; background: #f8fafc; }
.invoices-card .app-table td { padding-top: 15px; padding-bottom: 15px; vertical-align: middle; }
.invoice-number { color: var(--sa-blue); font-weight: 750; }
.invoice-client strong { display: block; color: var(--sa-text); font-size: 13px; }
.invoice-client > small { display: block; margin-top: 2px; color: var(--sa-muted); font-size: 11px; }
.invoice-status-line { margin-top: 7px; }
.invoice-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .035em;
    text-transform: uppercase;
}
.invoice-status.is-paid { color: #157347; background: #e8f7ef; }
.invoice-status.is-pending { color: #9a6700; background: #fff6d8; }
.invoice-total { text-align: right; white-space: nowrap; }
.invoice-total strong { display: block; color: var(--sa-text); font-size: 14px; font-weight: 750; }
.invoice-total small { display: block; margin-top: 3px; color: var(--sa-muted); font-size: 10px; }
.invoice-actions { text-align: right; white-space: nowrap; }
.invoice-actions form { display: inline; }
.invoice-action {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    margin-left: 4px;
    padding: 6px 10px;
    border: 1px solid var(--sa-border);
    border-radius: 7px;
    font: inherit;
    font-size: 11px;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
}
.action-view { color: #475569; background: #fff; }
.action-view:hover { color: var(--sa-blue); border-color: #b9cdf6; background: #f5f8ff; }
.action-pay { color: #157347; border-color: #bde5ce; background: #eefaf3; }
.action-pay:hover { color: #fff; border-color: #168351; background: #168351; }
.action-cancel { color: #8b5b64; background: transparent; }
.action-cancel:hover { color: #c43d55; border-color: #efc3cb; background: #fff5f6; }

@media (max-width: 768px) {
    .invoices-card .table-filter-bar { align-items: flex-start; padding: 16px; }
    .invoices-card .filter-group label { display: none; }
    .invoice-actions { display: flex !important; flex-wrap: wrap; gap: 7px; }
    .invoice-actions form { flex: 1; }
    .invoice-action { justify-content: center; width: 100%; min-height: 38px; margin: 0; }
}

/* ========================================================================== 
   SIDEBAR DASHBOARD — inspirado na referência, adaptado à Class Cigar Stock
   ========================================================================== */
body:not(:has(.app-card-login)) { padding-left: 248px; padding-top: 68px; }

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    width: 248px;
    padding: 0 14px 18px;
    background: linear-gradient(180deg, #33231d 0%, #241915 100%);
    color: #fff;
    box-shadow: 8px 0 30px rgba(46, 30, 22, .12);
}

.sidebar-brand {
    min-height: 92px;
    margin: 0 -14px 14px;
    padding: 15px 18px;
    background: rgba(255, 255, 255, .98);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.sidebar-brand .nav-logo img { width: 210px; height: 56px; }
.app-sidebar .nav-menu { display: block; overflow-y: auto; padding: 4px 0 16px; }
.nav-section-label {
    margin: 17px 12px 8px;
    color: rgba(255, 255, 255, .38);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .14em;
    list-style: none;
    text-transform: uppercase;
}
.app-sidebar .nav-item { margin: 3px 0; list-style: none; }
.app-sidebar .nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 9px 12px;
    border-radius: 9px;
    color: rgba(255, 255, 255, .72);
    font-size: 13px;
    font-weight: 600;
}
.app-sidebar .nav-item a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.app-sidebar .nav-item.active a {
    color: #2d201a;
    background: linear-gradient(135deg, #e5be68, #c99838);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .16);
}
.nav-icon {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    color: inherit;
    font-size: 18px;
    line-height: 1;
}
.sidebar-footer {
    margin-top: auto;
    padding: 16px 12px 2px;
    border-top: 1px solid rgba(255, 255, 255, .1);
}
.sidebar-footer span { display: block; color: rgba(255, 255, 255, .4); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.sidebar-footer strong { display: block; margin-top: 4px; color: #d7ad58; font-size: 14px; }

.app-topbar {
    position: fixed;
    inset: 0 0 auto 248px;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    padding: 10px 26px;
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--v2-border);
    box-shadow: 0 4px 20px rgba(54, 38, 25, .05);
    backdrop-filter: blur(14px);
}
.topbar-title-zone { display: flex; align-items: center; gap: 12px; }
.topbar-title-zone > div { display: flex; flex-direction: column; gap: 2px; }
.topbar-title-zone small { color: #968d87; font-size: 10px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; }
.topbar-title-zone strong { color: #2c211b; font-size: 17px; }
.app-topbar .mobile-menu-toggle { display: none; }
.sidebar-overlay { display: none; }

body:not(:has(.app-card-login)) .app-container { max-width: 1600px; }
.welcome-section h1 { font-size: 27px; }
.welcome-section h1 span { color: #b48428; }
.kpi-grid { gap: 18px !important; }
.kpi-grid .app-card {
    position: relative;
    overflow: hidden;
    min-height: 126px;
    padding: 22px !important;
    border-top: 3px solid #c99b45 !important;
}
.kpi-grid .app-card::after {
    content: '';
    position: absolute;
    top: -24px;
    right: -20px;
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: rgba(201, 155, 69, .09);
}
.kpi-title { max-width: 80%; font-size: 10px !important; font-weight: 800 !important; letter-spacing: .07em; text-transform: uppercase; }
.kpi-value { margin-top: 12px; font-size: 28px !important; }
.dashboard-sections { gap: 20px !important; }
.section-box { padding: 22px !important; }

@media (max-width: 980px) {
    body:not(:has(.app-card-login)) { padding-left: 216px; }
    .app-sidebar { width: 216px; }
    .app-topbar { left: 216px; }
    .sidebar-brand .nav-logo img { width: 182px; height: 50px; }
    .user-name { display: none; }
}

@media (max-width: 768px) {
    body:not(:has(.app-card-login)) { padding-left: 0; padding-top: 62px; }
    body.menu-open { overflow: hidden; }
    .app-sidebar {
        width: min(286px, 84vw);
        padding-inline: 14px;
        transform: translateX(-105%);
        transition: transform .24s ease;
        box-shadow: 18px 0 45px rgba(30, 20, 15, .25);
    }
    .app-sidebar.mobile-open { transform: translateX(0); }
    .sidebar-brand { min-height: 78px; }
    .sidebar-brand .nav-logo img { width: 204px; height: 52px; }
    .app-sidebar .nav-menu { position: static !important; display: block !important; width: auto !important; background: transparent !important; border: 0 !important; box-shadow: none !important; }
    .app-sidebar .nav-item a { min-height: 47px; }
    .app-topbar { left: 0; min-height: 62px; padding: 7px 12px; }
    .app-topbar .mobile-menu-toggle { display: flex; position: static; width: 40px; height: 40px; padding: 10px 8px; border: 1px solid var(--v2-border); border-radius: 9px; background: #fff; }
    .app-topbar .mobile-menu-toggle .bar { background: #4f423b; }
    .topbar-title-zone small { display: none; }
    .topbar-title-zone strong { font-size: 15px; }
    .app-topbar .nav-right-zone { padding: 0; border: 0; background: transparent; }
    .app-topbar .currency-selector { display: none; }
    .app-topbar .btn-logout { padding: 7px 10px; }
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 1150;
        width: 100%;
        height: 100%;
        border: 0;
        background: rgba(26, 18, 14, .48);
        backdrop-filter: blur(2px);
    }
    body.menu-open .sidebar-overlay { display: block; }
    .welcome-section h1 { font-size: 22px; }
    .kpi-grid .app-card { min-height: 112px; }
}

@media (max-width: 360px) {
    .kpi-grid {
        grid-template-columns: 1fr !important;
    }

    .app-table tbody tr {
        grid-template-columns: 1fr;
    }

    .app-table tbody td,
    .app-table td[data-label*="Cliente"],
    .app-table td[data-label*="Empresa"],
    .app-table td[data-label*="Ações"],
    .app-table td[data-label="Ação"] {
        grid-column: 1;
    }
}

/* ========================================================================== 
   CLASS CIGAR STOCK — DT DIGITAL / LIGHT UI
   ========================================================================== */
:root {
    --v2-bg: #f5f3ef;
    --v2-surface: #ffffff;
    --v2-surface-raised: #ffffff;
    --v2-surface-soft: #f7f5f2;
    --v2-border: #e5dfd6;
    --v2-border-soft: #eee9e2;
    --v2-text: #2c211b;
    --v2-muted: #756c66;
    --v2-gold: #a87921;
    --v2-gold-soft: rgba(168, 121, 33, .12);
    --v2-danger: #b94242;
    --v2-success: #267a55;
    --v2-blue: #356d91;
    --v2-radius: 14px;
    --v2-shadow: 0 10px 30px rgba(54, 38, 25, .07);
    --bg-dark: #f5f3ef;
    --card-bg: #ffffff;
    --border-color: #e5dfd6;
    --border-input: #d8d0c6;
    --text-primary: #2c211b;
    --text-muted: #756c66;
    --text-inactive: #9b938d;
    --gold: #a87921;
    --gold-hover: #8f651b;
    --danger: #b94242;
    --success: #267a55;
}

html { background: var(--v2-bg); }

body {
    background:
        radial-gradient(circle at 90% 0, rgba(190, 153, 86, .12), transparent 28rem),
        var(--v2-bg);
    color: var(--v2-text);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: 76px;
    padding: 10px clamp(18px, 3vw, 42px);
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--v2-border);
    box-shadow: 0 5px 24px rgba(54, 38, 25, .06);
    backdrop-filter: blur(16px);
}

.nav-brand-container { display: flex; align-items: center; }
.nav-logo a { display: block; line-height: 0; }
.nav-logo img { display: block; width: 214px; height: 56px; object-fit: cover; object-position: left center; }
.nav-menu { align-items: center; gap: 4px; }
.nav-item a {
    display: block;
    padding: 9px 10px;
    border-radius: 8px;
    color: #665d57;
    font-size: 13px;
    font-weight: 650;
}
.nav-item a:hover { color: #6f4c14; background: #f7f1e7; }
.nav-item.active a { color: #684811; background: #f1e7d6; }
.nav-right-zone { display: flex; align-items: center; gap: 14px; }
.currency-selector { display: flex; padding: 3px; gap: 2px; background: #f4f1ec; border: 1px solid var(--v2-border); border-radius: 9px; }
.currency-btn { padding: 6px 7px; border-radius: 6px; color: #746b65; text-decoration: none; font-size: 10px; font-weight: 800; }
.currency-btn.active { color: #fff; background: #8d641e; box-shadow: 0 3px 8px rgba(100, 70, 20, .18); }
.user-info { color: var(--v2-muted); }
.user-level { color: #9a918a; }
.btn-logout { color: #a83e3e; border-color: #e5c8c8; background: #fff8f8; }
.btn-logout:hover { background: #a83e3e; border-color: #a83e3e; }

.app-container { padding: 34px clamp(18px, 3vw, 44px) 52px; }
.page-header, .welcome-section { margin-bottom: 26px; }
.page-header h1, .welcome-section h1 { color: #2c211b; font-size: clamp(24px, 3vw, 32px); }
.welcome-section p { margin-top: 7px; color: var(--v2-muted); }
.app-card, .section-box, .chart-container, .kpi-card, .filter-card {
    background: #fff !important;
    border: 1px solid var(--v2-border) !important;
    border-radius: var(--v2-radius) !important;
    box-shadow: var(--v2-shadow);
}
.card-header, .section-header { color: #6f4c14; border-color: var(--v2-border); }
.kpi-title { color: var(--v2-muted) !important; }
.kpi-value { color: #2c211b; }

.form-label { color: #6e655f; font-weight: 700; }
.input-padrao, .select-limite, select.input-padrao {
    background: #fff !important;
    border: 1px solid var(--border-input) !important;
    color: var(--v2-text) !important;
    border-radius: 9px;
}
.input-padrao::placeholder { color: #aaa19a; }
.input-padrao:focus, .select-limite:focus { border-color: #b58a40 !important; box-shadow: 0 0 0 4px var(--v2-gold-soft); }
.btn-padrao, .btn-filtrar {
    background: #8d641e !important;
    color: #fff !important;
    border-radius: 9px !important;
    box-shadow: 0 5px 12px rgba(111, 76, 20, .16);
}
.btn-padrao:hover, .btn-filtrar:hover { background: #704c14 !important; transform: translateY(-1px); }
.btn-acao-tabela { color: #504740; background: #fff; border-color: #d8d0c6; }

.app-table th { background: #f8f6f3; color: #756c66; border-color: var(--v2-border); }
.app-table td { color: #3f352f; border-color: var(--v2-border-soft); }
.app-table tbody tr:hover { background: #fbfaf8; }
.text-muted { color: var(--v2-muted); }
.text-inactive { color: var(--text-inactive); }
.alert { border-radius: 10px; }
.alert-success { color: #236b4b !important; background: #edf8f2 !important; border-color: #b8dfcc !important; }
.alert-danger { color: #9d3535 !important; background: #fff1f1 !important; border-color: #edc7c7 !important; }

/* Login */
body:has(.app-card-login) { justify-content: center; padding: 24px; }
.app-card-login {
    position: relative;
    margin: 0 auto;
    max-width: 440px;
    padding: 34px;
    background: rgba(255, 255, 255, .98);
    border: 1px solid var(--v2-border);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(54, 38, 25, .13);
}
.login-header { margin-bottom: 28px; }
.login-logo { display: block; width: 100%; max-width: 310px; height: 80px; margin: 0 auto 22px; object-fit: cover; object-position: left center; }
.login-header h1 { color: #2c211b; font-size: 27px; letter-spacing: -.03em; text-transform: none; }
.login-header p, .login-footer { color: var(--v2-muted); }

/* Modais antigos integrados no tema claro */
.modal-content-cigar, .modal-cliente-conteudo, #modalEditarUsuario > .app-card, .invoice-box {
    background: #fff !important;
    color: var(--v2-text) !important;
    border-color: var(--v2-border) !important;
}
.invoice-table th { background: #f5f2ed !important; color: var(--v2-muted) !important; }
.invoice-table td { color: var(--v2-text) !important; border-color: var(--v2-border) !important; }

@media (max-width: 1180px) and (min-width: 769px) {
    .app-nav { flex-wrap: wrap; }
    .nav-menu { order: 3; width: 100%; justify-content: center; margin-top: 6px; }
}

@media (max-width: 768px) {
    body { padding-bottom: env(safe-area-inset-bottom); }
    .app-nav { position: sticky; min-height: 64px; padding: 8px 12px; }
    .nav-logo img { width: 170px; height: 44px; }
    .mobile-menu-toggle { display: flex; }
    .mobile-menu-toggle .bar { background: #594c44; }
    .nav-menu {
        top: 65px;
        background: #fff;
        border-color: var(--v2-border);
        box-shadow: 0 18px 32px rgba(54, 38, 25, .12);
    }
    .nav-menu .nav-item a { min-height: 46px; display: flex; align-items: center; padding-inline: 15px; }
    .nav-right-zone { background: #f6f3ef; border-color: var(--v2-border); }
    .user-name { display: none; }
    .app-container { padding: 20px 12px 34px !important; }
    .page-header h1, .welcome-section h1 { font-size: 23px; }
    .app-card, .section-box, .chart-container, .kpi-card { box-shadow: 0 6px 18px rgba(54, 38, 25, .06); }
    .app-table tbody tr { background: #fff !important; border-color: var(--v2-border) !important; box-shadow: 0 5px 14px rgba(54, 38, 25, .05); }
    .app-table tbody td { background: #faf8f5; border-color: var(--v2-border-soft) !important; color: var(--v2-text); }
    .app-table td[data-label*="Cliente"], .app-table td[data-label*="Empresa"], .app-table td[data-label="Nome"], .app-table td[data-label*="Descrição"] { background: #f7f1e7; }
    .app-table .mobile-cell-value { color: var(--v2-text); }
    .app-table tbody td::before { color: #897f77; }
    .input-padrao, select.input-padrao, textarea.input-padrao, .btn-padrao { min-height: 48px !important; }
    .app-card-login { padding: 28px 20px; }
    .login-logo { height: 66px; }
}

/* ========================================================================== 
   PALETA FINAL — Dashboard roxo/ciano conforme a referência
   ========================================================================== */
:root {
    --v2-bg: #f4f5f9;
    --v2-surface: #ffffff;
    --v2-surface-raised: #ffffff;
    --v2-surface-soft: #f7f7fb;
    --v2-border: #e7e8ef;
    --v2-border-soft: #eff0f5;
    --v2-text: #3f4254;
    --v2-muted: #8b8e9f;
    --v2-gold: #7568bf;
    --v2-gold-soft: rgba(117, 104, 191, .13);
    --v2-blue: #23b7d8;
    --bg-dark: #f4f5f9;
    --card-bg: #ffffff;
    --border-color: #e7e8ef;
    --border-input: #dfe1ea;
    --text-primary: #3f4254;
    --text-muted: #8b8e9f;
    --gold: #7568bf;
    --gold-hover: #6659b2;
}

html, body {
    background: #f4f5f9;
    color: #3f4254;
}

.app-sidebar {
    background: linear-gradient(180deg, #776bc1 0%, #6e62b8 55%, #685bb0 100%);
    box-shadow: 8px 0 28px rgba(76, 66, 145, .16);
}
.sidebar-brand { background: #7569bd; border-color: rgba(255, 255, 255, .1); }
.sidebar-brand .nav-logo {
    width: 100%;
    padding: 7px 9px;
    overflow: hidden;
    background: #fff;
    border-radius: 8px;
}
.sidebar-brand .nav-logo img { width: 100%; height: 43px; }
.nav-section-label { color: rgba(255, 255, 255, .48); }
.app-sidebar .nav-item a { color: rgba(255, 255, 255, .78); }
.app-sidebar .nav-item a:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.app-sidebar .nav-item.active a {
    color: #fff;
    background: rgba(255, 255, 255, .18);
    box-shadow: inset 3px 0 0 #48d3ed, 0 7px 18px rgba(61, 50, 130, .16);
}
.sidebar-footer { border-color: rgba(255, 255, 255, .14); }
.sidebar-footer span { color: rgba(255, 255, 255, .48); }
.sidebar-footer strong { color: #fff; }

.app-topbar {
    background: rgba(255, 255, 255, .97);
    border-color: #e8e9f0;
    box-shadow: 0 3px 16px rgba(57, 60, 90, .06);
}
.topbar-title-zone strong, .page-header h1, .welcome-section h1 { color: #424456; }
.welcome-section h1 span { color: #7568bf; }
.currency-selector { background: #f4f4f8; border-color: #e2e3eb; }
.currency-btn { color: #8a8d9d; }
.currency-btn.active { color: #fff; background: #7568bf; box-shadow: 0 3px 9px rgba(88, 75, 171, .24); }
.btn-logout { color: #7568bf; border-color: #dcd8f2; background: #f8f7fd; }
.btn-logout:hover { color: #fff; background: #7568bf; border-color: #7568bf; }

.app-card, .section-box, .chart-container, .kpi-card, .filter-card {
    border-color: #e7e8ef !important;
    box-shadow: 0 5px 16px rgba(52, 55, 84, .06);
}
.card-header, .section-header { color: #575a70; border-color: #e9eaf0; }

/* Indicadores coloridos como os cartões do dashboard de referência */
.kpi-grid .app-card {
    color: #fff !important;
    background: linear-gradient(135deg, #796dc3 0%, #6e62b8 100%) !important;
    border: 0 !important;
    border-top: 0 !important;
    box-shadow: 0 9px 20px rgba(87, 73, 169, .19);
}
.kpi-grid .app-card:nth-child(even) { background: linear-gradient(135deg, #7467bd, #675aad) !important; }
.kpi-grid .app-card::after {
    width: 104px;
    height: 104px;
    top: -34px;
    right: -26px;
    background: rgba(255, 255, 255, .09);
}
.kpi-grid .kpi-title,
.kpi-grid .kpi-value,
.kpi-grid .text-muted,
.kpi-grid small { color: #fff !important; }
.kpi-grid .kpi-title { opacity: .78; }
.kpi-grid small { opacity: .68; }
.kpi-grid .highlight { color: #65e2f3 !important; }

.app-table th { background: #f7f7fa; color: #858899; border-color: #e7e8ef; }
.app-table td { color: #505265; border-color: #eff0f5; }
.app-table tbody tr:hover { background: #fafaff; }
.badge-warning { color: #6c5ab8 !important; border-color: #bdb5e7 !important; background: #f1effb !important; }
.badge-danger { color: #d35b72 !important; border-color: #efbdc7 !important; background: #fff1f4 !important; }

.input-padrao, .select-limite, select.input-padrao { border-color: #dfe1ea !important; }
.input-padrao:focus, .select-limite:focus { border-color: #8578cb !important; box-shadow: 0 0 0 4px rgba(117, 104, 191, .13); }
.btn-padrao, .btn-filtrar {
    background: #7568bf !important;
    box-shadow: 0 5px 13px rgba(87, 73, 169, .2);
}
.btn-padrao:hover, .btn-filtrar:hover { background: #6558ae !important; }
.btn-acao-tabela { color: #65687a; border-color: #dfe1ea; }
.btn-acao-tabela:hover { border-color: #9186d0; color: #6659b2; }
.login-header h1 { color: #454758; }
.app-card-login { border-color: #e4e5ed; box-shadow: 0 24px 70px rgba(65, 62, 112, .13); }

@media (max-width: 768px) {
    .app-topbar .mobile-menu-toggle { border-color: #e0e1e9; }
    .app-topbar .mobile-menu-toggle .bar { background: #6d61b6; }
    .sidebar-overlay { background: rgba(52, 45, 103, .48); }
    .app-table tbody tr { border-color: #e5e6ed !important; box-shadow: 0 5px 14px rgba(54, 57, 88, .06); }
    .app-table tbody td { background: #f9f9fc; border-color: #ececf2 !important; }
    .app-table td[data-label*="Cliente"],
    .app-table td[data-label*="Empresa"],
    .app-table td[data-label="Nome"],
    .app-table td[data-label*="Descrição"] { background: #f1f0fa; }
}

/* ========================================================================== 
   SMARTADMIN LIGHT — identidade final da Class Cigar Stock
   ========================================================================== */
:root {
    --sa-blue: #5b8def;
    --sa-blue-dark: #4777d7;
    --sa-blue-soft: #eaf1ff;
    --sa-bg: #f8fafc;
    --sa-card: #ffffff;
    --sa-border: #e2e8f0;
    --sa-text: #1e293b;
    --sa-muted: #7c8ba1;
    --v2-bg: var(--sa-bg);
    --v2-text: var(--sa-text);
    --v2-muted: var(--sa-muted);
    --v2-gold: var(--sa-blue);
    --v2-gold-soft: rgba(91, 141, 239, .13);
    --border-input: #dbe3ee;
    --gold: var(--sa-blue);
    --gold-hover: var(--sa-blue-dark);
}

html, body {
    background: var(--sa-bg);
    color: var(--sa-text);
    font-family: "Plus Jakarta Sans", Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body:not(:has(.app-card-login)) { padding-top: 60px; padding-left: 310px; }

.sidebar-rail {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1300;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 70px;
    background: #f4f7fb;
    border-right: 1px solid var(--sa-border);
}
.rail-brand {
    display: grid;
    place-items: center;
    width: 70px;
    height: 60px;
    color: var(--sa-blue);
    border-bottom: 1px solid var(--sa-border);
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -.08em;
    text-decoration: none;
}
.rail-link {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-top: 8px;
    color: #7c8ba1;
    border-radius: 9px;
    font-size: 19px;
    text-decoration: none;
}
.rail-link:hover { color: var(--sa-blue); background: #edf3fd; }
.rail-link.active { color: var(--sa-blue); background: #dfeaff; }

.app-sidebar {
    left: 70px;
    width: 240px;
    padding: 0 9px 18px;
    color: var(--sa-text);
    background: #fff;
    border-right: 1px solid var(--sa-border);
    box-shadow: none;
}
.sidebar-brand {
    min-height: 60px;
    margin: 0 -9px 8px;
    padding: 0 20px;
    background: #fff;
    border-bottom: 1px solid var(--sa-border);
}
.sidebar-heading { display: flex; flex-direction: column; gap: 2px; }
.sidebar-heading span { color: #96a2b4; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-heading strong { color: var(--sa-text); font-size: 14px; }
.nav-section-label { margin: 17px 12px 7px; color: #a2acbb; }
.app-sidebar .nav-item a {
    min-height: 39px;
    gap: 10px;
    padding: 8px 12px;
    color: #475569;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
}
.app-sidebar .nav-item a:hover { color: var(--sa-blue); background: #f1f5fb; }
.app-sidebar .nav-item.active a {
    color: var(--sa-blue);
    background: var(--sa-blue-soft);
    box-shadow: none;
}
.nav-icon { width: 20px; height: 20px; color: #8492a6; font-size: 16px; }
.app-sidebar .nav-item.active .nav-icon { color: var(--sa-blue); }
.sidebar-footer { border-color: var(--sa-border); }
.sidebar-footer span { color: #9aa6b7; }
.sidebar-footer strong { color: var(--sa-blue); }

.app-topbar {
    left: 310px;
    min-height: 60px;
    padding: 8px 24px;
    background: rgba(255, 255, 255, .97);
    border-color: var(--sa-border);
    box-shadow: none;
}
.topbar-title-zone small { color: #9aa6b7; }
.topbar-title-zone strong { color: var(--sa-text); font-size: 15px; }
.currency-selector { background: #f5f7fb; border-color: var(--sa-border); }
.currency-btn { color: #8996a8; }
.currency-btn.active { color: #fff; background: var(--sa-blue); box-shadow: none; }
.btn-logout { color: var(--sa-blue); border-color: #d6e3fb; background: #f6f9ff; }
.btn-logout:hover { color: #fff; background: var(--sa-blue); border-color: var(--sa-blue); }

body:not(:has(.app-card-login)) .app-container { max-width: 1550px; padding: 32px 32px 48px; }
.welcome-section {
    padding: 25px 31px;
    background: linear-gradient(135deg, #f4f7ff, #f9fbff);
    border: 1px solid #d9e5fb;
    border-radius: 8px;
}
.welcome-section h1 { color: var(--sa-text); font-size: 23px; }
.welcome-section h1 span { color: var(--sa-blue); }
.page-header h1 { color: var(--sa-text); }

.app-card, .section-box, .chart-container, .kpi-card, .filter-card {
    background: var(--sa-card) !important;
    border: 1px solid var(--sa-border) !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}
.kpi-grid { gap: 22px !important; }
.kpi-grid .app-card,
.kpi-grid .app-card:nth-child(even) {
    min-height: 116px;
    padding: 22px 24px !important;
    color: var(--sa-text) !important;
    background: #fff !important;
    border: 1px solid var(--sa-border) !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}
.kpi-grid .app-card::after {
    top: 25px;
    right: 22px;
    width: 48px;
    height: 48px;
    background: #eaf1ff;
    border-radius: 8px;
}
.kpi-grid .app-card:nth-child(2)::after { background: #dcfce7; }
.kpi-grid .app-card:nth-child(3)::after { background: #fef9c3; }
.kpi-grid .app-card:nth-child(4)::after { background: #fee2e2; }
.kpi-grid .kpi-title { color: var(--sa-muted) !important; opacity: 1; }
.kpi-grid .kpi-value,
.kpi-grid .kpi-value.highlight,
.kpi-grid .text-muted { color: var(--sa-text) !important; opacity: 1; }
.kpi-grid small { color: var(--sa-muted) !important; opacity: 1; }
.section-box { padding: 0 !important; overflow: hidden; }
.section-header, .card-header {
    min-height: 58px;
    margin: 0 !important;
    padding: 18px 24px !important;
    color: var(--sa-text);
    border-color: var(--sa-border);
}
.table-responsive-wrapper { padding: 0 24px 22px; }
.app-table th { background: #f8fafc; color: #7c8ba1; border-color: var(--sa-border); }
.app-table td { color: #475569; border-color: #edf1f5; }
.app-table tbody tr:hover { background: #f8fbff; }
.btn-padrao, .btn-filtrar { background: var(--sa-blue) !important; box-shadow: none; }
.btn-padrao:hover, .btn-filtrar:hover { background: var(--sa-blue-dark) !important; }
.input-padrao:focus, .select-limite:focus { border-color: #8eb0f5 !important; box-shadow: 0 0 0 3px rgba(91, 141, 239, .13); }
.login-header h1 { color: var(--sa-text); }

@media (max-width: 1100px) and (min-width: 769px) {
    body:not(:has(.app-card-login)) { padding-left: 250px; }
    .sidebar-rail { display: none; }
    .app-sidebar { left: 0; width: 250px; }
    .app-topbar { left: 250px; }
}

@media (max-width: 768px) {
    body:not(:has(.app-card-login)) { padding-left: 0; padding-top: 60px; }
    .sidebar-rail { display: none; }
    .app-sidebar {
        left: 0;
        width: min(280px, 86vw);
        background: #fff;
        box-shadow: 18px 0 45px rgba(15, 23, 42, .18);
    }
    .app-topbar { left: 0; }
    .app-topbar .mobile-menu-toggle .bar { background: var(--sa-blue); }
    .sidebar-overlay { background: rgba(30, 41, 59, .4); }
    body:not(:has(.app-card-login)) .app-container { padding: 18px 12px 34px !important; }
    .welcome-section { padding: 20px; }
    .welcome-section h1 { font-size: 20px; }
    .kpi-grid .app-card { min-height: 108px; }
    .app-table tbody td { background: #f8fafc; border-color: #e8edf4 !important; }
    .app-table td[data-label*="Cliente"],
    .app-table td[data-label*="Empresa"],
    .app-table td[data-label="Nome"],
    .app-table td[data-label*="Descrição"] { background: #eef4ff; }
}

/* Navegação final: uma única barra lateral */
body:not(:has(.app-card-login)) { padding-left: 240px; }
.app-sidebar { left: 0; width: 240px; }
.app-topbar { left: 240px; }
.sidebar-brand {
    min-height: 88px;
    padding: 10px 14px;
}
.sidebar-logo-link {
    display: block;
    width: 100%;
    line-height: 0;
}
.sidebar-logo-image {
    display: block;
    width: 100%;
    height: initial;
    object-fit: cover;
    object-position: left center;
}
.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0 auto 24px;
}
.login-brand-mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    color: #fff;
    background: var(--sa-blue);
    border-radius: 10px;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: -.06em;
}
.login-brand-name { color: var(--sa-text); font-size: 20px; font-weight: 800; letter-spacing: -.03em; }

@media (max-width: 1100px) and (min-width: 769px) {
    body:not(:has(.app-card-login)) { padding-left: 240px; }
    .app-sidebar { left: 0; width: 240px; }
    .app-topbar { left: 240px; }
}

@media (max-width: 768px) {
    body:not(:has(.app-card-login)) { padding-left: 0; }
    .app-topbar { left: 0; }
    .sidebar-brand { min-height: 82px; }
    .sidebar-logo-image { height: initial; }
}

/* Formulários internos e configuração da empresa */
.main-grid { grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); gap: 24px; }
.main-grid > .app-card { padding: 0 !important; overflow: hidden; }
.main-grid > .app-card > form { padding: 22px 24px 24px; }
.main-grid > .app-card > .card-header { background: #fbfcfe; }
.form-group { margin-bottom: 18px; }
.form-label {
    margin-bottom: 7px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .035em;
    text-transform: none;
}
.input-padrao {
    min-height: 44px;
    padding: 10px 13px;
    border-radius: 7px;
    font-size: 14px;
}
textarea.input-padrao { min-height: 96px; resize: vertical; }
.btn-padrao {
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 7px !important;
    font-size: 13px;
    letter-spacing: 0;
    text-transform: none;
}

.settings-page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.settings-page-header h1 { margin-top: 5px; }
.settings-page-header p { margin-top: 7px; color: var(--sa-muted); font-size: 14px; }
.page-eyebrow { color: var(--sa-blue); font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.company-status { padding: 7px 11px; color: #168351; background: #e8f8ef; border: 1px solid #bce8ce; border-radius: 999px; font-size: 11px; font-weight: 700; }
.settings-form { display: grid; gap: 18px; }
.settings-card {
    display: grid;
    grid-template-columns: 245px minmax(0, 1fr);
    gap: 30px;
    padding: 27px;
    background: #fff;
    border: 1px solid var(--sa-border);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04);
}
.settings-card-heading { display: flex; align-items: flex-start; gap: 13px; }
.settings-card-heading h2 { color: var(--sa-text); font-size: 15px; }
.settings-card-heading p { margin-top: 5px; color: var(--sa-muted); font-size: 12px; line-height: 1.5; }
.settings-icon { display: grid; place-items: center; flex: 0 0 34px; height: 34px; color: var(--sa-blue); background: var(--sa-blue-soft); border-radius: 7px; font-size: 10px; font-weight: 800; }
.settings-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.settings-fields .field-span-2 { grid-column: 1 / -1; }
.settings-actions {
    position: sticky;
    bottom: 12px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, .96);
    border: 1px solid var(--sa-border);
    border-radius: 8px;
    box-shadow: 0 8px 26px rgba(15, 23, 42, .09);
    backdrop-filter: blur(10px);
}
.settings-actions p { color: var(--sa-muted); font-size: 12px; }
.settings-actions .btn-padrao { width: auto; min-width: 180px; }

@media (max-width: 900px) {
    .settings-card { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 768px) {
    .main-grid { grid-template-columns: 1fr; }
    .settings-page-header { align-items: flex-start; flex-direction: column; }
    .settings-card { padding: 20px 16px; }
    .settings-fields { grid-template-columns: 1fr; }
    .settings-fields .field-span-2 { grid-column: 1; }
    .settings-actions { align-items: stretch; flex-direction: column; bottom: 6px; }
    .settings-actions .btn-padrao { width: 100%; }
}

/* Páginas de listagem com criação em modal */
.list-page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.list-page-header h1 { margin-top: 5px; }
.btn-add-item {
    min-height: 42px;
    padding: 9px 16px;
    color: #fff;
    background: var(--sa-blue);
    border: 1px solid var(--sa-blue);
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: .18s ease;
    text-align: center;
    text-decoration: none;
}
.btn-add-item:hover { background: var(--sa-blue-dark); border-color: var(--sa-blue-dark); transform: translateY(-1px); }
body.create-modal-open { overflow: hidden; }
.main-grid:has(> .create-modal-panel) { grid-template-columns: minmax(0, 1fr); }
.create-modal-panel {
    position: fixed !important;
    inset: 50% auto auto 50%;
    z-index: 3000;
    display: none;
    width: min(760px, calc(100vw - 32px)) !important;
    max-height: min(88vh, 820px);
    margin: 0 !important;
    overflow: auto !important;
    transform: translate(-50%, -50%);
    border-radius: 10px !important;
    box-shadow: 0 0 0 100vmax rgba(30, 41, 59, .46), 0 24px 70px rgba(15, 23, 42, .22) !important;
}
.create-modal-panel.is-open { display: block; }
.create-modal-panel > form { padding: 24px !important; }
.modal-form-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff !important;
}
.modal-form-close {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    color: #64748b;
    background: #f5f7fa;
    border: 1px solid var(--sa-border);
    border-radius: 7px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.modal-form-close:hover { color: #dc4c64; background: #fff3f5; border-color: #f4c7cf; }
#modalNovaEntrada, #modalNovaSaida { width: min(920px, calc(100vw - 32px)) !important; }

@media (max-width: 768px) {
    .list-page-header { align-items: stretch; flex-direction: column; }
    .btn-add-item { width: 100%; }
    .create-modal-panel {
        inset: auto 0 0;
        width: 100% !important;
        max-height: 92vh;
        transform: none;
        border-radius: 14px 14px 0 0 !important;
    }
    .create-modal-panel > form { padding: 18px 14px 24px !important; }
    .create-modal-panel .form-grid { grid-template-columns: 1fr !important; gap: 12px !important; }
}

/* Páginas dedicadas para movimentos complexos */
.form-page-container { max-width: 1180px !important; }
.form-page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.form-page-header h1 { margin-top: 5px; }
.form-page-header p { margin-top: 7px; color: var(--sa-muted); font-size: 14px; }
.btn-back-list, .btn-secondary-clean {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 14px;
    color: #526174;
    background: #fff;
    border: 1px solid var(--sa-border);
    border-radius: 7px;
    font-size: 12px;
    font-weight: 650;
    text-decoration: none;
}
.btn-back-list:hover, .btn-secondary-clean:hover { color: var(--sa-blue); border-color: #b9ccf2; background: #f7faff; }
.standalone-form-card { overflow: hidden; margin-bottom: 20px; }
.standalone-form { padding: 25px; }
.standalone-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.standalone-fields .field-wide { grid-column: 1 / -1; }
.entry-fields { grid-template-columns: 2fr 1fr 1fr; }
.entry-fields .field-wide { grid-column: 1 / -1; }
.form-help-box { padding: 12px 14px; color: #64748b; background: #f7f9fc; border: 1px solid #e8edf4; border-radius: 7px; font-size: 12px; }
.fixed-setting-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 9px 12px;
    background: #f5f8fd;
    border: 1px solid #dfe7f3;
    border-radius: 7px;
}
.fixed-setting-value strong { color: var(--sa-blue); font-size: 14px; }
.fixed-setting-value span { color: var(--sa-muted); font-size: 10px; text-align: right; }
.standalone-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}
.standalone-form-actions .btn-padrao { width: auto; min-width: 180px; }
.invoice-create-layout { display: grid; gap: 0; }
.invoice-items-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.btn-add-line {
    padding: 8px 12px;
    color: var(--sa-blue);
    background: var(--sa-blue-soft);
    border: 1px solid #ceddf9;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.invoice-items-wrap { padding: 20px 24px 24px; overflow-x: auto; }
.invoice-entry-table { width: 100%; border-collapse: collapse; }
.invoice-entry-table th { padding: 10px; color: var(--sa-muted); background: #f8fafc; font-size: 11px; text-align: left; }
.invoice-entry-table td { padding: 9px 6px; border-bottom: 1px solid #edf1f5; }
.invoice-entry-table th:nth-child(2), .invoice-entry-table td:nth-child(2) { width: 130px; }
.invoice-entry-table th:nth-child(3), .invoice-entry-table td:nth-child(3) { width: 190px; }
.invoice-entry-table th:last-child, .invoice-entry-table td:last-child { width: 50px; text-align: center; }
.btn-remove-line { width: 34px; height: 34px; color: #d4485f; background: #fff3f5; border: 1px solid #f3c4cc; border-radius: 6px; font-size: 20px; cursor: pointer; }
.invoice-empty-state { padding: 28px; color: var(--sa-muted); text-align: center; font-size: 13px; }
.invoice-submit-actions {
    position: sticky;
    bottom: 10px;
    z-index: 10;
    margin: 0;
    padding: 14px 16px;
    background: rgba(255,255,255,.96);
    border: 1px solid var(--sa-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15,23,42,.09);
    backdrop-filter: blur(10px);
}

@media (max-width: 768px) {
    .form-page-header { align-items: stretch; flex-direction: column; }
    .standalone-form { padding: 18px 14px; }
    .standalone-fields, .entry-fields { grid-template-columns: 1fr; }
    .standalone-fields .field-wide, .entry-fields .field-wide { grid-column: 1; }
    .standalone-form-actions { align-items: stretch; flex-direction: column-reverse; }
    .standalone-form-actions .btn-padrao, .btn-secondary-clean, .btn-back-list { width: 100%; }
    .invoice-items-header { align-items: stretch; flex-direction: column; }
    .invoice-items-wrap { padding: 14px; }
    .invoice-entry-table { min-width: 680px; }
}

/* Alinhamento final entre a identidade lateral e a barra superior */
body:not(:has(.app-card-login)) { padding-top: 64px; }
.sidebar-brand {
    min-height: 64px;
    height: 64px;
    margin-bottom: 0;
    padding: 8px 14px;
    border-bottom: 1px solid var(--sa-border);
}
.sidebar-logo-link {
    display: flex;
    align-items: center;
    height: 100%;
}
.sidebar-logo-image {
    width: 100%;
    max-height: 44px;
    object-fit: contain;
    object-position: left center;
}
.app-topbar {
    min-height: 64px;
    height: 64px;
    padding-top: 8px;
    padding-bottom: 8px;
}
.app-sidebar .nav-menu { padding-top: 12px; }
.topbar-page-title { justify-content: center; }
.user-identity {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    line-height: 1.15;
}
.user-company {
    color: #94a3b8;
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.user-person { display: flex; align-items: center; gap: 7px; color: var(--sa-text); }
.user-person strong { font-size: 13px; font-weight: 700; }
.user-person .user-level {
    color: #8492a6;
    font-size: 9px;
    font-weight: 650;
    letter-spacing: .04em;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    body:not(:has(.app-card-login)) { padding-top: 60px; }
    .sidebar-brand { min-height: 64px; height: 64px; }
    .app-topbar { min-height: 60px; height: 60px; }
}

/* ========================================================================== 
   CIGAR MANAGEMENT — identidade editorial operacional
   ========================================================================== */
:root {
    --cm-ink: #172033;
    --cm-text: #334155;
    --cm-muted: #7b8799;
    --cm-bg: #f5f7fa;
    --cm-card: #ffffff;
    --cm-line: #e5eaf0;
    --cm-blue: #4f7ee8;
    --cm-blue-deep: #3c68cf;
    --cm-blue-soft: #edf3ff;
    --cm-green: #16815a;
    --cm-yellow: #9a6a00;
    --sa-blue: var(--cm-blue);
    --sa-blue-dark: var(--cm-blue-deep);
    --sa-blue-soft: var(--cm-blue-soft);
    --sa-bg: var(--cm-bg);
    --sa-card: var(--cm-card);
    --sa-border: var(--cm-line);
    --sa-text: var(--cm-ink);
    --sa-muted: var(--cm-muted);
}

html, body { background: var(--cm-bg); color: var(--cm-text); }
body:not(:has(.app-card-login)) { padding: 72px 0 0 248px; }

.app-sidebar {
    left: 0;
    width: 248px;
    padding: 0 12px 104px;
    background: #fff;
    border-right: 1px solid var(--cm-line);
    box-shadow: none;
}
.sidebar-brand {
    height: 72px;
    min-height: 72px;
    margin: 0 -12px;
    padding: 13px 18px;
    border-bottom: 0;
}
.sidebar-logo-image { width: auto; max-width: 194px; max-height: 44px; }
.sidebar-company {
    margin: 5px 8px 18px;
    padding: 12px 13px;
    background: #f7f9fc;
    border: 1px solid #edf0f4;
    border-radius: 10px;
}
.sidebar-company span { display: block; color: #9aa5b4; font-size: 8px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.sidebar-company strong { display: block; margin-top: 4px; overflow: hidden; color: var(--cm-ink); font-size: 12px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.app-sidebar .nav-menu { padding: 0 0 18px; }
.nav-section-label { margin: 18px 10px 7px; color: #a1abba; font-size: 9px; letter-spacing: .13em; }
.app-sidebar .nav-item { margin: 2px 0; }
.app-sidebar .nav-item a {
    min-height: 42px;
    gap: 12px;
    padding: 9px 11px;
    color: #526176;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
}
.app-sidebar .nav-item a:hover { color: var(--cm-ink); background: #f5f7fa; }
.app-sidebar .nav-item.active a { color: var(--cm-blue); background: var(--cm-blue-soft); box-shadow: none; }
.nav-icon { display: grid; place-items: center; width: 21px; height: 21px; color: #8996a8; }
.nav-icon svg, .mobile-bottom-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app-sidebar .nav-item.active .nav-icon { color: var(--cm-blue); }
.sidebar-profile {
    position: absolute;
    right: 12px;
    bottom: 12px;
    left: 12px;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 10px;
    padding: 11px;
    background: #fff;
    border: 1px solid var(--cm-line);
    border-radius: 11px;
    box-shadow: 0 8px 24px rgba(23, 32, 51, .06);
}
.profile-avatar { display: grid; place-items: center; width: 36px; height: 36px; color: #fff; background: var(--cm-ink); border-radius: 10px; font-size: 11px; font-weight: 800; }
.profile-copy { min-width: 0; }
.profile-copy small, .profile-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy small { color: #9aa5b4; font-size: 8px; font-weight: 700; text-transform: uppercase; }
.profile-copy strong { margin-top: 3px; color: var(--cm-ink); font-size: 11px; }
.profile-logout { display: grid; place-items: center; width: 28px; height: 28px; color: #8a96a7; border-radius: 7px; font-size: 15px; text-decoration: none; }
.profile-logout:hover { color: #c33f54; background: #fff1f3; }

.app-topbar {
    left: 248px;
    height: 72px;
    min-height: 72px;
    padding: 10px clamp(20px, 3vw, 42px);
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--cm-line);
    box-shadow: none;
    backdrop-filter: blur(16px);
}
.topbar-page-title { display: flex; flex-direction: column; gap: 2px; }
.topbar-page-title small { color: #a0aaba; font-size: 8px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.topbar-page-title strong { color: var(--cm-ink); font-size: 16px; font-weight: 750; }
.topbar-currency { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #f7f9fc; border: 1px solid var(--cm-line); border-radius: 9px; }
.topbar-currency small { color: #9aa5b4; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.topbar-currency strong { color: var(--cm-ink); font-size: 11px; }
.mobile-bottom-nav { display: none; }

body:not(:has(.app-card-login)) .app-container { width: 100%; max-width: 1500px; padding: 38px clamp(22px, 3.5vw, 52px) 56px; }
.page-header, .welcome-section { margin-bottom: 26px; }
.page-eyebrow { color: var(--cm-blue); font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.page-header h1, .welcome-section h1 { margin-top: 6px; color: var(--cm-ink); font-size: clamp(25px, 2.8vw, 34px); font-weight: 780; letter-spacing: -.035em; }
.app-card, .section-box, .chart-container, .kpi-card, .filter-card {
    background: #fff !important;
    border: 1px solid var(--cm-line) !important;
    border-radius: 13px !important;
    box-shadow: 0 4px 18px rgba(23, 32, 51, .035) !important;
}
.card-header, .section-header { color: var(--cm-ink); border-color: var(--cm-line); font-weight: 750; }
.app-table th { padding: 12px 14px; color: #8190a5; background: #f8fafc; border-color: var(--cm-line); font-size: 10px; font-weight: 750; letter-spacing: .025em; }
.app-table td { padding: 14px; color: #4b5a70; border-color: #edf0f4; }
.app-table tbody tr:hover { background: #fbfcfe; }
.input-padrao, .select-limite, select.input-padrao, textarea.input-padrao {
    min-height: 44px;
    color: var(--cm-ink) !important;
    background: #fff !important;
    border-color: #dce3eb !important;
    border-radius: 9px !important;
}
.input-padrao:focus, .select-limite:focus { border-color: var(--cm-blue) !important; box-shadow: 0 0 0 4px rgba(79,126,232,.11) !important; }
.btn-add-item, .btn-padrao, .btn-filtrar { color: #fff !important; background: var(--cm-blue) !important; border-color: var(--cm-blue) !important; border-radius: 9px !important; box-shadow: 0 5px 14px rgba(79,126,232,.18) !important; }
.btn-add-item:hover, .btn-padrao:hover, .btn-filtrar:hover { background: var(--cm-blue-deep) !important; transform: translateY(-1px); }
.kpi-grid { gap: 16px !important; }
.kpi-grid .app-card, .kpi-grid .app-card:nth-child(even) { min-height: 112px; padding: 21px 22px !important; background: #fff !important; border: 1px solid var(--cm-line) !important; }
.kpi-grid .app-card::after { display: none; }
.kpi-grid .kpi-title { color: #8995a6 !important; font-size: 9px; letter-spacing: .08em; }
.kpi-grid .kpi-value { color: var(--cm-ink) !important; }
.kpi-grid small, .kpi-grid .text-muted { color: var(--cm-muted) !important; }
.kpi-grid .highlight { color: var(--cm-blue) !important; }

@media (max-width: 768px) {
    body:not(:has(.app-card-login)) { padding: 62px 0 78px; }
    .app-sidebar { left: 0; width: min(86vw, 300px); padding-bottom: 104px; transform: translateX(-105%); box-shadow: 18px 0 55px rgba(23,32,51,.18); }
    .app-sidebar.mobile-open { transform: translateX(0); }
    .sidebar-brand { height: 66px; min-height: 66px; }
    .sidebar-company { margin-top: 0; }
    .app-topbar { left: 0; height: 62px; min-height: 62px; padding: 8px 14px; }
    .app-topbar .mobile-menu-toggle { display: flex; width: 38px; height: 38px; border-color: var(--cm-line); border-radius: 9px; }
    .topbar-page-title small { display: none; }
    .topbar-page-title strong { font-size: 15px; }
    .topbar-currency { padding: 7px 9px; }
    .topbar-currency small { display: none; }
    .mobile-bottom-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1250;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        height: 70px;
        padding: 7px max(7px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left));
        background: rgba(255,255,255,.97);
        border-top: 1px solid var(--cm-line);
        box-shadow: 0 -8px 28px rgba(23,32,51,.08);
        backdrop-filter: blur(18px);
    }
    .mobile-bottom-nav a, .mobile-bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #8794a6; background: none; border: 0; font: inherit; font-size: 9px; font-weight: 700; text-decoration: none; }
    .mobile-bottom-nav a.active { color: var(--cm-blue); }
    .mobile-bottom-nav .mobile-primary-action svg { width: 32px; height: 32px; padding: 7px; color: #fff; background: var(--cm-blue); border-radius: 10px; box-shadow: 0 5px 12px rgba(79,126,232,.24); }
    .more-dots { height: 18px; font-size: 16px; line-height: 11px; letter-spacing: 1px; }
    body:not(:has(.app-card-login)) .app-container { padding: 24px 14px 30px !important; }
    .page-header, .welcome-section { margin-bottom: 20px; }
    .page-header h1, .welcome-section h1 { font-size: 25px; }
    .app-card { border-radius: 12px !important; }
    .app-table tbody tr { border-color: var(--cm-line) !important; border-radius: 12px !important; box-shadow: 0 3px 14px rgba(23,32,51,.04) !important; }
    .app-table tbody td { background: #fff !important; border-color: #edf0f4 !important; }
    .app-table td[data-label*="Cliente"], .app-table td[data-label*="Empresa"], .app-table td[data-label="Nome"], .app-table td[data-label*="Descrição"] { background: #f9fbfd !important; }
}

/* Correção final: moeda e menu lado a lado no mobile */
@media (max-width: 768px) {
    .app-topbar .nav-right-zone {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-end;
        gap: 8px !important;
        width: auto !important;
        padding: 0 !important;
        background: transparent !important;
        border: 0 !important;
    }
    .app-topbar .topbar-currency,
    .app-topbar .mobile-menu-toggle { flex: 0 0 auto; margin: 0 !important; }

    .critical-stock-table tbody tr {
        grid-template-columns: minmax(0, 1fr) 58px !important;
    }
    .critical-stock-table td[data-label="Marca"] {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start;
        gap: 5px !important;
        min-height: 38px;
    }
    .critical-stock-table td[data-label="Marca"]::before {
        content: "Marca:" !important;
        flex: 0 0 auto;
        font-size: 9px;
    }
    .critical-stock-table td[data-label="Marca"] .mobile-cell-value {
        width: auto;
        color: var(--cm-ink);
        font-size: 12px;
        font-weight: 700;
    }
    .critical-stock-table td[data-label="Produto (Linha/Vitola)"] { grid-column: 1; }
    .critical-stock-table td[data-label="Atual"] { grid-column: 2; }
    .critical-stock-table td[data-label="Estado"] { display: none !important; }

    /* Catálogo de charutos: foto/marca, produto/stock e ações */
    .cigar-catalog-table tbody tr {
        grid-template-columns: 64px minmax(0, 1fr) 70px !important;
        gap: 6px !important;
        padding: 8px !important;
    }
    .cigar-catalog-table td[data-label="Foto"] {
        grid-column: 1;
        min-height: 64px;
        padding: 7px !important;
    }
    .cigar-catalog-table td[data-label="Foto"] .catalog-thumb,
    .cigar-catalog-table td[data-label="Foto"] .catalog-placeholder {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }
    .cigar-catalog-table td[data-label="Marca"] {
        grid-column: 2 / -1;
        min-height: 64px;
        padding: 8px 10px !important;
        background: #f7f9fc !important;
    }
    .cigar-catalog-table td[data-label="Charuto (Linha / Vitola)"] {
        grid-column: 1 / 3;
        min-height: 58px;
        padding: 8px 10px !important;
    }
    .cigar-catalog-table td[data-label="Alerta Mín."] { display: none !important; }
    .cigar-catalog-table td[data-label="Stock Físico"] {
        grid-column: 3;
        min-height: 58px;
        padding: 8px 5px !important;
        align-items: center;
        text-align: center !important;
    }
    .cigar-catalog-table td[data-label="Stock Físico"]::before,
    .cigar-catalog-table td[data-label="Stock Físico"] .mobile-cell-value { text-align: center; }
    .cigar-catalog-table td[data-label="Ações"] {
        grid-column: 1 / -1;
        margin-top: 1px !important;
    }
}

/* Página inicial comercial + acesso */
.product-login-page { min-height: 100vh; padding: 0 !important; background: #eef2f7; }
.product-login-shell { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(420px, .8fr); min-height: 100vh; }
.login-showcase { position: relative; display: flex; align-items: center; min-width: 0; padding: clamp(42px, 7vw, 100px); overflow: hidden; color: #fff; background: radial-gradient(circle at 78% 15%, rgba(107,146,238,.38), transparent 28%), linear-gradient(145deg,#142039 0%,#1c3158 58%,#294d86 100%); }
.login-showcase::before { content:""; position:absolute; width:420px; height:420px; right:-170px; bottom:-190px; border:1px solid rgba(255,255,255,.1); border-radius:50%; box-shadow:0 0 0 65px rgba(255,255,255,.025),0 0 0 130px rgba(255,255,255,.02); }
.showcase-content { position: relative; z-index: 2; width: min(620px,100%); }
.showcase-kicker { display:inline-flex; padding:6px 10px; color:#bcd1ff; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.12); border-radius:999px; font-size:10px; font-weight:800; letter-spacing:.1em; text-transform:uppercase; }
.showcase-content h1 { margin:24px 0 18px; color:#fff; font-size:clamp(38px,5.2vw,68px); line-height:1.02; letter-spacing:-.055em; }
.showcase-content h1 span { color:#8fb3ff; }
.showcase-content>p { max-width:540px; margin:0; color:#c2cde0; font-size:15px; line-height:1.7; }
.showcase-benefits { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin:34px 0 28px; }
.showcase-benefits>div { min-width:0; padding:14px; background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.1); border-radius:11px; backdrop-filter:blur(8px); }
.showcase-benefits span { display:block; color:#7fa7fa; font-size:9px; font-weight:800; }
.showcase-benefits strong { display:block; margin-top:9px; color:#fff; font-size:11px; }
.showcase-benefits small { display:block; margin-top:4px; color:#9fb0c8; font-size:9px; line-height:1.45; }
.showcase-cta { display:inline-flex; align-items:center; gap:16px; min-height:44px; padding:10px 16px; color:#fff; background:#4f7ee8; border-radius:9px; font-size:12px; font-weight:750; text-decoration:none; box-shadow:0 8px 25px rgba(23,49,102,.35); }
.showcase-cta span { font-size:18px; }
.showcase-preview { position:absolute; right:-160px; bottom:42px; width:420px; height:235px; overflow:hidden; background:#f8fafc; border:5px solid rgba(255,255,255,.16); border-radius:15px; box-shadow:0 25px 70px rgba(5,15,35,.35); transform:rotate(-4deg); opacity:.48; }
.preview-top { display:flex; align-items:center; gap:5px;height:30px;padding:0 11px;color:#687991;background:#fff;border-bottom:1px solid #e6ebf1;font-size:7px}.preview-top i{width:5px;height:5px;background:#ccd5e1;border-radius:50%}.preview-top span{margin-left:7px}.preview-body{display:grid;grid-template-columns:72px 1fr;height:calc(100% - 30px)}.preview-sidebar{background:#fff;border-right:1px solid #e5eaf0}.preview-main{padding:18px}.preview-title{width:45%;height:11px;background:#dfe6ef;border-radius:4px}.preview-kpis{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:15px}.preview-kpis i{height:38px;background:#fff;border:1px solid #e2e8f0;border-radius:6px}.preview-chart{display:flex;align-items:end;gap:12px;height:88px;margin-top:12px;padding:12px;background:#fff;border:1px solid #e2e8f0;border-radius:7px}.preview-chart span{flex:1;background:#668ee8;border-radius:3px 3px 0 0}.preview-chart span:nth-child(1){height:30%}.preview-chart span:nth-child(2){height:48%}.preview-chart span:nth-child(3){height:38%}.preview-chart span:nth-child(4){height:70%}.preview-chart span:nth-child(5){height:60%}.preview-chart span:nth-child(6){height:88%}
.login-access-panel { display:grid; place-items:center; padding:40px; background:#fff; }
.product-login-page .app-card-login { width:min(430px,100%); margin:0; padding:0; background:transparent; border:0; border-radius:0; box-shadow:none; }
.product-login-page .login-header { text-align:left; }
.product-login-page .login-header .login-logo { max-width:230px; margin:0 0 38px; object-position:left center; }
.product-login-page .login-header h1 { font-size:28px; letter-spacing:-.035em; }
.product-login-page .login-header p { margin-bottom:28px; }
.product-login-page .btn-padrao { min-height:46px; border-radius:9px !important; }
.login-new-account { display:flex; align-items:center; justify-content:center; gap:6px; margin-top:18px; color:var(--cm-muted); font-size:11px; }
.login-new-account a { color:var(--cm-blue); font-weight:750; text-decoration:none; }
.product-login-page .login-footer { margin-top:34px; color:#a0aaba; font-size:9px; }

@media (max-width: 980px) { .product-login-shell { grid-template-columns:1fr; } .login-showcase { min-height:auto; padding:42px 28px; } .showcase-content h1 { font-size:42px; } .showcase-preview { display:none; } .login-access-panel { padding:46px 24px; } }
@media (max-width: 560px) { .login-showcase { padding:30px 20px 32px; } .showcase-content h1 { margin:18px 0 12px; font-size:34px; } .showcase-content>p { font-size:12px; line-height:1.55; } .showcase-benefits { grid-template-columns:1fr; margin:22px 0 18px; } .showcase-benefits>div { display:grid; grid-template-columns:24px 1fr; gap:0 6px; padding:10px 12px; } .showcase-benefits span { grid-row:1/3; } .showcase-benefits strong { margin:0; } .showcase-benefits small { margin-top:2px; } .showcase-cta { width:100%; } .login-access-panel { padding:38px 20px; } .product-login-page .login-header .login-logo { max-width:210px; margin-bottom:30px; } }

/* Landing editorial exclusiva do Cigar Management */
.editorial-login-page { min-height:100vh; padding:0!important; color:#344258; background:#f4f7fb; }
.editorial-login-shell { width:min(1480px,100%); margin:auto; padding:0 clamp(20px,5vw,72px); }
.editorial-login-nav { display:flex; align-items:center; justify-content:space-between; min-height:92px; border-bottom:1px solid #dfe6ef; }
.editorial-login-nav>img { display:block; width:auto; max-width:220px; max-height:54px; object-fit:contain; }
.editorial-login-nav>div { display:flex; align-items:center; gap:20px; }
.editorial-login-nav span { color:#9aa6b7; font-size:9px; font-weight:750; letter-spacing:.1em; text-transform:uppercase; }
.editorial-login-nav a { display:inline-flex; align-items:center; min-height:38px; padding:8px 13px; color:#3f6fd9; background:#edf3ff; border:1px solid #d7e3fd; border-radius:9px; font-size:11px; font-weight:750; text-decoration:none; }
.editorial-login-nav .public-language-switch { display:flex; align-items:center; gap:3px; padding:3px; background:#e9eef6; border-radius:8px; }
.editorial-login-nav .public-language-switch a { min-height:26px; padding:4px 7px; color:#78879b; background:transparent; border:0; border-radius:6px; font-size:8px; }
.editorial-login-nav .public-language-switch a.active { color:#fff; background:#4f7ee8; }
.editorial-hero { padding:clamp(56px,7vw,96px) 0 0; text-align:center; }
.editorial-kicker { color:#4f7ee8; font-size:9px; font-weight:850; letter-spacing:.16em; text-transform:uppercase; }
.editorial-hero h1 { margin:18px 0; color:#172033; font-size:clamp(43px,6.4vw,82px); font-weight:800; line-height:.98; letter-spacing:-.065em; }
.editorial-hero h1 em { color:#4f7ee8; font-family:Georgia,serif; font-weight:400; }
.editorial-hero>p { max-width:680px; margin:0 auto; color:#6f7d91; font-size:14px; line-height:1.7; }
.editorial-product-window { width:min(1120px,96%); margin:52px auto 0; overflow:hidden; background:#fff; border:1px solid #dfe6ef; border-radius:18px 18px 0 0; box-shadow:0 28px 75px rgba(28,49,86,.12); text-align:left; }
.editorial-product-window>img { display:block; width:100%; height:auto; aspect-ratio:1.93/1; object-fit:cover; object-position:top center; }
.editorial-window-bar { display:flex; align-items:center; gap:6px; height:42px; padding:0 15px; color:#7e8da2; background:#fbfcfe; border-bottom:1px solid #e5eaf0; font-size:8px; }
.editorial-window-bar i { width:7px;height:7px;background:#d5dde7;border-radius:50%; }.editorial-window-bar span{margin-left:8px}.editorial-window-bar b{margin-left:auto;padding:4px 7px;color:#426ecf;background:#edf3ff;border-radius:5px;font-size:7px}
.editorial-window-content { display:grid; grid-template-columns:145px 1fr; height:calc(100% - 42px); }
.editorial-window-content aside { display:flex; flex-direction:column; gap:13px; padding:25px 18px; border-right:1px solid #e7ebf1; }
.editorial-window-content aside span { width:75%;height:8px;background:#e8edf3;border-radius:4px}.editorial-window-content aside span:first-child{width:100%;height:28px;background:#edf3ff;border-radius:7px}
.editorial-dashboard { padding:30px; background:#f7f9fc; }.editorial-welcome{width:48%;height:28px;background:#dfe6ef;border-radius:7px}.editorial-metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:22px 0}.editorial-metrics i{height:68px;background:#fff;border:1px solid #e3e8ef;border-radius:9px;box-shadow:0 3px 10px rgba(23,32,51,.025)}.editorial-data{display:grid;grid-template-columns:1.4fr .8fr;gap:12px;height:155px}.editorial-bars,.editorial-list{display:flex;align-items:end;gap:13px;padding:20px;background:#fff;border:1px solid #e3e8ef;border-radius:9px}.editorial-bars span{flex:1;background:linear-gradient(#7398ed,#4f7ee8);border-radius:4px 4px 0 0}.editorial-bars span:nth-child(1){height:28%}.editorial-bars span:nth-child(2){height:44%}.editorial-bars span:nth-child(3){height:38%}.editorial-bars span:nth-child(4){height:70%}.editorial-bars span:nth-child(5){height:58%}.editorial-bars span:nth-child(6){height:88%}.editorial-list{align-items:stretch;flex-direction:column;gap:11px}.editorial-list i{height:9px;background:#e7ecf2;border-radius:4px}
.editorial-access-dock { position:relative; z-index:2; display:grid; grid-template-columns:220px minmax(0,1fr); align-items:center; gap:28px; width:min(1060px,94%); margin:-34px auto 0; padding:22px 24px; background:rgba(255,255,255,.98); border:1px solid #dfe6ef; border-radius:16px; box-shadow:0 18px 48px rgba(23,32,51,.12); backdrop-filter:blur(14px); }
.access-dock-title span,.access-dock-title strong,.access-dock-title small{display:block}.access-dock-title span{color:#4f7ee8;font-size:8px;font-weight:800;letter-spacing:.12em;text-transform:uppercase}.access-dock-title strong{margin-top:4px;color:#172033;font-size:15px}.access-dock-title small{margin-top:5px;color:#8491a3;font-size:9px;line-height:1.45}
.editorial-access-dock .app-card-login { width:100%; max-width:none; margin:0; padding:0; background:transparent; border:0; box-shadow:none; }
.editorial-login-form { display:grid; grid-template-columns:minmax(190px,1fr) minmax(190px,1fr) minmax(124px,.55fr); align-items:end; gap:14px; width:100%; }
.editorial-login-form .form-group { margin:0; }.editorial-login-form .form-label{margin-bottom:6px;font-size:8px}.editorial-login-form .input-padrao{min-height:46px;padding:10px 13px;background:#f8faff;border-color:#dce4ef;border-radius:9px;font-size:11px}.editorial-login-form .input-padrao:focus{background:#fff;border-color:#7398ed;box-shadow:0 0 0 3px rgba(79,126,232,.1)}.editorial-login-form .btn-padrao{display:flex;align-items:center;justify-content:space-between;min-height:46px;margin:0!important;padding:8px 15px!important;border-radius:9px}.editorial-login-form .btn-padrao span{font-size:16px}.editorial-access-dock .alert-danger{grid-column:1/-1;margin:0 0 10px}
.editorial-values { display:grid; grid-template-columns:repeat(3,1fr); gap:0; width:min(980px,92%); margin:58px auto; border-top:1px solid #dfe6ef; border-bottom:1px solid #dfe6ef; }
.editorial-values>div { display:grid; grid-template-columns:30px 1fr; gap:2px 10px; padding:23px 28px; border-right:1px solid #dfe6ef; }.editorial-values>div:last-child{border-right:0}.editorial-values span{grid-row:1/3;color:#4f7ee8;font-size:9px;font-weight:800}.editorial-values strong{color:#172033;font-size:11px}.editorial-values small{color:#8491a3;font-size:9px}
.editorial-footer { display:flex; justify-content:space-between; padding:0 0 28px; color:#9ba6b5; font-size:9px; }
@media(max-width:820px){.editorial-product-window{width:100%}.editorial-access-dock{grid-template-columns:1fr;margin-top:-25px}.editorial-login-form{grid-template-columns:1fr 1fr}.editorial-login-form .btn-padrao{grid-column:1/-1}.editorial-values{width:100%}}
@media(max-width:560px){.editorial-login-shell{padding:0 15px}.editorial-login-nav{min-height:72px}.editorial-login-nav>img{max-width:145px}.editorial-login-nav>div{gap:6px}.editorial-login-nav span{display:none}.editorial-login-nav a{padding:7px 9px;font-size:8px}.editorial-login-nav .public-language-switch a{padding:4px 6px}.editorial-hero{padding-top:46px}.editorial-hero h1{font-size:42px}.editorial-hero>p{font-size:12px}.editorial-product-window{margin-top:34px;border-radius:13px 13px 0 0}.editorial-window-bar b{font-size:6px}.editorial-access-dock{width:100%;padding:19px 16px;gap:17px}.access-dock-title small{font-size:9px}.editorial-login-form{grid-template-columns:1fr}.editorial-login-form .btn-padrao{grid-column:auto}.editorial-values{grid-template-columns:1fr;margin:38px auto 28px}.editorial-values>div{border-right:0;border-bottom:1px solid #dfe6ef}.editorial-values>div:last-child{border-bottom:0}.editorial-footer{flex-direction:column;align-items:center;gap:4px}}
