/* ========== DARK THEME OVERRIDES ========== */
/* Applied when <html data-theme="dark"> */

html[data-theme="dark"] body {
    background: #0f0f1a;
    color: #e0e0e8;
}

html[data-theme="dark"] h1 { color: #e0e0e8; }
html[data-theme="dark"] h2 { color: #a0a0b0; }
html[data-theme="dark"] h3 { color: #d0d0d8; }
html[data-theme="dark"] a { color: #4fc3f7; }

/* ===== Layout ===== */
html[data-theme="dark"] .sidebar {
    background: #0a0a18;
    border-right: 1px solid #1a1a2e;
}

html[data-theme="dark"] .sidebar-header {
    border-bottom-color: #1a1a2e;
}

html[data-theme="dark"] .sidebar-footer {
    border-top-color: #1a1a2e;
}

html[data-theme="dark"] .main-content {
    background: #0f0f1a;
}

html[data-theme="dark"] .topbar {
    background: #161625;
    border-bottom-color: #1e1e30;
}

html[data-theme="dark"] .powered-by { color: #666; }
html[data-theme="dark"] .powered-by strong { color: #8888cc; }

html[data-theme="dark"] .btn-logout {
    color: #f87171;
    border-color: #f87171;
}

html[data-theme="dark"] .btn-logout:hover {
    background: #f87171;
    color: #fff;
}

html[data-theme="dark"] .page-content {
    background: #0f0f1a;
}

/* ===== Maintenance Banner ===== */
html[data-theme="dark"] .maintenance-banner {
    background: #42350a;
    color: #fbbf24;
    border-bottom-color: #92400e;
}

/* ===== Nav Menu ===== */
html[data-theme="dark"] .nav-link {
    color: #b0b0c0;
}

html[data-theme="dark"] .nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #e0e0e8;
}

html[data-theme="dark"] .nav-link.active {
    background: rgba(79, 195, 247, 0.1);
    color: #4fc3f7;
}

html[data-theme="dark"] .nav-section {
    color: #555570;
    border-top-color: #1a1a2e;
}

/* ===== Forms ===== */
html[data-theme="dark"] .form-group label,
html[data-theme="dark"] .form-field label {
    color: #a0a0b0;
}

html[data-theme="dark"] .form-input,
html[data-theme="dark"] select.form-input,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="time"],
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background: #1a1a2e;
    border-color: #2a2a40;
    color: #e0e0e8;
}

html[data-theme="dark"] .form-input:focus,
html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus {
    border-color: #4fc3f7;
    box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.15);
}

html[data-theme="dark"] .form-card {
    background: #161625;
    border-color: #2a2a40;
}

/* ===== Buttons ===== */
html[data-theme="dark"] .btn-secondary {
    background: #1a1a2e;
    color: #c0c0d0;
    border-color: #2a2a40;
}

html[data-theme="dark"] .btn-secondary:hover {
    background: #222238;
}

html[data-theme="dark"] .btn-small {
    background: #1a1a2e;
    border-color: #2a2a40;
    color: #c0c0d0;
}

html[data-theme="dark"] .btn-small:hover {
    background: #222238;
}

/* ===== Alerts ===== */
html[data-theme="dark"] .alert-error {
    background: #2d1515;
    color: #fca5a5;
    border-left-color: #dc2626;
}

html[data-theme="dark"] .alert-success {
    background: #0d2818;
    color: #86efac;
    border-left-color: #22c55e;
}

/* ===== Data Tables ===== */
html[data-theme="dark"] .data-table {
    background: #161625;
}

html[data-theme="dark"] .data-table th {
    background: #0a0a18;
}

html[data-theme="dark"] .data-table td {
    border-bottom-color: #1e1e30;
    color: #d0d0d8;
}

html[data-theme="dark"] .data-table tbody tr:hover td {
    background: #1a1a2e;
}

/* ===== Dashboard ===== */
html[data-theme="dark"] .stat-card {
    background: #161625;
    border-color: #2a2a40;
}

html[data-theme="dark"] .stat-number { color: #e0e0e8; }
html[data-theme="dark"] .stat-label { color: #777790; }

html[data-theme="dark"] .dash-card {
    background: #161625;
    border-color: #2a2a40;
}

html[data-theme="dark"] .dash-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .card-body h3 { color: #e0e0e8; }
html[data-theme="dark"] .card-body p { color: #777790; }
html[data-theme="dark"] .dash-subtitle { color: #777790; }

/* ===== Tabs ===== */
html[data-theme="dark"] .tab-btn {
    color: #777790;
}

html[data-theme="dark"] .tab-btn:hover {
    color: #b0b0c0;
}

html[data-theme="dark"] .tab-nav {
    border-bottom-color: #2a2a40;
}

/* ===== Users Page (scoped overrides) ===== */
html[data-theme="dark"] .users-page .page-header h1 {
    color: #e0e0e8;
}

html[data-theme="dark"] .tabs-bar {
    background: #161625;
    border-color: #2a2a40;
}

html[data-theme="dark"] .tab-item {
    color: #777790;
}

html[data-theme="dark"] .tab-item:hover {
    color: #b0b0c0;
    background: rgba(255, 255, 255, 0.03);
}

html[data-theme="dark"] .tab-item.active {
    color: #4fc3f7;
    background: rgba(79, 195, 247, 0.08);
}

html[data-theme="dark"] .form-panel {
    background: #161625;
    border-color: #2a2a40;
}

html[data-theme="dark"] .form-panel-header {
    background: #0a0a18;
    border-bottom-color: #1e1e30;
    color: #e0e0e8;
}

html[data-theme="dark"] .user-table {
    background: #161625;
    border-color: #2a2a40;
}

html[data-theme="dark"] .user-table thead {
    background: #0a0a18;
}

html[data-theme="dark"] .user-table th {
    color: #a0a0b0;
    border-bottom-color: #2a2a40;
}

html[data-theme="dark"] .user-table td {
    border-bottom-color: #1e1e30;
    color: #d0d0d8;
}

html[data-theme="dark"] .user-table tbody tr:hover {
    background: #1a1a2e;
}

html[data-theme="dark"] .row-inactive td {
    color: #555570 !important;
}

html[data-theme="dark"] .msg-bar.msg-success {
    background: #0d2818;
    color: #86efac;
    border-color: #166534;
}

html[data-theme="dark"] .msg-bar.msg-error {
    background: #2d1515;
    color: #fca5a5;
    border-color: #991b1b;
}

html[data-theme="dark"] .act-btn {
    border-color: #2a2a40;
    color: #a0a0b0;
}

html[data-theme="dark"] .act-btn:hover {
    background: #1a1a2e;
}

html[data-theme="dark"] .act-edit:hover { background: #1a2230; }
html[data-theme="dark"] .act-pwd:hover { background: #1e1a2e; }
html[data-theme="dark"] .act-logout { color: #f87171; border-color: #7f1d1d; }
html[data-theme="dark"] .act-logout:hover { background: #2d1515; }
html[data-theme="dark"] .act-activate { color: #4ade80; border-color: #166534; }
html[data-theme="dark"] .act-activate:hover { background: #0d2818; }
html[data-theme="dark"] .act-unlock { color: #fbbf24; border-color: #92400e; }
html[data-theme="dark"] .act-unlock:hover { background: #2d2010; }

html[data-theme="dark"] .status-pill.active {
    background: #0d2818;
    color: #4ade80;
}

html[data-theme="dark"] .status-pill.inactive {
    background: #1a1a2e;
    color: #777790;
}

html[data-theme="dark"] .status-pill.locked {
    background: #2d1515;
    color: #f87171;
}

html[data-theme="dark"] .mod-tag {
    opacity: 0.9;
}

html[data-theme="dark"] .search-box {
    background: #1a1a2e;
    border-color: #2a2a40;
    color: #e0e0e8;
}

html[data-theme="dark"] .maintenance-controls {
    background: #161625;
    border-color: #2a2a40;
}

html[data-theme="dark"] .maint-active {
    color: #fbbf24;
}

html[data-theme="dark"] .schedule-section label {
    color: #a0a0b0;
}

html[data-theme="dark"] .check-row label {
    color: #c0c0d0;
}

html[data-theme="dark"] .online-dot {
    border-color: #161625;
    box-shadow: 0 0 0 1px #2a2a40;
}

/* ===== Certificate Pages ===== */
html[data-theme="dark"] .cert-panel,
html[data-theme="dark"] .cert-card,
html[data-theme="dark"] .cert-form {
    background: #161625;
    border-color: #2a2a40;
}

html[data-theme="dark"] .cert-header {
    background: #0a0a18;
    color: #e0e0e8;
}

/* ===== Audit / Invoices / General Pages ===== */
html[data-theme="dark"] .page-card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .card {
    background: #161625;
    border-color: #2a2a40;
}

/* ===== Client List Checkboxes ===== */
html[data-theme="dark"] .client-list-checkboxes {
    background: #1a1a2e;
    border-color: #2a2a40;
}

/* ===== Pricing Cards ===== */
html[data-theme="dark"] .pricing-card {
    background: #161625;
    border-color: #2a2a40;
}

html[data-theme="dark"] .pricing-card h4 {
    color: #e0e0e8;
}

/* ===== Scrollbar ===== */
html[data-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

html[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #0f0f1a;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #2a2a40;
    border-radius: 4px;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #3a3a50;
}

/* ===== State Messages ===== */
html[data-theme="dark"] .state-msg {
    color: #555570;
}

/* ===== Modal / Overlay ===== */
html[data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.7);
}

html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .pwd-modal {
    background: #161625;
    border-color: #2a2a40;
    color: #e0e0e8;
}

/* ===== Blazor Error UI ===== */
html[data-theme="dark"] #blazor-error-ui {
    background: #7f1d1d;
}

/* ===== Logs Page ===== */
html[data-theme="dark"] .logs-header h1 {
    color: #e0e0e8;
}

html[data-theme="dark"] .level-filter {
    background: #1a1a2e;
    border-color: #2a2a40;
    color: #e0e0e8;
}

html[data-theme="dark"] .btn-refresh {
    background: #2a2a40;
}

html[data-theme="dark"] .btn-refresh:hover {
    background: #3a3a50;
}

html[data-theme="dark"] .logs-container {
    background: #161625;
    border-color: #2a2a40;
}

html[data-theme="dark"] .logs-empty {
    color: #555570;
}

html[data-theme="dark"] .log-entry {
    border-bottom-color: #1e1e30;
}

html[data-theme="dark"] .log-entry.log-error {
    background: #1a1015;
}

html[data-theme="dark"] .log-entry.log-critical {
    background: #1f0f0f;
}

html[data-theme="dark"] .level-warning {
    background: #42350a;
    color: #fbbf24;
}

html[data-theme="dark"] .level-error {
    background: #2d1515;
    color: #fca5a5;
}

html[data-theme="dark"] .log-cat {
    background: #1a1a2e;
    color: #777790;
}

html[data-theme="dark"] .log-msg {
    color: #d0d0d8;
}

html[data-theme="dark"] .log-time {
    color: #555570;
}

/* ===== Login Page (stays dark by design, no changes needed) ===== */
