/* ==========================================================================
   DESCOMPLICAI REFORMA TRIBUTÁRIA
   Design System DescomplicAI + Prototype Layout & Components
   ========================================================================== */

/* --- Container & Headers --- */
.reforma-container {
    padding: 8px 4px 32px 4px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.reforma-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 4px;
}

.reforma-title-group h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text-primary, #102a43);
    margin: 0 0 4px 0;
    line-height: 1.2;
    font-family: var(--font-family-display, 'DM Sans', sans-serif);
}

.reforma-title-group p {
    font-size: 13px;
    color: var(--color-text-secondary, #627d98);
    margin: 0;
}

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

/* --- Status KPI Cards (Top Metrics) --- */
.reforma-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.reforma-kpi-card {
    background: var(--color-surface-card, #ffffff);
    border: 1px solid var(--color-border-subtle, #e2e8f0);
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.reforma-kpi-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.reforma-kpi-card.blue {
    background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 100%);
    border-color: #bfdbfe;
}
.reforma-kpi-card.green {
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
    border-color: #bbf7d0;
}
.reforma-kpi-card.orange {
    background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%);
    border-color: #fed7aa;
}
.reforma-kpi-card.purple {
    background: linear-gradient(135deg, #faf5ff 0%, #ffffff 100%);
    border-color: #e9d5ff;
}

.reforma-kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.reforma-kpi-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.reforma-kpi-card.blue .reforma-kpi-title { color: #1d4ed8; }
.reforma-kpi-card.green .reforma-kpi-title { color: #15803d; }
.reforma-kpi-card.orange .reforma-kpi-title { color: #c2410c; }
.reforma-kpi-card.purple .reforma-kpi-title { color: #7e22ce; }

.reforma-kpi-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.reforma-kpi-card.blue .reforma-kpi-icon { background: #dbeafe; color: #1e40af; }
.reforma-kpi-card.green .reforma-kpi-icon { background: #dcfce7; color: #166534; }
.reforma-kpi-card.orange .reforma-kpi-icon { background: #ffedd5; color: #9a3412; }
.reforma-kpi-card.purple .reforma-kpi-icon { background: #f3e8ff; color: #6b21a8; }

.reforma-kpi-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--color-text-primary, #0f172a);
    font-family: var(--font-family-display, 'DM Sans', sans-serif);
    margin-bottom: 4px;
}

.reforma-kpi-subtext {
    font-size: 12px;
    color: var(--color-text-secondary, #64748b);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* --- Credit 5 Canonical Status Cards --- */
.reforma-credit-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
}

.reforma-credit-card {
    background: var(--color-surface-card, #ffffff);
    border: 1px solid var(--color-border-subtle, #e2e8f0);
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.reforma-credit-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.reforma-credit-card.active {
    border-width: 2px;
}

.reforma-credit-card.pendente { border-top: 4px solid #f59e0b; }
.reforma-credit-card.pendente.active { border-color: #f59e0b; background: #fffbeb; }

.reforma-credit-card.parcial { border-top: 4px solid #0284c7; }
.reforma-credit-card.parcial.active { border-color: #0284c7; background: #f0f9ff; }

.reforma-credit-card.elegivel { border-top: 4px solid #10b981; }
.reforma-credit-card.elegivel.active { border-color: #10b981; background: #ecfdf5; }

.reforma-credit-card.bloqueado { border-top: 4px solid #ef4444; }
.reforma-credit-card.bloqueado.active { border-color: #ef4444; background: #fef2f2; }

.reforma-credit-card.utilizado { border-top: 4px solid #6b7280; }
.reforma-credit-card.utilizado.active { border-color: #6b7280; background: #f9fafb; }

.reforma-credit-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.reforma-credit-card-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary, #475569);
}

.reforma-credit-card-value {
    font-size: 19px;
    font-weight: 700;
    color: var(--color-text-primary, #0f172a);
    margin-bottom: 2px;
}

.reforma-credit-card-count {
    font-size: 11px;
    color: var(--color-text-muted, #94a3b8);
}

/* --- 4 Integration Source Cards (ROC) --- */
.reforma-integration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.reforma-integration-card {
    background: var(--color-surface-card, #ffffff);
    border: 1px solid var(--color-border-subtle, #e2e8f0);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
}

.reforma-integration-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.reforma-integration-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.reforma-integration-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 2px 0;
    color: var(--color-text-primary, #0f172a);
}

.reforma-integration-info p {
    font-size: 11px;
    color: var(--color-text-secondary, #64748b);
    margin: 0;
}

.reforma-integration-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--color-border-subtle, #f1f5f9);
}

/* --- Tab Navigation --- */
.reforma-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--color-border-subtle, #e2e8f0);
    padding-bottom: 0;
}

.reforma-tab-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary, #64748b);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.reforma-tab-btn:hover {
    color: var(--palette-primary-medium, #2f6fa8);
}

.reforma-tab-btn.active {
    color: var(--palette-primary-medium, #2f6fa8);
    border-bottom-color: var(--palette-primary-medium, #2f6fa8);
}

/* --- Filter Bar / Frame --- */
.reforma-filter-bar {
    background: var(--color-surface-card, #ffffff);
    border: 1px solid var(--color-border-subtle, #e2e8f0);
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px;
}

.reforma-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 160px;
}

.reforma-filter-group label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-secondary, #64748b);
    margin: 0;
}

.reforma-filter-group input,
.reforma-filter-group select {
    height: 38px;
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid var(--color-border-subtle, #cbd5e1);
    background: var(--color-surface-elevated, #ffffff);
    color: var(--color-text-primary, #0f172a);
    outline: none;
    transition: border-color 0.15s ease;
}

.reforma-filter-group input:focus,
.reforma-filter-group select:focus {
    border-color: var(--palette-primary-medium, #2f6fa8);
}

/* --- Tables & Lists --- */
.reforma-card {
    background: var(--color-surface-card, #ffffff);
    border: 1px solid var(--color-border-subtle, #e2e8f0);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.reforma-card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--color-border-subtle, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-surface-canvas, #f8fafc);
}

.reforma-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text-primary, #0f172a);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reforma-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.reforma-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    text-align: left;
}

.reforma-table th {
    background: var(--color-surface-canvas, #f8fafc);
    color: var(--color-text-secondary, #475569);
    font-weight: 600;
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-border-subtle, #e2e8f0);
    white-space: nowrap;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.03em;
}

.reforma-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--color-border-subtle, #f1f5f9);
    color: var(--color-text-primary, #1e293b);
    vertical-align: middle;
}

.reforma-table tr:hover td {
    background-color: var(--color-surface-muted, #f8fafc);
}

/* --- Status Badges / Pills --- */
.reforma-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.reforma-badge.elegivel,
.reforma-badge.success {
    background: #dcfce7;
    color: #15803d;
}

.reforma-badge.pendente,
.reforma-badge.warning {
    background: #fef3c7;
    color: #b45309;
}

.reforma-badge.parcial,
.reforma-badge.info {
    background: #e0f2fe;
    color: #0369a1;
}

.reforma-badge.bloqueado,
.reforma-badge.danger {
    background: #fee2e2;
    color: #b91c1c;
}

.reforma-badge.utilizado,
.reforma-badge.secondary {
    background: #f1f5f9;
    color: #475569;
}

/* --- Buttons --- */
.reforma-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    text-decoration: none;
}

.reforma-btn-primary {
    background: var(--palette-primary-medium, #2f6fa8);
    color: #ffffff;
}
.reforma-btn-primary:hover {
    background: var(--palette-primary-dark, #255a8a);
}

.reforma-btn-secondary {
    background: var(--color-surface-elevated, #ffffff);
    border-color: var(--color-border-subtle, #cbd5e1);
    color: var(--color-text-primary, #334155);
}
.reforma-btn-secondary:hover {
    background: var(--color-surface-muted, #f1f5f9);
    border-color: #94a3b8;
}

.reforma-btn-sm {
    padding: 4px 8px;
    font-size: 11.5px;
    border-radius: 4px;
}

/* --- Modals --- */
.reforma-modal-backdrop,
.reforma-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    padding: 20px;
}

.reforma-modal {
    background: #ffffff;
    background: var(--color-surface-card, #ffffff);
    border-radius: 12px;
    border: 1px solid var(--color-border-subtle, #e2e8f0);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: reformaModalFadeIn 0.2s ease-out;
}

.reforma-modal-sm { max-width: 480px; }
.reforma-modal-md { max-width: 650px; }
.reforma-modal-lg { max-width: 900px; }
.reforma-modal-xl { max-width: 1300px; width: 92vw; }
.reforma-modal-xxl { max-width: 1850px; width: 98vw; }
.reforma-modal-fluid { max-width: 98vw; width: 98vw; }

@keyframes reformaModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(-8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.reforma-modal-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--color-border-subtle, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-surface-card, #ffffff);
}

.reforma-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-primary, #0f172a);
    margin: 0;
}

.reforma-modal-body {
    padding: 22px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--color-surface-card, #ffffff);
    flex: 1;
}

.reforma-modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--color-border-subtle, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    background: var(--color-surface-canvas, #f8fafc);
}

/* --- Dark Mode Overrides --- */
[data-theme="dark"] .reforma-title-group h1,
[data-theme="dark"] .reforma-kpi-value,
[data-theme="dark"] .reforma-credit-card-value,
[data-theme="dark"] .reforma-card-title,
[data-theme="dark"] .reforma-modal-title {
    color: #f1f5f9;
}

[data-theme="dark"] .reforma-kpi-card {
    background: #1e293b;
    border-color: #334155;
}
[data-theme="dark"] .reforma-kpi-card.blue { background: linear-gradient(135deg, #172554 0%, #1e293b 100%); border-color: #1e3a8a; }
[data-theme="dark"] .reforma-kpi-card.green { background: linear-gradient(135deg, #052e16 0%, #1e293b 100%); border-color: #14532d; }
[data-theme="dark"] .reforma-kpi-card.orange { background: linear-gradient(135deg, #431407 0%, #1e293b 100%); border-color: #7c2d12; }

[data-theme="dark"] .reforma-card,
[data-theme="dark"] .reforma-credit-card,
[data-theme="dark"] .reforma-integration-card,
[data-theme="dark"] .reforma-filter-bar,
[data-theme="dark"] .reforma-modal {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .reforma-card-header,
[data-theme="dark"] .reforma-table th,
[data-theme="dark"] .reforma-modal-footer {
    background: #0f172a;
    border-color: #334155;
}

[data-theme="dark"] .reforma-table td {
    border-color: #334155;
    color: #e2e8f0;
}

[data-theme="dark"] .reforma-table tr:hover td {
    background: #334155;
}

[data-theme="dark"] .reforma-filter-group input,
[data-theme="dark"] .reforma-filter-group select {
    background: #0f172a;
    border-color: #475569;
    color: #f1f5f9;
}


/* --- Eventos SEFAZ - Emissor Dinâmico & Layout --- */
.reforma-grid-2 {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 1024px) {
    .reforma-grid-2 {
        grid-template-columns: 1fr;
    }
}

.reforma-card {
    background: var(--color-surface-card, #ffffff);
    border: 1px solid var(--color-border-subtle, #e2e8f0);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.reforma-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border-subtle, #e2e8f0);
    padding-bottom: 14px;
    margin-bottom: 18px;
}

.reforma-card-header h3, .reforma-card-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-primary, #102a43);
    display: flex;
    align-items: center;
    gap: 8px;
}

.reforma-form-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 14px 16px;
}

.reforma-col-12 { grid-column: span 12; }
.reforma-col-8 { grid-column: span 8; }
.reforma-col-6 { grid-column: span 6; }
.reforma-col-4 { grid-column: span 4; }
.reforma-col-3 { grid-column: span 3; }
.reforma-col-2 { grid-column: span 2; }

.reforma-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.reforma-form-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary, #486581);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reforma-form-control, .reforma-form-select {
    width: 100%;
    padding: 9px 12px;
    font-size: 13px;
    font-family: inherit;
    color: var(--color-text-primary, #102a43);
    background-color: var(--color-surface-input, #ffffff);
    border: 1px solid var(--color-border-subtle, #cbd5e1);
    border-radius: 8px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.reforma-form-control:focus, .reforma-form-select:focus {
    outline: none;
    border-color: var(--primary-color, #2f6fa8);
    box-shadow: 0 0 0 3px rgba(47, 111, 168, 0.15);
}

.reforma-form-control.font-mono {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.reforma-dynamic-schema-box {
    background: var(--color-surface-subtle, #f8fafc);
    border: 1px solid var(--color-border-subtle, #e2e8f0);
    border-radius: 10px;
    padding: 16px;
    margin-top: 14px;
    margin-bottom: 18px;
}

.reforma-schema-header {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-color, #2f6fa8);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.reforma-steps-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border-subtle, #e2e8f0);
}

.reforma-btn-step {
    flex: 1;
    min-width: 120px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid var(--color-border-subtle, #cbd5e1);
    background: var(--color-surface-card, #ffffff);
    color: var(--color-text-primary, #102a43);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.reforma-btn-step:hover:not(:disabled) {
    border-color: var(--primary-color, #2f6fa8);
    color: var(--primary-color, #2f6fa8);
    background: rgba(47, 111, 168, 0.04);
}

.reforma-btn-step.primary {
    background: var(--primary-color, #2f6fa8);
    color: #ffffff;
    border-color: var(--primary-color, #2f6fa8);
}

.reforma-btn-step.primary:hover:not(:disabled) {
    background: #255a8a;
}

.reforma-btn-step.success {
    background: #10b981;
    color: #ffffff;
    border-color: #10b981;
}

.reforma-btn-step.success:hover:not(:disabled) {
    background: #059669;
}

.reforma-btn-step:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.reforma-xml-viewer {
    background: #0f172a;
    color: #e2e8f0;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 12px;
    line-height: 1.5;
    padding: 16px;
    border-radius: 8px;
    overflow: auto;
    max-height: 480px;
    white-space: pre-wrap;
    word-break: break-all;
    border: 1px solid #1e293b;
}

.reforma-xml-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--color-border-subtle, #e2e8f0);
    margin-bottom: 14px;
    padding-bottom: 8px;
}

.reforma-xml-tab {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--color-text-secondary, #627d98);
    cursor: pointer;
    transition: all 0.2s;
}

.reforma-xml-tab.active {
    background: var(--color-surface-subtle, #e2e8f0);
    color: var(--color-text-primary, #102a43);
}

.reforma-cert-card {
    background: var(--color-surface-subtle, #f8fafc);
    border: 1px solid var(--color-border-subtle, #e2e8f0);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 14px;
}

.reforma-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.reforma-alert.success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.reforma-alert.danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.reforma-alert.info {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #075985;
}


/* --- Additional Dark Mode Overrides for Eventos & Dynamic Schema --- */
[data-theme="dark"] .reforma-dynamic-schema-box {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .reforma-dynamic-schema-box label,
[data-theme="dark"] .reforma-dynamic-schema-box .reforma-form-label {
    color: #94a3b8 !important;
}

[data-theme="dark"] .reforma-dynamic-schema-box input,
[data-theme="dark"] .reforma-dynamic-schema-box select,
[data-theme="dark"] .reforma-form-control,
[data-theme="dark"] .reforma-form-select {
    background-color: #0f172a !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .reforma-dynamic-schema-box input:focus,
[data-theme="dark"] .reforma-dynamic-schema-box select:focus,
[data-theme="dark"] .reforma-form-control:focus,
[data-theme="dark"] .reforma-form-select:focus {
    border-color: var(--primary-color, #2f6fa8) !important;
    background-color: #0f172a !important;
    color: #ffffff !important;
}

[data-theme="dark"] .reforma-card-header h3,
[data-theme="dark"] .reforma-card-header h4 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .reforma-cert-card {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .reforma-btn-step {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .reforma-btn-step:hover:not(:disabled) {
    background: #334155 !important;
    border-color: var(--primary-color, #2f6fa8) !important;
    color: var(--primary-color, #2f6fa8) !important;
}

[data-theme="dark"] .reforma-btn-step.primary {
    background: var(--primary-color, #2f6fa8) !important;
    color: #ffffff !important;
    border-color: var(--primary-color, #2f6fa8) !important;
}

[data-theme="dark"] .reforma-btn-step.success {
    background: #10b981 !important;
    color: #ffffff !important;
    border-color: #10b981 !important;
}

[data-theme="dark"] .reforma-xml-tab {
    color: #94a3b8 !important;
}

[data-theme="dark"] .reforma-xml-tab.active {
    background: #334155 !important;
    color: #f1f5f9 !important;
}

[data-theme="dark"] .reforma-steps-actions {
    border-top-color: #334155 !important;
}

[data-theme="dark"] .reforma-xml-tabs {
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] .reforma-alert.success {
    background: #064e3b !important;
    border-color: #047857 !important;
    color: #a7f3d0 !important;
}

[data-theme="dark"] .reforma-alert.danger {
    background: #450a0a !important;
    border-color: #991b1b !important;
    color: #fecaca !important;
}

[data-theme="dark"] .reforma-alert.info {
    background: #082f49 !important;
    border-color: #0369a1 !important;
    color: #bae6fd !important;
}


/* --- Table Container & Scrollbar --- */
.reforma-table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.reforma-table-container::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.reforma-table-container::-webkit-scrollbar-track {
    background: var(--color-surface-canvas, #f1f5f9);
    border-radius: 4px;
}

.reforma-table-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.reforma-table-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
