:is(.cms-environment-dashboard, .page-automacoes-v5, .amb-col-config-panel) {
    --cms-action-icon-size: 16px;
}

:is(.cms-environment-dashboard, .page-automacoes-v5) .lc-iconlink > .content > svg,
:is(.cms-environment-dashboard, .page-automacoes-v5) button > svg,
:is(.cms-environment-dashboard, .page-automacoes-v5) .card-frame-header-content .block-icons .icon > svg,
.amb-col-config-panel button > svg {
    width: var(--cms-action-icon-size) !important;
    height: var(--cms-action-icon-size) !important;
    padding: 0 !important;
    flex-shrink: 0;
}

:is(.cms-environment-dashboard, .page-automacoes-v5) :is(.lc-iconlink > .content > i, .amb-vm-act > i) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--cms-action-icon-size);
    height: var(--cms-action-icon-size);
    font-size: var(--cms-action-icon-size) !important;
    line-height: 1;
}

.dashboard-saas .graph-card {
  background-color: #FFF;
  height: 250px;
  width: 350px;
  margin-right: 10px !important;
  margin-bottom: 10px !important;
}
.dashboard-saas .graph-card .graph-card-body .graph-card-title {
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 1rem;
  line-height: 160%;
  padding-bottom: 0rem;
}
.dashboard-saas .graph-card .graph-card-body .graph-card-subtitle {
  padding-top: 0rem;
}
.dashboard-saas .graph-card .graph-card-body .graph-card-subtitle span {
  font-family: "Inter", sans-serif;
  font-weight: 500;
  font-size: 0.8rem;
  line-height: 160%;
  color: #434a63;
}
.dashboard-saas .graph-card .graph-card-body .graph-card-subtitle canvas {
  padding-top: 1rem;
}
.dashboard-saas .button {
  width: 7rem;
}
/* ─── Forçar sincronização CSP (mesma paleta do CSP Sync Monitor) ─── */
.fsync {
    --fsync-ink: #111827;
    --fsync-text: #374151;
    --fsync-muted: #6b7280;
    --fsync-line: #e5e7eb;
    --fsync-soft-line: #f3f4f6;
    --fsync-blue: #2563eb;
    --fsync-green: #16a34a;
    --fsync-amber: #ca8a04;
    --fsync-red: #dc2626;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 100%;
    padding: 0 8px 16px;
    color: var(--fsync-text);
}

.fsync-panel {
    background: #fff;
    border: 1px solid var(--fsync-line);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 16px;
}

.fsync-panel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--fsync-soft-line);
}
.fsync-panel__head h2 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--fsync-ink);
}
.fsync-panel__head span { font-size: 11px; color: var(--fsync-muted); }
.fsync-panel__actions { display: flex; align-items: center; gap: 10px; }

/* ─── Formulário ─── */
.fsync-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 20px;
}
.fsync-field { display: flex; flex-direction: column; gap: 4px; }
.fsync-label { font-size: 11px; color: var(--fsync-muted); }
.fsync-client { display: flex; flex-direction: column; font-size: 13px; font-weight: 600; color: var(--fsync-ink); }
.fsync-client small { font-size: 11px; font-weight: 400; color: var(--fsync-muted); }
.fsync-field select {
    height: 28px;
    min-width: 120px;
    padding: 0 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    color: var(--fsync-ink);
    font-size: 12px;
}
.fsync-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 380px;
    font-size: 12px;
    color: var(--fsync-ink);
    cursor: pointer;
}
.fsync-check input { margin-top: 2px; }
.fsync-check small { display: block; margin-top: 2px; font-size: 11px; color: var(--fsync-muted); }

.fsync-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    margin-left: auto;
    padding: 0 14px;
    border: 0;
    border-radius: 6px;
    background: var(--fsync-blue);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.fsync-primary:disabled { background: #9ca3af; cursor: not-allowed; }
.fsync-primary svg { font-size: 16px; }

.fsync-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--fsync-blue);
    font-size: 12px;
    cursor: pointer;
}

/* ─── Avisos ─── */
.fsync-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
}
.fsync-notice > svg { flex: 0 0 auto; font-size: 20px; }
.fsync-notice div { display: flex; flex-direction: column; gap: 2px; }
.fsync-notice span { color: var(--fsync-text); }
.fsync-notice button {
    margin-left: auto;
    padding: 5px 10px;
    border: 1px solid currentColor;
    border-radius: 4px;
    background: transparent;
    color: inherit;
    font-size: 12px;
    cursor: pointer;
}
.fsync-notice--warn { background: rgba(234, 179, 8, 0.08); border: 1px solid rgba(234, 179, 8, 0.3); color: var(--fsync-amber); }
.fsync-notice--err { background: rgba(239, 68, 68, 0.06); border: 1px solid rgba(239, 68, 68, 0.3); color: var(--fsync-red); }

