/* ==========================================================================
   METAS DASHBOARD & CADASTRO DE METAS MODERNO
   Estilo visual baseado no metas_dashboard.html, sem meta de margem
   Cards executivos de cadastro com atalhos de cálculo em tempo real
   ========================================================================== */

#metas-view {
    width: 100%;
    min-height: 100vh;
    background: #f8fafc;
    color: #0f172a;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    padding: 1.5rem 2rem;
    box-sizing: border-box;
}

#metas-view:not(.active) {
    display: none !important;
}

#metas-view.active {
    display: flex !important;
    flex-direction: column;
    gap: 1.5rem;
}

.metas-container {
    width: 100%;
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Header & Barra de Filtros
   -------------------------------------------------------------------------- */
.metas-header-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 1.25rem 1.75rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.metas-header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.metas-target-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(251, 191, 36, 0.2);
    color: #b45309;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.metas-dashboard-title {
    font-size: 1.45rem;
    font-weight: 800;
    margin: 0;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.metas-breadcrumb {
    font-size: 0.85rem;
    font-weight: 500;
    color: #64748b;
    margin-top: 2px;
}

.breadcrumb-link {
    color: #2563eb;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s;
}

.breadcrumb-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.metas-filter-controls {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.metas-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metas-form-group label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metas-select {
    padding: 0.55rem 0.9rem;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    font-size: 0.88rem;
    font-weight: 600;
    color: #0f172a;
    outline: none;
    transition: all 0.2s;
    cursor: pointer;
}

.metas-select:focus {
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.metas-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0.55rem 1.25rem;
    border-radius: 8px;
    font-size: 0.86rem;
    font-weight: 600;
    background: #2563eb;
    color: #ffffff;
    border: 1px solid #1d4ed8;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
    transition: all 0.2s;
}

.metas-btn-primary:hover {
    background: #1d4ed8;
}

.metas-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0.55rem 1.15rem;
    border-radius: 8px;
    font-size: 0.86rem;
    font-weight: 600;
    background: #ffffff;
    color: #334155;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    transition: all 0.2s;
}

.metas-btn-secondary:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

/* --------------------------------------------------------------------------
   Panes / Abas
   -------------------------------------------------------------------------- */
.metas-pane {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

/* --------------------------------------------------------------------------
   Metrics Grid & Metric Cards (Estilo metas_dashboard.html)
   -------------------------------------------------------------------------- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

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

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

.metric-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.25rem 1.4rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.metric-card.card-primary {
    background: #eff6ff;
    border-color: #bfdbfe;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.08);
}

.metric-title {
    font-size: 0.76rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.35rem;
}

.metric-value {
    font-size: 1.65rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.metric-value.font-md {
    font-size: 1.45rem;
    font-weight: 800;
}

.metric-subtext {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.trend-up {
    color: #16a34a !important;
    font-weight: 700;
}

.trend-down {
    color: #dc2626 !important;
    font-weight: 700;
}

.text-warning {
    color: #d97706 !important;
    font-weight: 700;
}

.text-blue  { color: #2563eb !important; }
.text-amber { color: #b45309 !important; }
.text-slate { color: #475569 !important; }

/* --------------------------------------------------------------------------
   Seção de Gráficos (Grid 2fr : 1fr)
   -------------------------------------------------------------------------- */
.metas-charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 1080px) {
    .metas-charts-grid {
        grid-template-columns: 1fr;
    }
}

.metas-card-box {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

.card-box-header {
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
}

.card-box-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.card-box-subtitle {
    font-size: 0.78rem;
    color: #64748b;
    margin: 2px 0 0 0;
}

.card-box-hint {
    font-size: 0.75rem;
    color: #2563eb;
    font-weight: 600;
}

.chart-canvas-container {
    height: 380px;
    position: relative;
    padding: 1rem 1.25rem;
}

/* --------------------------------------------------------------------------
   Tabelas Executivas com Drilldown & Badges
   -------------------------------------------------------------------------- */
.metas-table-responsive {
    width: 100%;
    overflow-x: auto;
}

.metas-dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
    text-align: left;
}

.metas-dash-table th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 14px;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.metas-dash-table td {
    padding: 11px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

.metas-dash-table tbody tr {
    transition: background-color 0.15s ease;
}

.metas-dash-table tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.04);
}