/* ─── Andamento ─── */
.fsync-phases {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-gap: 12px;
    gap: 12px;
    margin-bottom: 12px;
}
.fsync-phase {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--fsync-line);
    border-radius: 8px;
    font-size: 12px;
}
.fsync-phase > svg { flex: 0 0 auto; margin-top: 1px; font-size: 18px; }
.fsync-phase div { display: flex; flex-direction: column; gap: 2px; }
.fsync-phase strong { color: var(--fsync-ink); font-weight: 600; }
.fsync-phase span { color: var(--fsync-muted); font-size: 11px; }
.fsync-phase--done > svg { color: var(--fsync-green); }
.fsync-phase--active { border-color: rgba(37, 99, 235, 0.4); background: rgba(59, 130, 246, 0.05); }
.fsync-phase--active > svg { color: var(--fsync-blue); }
.fsync-phase--pending > svg, .fsync-phase--skipped > svg { color: #9ca3af; }
.fsync-phase--skipped strong { color: var(--fsync-muted); }

.fsync-spin { animation: fsync-spin 1s linear infinite; }
@keyframes fsync-spin { to { transform: rotate(360deg); } }

.fsync-message { margin: 0 0 12px; font-size: 12px; }
.fsync-message--ok { color: var(--fsync-green); }
.fsync-message--err { color: var(--fsync-red); }
.fsync-message--warn { color: var(--fsync-amber); }

/* ─── Resultado ─── */
.fsync-result {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-gap: 12px;
    gap: 12px;
    margin-bottom: 12px;
}
.fsync-result > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f9fafb;
}
.fsync-result span { font-size: 11px; color: var(--fsync-muted); }
.fsync-result strong { font-size: 18px; font-weight: 600; color: var(--fsync-ink); font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
.fsync-result small { font-size: 11px; color: var(--fsync-muted); }

/* ─── Tabelas ─── */
.fsync-table-wrap { overflow-x: auto; }
.fsync-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.fsync-table th {
    padding: 6px 8px;
    border-bottom: 2px solid var(--fsync-line);
    color: var(--fsync-muted);
    font-size: 11px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}
.fsync-table td { padding: 6px 8px; border-bottom: 1px solid var(--fsync-soft-line); }
.fsync-table .r { text-align: right; font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }
.fsync-table tr:hover { background: #f9fafb; }
.fsync-table tr:last-child td { border-bottom: none; }
.fsync-table--steps { margin-top: 4px; }
.fsync-detail { max-width: 480px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fsync-muted); }

.fsync-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.fsync-badge--ok { background: rgba(34, 197, 94, 0.1); color: var(--fsync-green); }
.fsync-badge--warn { background: rgba(234, 179, 8, 0.1); color: var(--fsync-amber); }
.fsync-badge--err { background: rgba(239, 68, 68, 0.1); color: var(--fsync-red); }
.fsync-badge--info { background: rgba(59, 130, 246, 0.1); color: var(--fsync-blue); }

.fsync-empty { margin: 0; padding: 20px; text-align: center; color: #9ca3af; font-size: 13px; }

@media (max-width: 900px) {
    .fsync-phases, .fsync-result { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fsync-primary { margin-left: 0; }
}

@media (max-width: 600px) {
    .fsync-phases { grid-template-columns: minmax(0, 1fr); }
}

/* ── Layout base ──────────────────────────────────────────────────────── */
.lcdashboard.csp-billing-review .card-frame:hover {
    box-shadow: none;
}

/* ── Aviso de acesso restrito ─────────────────────────────────────────── */
.csp-billing-review .access-denied {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
    gap: 16px;
    color: #666;
    color: var(--color-text-secondary, #666);
}

.csp-billing-review .access-denied svg {
    font-size: 64px;
    color: #d32f2f;
    color: var(--color-danger, #d32f2f);
    opacity: 0.5;
}

.csp-billing-review .access-denied h2 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    color: var(--color-text-primary, #333);
}

.csp-billing-review .access-denied p {
    font-size: 13px;
    max-width: 400px;
    text-align: center;
}

/* ── Relatório não gerado ─────────────────────────────────────────────── */
.csp-billing-review .report-not-generated {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
    gap: 8px;
    color: #666;
    color: var(--color-text-secondary, #666);
}

.csp-billing-review .report-not-generated h2 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    color: var(--color-text-primary, #333);
    margin: 0;
}

.csp-billing-review .report-not-generated p {
    font-size: 13px;
    max-width: 420px;
    text-align: center;
    margin: 0;
}

.csp-billing-review .generate-report-btn {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    background: #1976d2;
    background: var(--color-primary, #1976d2);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

.csp-billing-review .generate-report-btn:hover:not(:disabled) {
    background: #1565c0;
    background: var(--color-primary-dark, #1565c0);
}

.csp-billing-review .generate-report-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ── Cards de resumo (dentro de LCDashboard cards) ────────────────────── */
.lcdashboard.csp-billing-review .summary-card-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    height: 100%;
}

.lcdashboard.csp-billing-review .summary-card-value {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    color: var(--color-text-primary, #333);
}

.lcdashboard.csp-billing-review .summary-card-value.positive {
    color: #2e7d32;
    color: var(--color-success, #2e7d32);
}

.lcdashboard.csp-billing-review .summary-card-value.info {
    color: #1565c0;
    color: var(--color-info, #1565c0);
}

.lcdashboard.csp-billing-review .summary-card-value.warn {
    color: #e65100;
    color: var(--color-warning, #e65100);
}

.lcdashboard.csp-billing-review .summary-card-sub {
    font-size: 11px;
    color: #888;
    color: var(--color-text-secondary, #888);
}

/* ── Top Tab Bar (Reconciliação / Consumo Diário) ─────────────────────── */
.csp-billing-review .top-tab-bar {
    display: flex;
    gap: 0;
    padding: 0 8px;
    margin-bottom: 16px;
    border-bottom: 2px solid #e0e0e0;
    border-bottom: 2px solid var(--color-border, #e0e0e0);
}

.csp-billing-review .top-tab {
    padding: 10px 24px;
    border: none;
    background: transparent;
    color: #666;
    color: var(--color-text-secondary, #666);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    display: flex;
    align-items: center;
}

.csp-billing-review .top-tab:hover {
    color: #333;
    color: var(--color-text-primary, #333);
    background: #e3f2fd;
    background: var(--color-primary-light, #e3f2fd);
    border-radius: 6px 6px 0 0;
}

.csp-billing-review .top-tab.active {
    color: #1565c0;
    color: var(--color-primary, #1565c0);
    border-bottom-color: #1565c0;
    border-bottom-color: var(--color-primary, #1565c0);
    font-weight: 600;
}

/* ── Sub Tabs ─────────────────────────────────────────────────────────── */
.csp-billing-review .view-tabs {
    display: flex;
    gap: 4px;
    padding: 0 8px;
    margin-bottom: 12px;
}

.csp-billing-review .view-tab {
    padding: 6px 16px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    border: 1px solid var(--color-border, #e0e0e0);
    background: #fff;
    background: var(--color-surface, #fff);
    color: #666;
    color: var(--color-text-secondary, #666);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.csp-billing-review .view-tab:hover {
    background: #e3f2fd;
    background: var(--color-primary-light, #e3f2fd);
}

.csp-billing-review .view-tab.active {
    background: #1565c0;
    background: var(--color-primary, #1565c0);
    color: #fff;
    border-color: #1565c0;
    border-color: var(--color-primary, #1565c0);
}

/* ── Badges ───────────────────────────────────────────────────────────── */
.csp-billing-review .fonte-badge {
    display: inline-block;
    background: #e3f2fd;
    background: var(--color-primary-light, #e3f2fd);
    color: #1565c0;
    color: var(--color-primary, #1565c0);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.csp-billing-review .sip-badge {
    display: inline-block;
    background: #f5f5f5;
    background: var(--color-surface-variant, #f5f5f5);
    color: #333;
    color: var(--color-text-primary, #333);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

.csp-billing-review .sip-badge-nf {
    background: #e8f5e9;
    color: #2e7d32;
}

.csp-billing-review .cell-muted {
    color: #bbb;
    color: var(--color-text-disabled, #bbb);
}

/* ── Células da tabela ────────────────────────────────────────────────── */
.csp-billing-review .cell-currency {
    text-align: right;
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

.csp-billing-review .cell-factor {
    text-align: right;
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
    color: #666;
    color: var(--color-text-secondary, #666);
}

.csp-billing-review .cell-percent {
    text-align: right;
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

.csp-billing-review .cell-percent.positive {
    color: #2e7d32;
    color: var(--color-success, #2e7d32);
}

.csp-billing-review .cell-percent.negative {
    color: #d32f2f;
    color: var(--color-danger, #d32f2f);
}

.csp-billing-review .cell-percent.zero {
    color: #999;
    color: var(--color-text-secondary, #999);
}

/* ── Destaque coluna Valor NF ─────────────────────────────────────────── */
.csp-billing-review .cell-nf-value {
    color: #2e7d32;
    color: var(--color-success, #2e7d32);
}

/* ── Indicador de cache ───────────────────────────────────────────────── */
.csp-billing-review .cache-info {
    margin-top: 2px;
    font-size: 10px;
    color: #aaa;
    color: var(--color-text-tertiary, #aaa);
    font-style: italic;
}

/* ── Step Monitor Overlay ─────────────────────────────────────────────── */
.step-monitor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.step-monitor-panel {
    background: #fff;
    background: var(--color-bg-primary, #fff);
    border-radius: 12px;
    padding: 32px;
    min-width: 420px;
    max-width: 520px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.step-monitor-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: #333;
    color: var(--color-text-primary, #333);
}

.step-monitor-subtitle {
    font-size: 13px;
    color: #888;
    color: var(--color-text-secondary, #888);
    margin: 0 0 24px 0;
}

.step-monitor-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.step-monitor-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    background: #f5f5f5;
    background: var(--color-bg-secondary, #f5f5f5);
    transition: all 0.3s ease;
}

.step-monitor-step.active {
    background: #e3f2fd;
    background: var(--color-info-bg, #e3f2fd);
    border-left: 3px solid #1976d2;
    border-left: 3px solid var(--color-info, #1976d2);
}

.step-monitor-step.success {
    background: #e8f5e9;
    background: var(--color-success-bg, #e8f5e9);
    border-left: 3px solid #2e7d32;
    border-left: 3px solid var(--color-success, #2e7d32);
}

.step-monitor-step.failed {
    background: #fce4ec;
    background: var(--color-danger-bg, #fce4ec);
    border-left: 3px solid #d32f2f;
    border-left: 3px solid var(--color-danger, #d32f2f);
}

.step-monitor-step.pending {
    opacity: 0.5;
}

.step-monitor-step .step-icon {
    font-size: 18px;
    min-width: 24px;
    text-align: center;
    line-height: 1.4;
}

.step-monitor-step .step-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.step-monitor-step .step-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    color: var(--color-text-primary, #333);
}

.step-monitor-step .step-detail {
    font-size: 11px;
    color: #888;
    color: var(--color-text-secondary, #888);
}

.step-monitor-step .step-error {
    color: #d32f2f;
    color: var(--color-danger, #d32f2f);
    font-weight: 500;
}

.step-monitor-step.active .step-icon {
    animation: pulse-spin 1.5s ease-in-out infinite;
}

@keyframes pulse-spin {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.step-monitor-close-btn {
    display: block;
    margin: 24px auto 0;
    padding: 10px 32px;
    border: none;
    border-radius: 6px;
    background: #1976d2;
    background: var(--color-primary, #1976d2);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.step-monitor-close-btn:hover {
    background: #1565c0;
    background: var(--color-primary-dark, #1565c0);
}

/* ── Row Detail Panel (detalhe contratos por customer) ────────────────── */

.row-detail-panel {
    border-top: 2px solid #1976d2;
    border-top: 2px solid var(--color-primary, #1976d2);
    background: #f8f9fb;
    background: var(--color-background-secondary, #f8f9fb);
    padding: 12px 16px;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to   { opacity: 1; max-height: 400px; }
}

.row-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.row-detail-title {
    font-size: 13px;
    color: #333;
    color: var(--color-text-primary, #333);
}

.row-detail-customer-id {
    font-size: 11px;
    color: #888;
    color: var(--color-text-secondary, #888);
    margin-left: 6px;
    font-weight: 400;
}

.row-detail-count {
    font-size: 11px;
    color: #888;
    color: var(--color-text-secondary, #888);
    background: #eee;
    background: var(--color-background-tertiary, #eee);
    padding: 2px 8px;
    border-radius: 10px;
}

.row-detail-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 18px;
    color: #888;
    color: var(--color-text-secondary, #888);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
}

.row-detail-close:hover {
    background: #ddd;
    background: var(--color-background-tertiary, #ddd);
    color: #333;
    color: var(--color-text-primary, #333);
}

.row-detail-empty {
    font-size: 12px;
    color: #999;
    color: var(--color-text-secondary, #999);
    padding: 8px 0;
    font-style: italic;
}

.row-detail-table-wrapper {
    overflow-x: auto;
    max-height: 220px;
    overflow-y: auto;
}

.row-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.row-detail-table thead th {
    position: sticky;
    top: 0;
    background: #eaedf1;
    background: var(--color-background-tertiary, #eaedf1);
    padding: 6px 10px;
    text-align: left;
    font-weight: 600;
    color: #555;
    color: var(--color-text-primary, #555);
    border-bottom: 1px solid #ddd;
    border-bottom: 1px solid var(--color-border, #ddd);
    white-space: nowrap;
}

.row-detail-table tbody td {
    padding: 5px 10px;
    border-bottom: 1px solid #eee;
    border-bottom: 1px solid var(--color-border-light, #eee);
    color: #333;
    color: var(--color-text-primary, #333);
}

.row-detail-table tbody tr:hover {
    background: #f0f4ff;
    background: var(--color-background-hover, #f0f4ff);
}

.row-detail-tenant {
    font-size: 11px;
    color: #888;
    color: var(--color-text-secondary, #888);
    font-family: monospace;
}

.status-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    padding: 1px 8px;
    border-radius: 10px;
}

.status-badge.active {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge.inactive {
    background: #fce4ec;
    color: #c62828;
}

/* ── Modal: Contratos SIP ─────────────────────────────────────────────── */

.sip-contracts-modal {
    background: #fff;
    background: var(--color-background, #fff);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    width: 92vw;
    max-width: 1200px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideDown 0.2s ease-out;
}

.sip-contracts-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px 12px;
    border-bottom: 1px solid #eee;
    border-bottom: 1px solid var(--color-border, #eee);
}

.sip-contracts-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #333;
    color: var(--color-text-primary, #333);
}

.sip-contracts-count {
    font-size: 12px;
    color: #888;
    color: var(--color-text-secondary, #888);
    background: #eee;
    background: var(--color-background-tertiary, #eee);
    padding: 2px 10px;
    border-radius: 10px;
}

.sip-contracts-filter {
    padding: 8px 20px;
}

.sip-contracts-filter-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border: 1px solid var(--color-border, #ddd);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    background: #f8f9fb;
    background: var(--color-background-secondary, #f8f9fb);
    color: #333;
    color: var(--color-text-primary, #333);
    transition: border-color 0.2s;
}

.sip-contracts-filter-input:focus {
    border-color: #1976d2;
    border-color: var(--color-primary, #1976d2);
}

.sip-contracts-filter-input::placeholder {
    color: #aaa;
    color: var(--color-text-secondary, #aaa);
}

.sip-contracts-table-wrapper {
    flex: 1 1;
    min-height: 0;
    padding: 0 4px 4px;
}

/* ── RevoGrid cell helpers (SIP contracts) ────────────────────────────── */

.sip-contracts-table-wrapper revo-grid {
    font-size: 12px;
}

.revo-cell--right {
    text-align: right;
}

.revo-cell-status-active {
    color: #2e7d32;
    font-weight: 500;
}

.revo-cell-status-inactive {
    color: #c62828;
    font-weight: 500;
}

/* ── Modal: Histórico 3 meses ─────────────────────────────────────────── */

.history-modal {
    height: auto;
    max-height: 80vh;
}

.history-table-wrapper {
    overflow-x: auto;
}

.history-table tbody td {
    vertical-align: middle;
}

.history-row-current {
    background: #e3f2fd !important;
    background: var(--color-info-bg, #e3f2fd) !important;
}

.history-current-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    background: #1976d2;
    background: var(--color-primary, #1976d2);
    color: #fff;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 6px;
    vertical-align: middle;
}

.history-variation {
    display: block;
    font-size: 10px;
    margin-top: 2px;
}

.history-variation.up {
    color: #d32f2f;
    color: var(--color-danger, #d32f2f);
}

.history-variation.down {
    color: #2e7d32;
    color: var(--color-success, #2e7d32);
}

.history-totals-row {
    background: #eaedf1;
    background: var(--color-background-tertiary, #eaedf1);
}

.history-totals-row td {
    border-top: 2px solid #ccc;
    border-top: 2px solid var(--color-border, #ccc);
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