.metas-dash-table tbody tr:last-child td {
    border-bottom: none;
}

.metas-dash-table tfoot td {
    background: #f8fafc;
    font-weight: 700;
    color: #0f172a;
    border-top: 2px solid #cbd5e1;
    padding: 13px 14px;
}

.row-clickable-link {
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.row-clickable-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.col-r { text-align: right; }
.col-c { text-align: center; }

.badge-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.badge-atingido {
    color: #16a34a;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.badge-atencao {
    color: #d97706;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-critico {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-sem-meta {
    color: #64748b;
    background: rgba(148, 163, 184, 0.15);
    border: 1px solid rgba(148, 163, 184, 0.3);
}

/* ==========================================================================
   NOVO DESIGN DE CADASTRO DE METAS (ALTA USABILIDADE & FOCO EM RESULTADO)
   ========================================================================== */

/* Barra de Navegação por Lojas */
.metas-store-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    background: #ffffff;
    padding: 1rem 1.4rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
}

.store-nav-title {
    font-size: 0.84rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.store-nav-pills {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.store-nav-pill {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.store-nav-pill:hover {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}

.store-nav-pill.active {
    background: #2563eb;
    color: #ffffff;
    border-color: #1d4ed8;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
    font-weight: 700;
}

.store-nav-pill.pill-rede {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.store-nav-pill.pill-rede.active {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

/* Card Resumo da Loja e Toolbar de Ações */
.metas-cadastro-summary-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 1.4rem 1.75rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: relative;
}

.summary-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}

.summary-store-name {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

.summary-store-sub {
    font-size: 0.82rem;
    color: #64748b;
    margin: 2px 0 0 0;
}

.summary-actions-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-group-quick {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.btn-quick-calc {
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    border: none;
    background: transparent;
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-quick-calc:hover {
    background: #ffffff;
    color: #2563eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.metas-btn-save-master {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.65rem 1.4rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    background: #16a34a;
    color: #ffffff;
    border: 1px solid #15803d;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.25);
    transition: all 0.2s;
}

.metas-btn-save-master:hover {
    background: #15803d;
}

.summary-kpis-deck {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width: 960px) {
    .summary-kpis-deck {
        grid-template-columns: repeat(2, 1fr);
    }
}

.summary-kpi-item {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
}

.summary-kpi-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 2px;
}

.summary-kpi-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.summary-kpi-detail {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 3px;
    font-weight: 500;
}

/* Grid de Cards das Categorias */
.metas-category-edit-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.category-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.25rem 1.6rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    display: grid;
    grid-template-columns: 240px 1fr 1fr;
    align-items: center;
    gap: 1.75rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.category-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

@media (max-width: 1100px) {
    .category-card {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

.cat-header-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cat-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cat-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
}

.cat-share-badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: #2563eb;
    background: #eff6ff;
    padding: 2px 6px;
    border-radius: 6px;
}

.cat-baseline-info {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 4px;
    line-height: 1.4;
}

.cat-baseline-info strong {
    color: #1e293b;
}

/* Tabela Executiva de Arbitragem de Metas */
.input-table-meta-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    padding: 2px 0;
}

.input-table-meta-row {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0 8px;
    transition: all 0.2s;
    width: 100%;
    max-width: 200px;
}

.input-table-meta-row:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.input-table-meta-prefix {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    margin-right: 4px;
}

.input-table-meta {
    border: none;
    outline: none;
    font-family: monospace;
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
    width: 100%;
    padding: 5px 0;
    text-align: right;
    background: transparent;
}

.table-shortcuts-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-table-shortcut {
    padding: 2px 6px;
    font-size: 0.68rem;
    font-weight: 700;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-table-shortcut:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #1d4ed8;
}

.sub-cell-detail {
    font-size: 0.72rem;
    color: #64748b;
    display: block;
    line-height: 1.2;
}
    font-family: monospace;
}

.math-box-val.font-highlight {
    color: #b45309;
}

.math-box-sub {
    font-size: 0.68rem;
    color: #64748b;
    line-height: 1.25;
}

.math-sign {
    font-size: 1.1rem;
    font-weight: 800;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Bloco de Entrada da Meta */
.cat-input-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.input-main-label {
    font-size: 0.74rem;
    font-weight: 700;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.cat-quick-shortcuts {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-pill-shortcut {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-pill-shortcut:hover {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}

.meta-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.meta-currency-prefix {
    position: absolute;
    left: 12px;
    font-weight: 700;
    font-size: 0.95rem;
    color: #94a3b8;
    pointer-events: none;
}

.input-meta-primary {
    width: 100%;
    padding: 0.65rem 0.85rem 0.65rem 36px;
    border-radius: 8px;
    border: 2px solid #cbd5e1;
    background: #ffffff;
    font-size: 1.15rem;
    font-weight: 800;
    font-family: monospace;
    color: #0f172a;
    text-align: right;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s;
}

.input-meta-primary:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.cat-dynamic-indicators {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.indicator-growth {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.toast-floating-banner {
    position: absolute;
    top: 14px;
    right: 20px;
    background: #16a34a;
    color: #ffffff;
    padding: 0.45rem 1rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
    animation: fadeInToast 0.2s ease-in-out;
}

@keyframes fadeInToast {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   POPUP MODAL: DETALHAMENTO DE NOTAS E PRODUTOS DO IMPOSTO (ICMS)
   ========================================================================== */
.cell-tax-clickable {
    cursor: pointer !important;
    position: relative;
    transition: all 0.15s ease-in-out;
}

.cell-tax-clickable strong {
    text-decoration: underline dotted #94a3b8;
    text-underline-offset: 3px;
}

.cell-tax-clickable:hover {
    background-color: #eff6ff !important;
}

.cell-tax-clickable:hover strong {
    color: #2563eb !important;
    text-decoration: underline solid #2563eb;
}

.tax-modal-box {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 1260px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.28);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleIn {
    from {
        opacity: 0;
        transform: scale(0.97);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.tax-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
}

.tax-modal-title-area {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tax-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 6px;
    background: #f1f5f9;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.tax-badge-cat {
    background: #e0e7ff;
    color: #3730a3;
}

.tax-badge-tipo {
    background: #dcfce7;
    color: #15803d;
}

.tax-badge-tipo.debito {
    background: #fee2e2;
    color: #b91c1c;
}

.tax-badge-trib {
    background: #f3e8ff;
    color: #7e22ce;
}

.tax-modal-title {
    font-size: 1.22rem;
    font-weight: 800;
    color: #0f172a;
    margin: 4px 0 2px 0;
}

.tax-modal-sub {
    font-size: 0.82rem;
    color: #64748b;
    margin: 0;
}

.tax-modal-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.15s;
}

.tax-modal-close:hover {
    color: #0f172a;
}

.tax-modal-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.75rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.tax-tabs-group {
    display: flex;
    gap: 6px;
    background: #e2e8f0;
    padding: 3px;
    border-radius: 8px;
}

.tax-tab-btn {
    border: none;
    background: transparent;
    padding: 0.45rem 1rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.tax-tab-btn:hover {
    color: #1e293b;
}

.tax-tab-btn.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tax-trib-selector {
    display: flex;
    align-items: center;
    gap: 3px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 2px 4px;
}

.tax-trib-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    padding: 0 4px 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tax-trib-btn {
    border: none;
    background: transparent;
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.tax-trib-btn:hover {
    color: #1e293b;
    background: #f1f5f9;
}

.tax-trib-btn.active {
    background: #7e22ce;
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(126, 34, 206, 0.25);
}

.text-purple {
    color: #7e22ce !important;
}

.tax-col-trib {
    font-family: monospace;
    font-size: 0.82rem;
}

.tax-val-icms {
    color: #0369a1;
}

.tax-val-pis {
    color: #b45309;
}

.tax-val-cofins {
    color: #c026d3;
}

.tax-val-total {
    font-weight: 800;
}

.tax-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 320px;
}

.tax-search-icon {
    position: absolute;
    left: 10px;
    color: #94a3b8;
    pointer-events: none;
}

.tax-search-input {
    width: 100%;
    padding: 0.5rem 0.85rem 0.5rem 34px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    font-size: 0.85rem;
    color: #0f172a;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s;
}

.tax-search-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.tax-kpi-bar {
    display: flex;
    gap: 1.5rem;
    padding: 0.75rem 1.75rem;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    flex-wrap: wrap;
}

.tax-kpi-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tax-kpi-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tax-kpi-val {
    font-size: 1.05rem;
    font-weight: 800;
    font-family: monospace;
    color: #0f172a;
}

.tax-table-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    max-height: 52vh;
    background: #ffffff;
}

.tax-details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}

.tax-details-table thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    color: #475569;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid #e2e8f0;
    z-index: 5;
    white-space: nowrap;
}

.tax-details-table tbody td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

.tax-details-table tbody tr:hover {
    background-color: #f8fafc;
}

.tax-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1.75rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 12px;
}

.tax-footer-note {
    font-size: 0.75rem;
    color: #64748b;
}

.model-tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    font-family: monospace;
}

.model-tag.nfe-55 {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.model-tag.nfce-65 {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

/* ==========================================================================
   PAINEL DE RUPTURA OPERACIONAL & COMPORTAMENTO DE COMPRA DO CLIENTE
   ========================================================================== */
.rupture-panel-container {
    border-top: 4px solid #ef4444;
}

.rupture-header-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.rupture-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rupture-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rupture-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
    font-size: 0.70rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.rupture-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-export-rupture-pdf {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #0A58CA;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 9px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(10, 88, 202, 0.25);
    transition: all 0.2s ease;
}

.btn-export-rupture-pdf:hover {
    background: #084298;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(10, 88, 202, 0.35);
}

.btn-refresh-rupture {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    color: #334155;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-refresh-rupture:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

.rupture-filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-top: 16px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.rupture-filter-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 180px;
}

.rupture-filter-item.flex-search {
    flex: 1;
    min-width: 220px;
}

.rupture-filter-item label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.metas-input-search {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #0f172a;
    background: #ffffff;
    outline: none;
    transition: all 0.2s ease;
}

.metas-input-search:focus {
    border-color: #0A58CA;
    box-shadow: 0 0 0 3px rgba(10, 88, 202, 0.12);
}

.rupture-kpis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.rupture-kpi-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease;
}

.rupture-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.rupture-kpi-card.card-danger {
    border-left: 4px solid #ef4444;
}

.rupture-kpi-card.card-primary {
    border-left: 4px solid #0A58CA;
}

.rupture-kpi-card.card-warning {
    border-left: 4px solid #f59e0b;
}

.rupture-kpi-card.card-purple {
    border-left: 4px solid #8b5cf6;
}

.kpi-icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-icon-wrap.icon-red {
    background: #fef2f2;
    color: #dc2626;
}

.kpi-icon-wrap.icon-blue {
    background: #eff6ff;
    color: #0A58CA;
}

.kpi-icon-wrap.icon-amber {
    background: #fffbeb;
    color: #d97706;
}

.kpi-icon-wrap.icon-purple {
    background: #f5f3ff;
    color: #7c3aed;
}

.rupture-kpi-label {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.rupture-kpi-val {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.2;
}

.rupture-kpi-val.text-red {
    color: #dc2626;
}

.rupture-kpi-val.text-blue {
    color: #0A58CA;
}

.rupture-kpi-val.text-amber {
    color: #d97706;
}

.rupture-kpi-val.text-purple {
    color: #7c3aed;
}

.rupture-kpi-sub {
    display: block;
    font-size: 0.70rem;
    color: #94a3b8;
    margin-top: 2px;
}

.badge-ruptura-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.badge-normal-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
}


