/* ═══════════════════════════════════════════════════════════════
   Neutron CRM — style.css
   Brand accent: --px-green: #2dba4e
   ═══════════════════════════════════════════════════════════════ */

/* ─── CSS VARIABLES ──────────────────────────────────────────── */
:root {
    --px-green:       #2dba4e;
    --px-green-hover: #24a042;
    --px-green-light: #e8f8ed;
    --px-green-mid:   #d1f5db;

    --accent:         var(--px-green);
    --accent-hover:   var(--px-green-hover);
    --accent-light:   var(--px-green-light);

    --bg-page:        #f4f6f9;
    --bg-white:       #ffffff;
    --bg-hover:       #f0fdf4;
    --bg-active:      #e8f8ed;

    --border:         #e2e8f0;
    --border-focus:   var(--px-green);

    --text-primary:   #1a202c;
    --text-secondary: #475569;
    --text-muted:     #94a3b8;

    --shadow-sm:  0 1px 3px rgba(0,0,0,.07);
    --shadow-md:  0 4px 16px rgba(0,0,0,.1);

    --radius-sm:  8px;
    --radius-md:  10px;
    --radius-lg:  14px;
}

/* ─── RESET / BASE ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

a { text-decoration: none; color: inherit; }

/* ─── LAYOUT ──────────────────────────────────────────────────── */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.content-area {
    flex: 1;
    padding: 28px;
}

/* ─── SIDEBAR ─────────────────────────────────────────────────── */
.sidebar {
    width: 230px;
    min-height: 100vh;
    background: var(--bg-white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    flex-shrink: 0;
}

.sidebar-logo {
    padding: 18px 16px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-logo-img {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.sidebar-nav {
    padding: 12px 10px;
    flex: 1;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 14px 8px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    margin-bottom: 2px;
}

.nav-item:hover { background: var(--bg-hover); color: var(--px-green); }

.nav-item.active {
    background: var(--px-green-light);
    color: var(--px-green);
    font-weight: 600;
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    flex-shrink: 0;
}

.nav-icon .bx { font-size: 18px; line-height: 1; }

.nav-item-group .nav-submenu { display: none; padding-left: 12px; }
.nav-item-group .nav-submenu.open { display: block; }

.nav-chevron {
    font-size: 18px;
    margin-left: auto;
    transition: transform 0.2s ease;
    color: var(--text-muted);
}

.nav-item-group.open .nav-chevron { transform: rotate(180deg); }

.nav-subitem { font-size: 0.875rem; opacity: 0.9; }

.sidebar-footer {
    padding: 12px 10px;
    border-top: 1px solid var(--border);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-page);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--px-green);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }

.user-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role { font-size: 11px; color: var(--text-muted); }

/* ─── TOP HEADER ──────────────────────────────────────────────── */
.top-header {
    height: 60px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-search {
    flex: 1;
    max-width: 340px;
    position: relative;
}

.header-search input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--bg-page);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

.header-search input:focus { border-color: var(--px-green); }

.header-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 15px;
    height: 15px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.header-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.header-btn:hover {
    border-color: var(--px-green);
    color: var(--px-green);
    background: var(--px-green-light);
}

.header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--px-green);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid var(--px-green-light);
}

/* ─── PAGE HEADER ─────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 4px 0 0;
}

/* ─── CARDS ───────────────────────────────────────────────────── */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.card-body { padding: 24px; }
.card-body.p-0 { padding: 0 !important; }

.form-card-wrap {
    max-width: 680px;
    margin: 0 auto;
}

/* ─── DATA TABLE ──────────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th {
    background: #f8fafc;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.data-table td {
    padding: 13px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: var(--text-primary);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-hover); }

/* ─── BUTTONS ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    text-decoration: none;
    font-family: 'DM Sans', sans-serif;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: 'DM Sans', sans-serif;
    text-decoration: none;
    line-height: 1;
    background: var(--px-green);
    color: #fff;
}

.btn-primary:hover {
    background: var(--px-green-hover);
    box-shadow: 0 4px 12px rgba(45,186,78,.28);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    text-decoration: none;
    line-height: 1;
    background: #f1f5f9;
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover {
    background: var(--px-green-light);
    border-color: var(--px-green);
    color: var(--px-green);
}

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--px-green);
    color: var(--px-green);
    background: var(--px-green-light);
}

/* ─── ICON BUTTONS ────────────────────────────────────────────── */
.action-btns { display: flex; gap: 6px; }

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-edit   { background: var(--px-green-light); color: var(--px-green); }
.btn-edit:hover  { background: var(--px-green-mid); }
.btn-delete { background: #fef2f2; color: #ef4444; }
.btn-delete:hover { background: #fee2e2; }

/* ─── BADGES ──────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}

.badge-group  { background: #ede9fe; color: #6d28d9; }
.badge-parent { background: var(--px-green-light); color: var(--px-green); }
.badge-child  { background: #fef9c3; color: #b45309; }

.type-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; }
.type-super { background: #fef3c7; color: #d97706; }
.type-staff { background: var(--px-green-light); color: var(--px-green); }

.role-badge { background: #eff6ff; color: #3b82f6; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; }
.perm-badge { background: var(--px-green-light); color: var(--px-green); padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; }

/* ─── TOGGLE SWITCH ───────────────────────────────────────────── */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: #cbd5e1; border-radius: 34px; transition: .3s; }
.toggle-slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .3s; }
input:checked + .toggle-slider { background: var(--px-green); }
input:checked + .toggle-slider:before { transform: translateX(20px); }

/* ─── FORMS ───────────────────────────────────────────────────── */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }

.form-group label,
.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-control,
.form-input {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    box-sizing: border-box;
    font-family: 'DM Sans', sans-serif;
    color: var(--text-primary);
    background: var(--bg-white);
}

.form-control:focus,
.form-input:focus {
    border-color: var(--px-green);
    box-shadow: 0 0 0 3px rgba(45,186,78,.12);
}

.required { color: #ef4444; }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

.form-actions-sticky {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 0 4px;
}

/* ─── ALERTS ──────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.alert-success { background: var(--px-green-light); color: #166534; border: 1px solid var(--px-green-mid); }
.alert-error   { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }

/* ─── TEXT HELPERS ────────────────────────────────────────────── */
.text-muted   { color: var(--text-muted); }
.text-center  { text-align: center; }
.text-danger  { color: #ef4444; font-size: 0.8rem; }
.py-4         { padding: 2rem 0; }

code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--px-green);
}

/* ─── ADMIN / USER TABLE SPECIFICS ───────────────────────────── */
.admin-info { display: flex; align-items: center; gap: 10px; }

.admin-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--px-green), #24a042);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    flex-shrink: 0;
}

.role-name { display: flex; align-items: center; gap: 8px; }

/* ─── MODAL (global — shared by all pages) ────────────────────── */
/*
 * .cm-modal-* classes are defined ONLY here.
 * Page-specific blade files must NOT redeclare these rules.
 * Mobile bottom-sheet behaviour is handled here at ≤520px.
 */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show { display: flex; }

.modal-box {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 620px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 1rem; font-weight: 700; margin: 0; color: var(--text-primary); }

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    transition: color 0.15s;
}

.modal-close:hover { color: #ef4444; }

/* ─── CM-MODAL (leads & shared pages) ────────────────────────── */
.cm-modal-bg {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cm-modal-bg.open { display: flex; }

.cm-modal {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 580px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    display: flex;
    flex-direction: column;
    animation: cmModalIn .2s ease;
    max-height: calc(100dvh - 40px);
}

.cm-modal.wide { max-width: 660px; }

@keyframes cmModalIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cm-modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.cm-modal-header h3 {
    font-family: 'Sora', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.cm-modal-close {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: background .15s, color .15s;
}

.cm-modal-close:hover { background: #fee2e2; color: #dc2626; border-color: #fecaca; }

.cm-modal form { display: flex; flex-direction: column; }

.cm-modal-body {
    padding: 22px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(100dvh - 160px);
}

.cm-modal-footer {
    padding: 6px 22px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* dark mode */
html.dark-mode .cm-modal-header { background: transparent; border-color: var(--border); }
html.dark-mode .cm-modal-close:hover { background: rgba(239,68,68,.15); color: #f87171; border-color: rgba(239,68,68,.3); }




/* ─── PERMISSIONS ─────────────────────────────────────────────── */
.perm-outer-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    overflow: hidden;
}

.perm-outer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    background: #fafbfc;
}

.perm-outer-header h3 { font-size: 1rem; font-weight: 700; margin: 0; color: var(--text-primary); }

.perm-controls { display: flex; gap: 8px; }

.perm-body { padding: 22px; display: flex; flex-direction: column; gap: 20px; }

.perm-group-box {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.perm-group-box-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1.5px solid var(--border);
    cursor: pointer;
    user-select: none;
}

.perm-group-box-header:hover { background: var(--px-green-light); }
.perm-group-box-header.checked-header { background: var(--px-green-light); border-color: var(--px-green); }

.perm-group-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    flex: 1;
}

.perm-group-count {
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--px-green-light);
    color: var(--px-green);
    padding: 2px 8px;
    border-radius: 20px;
}

.perm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
    gap: 1px;
    background: var(--border);
}

.perm-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 14px;
    background: var(--bg-white);
    cursor: pointer;
    transition: background 0.12s;
    user-select: none;
}

.perm-item:hover { background: var(--bg-hover); }
.perm-item input[type="checkbox"] { display: none; }

.checkmark {
    width: 17px;
    height: 17px;
    min-width: 17px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.perm-item:has(input:checked) { background: var(--px-green-light); }
.perm-item:has(input:checked) .checkmark { background: var(--px-green); border-color: var(--px-green); }
.perm-item:has(input:checked) .checkmark::after { content: '✓'; color: #fff; font-size: 10px; font-weight: 700; }

.perm-group-check { display: flex; align-items: center; cursor: pointer; }
.perm-group-check input { display: none; }
.perm-group-check:has(input:checked) .checkmark { background: var(--px-green); border-color: var(--px-green); }
.perm-group-check:has(input:checked) .checkmark::after { content: '✓'; color: #fff; font-size: 10px; font-weight: 700; }

.perm-icon  { display: flex; align-items: center; flex-shrink: 0; }
.perm-title { font-size: 0.8125rem; font-weight: 500; color: var(--text-primary); flex: 1; }
.perm-sub-badge { background: #fef9c3; color: #b45309; font-size: 0.625rem; padding: 1px 5px; border-radius: 4px; font-weight: 600; flex-shrink: 0; }

.role-name-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 22px;
    margin-bottom: 16px;
}

/* ─── STATS ROW ───────────────────────────────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: box-shadow 0.2s, transform 0.2s;
    position: relative;
    overflow: hidden;
}

.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 14px 14px 0 0;
}

.stat-card.accent-green::before   { background: var(--px-green); }
.stat-card.accent-sky::before     { background: #0ea5e9; }
.stat-card.accent-emerald::before { background: #10b981; }
.stat-card.accent-indigo::before  { background: #4f46e5; }

.stat-header { display: flex; align-items: center; justify-content: space-between; }
.stat-label  { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; }

.stat-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.stat-icon.green   { background: var(--px-green-light); color: var(--px-green); }
.stat-icon.sky     { background: #e0f2fe; color: #0ea5e9; }
.stat-icon.emerald { background: #d1fae5; color: #10b981; }
.stat-icon.indigo  { background: #eef1ff; color: #4f46e5; }

.stat-value  { font-family: 'Sora', sans-serif; font-size: 30px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.stat-footer { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.stat-badge  { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.stat-badge.up      { background: var(--px-green-light); color: var(--px-green); }
.stat-badge.neutral { background: #f3f4f6; color: #6b7280; }

/* ─── QUICK ACTIONS ───────────────────────────────────────────── */
.section-header { margin-bottom: 16px; }
.section-title  { font-family: 'Sora', sans-serif; font-size: 15px; font-weight: 700; color: var(--text-primary); }

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.qa-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.18s ease;
    box-shadow: var(--shadow-sm);
}

.qa-card:hover {
    border-color: var(--px-green);
    background: var(--bg-active);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.qa-icon { width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.qa-text strong { display: block; font-size: 13.5px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.qa-text span   { font-size: 11.5px; color: var(--text-muted); }

/* ─── DASHBOARD CARD / TABLE ──────────────────────────────────── */
.dash-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.dash-card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dash-card-header h2 { font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 700; color: var(--text-primary); }

.view-all       { font-size: 12px; font-weight: 600; color: var(--px-green); text-decoration: none; }
.view-all:hover { text-decoration: underline; }

.table-wrap { overflow-x: auto; }

.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.status-pill.new      { background: #dbeafe; color: #1d4ed8; }
.status-pill.followup { background: #fef3c7; color: #d97706; }
.status-pill.closed   { background: var(--px-green-light); color: var(--px-green); }
.status-pill.lost     { background: #fee2e2; color: #dc2626; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.lead-name   { display: flex; align-items: center; gap: 10px; }
.lead-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--px-green-light); color: var(--px-green); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }

.empty-state   { padding: 48px; text-align: center; color: var(--text-muted); }
.empty-state i { width: 40px; height: 40px; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 13.5px; }

/* ─── PROFILE DROPDOWN ────────────────────────────────────────── */
.profile-dropdown-wrap { position: relative; }

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 210px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 200;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.profile-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }

.profile-dropdown-user { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.profile-dropdown-user .pd-name  { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-dropdown-user .pd-email { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.profile-dropdown-menu { padding: 6px; }

.pd-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; color: var(--text-secondary); text-decoration: none; transition: background 0.12s, color 0.12s; cursor: pointer; border: none; background: none; width: 100%; text-align: left; font-family: 'DM Sans', sans-serif; }
.pd-item:hover { background: var(--bg-hover); color: var(--px-green); }
.pd-item i { width: 15px; height: 15px; flex-shrink: 0; }
.pd-item.danger { color: #ef4444; }
.pd-item.danger:hover { background: #fee2e2; color: #dc2626; }
.pd-divider { height: 1px; background: var(--border); margin: 4px 6px; }

/* ─── PROFILE PAGE ────────────────────────────────────────────── */
.profile-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    align-items: start;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.profile-sidebar-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

.profile-avatar-wrap {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--px-green-light);
    flex-shrink: 0;
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    border-radius: 50%;
    display: block;
}

.profile-avatar-initials {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--px-green);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Sora', sans-serif;
    font-size: 28px;
    font-weight: 700;
    border: 3px solid var(--px-green-light);
}

.profile-name {
    font-family: 'Sora', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--px-green-light);
    color: var(--px-green);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.profile-meta {
    width: 100%;
    border-top: 1px solid var(--border);
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-meta-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-secondary); }
.profile-meta-item i { width: 14px; height: 14px; color: var(--text-muted); flex-shrink: 0; }

.profile-edit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    color: var(--px-green);
    border: 2px solid var(--px-green);
    border-radius: var(--radius-sm);
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    width: 100%;
    margin-top: 4px;
}

.profile-edit-btn:hover { background: var(--px-green); color: #fff; }

.profile-main-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.profile-main-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.profile-main-header h2 { font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 700; color: var(--text-primary); margin: 0; }

.profile-fields {
    padding: 20px 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 32px;
}

.profile-field-label { font-size: 10.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 4px; }
.profile-field-value { font-size: 13.5px; color: var(--text-primary); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-field-value.muted { color: var(--text-muted); font-style: italic; }

.profile-security-row {
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: nowrap;
}

.profile-right-col { display: flex; flex-direction: column; gap: 16px; }

.verified-badge   { display: inline-flex; align-items: center; gap: 4px; background: var(--px-green-light); color: var(--px-green); font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.unverified-badge { display: inline-flex; align-items: center; gap: 4px; background: #fef3c7; color: #d97706; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; }

.profile-activity-list { display: flex; flex-direction: column; }

.profile-activity-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    font-size: 12.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.profile-activity-item:last-child { border-bottom: none; }
.activity-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.activity-dot.green { background: var(--px-green); }
.activity-dot.blue  { background: #0ea5e9; }
.activity-dot.amber { background: #f59e0b; }
.activity-time { margin-left: auto; font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* ─── FORM CARD ───────────────────────────────────────────────── */
.form-card { background: var(--bg-white); border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-sm); overflow: hidden; width: 100%; margin-bottom: 16px; }
.form-card-header { padding: 18px 24px; border-bottom: 1px solid var(--border); }
.form-card-header h2 { font-family: 'Sora', sans-serif; font-size: 14px; font-weight: 700; color: var(--text-primary); }
.form-card-header p  { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }
.form-card-body { padding: 24px; }

.form-input-wrap { position: relative; }
.form-input-wrap .form-input { padding-right: 44px; }
.form-eye-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-muted); display: flex; align-items: center; padding: 2px; transition: color 0.15s; }
.form-eye-btn:hover { color: var(--px-green); }
.form-eye-btn i { width: 16px; height: 16px; }

.form-error { font-size: 11.5px; color: #ef4444; font-weight: 500; }
.form-hint  { font-size: 11.5px; color: var(--text-muted); }
.form-label .req { color: #ef4444; margin-left: 2px; }

/* ─── AVATAR UPLOAD ───────────────────────────────────────────── */
.avatar-upload-wrap { display: flex; align-items: center; gap: 20px; }

.avatar-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 20%;
    border: 3px solid var(--px-green-light);
    flex-shrink: 0;
}

.avatar-preview-initials {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--px-green);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Sora', sans-serif;
    font-size: 20px;
    font-weight: 500;
    border: 3px solid var(--px-green-light);
    flex-shrink: 0;
}

.avatar-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: var(--px-green-light);
    color: var(--px-green);
    border: 1.5px solid var(--px-green);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-family: 'DM Sans', sans-serif;
    width: fit-content;
}

.avatar-upload-btn:hover { background: var(--px-green); color: #fff; }

.avatar-remove-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: #fef2f2;
    color: #ef4444;
    border: 1.5px solid #fca5a5;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    font-family: 'DM Sans', sans-serif;
}

.avatar-remove-btn:hover { background: #ef4444; color: #fff; border-color: #ef4444; }

/* ─── SAVINGS SHEET ───────────────────────────────────────────── */
.savings-wrap { width: 100%; max-width: 640px; margin: 0 auto; }
.savings-card { background: var(--bg-white); border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-sm); overflow: hidden; }
.savings-card-header { padding: 22px 28px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 14px; }
.savings-card-icon { width: 44px; height: 44px; border-radius: 12px; background: #fef3c7; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.savings-card-icon i { color: #d97706; width: 20px; height: 20px; }
.savings-card-header-text h2 { font-family: 'Sora', sans-serif; font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.savings-card-header-text p  { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.savings-card-body { padding: 28px; }

.sv-upload-zone { border: 2px dashed var(--border); border-radius: var(--radius-md); padding: 40px 24px; text-align: center; cursor: pointer; transition: border-color 0.2s, background 0.2s; background: var(--bg-page); position: relative; margin-bottom: 22px; }
.sv-upload-zone:hover { border-color: var(--px-green); background: var(--bg-active); }
.sv-upload-zone.sv-has-file { border-color: var(--px-green); border-style: solid; background: var(--px-green-light); }
.sv-upload-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.sv-upload-icon { width: 50px; height: 50px; border-radius: 14px; background: var(--px-green-light); display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; transition: background 0.2s; }
.sv-upload-zone.sv-has-file .sv-upload-icon { background: var(--px-green-mid); }
.sv-upload-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.sv-upload-sub   { font-size: 12px; color: var(--text-muted); }
.sv-upload-sub strong { color: var(--px-green); font-weight: 600; }

.sv-file-strip { display: none; align-items: center; gap: 10px; background: var(--px-green-light); border: 1px solid var(--px-green-mid); border-radius: var(--radius-sm); padding: 11px 14px; margin-bottom: 22px; }
.sv-file-strip.show { display: flex; }
.sv-file-strip-icon { width: 34px; height: 34px; background: var(--px-green-mid); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sv-file-strip-icon i { color: var(--px-green); width: 16px; height: 16px; }
.sv-file-strip-info { flex: 1; min-width: 0; }
.sv-file-strip-name { font-size: 13px; font-weight: 600; color: #065f46; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-file-strip-size { font-size: 11px; color: var(--px-green); margin-top: 1px; }
.sv-file-remove { background: none; border: none; cursor: pointer; color: var(--px-green); display: flex; align-items: center; padding: 4px; border-radius: 4px; transition: background 0.15s; flex-shrink: 0; }
.sv-file-remove:hover { background: var(--px-green-mid); }
.sv-file-remove i { width: 14px; height: 14px; }

.sv-field { margin-bottom: 22px; }
.sv-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 7px; }
.sv-label .sv-req { color: #ef4444; margin-left: 2px; }

.sv-select-wrap { position: relative; }
.sv-select { width: 100%; padding: 10px 38px 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-family: 'DM Sans', sans-serif; font-size: 13.5px; color: var(--text-primary); background: var(--bg-white); outline: none; appearance: none; -webkit-appearance: none; transition: border-color 0.2s, box-shadow 0.2s; cursor: pointer; }
.sv-select:focus { border-color: var(--px-green); box-shadow: 0 0 0 3px rgba(45,186,78,.12); }
.sv-select-wrap::after { content: ''; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 5px solid var(--text-muted); pointer-events: none; }

.sv-input { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-family: 'DM Sans', sans-serif; font-size: 13.5px; color: var(--text-primary); background: var(--bg-white); outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
.sv-input:focus { border-color: var(--px-green); box-shadow: 0 0 0 3px rgba(45,186,78,.12); }
.sv-input-error   { border-color: #ef4444 !important; }
.sv-field-error   { font-size: 11.5px; color: #ef4444; font-weight: 500; margin-top: 5px; }
.sv-input-prefix-wrap { position: relative; }
.sv-input-prefix  { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 13.5px; color: var(--text-muted); font-weight: 600; pointer-events: none; }
.sv-input-prefixed { padding-left: 28px; }

.sv-extracted-badge { display: inline-flex; align-items: center; gap: 3px; background: #fef3c7; color: #d97706; font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 20px; margin-left: 6px; vertical-align: middle; }

.sv-actions { display: flex; justify-content: flex-end; padding-top: 20px; border-top: 1px solid var(--border); margin-top: 4px; }
.sv-btn-submit { display: inline-flex; align-items: center; gap: 8px; background: var(--px-green); color: #fff; border: none; border-radius: var(--radius-sm); padding: 11px 24px; font-family: 'DM Sans', sans-serif; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background 0.15s, box-shadow 0.15s, transform 0.15s; }
.sv-btn-submit:hover { background: var(--px-green-hover); box-shadow: 0 4px 12px rgba(45,186,78,.28); transform: translateY(-1px); }
.sv-btn-submit i { width: 15px; height: 15px; }

.sv-btn-back { display: inline-flex; align-items: center; gap: 7px; background: transparent; color: var(--text-secondary); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 10px 20px; font-family: 'DM Sans', sans-serif; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: all 0.15s; text-decoration: none; }
.sv-btn-back:hover { background: var(--bg-hover); color: var(--text-primary); }
.sv-btn-back i { width: 15px; height: 15px; }

.sv-note { display: flex; align-items: flex-start; gap: 9px; background: var(--px-green-light); border: 1px solid var(--px-green-mid); border-radius: var(--radius-sm); padding: 11px 14px; font-size: 12px; color: #166534; line-height: 1.55; margin-bottom: 22px; }
.sv-note i { width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; }

.sv-alert-success { display: flex; align-items: center; gap: 10px; background: var(--px-green-light); border: 1px solid var(--px-green-mid); color: #166534; padding: 13px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; margin-bottom: 20px; }
.sv-alert-success i { width: 15px; height: 15px; flex-shrink: 0; }

.sv-fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sv-fields-grid .sv-full { grid-column: 1 / -1; }
.sv-section-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; display: flex; align-items: center; gap: 10px; }
.sv-section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.sv-energy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 4px; }
.sv-energy-card { border: 2px solid var(--border); border-radius: var(--radius-md); padding: 16px 12px; text-align: center; cursor: pointer; transition: all 0.18s ease; background: var(--bg-white); display: flex; flex-direction: column; align-items: center; gap: 8px; position: relative; }
.sv-energy-card input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.sv-energy-card:hover { border-color: var(--px-green); background: var(--bg-active); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.sv-energy-card.active { border-color: var(--px-green); background: var(--bg-active); box-shadow: 0 0 0 3px rgba(45,186,78,.1); }
.sv-energy-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.sv-energy-name   { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.sv-energy-saving { font-size: 11.5px; color: var(--px-green); font-weight: 600; background: var(--px-green-light); padding: 2px 8px; border-radius: 20px; }

.sv-savings-result { background: var(--bg-page); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; margin-top: 20px; animation: fadeSlideIn 0.3s ease; }
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.sv-savings-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.sv-savings-row:last-child  { border-bottom: none; padding-bottom: 0; }
.sv-savings-row:first-child { padding-top: 0; }
.sv-savings-label     { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.sv-savings-value     { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.sv-savings-green     { color: var(--px-green); font-size: 14px; }
.sv-savings-highlight { background: var(--px-green-light); margin: 0 -20px; padding: 10px 20px !important; }
.sv-savings-total     { padding-top: 14px !important; }
.sv-savings-big       { font-family: 'Sora', sans-serif; font-size: 18px; font-weight: 700; color: var(--px-green); }

.sv-view-all-btn { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 7px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 600; color: var(--text-secondary); text-decoration: none; background: var(--bg-white); transition: all 0.15s; white-space: nowrap; }
.sv-view-all-btn:hover { border-color: var(--px-green); color: var(--px-green); background: var(--bg-active); }

/* ─── LOGO LIGHT/DARK ─────────────────────────────────────────── */
.sidebar-logo-img.sidebar-logo-dark  { display: none !important; }
.sidebar-logo-img.sidebar-logo-light { display: block !important; }

/* ═══════════════════════════════════════════════════════════════
   DARK MODE
   ═══════════════════════════════════════════════════════════════ */
html.dark-mode {
    --bg-page:        #0d1b2e;
    --bg-white:       #152032;
    --bg-hover:       #1a2d45;
    --bg-active:      #1a2d45;
    --border:         #1e3448;
    --text-primary:   #e8edf5;
    --text-secondary: #8facc4;
    --text-muted:     #4e6880;
    --shadow-sm:      0 1px 3px rgba(0,0,0,.5);
    --shadow-md:      0 4px 20px rgba(0,0,0,.6);
    --accent:         #2dba4e;
    --accent-hover:   #24a042;
    --accent-light:   rgba(45,186,78,.15);
    --px-green-light: rgba(45,186,78,.15);
    --px-green-mid:   rgba(45,186,78,.25);
}

html.dark-mode body { background: var(--bg-page); }
html.dark-mode ::-webkit-scrollbar-thumb { background: #1e3448; }

/* Sidebar */
html.dark-mode .sidebar             { background: #0f1e30 !important; border-color: #1a2d45 !important; }
html.dark-mode .sidebar-footer      { border-color: var(--border); }
html.dark-mode .sidebar-logo        { background: #0f1e30 !important; border-color: #1a2d45 !important; }
html.dark-mode .sidebar-nav         { background: #0f1e30 !important; }
html.dark-mode .nav-section-label   { color: #2a4a6b !important; }
html.dark-mode .nav-item            { color: #8facc4 !important; }
html.dark-mode .nav-item:hover      { background: #1a2d45 !important; color: #e8edf5 !important; }
html.dark-mode .nav-item.active     { background: #0a1628 !important; color: #e8edf5 !important; border-left: 2px solid var(--px-green) !important; padding-left: 8px !important; }
html.dark-mode .nav-chevron         { color: #2a4a6b !important; }
html.dark-mode .nav-item:hover .nav-chevron { color: #8facc4 !important; }
html.dark-mode .nav-subitem         { color: #6a8aa8 !important; }
html.dark-mode .nav-subitem:hover   { background: #1a2d45 !important; color: #e8edf5 !important; }
html.dark-mode .nav-subitem.active  { background: #0a1628 !important; color: #e8edf5 !important; border-left: 2px solid var(--px-green) !important; padding-left: 8px !important; }
html.dark-mode .user-card           { background: rgba(0,0,0,.25) !important; }
html.dark-mode .user-name           { color: #e8edf5 !important; }
html.dark-mode .user-role           { color: #4e6880 !important; }
html.dark-mode .sidebar-logo-img.sidebar-logo-dark  { display: block !important; }
html.dark-mode .sidebar-logo-img.sidebar-logo-light { display: none !important; }

/* Top header */
html.dark-mode .top-header          { background: #152032; border-color: var(--border); box-shadow: 0 1px 0 rgba(0,0,0,.4); }
html.dark-mode .header-search input { color: var(--text-primary); background: transparent; }
html.dark-mode .header-search input::placeholder { color: var(--text-muted); }
html.dark-mode .header-btn          { background: #0d1b2e; border-color: var(--border); color: var(--text-secondary); }
html.dark-mode .header-btn:hover    { background: rgba(45,186,78,.12); border-color: var(--px-green); color: var(--px-green); }
html.dark-mode .header-avatar       { border-color: rgba(45,186,78,.3); }

/* Stat cards */
html.dark-mode .stat-card           { background: #152032; border-color: var(--border); box-shadow: 0 1px 6px rgba(0,0,0,.4); }
html.dark-mode .stat-icon.green     { background: rgba(45,186,78,.15);  color: var(--px-green); }
html.dark-mode .stat-icon.sky       { background: rgba(14,165,233,.15); color: #38bdf8; }
html.dark-mode .stat-icon.emerald   { background: rgba(16,185,129,.15); color: #34d399; }
html.dark-mode .stat-icon.indigo    { background: rgba(79,70,229,.15);  color: #818cf8; }
html.dark-mode .stat-badge.up       { background: rgba(45,186,78,.18); color: var(--px-green); }
html.dark-mode .stat-badge.neutral  { background: rgba(255,255,255,.06); color: var(--text-muted); }

/* Quick action cards */
html.dark-mode .qa-card             { background: #152032; border-color: var(--border); }
html.dark-mode .qa-card:hover       { background: #1a2d45 !important; border-color: #2a4a6b !important; box-shadow: 0 4px 16px rgba(0,0,0,.5) !important; }

/* Dash card / table */
html.dark-mode .dash-card           { background: #152032; border-color: var(--border); }
html.dark-mode .dash-card-header    { border-color: var(--border); }
html.dark-mode .data-table th       { background: #0d1b2e; color: var(--text-muted); border-color: var(--border); }
html.dark-mode .data-table td       { border-color: rgba(30,52,72,.6); color: var(--text-primary); }
html.dark-mode .data-table tr:hover td   { background: #1a2d45 !important; }
html.dark-mode .cm-table tbody tr:hover  { background: #1a2d45 !important; }
html.dark-mode .lead-avatar         { background: rgba(45,186,78,.18); color: var(--px-green); }

/* Status pills dark */
html.dark-mode .status-pill.new      { background: rgba(59,130,246,.18); color: #60a5fa; }
html.dark-mode .status-pill.followup { background: rgba(245,158,11,.18); color: #fbbf24; }
html.dark-mode .status-pill.closed   { background: rgba(45,186,78,.18);  color: #4ade80; }
html.dark-mode .status-pill.lost     { background: rgba(239,68,68,.18);  color: #f87171; }

/* General cards */
html.dark-mode .card,
html.dark-mode .form-card,
html.dark-mode .savings-card,
html.dark-mode .profile-sidebar-card,
html.dark-mode .profile-main-card,
html.dark-mode .perm-outer-card,
html.dark-mode .role-name-card       { background: #152032; border-color: var(--border); }

html.dark-mode .form-card-header,
html.dark-mode .profile-main-header,
html.dark-mode .dash-card-header,
html.dark-mode .perm-outer-header,
html.dark-mode .modal-header         { border-color: var(--border); background: transparent; }
html.dark-mode .perm-outer-header    { background: #0d1b2e; }

/* Forms */
html.dark-mode .form-control,
html.dark-mode .form-input,
html.dark-mode .sv-input,
html.dark-mode .sv-select            { background: #0d1b2e; border-color: var(--border); color: var(--text-primary); }
html.dark-mode .form-control:focus,
html.dark-mode .form-input:focus,
html.dark-mode .sv-input:focus,
html.dark-mode .sv-select:focus      { border-color: var(--px-green); box-shadow: 0 0 0 3px rgba(45,186,78,.15); }
html.dark-mode .form-control::placeholder,
html.dark-mode .form-input::placeholder,
html.dark-mode .sv-input::placeholder { color: var(--text-muted); }

/* Permissions */
html.dark-mode .perm-group-box          { border-color: var(--border); }
html.dark-mode .perm-group-box-header   { background: #0d1b2e; border-color: var(--border); }
html.dark-mode .perm-group-box-header:hover { background: rgba(45,186,78,.1); }
html.dark-mode .perm-group-box-header.checked-header { background: rgba(45,186,78,.12); border-color: var(--px-green); }
html.dark-mode .perm-item              { background: #152032; }
html.dark-mode .perm-item:hover        { background: rgba(45,186,78,.08); }
html.dark-mode .perm-item:has(input:checked) { background: rgba(45,186,78,.14); }

/* Profile */
html.dark-mode .profile-sidebar-card,
html.dark-mode .profile-main-card    { background: #152032; border-color: var(--border); }
html.dark-mode .profile-meta         { border-color: var(--border); }
html.dark-mode .profile-activity-item { border-color: var(--border); }
html.dark-mode .avatar-remove-btn    { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.3); color: #f87171; }
html.dark-mode .avatar-remove-btn:hover { background: #ef4444; color: #fff; border-color: #ef4444; }
html.dark-mode .avatar-preview-initials { border-color: rgba(45,186,78,.3); }
html.dark-mode .avatar-upload-btn    { background: rgba(45,186,78,.12); border-color: rgba(45,186,78,.4); color: var(--px-green); }
html.dark-mode .avatar-upload-btn:hover { background: var(--px-green); color: #fff; }

/* Savings sheet */
html.dark-mode .savings-card-icon    { background: rgba(217,119,6,.2) !important; }
html.dark-mode .savings-card-icon i  { color: #fbbf24 !important; }
html.dark-mode .sv-upload-zone       { background: #0d1b2e !important; border-color: #1e3448 !important; }
html.dark-mode .sv-upload-zone:hover { border-color: var(--px-green) !important; background: rgba(45,186,78,.06) !important; }
html.dark-mode .sv-upload-zone.sv-has-file { border-color: var(--px-green) !important; background: rgba(45,186,78,.08) !important; }
html.dark-mode .sv-file-strip        { background: rgba(45,186,78,.1) !important; border-color: rgba(45,186,78,.2) !important; }
html.dark-mode .sv-file-strip-name   { color: #4ade80 !important; }
html.dark-mode .sv-file-strip-size   { color: #2dba4e !important; }
html.dark-mode .sv-note              { background: rgba(45,186,78,.08) !important; border-color: rgba(45,186,78,.18) !important; color: #4ade80 !important; }
html.dark-mode .sv-extracted-badge   { background: rgba(217,119,6,.18) !important; color: #fbbf24 !important; }
html.dark-mode .sv-energy-card       { background: #0d1b2e !important; border-color: #1e3448 !important; }
html.dark-mode .sv-energy-card:hover { border-color: #2a4a6b !important; background: #152032 !important; transform: translateY(-2px) !important; }
html.dark-mode .sv-energy-card.active { border-color: var(--px-green) !important; background: rgba(45,186,78,.1) !important; box-shadow: 0 0 0 3px rgba(45,186,78,.12) !important; }
html.dark-mode .sv-energy-saving     { background: rgba(45,186,78,.15) !important; color: #4ade80 !important; }
html.dark-mode .sv-savings-result    { background: #0d1b2e !important; border-color: var(--border) !important; }
html.dark-mode .sv-savings-row       { border-color: var(--border) !important; }
html.dark-mode .sv-savings-green     { color: #4ade80 !important; }
html.dark-mode .sv-savings-highlight { background: rgba(45,186,78,.1) !important; }
html.dark-mode .sv-view-all-btn      { background: #0d1b2e !important; border-color: var(--border) !important; color: var(--text-secondary) !important; }
html.dark-mode .sv-view-all-btn:hover { border-color: var(--px-green) !important; color: var(--px-green) !important; background: rgba(45,186,78,.1) !important; }

/* Savings sheet — state select page */
html.dark-mode .ss-container         { background: #0d1b2e !important; }
html.dark-mode .ss-title             { color: #e8edf5 !important; }
html.dark-mode .ss-subtitle          { color: #4e6880 !important; }
html.dark-mode .ss-header            { border-color: #1e3448 !important; }
html.dark-mode .ss-card              { background: #152032 !important; border-color: #1e3448 !important; }
html.dark-mode .ss-card:hover        { background: #1a2d45 !important; border-color: #2a4a6b !important; }
html.dark-mode .ss-state-name        { color: #e8edf5 !important; }
html.dark-mode .ss-card-icon         { background: #0d1b2e !important; }
html.dark-mode .ss-icon-placeholder  { color: #8facc4 !important; }
html.dark-mode .ss-state-code        { background: #0d1b2e !important; color: #8facc4 !important; }
html.dark-mode .ss-empty             { background: #152032 !important; border-color: #1e3448 !important; }

/* Review page */
html.dark-mode .side-card            { background: #152032 !important; border-color: var(--border) !important; }
html.dark-mode .side-card-header     { background: #0d1b2e !important; color: var(--text-primary) !important; border-color: var(--border) !important; }
html.dark-mode .side-table thead th  { background: #0d1b2e !important; color: var(--text-muted) !important; border-color: var(--border) !important; }
html.dark-mode .side-table tbody tr:hover { background: #1a2d45 !important; }
html.dark-mode .charge-yes           { background: rgba(45,186,78,.18) !important; color: #4ade80 !important; }
html.dark-mode .charge-no            { background: rgba(239,68,68,.15) !important; color: #f87171 !important; }
html.dark-mode .charges-oa-badge     { background: rgba(217,119,6,.18) !important; color: #fbbf24 !important; }
html.dark-mode .sv-loading-box       { background: #152032 !important; border: 1px solid var(--border) !important; }

html.dark-mode .btn-secondary {
    background: #152032;
    border: none;
    color: #fff;
    box-shadow: none;
}

html.dark-mode .btn-secondary:hover {
    background: #1e3a5f;
    border: none;
    color: #fff;
    box-shadow: none;
}

/* ─── DARK MODE: Green primary button ─── */
html.dark-mode .btn-primary {
    background: linear-gradient(135deg, #2dba4e, #1e9e3a);
    border: none;
    color: #fff;
    box-shadow: 0 2px 8px rgba(45,186,78,.3);
}

html.dark-mode .btn-primary:hover {
    background: linear-gradient(135deg, #24a042, #197a2e);
    box-shadow: 0 4px 14px rgba(45,186,78,.4);
}


/* ─── DARK MODE: State readonly box ─── */
html.dark-mode .sv-state-readonly {
    background: #0d1b2e;
}

.dark-mode .sv-state-readonly {
    background: #0d1b2e;
    
}

html.dark-mode .sv-state-change-btn {
    background: rgba(245,158,11,.1);
    border-color: rgba(245,158,11,.25);
    color: #fbbf24;
}

html.dark-mode .sv-state-change-btn:hover {
    background: rgba(245,158,11,.2);
    border-color: rgba(245,158,11,.5);
}


/* ─── DARK MODE: sv-state-readonly — match select state page ─── */


html.dark-mode .sv-state-readonly-icon {
    background: #0d1b2e;
    border: 1px solid #1e3448;
}

html.dark-mode .sv-state-readonly-icon span {
    color: #8facc4 !important;
}

html.dark-mode .sv-state-readonly-name {
    color: #e8edf5;
}

html.dark-mode .sv-state-change-btn {
    background: #0d1b2e;
    border-color: #1e3448;
    color: #8facc4;
}

html.dark-mode .sv-state-change-btn:hover {
    background: #1a2d45;
    border-color: #2a4a6b;
    color: #e8edf5;
}


/* ─── DARK MODE: Dashboard stat badges ─── */
html.dark-mode .stat-badge.neutral {
    background: rgba(255,255,255,.07);
    color: #8facc4;
}

html.dark-mode .stat-badge.up {
    background: rgba(45,186,78,.18);
    color: #4ade80;
}

html.dark-mode .stat-badge.blue {
    background: rgba(37,99,235,.2);
    color: #93c5fd;
}

/* ─── DARK MODE: Dashboard status pills ─── */
html.dark-mode .status-pill.new {
    background: rgba(29,78,216,.2);
    color: #93c5fd;
}

html.dark-mode .status-pill.proposalsent {
    background: rgba(109,40,217,.2);
    color: #c4b5fd;
}

html.dark-mode .status-pill.closedwon {
    background: rgba(45,186,78,.18);
    color: #4ade80;
}

html.dark-mode .status-pill.contacted {
    background: rgba(14,165,233,.18);
    color: #38bdf8;
}

html.dark-mode .status-pill.followup,
html.dark-mode .status-pill.followingup {
    background: rgba(217,119,6,.18);
    color: #fbbf24;
}

html.dark-mode .status-pill.lost {
    background: rgba(220,38,38,.18);
    color: #f87171;
}


/* ─── DARK MODE: Lead Tracker ─── */

/* Date filter bar */
html.dark-mode .date-filter-bar       { background: #152032; border-color: #1e3448; }
html.dark-mode .date-filter-group     { border-color: #1e3448; }
html.dark-mode .date-filter-input     { color: #e8edf5; }
html.dark-mode .date-filter-input::placeholder { color: #4e6880; }
html.dark-mode .date-filter-label     { color: #4e6880; }
html.dark-mode .date-cal-icon         { color: #4e6880; }
html.dark-mode .date-filter-reset     { background: #152032 !important; color: #8facc4 !important; border-color: #1e3448 !important; }
html.dark-mode .date-filter-reset:hover { background: rgba(220,38,38,.15) !important; color: #f87171 !important; }
html.dark-mode .date-active-badge     { background: rgba(45,186,78,.15); border-color: rgba(45,186,78,.25); color: #4ade80; }

/* Back to Leads button */
html.dark-mode .tr-back-btn           { background: #152032; border-color: #1e3448; color: #8facc4; }
html.dark-mode .tr-back-btn:hover     { color: var(--px-green); border-color: rgba(45,186,78,.3); }

/* Pipeline columns */
html.dark-mode .pipeline-col          { background: #0d1b2e; border-color: #1e3448; }
html.dark-mode .pipeline-col-header   { background: #152032; border-color: #1e3448; }
html.dark-mode .pipeline-col-name     { color: #e8edf5; }

/* Column count badges dark */
html.dark-mode .pipeline-col[data-status="New"]           .pipeline-col-count { background: rgba(16,185,129,.18); color: #34d399; }
html.dark-mode .pipeline-col[data-status="Proposal Sent"] .pipeline-col-count { background: rgba(59,130,246,.18); color: #60a5fa; }
html.dark-mode .pipeline-col[data-status="Follow-up"]     .pipeline-col-count { background: rgba(245,158,11,.18); color: #fbbf24; }
html.dark-mode .pipeline-col[data-status="Closed Won"]    .pipeline-col-count { background: rgba(14,165,233,.18); color: #38bdf8; }
html.dark-mode .pipeline-col[data-status="Not Reachable"] .pipeline-col-count { background: rgba(156,163,175,.15); color: #9ca3af; }

/* Lead cards */
html.dark-mode .lead-card             { background: #152032; border-color: #1e3448; }
html.dark-mode .lead-card:hover       { box-shadow: 0 6px 20px rgba(0,0,0,.4); }
html.dark-mode .lead-card-name        { color: #e8edf5; }
html.dark-mode .lead-card-date-small  { color: #4e6880; }
html.dark-mode .lead-card-av          { background: rgba(45,186,78,.15); color: var(--px-green); border-color: #152032; box-shadow: 0 0 0 1px #1e3448; }
html.dark-mode .meta-text             { color: #8facc4; }
html.dark-mode .lead-card-type        { background: rgba(45,186,78,.12); color: #4ade80; }

/* Source badges */
html.dark-mode .card-source-badge.website   { background: rgba(109,40,217,.2); color: #c4b5fd; }
html.dark-mode .card-source-badge.dashboard { background: rgba(3,105,161,.2);  color: #38bdf8; }

/* Status select */
html.dark-mode .status-select         { background: #0d1b2e; border-color: #1e3448; color: #8facc4; }
html.dark-mode .status-select:focus   { border-color: var(--px-green); }
html.dark-mode .status-select-wrap::after { border-top-color: #4e6880; }

/* Pipeline empty state */
html.dark-mode .pipeline-col-empty    { color: #2a4a6b; }

/* History modal internals */
html.dark-mode .h-status-from         { background: #0d1b2e; color: #8facc4; }
html.dark-mode .history-note          { background: #0d1b2e; border-color: #1e3448; color: #8facc4; }
html.dark-mode .history-meta          { color: #4e6880; }
html.dark-mode .history-item::before  { background: #1e3448; }
html.dark-mode .history-dot           { border-color: #152032; box-shadow: 0 0 0 2px #1e3448; }
html.dark-mode .btn-cancel            { background: #0d1b2e; border-color: #1e3448; color: #8facc4; }
html.dark-mode .btn-cancel:hover      { background: #1a2d45; color: #e8edf5; }

/* ─── DARK MODE: Leads Index ─── */

/* Stats cards */
html.dark-mode .cm-stat               { background: #152032; border-color: #1e3448; }
html.dark-mode .cm-stat-label         { color: #4e6880; }
html.dark-mode .cm-stat-val           { color: #e8edf5; }
html.dark-mode .cm-stat-sub           { color: #4e6880; }

/* Toolbar */
html.dark-mode .cm-search             { background: #152032; border-color: #1e3448; }
html.dark-mode .cm-search input       { color: #e8edf5; }
html.dark-mode .cm-search input::placeholder { color: #4e6880; }
html.dark-mode .cm-search i           { color: #4e6880; }
html.dark-mode .cm-filter             { background: #152032; border-color: #1e3448; color: #e8edf5; }
html.dark-mode .tracker-btn           { background: #152032; border-color: #1e3448; color: #8facc4; }
html.dark-mode .tracker-btn:hover     { background: #1a2d45; color: var(--px-green); border-color: rgba(45,186,78,.3); }

/* Table card */
html.dark-mode .cm-card               { background: #152032; border-color: #1e3448; }
html.dark-mode .cm-card-header        { border-color: #1e3448; }
html.dark-mode .cm-card-header h2     { color: #e8edf5; }
html.dark-mode .cm-table thead th     { background: #0d1b2e; color: #4e6880; border-color: #1e3448; }
html.dark-mode .cm-table tbody tr     { border-color: #1e3448; }
html.dark-mode .cm-table tbody td     { color: #e8edf5; }
html.dark-mode .td-muted              { color: #8facc4; }
html.dark-mode .td-wrap               { color: #8facc4; }
html.dark-mode .cust-name             { color: #e8edf5; }
html.dark-mode .cust-email            { color: #4e6880; }
html.dark-mode .cust-av               { background: rgba(45,186,78,.15); color: var(--px-green); }

/* Status pills */
html.dark-mode .status-pill.New           { background: rgba(16,185,129,.18); color: #34d399; }
html.dark-mode .status-pill.Proposal-Sent { background: rgba(59,130,246,.18); color: #60a5fa; }
html.dark-mode .status-pill.Follow-up     { background: rgba(245,158,11,.18); color: #fbbf24; }
html.dark-mode .status-pill.Closed-Won    { background: rgba(14,165,233,.18); color: #38bdf8; }
html.dark-mode .status-pill.Not-Reachable { background: rgba(156,163,175,.15); color: #9ca3af; }

/* Source badges */
html.dark-mode .source-badge.website   { background: rgba(109,40,217,.2); color: #c4b5fd; }
html.dark-mode .source-badge.dashboard { background: rgba(3,105,161,.2);  color: #38bdf8; }

/* Assign cell */
html.dark-mode .assign-name           { color: #e8edf5; }
html.dark-mode .assign-btn            { background: rgba(109,40,217,.2); color: #c4b5fd; }
html.dark-mode .assign-btn:hover      { background: rgba(109,40,217,.3); color: #ddd6fe; }

/* Action buttons */
html.dark-mode .act-btn.view          { background: rgba(3,105,161,.2);   color: #38bdf8; }
html.dark-mode .act-btn.view:hover    { background: rgba(3,105,161,.35);  color: #7dd3fc; }
html.dark-mode .act-btn.history       { background: rgba(45,186,78,.15);  color: var(--px-green); }
html.dark-mode .act-btn.history:hover { background: rgba(45,186,78,.28);  color: #4ade80; }
html.dark-mode .act-btn.edit          { background: rgba(109,40,217,.2);  color: #c4b5fd; }
html.dark-mode .act-btn.edit:hover    { background: rgba(109,40,217,.35); color: #ddd6fe; }
html.dark-mode .act-btn.danger        { background: rgba(220,38,38,.18);  color: #f87171; }
html.dark-mode .act-btn.danger:hover  { background: rgba(220,38,38,.3);   color: #fca5a5; }

/* Export button */
html.dark-mode .export-btn            { background: rgba(45,186,78,.1); color: #4ade80; border-color: rgba(45,186,78,.25); }
html.dark-mode .export-btn:hover      { background: var(--px-green); color: #fff; border-color: var(--px-green); }

/* View modal hero */
html.dark-mode .view-lead-hero        { background: #0d1b2e; border-color: #1e3448; }
html.dark-mode .view-lead-av          { background: rgba(45,186,78,.15); color: var(--px-green); border-color: #152032; box-shadow: 0 0 0 2px #1e3448; }
html.dark-mode .view-lead-hero-name   { color: #e8edf5; }
html.dark-mode .view-lead-hero-email  { color: #4e6880; }
html.dark-mode .view-detail-label     { color: #4e6880; }
html.dark-mode .view-detail-value     { color: #e8edf5; }
html.dark-mode .view-detail-value.empty { color: #4e6880; }
html.dark-mode .view-section-divider  { color: #4e6880; border-color: #1e3448; }

/* Form controls inside modals */
html.dark-mode .form-control          { background: #0d1b2e; border-color: #1e3448; color: #e8edf5; }
html.dark-mode .form-control:focus    { border-color: var(--px-green); box-shadow: 0 0 0 3px rgba(45,186,78,.12); }
html.dark-mode .form-control::placeholder { color: #4e6880; }
html.dark-mode .form-label            { color: #8facc4; }

/* Assign modal history */
html.dark-mode #assignHistoryList > div { background: #0d1b2e !important; border-color: #1e3448 !important; }

/* Pagination */
html.dark-mode .cm-pagination         { border-color: #1e3448; }

/* ─── DARK MODE: Configuration page ─── */

/* Config card */
html.dark-mode .config-card                { background: #152032; border-color: #1e3448; }
html.dark-mode .config-card-header         { background: #152032; }
html.dark-mode .config-card-header:hover   { background: #1a2d45; }
html.dark-mode .config-card-header h2      { color: #e8edf5; }

/* Section body & table */
html.dark-mode .section-body               { border-color: #1e3448; }
html.dark-mode .config-table th            { background: #0d1b2e; color: #4e6880; border-color: #1e3448; }
html.dark-mode .config-table td            { border-color: #1e3448; color: #e8edf5; }
html.dark-mode .config-table tr:hover td   { background: #1a2d45; }
html.dark-mode .config-table tr:last-child td { border-bottom: none; }

/* Code badge */
html.dark-mode .config-table code          { background: #0d1b2e; color: #8facc4; }

/* Rate badges */
html.dark-mode .rate-badge                 { background: rgba(45,186,78,.12); color: #4ade80; }
html.dark-mode .count-badge                { background: rgba(45,186,78,.12); color: #4ade80; }

/* Active / Inactive status badges */
html.dark-mode .badge-active               { background: rgba(45,186,78,.18); color: #4ade80; border: none; }
html.dark-mode .badge-inactive             { background: rgba(156,163,175,.12); color: #8facc4; border: none; }

/* Icon buttons (edit/delete) */
html.dark-mode .btn-icon                   { background: #0d1b2e; border-color: #1e3448; color: #8facc4; }
html.dark-mode .btn-icon:hover             { background: #1a2d45; color: var(--px-green); }
html.dark-mode .btn-icon.danger:hover      { background: rgba(220,38,38,.15); color: #f87171; border-color: rgba(220,38,38,.3); }

/* Section footer collapse button */
html.dark-mode .section-footer             { border-color: #1e3448; }
html.dark-mode .btn-collapse               { color: #4e6880; }
html.dark-mode .btn-collapse:hover         { background: #1a2d45; color: #e8edf5; }

/* Modal form inputs & selects */
html.dark-mode .form-group input,
html.dark-mode .form-group select          { background: #0d1b2e; border-color: #1e3448; color: #e8edf5; }
html.dark-mode .form-group input:focus,
html.dark-mode .form-group select:focus    { border-color: var(--px-green); box-shadow: 0 0 0 3px rgba(45,186,78,.12); }
html.dark-mode .form-group input::placeholder { color: #4e6880; }
html.dark-mode .form-group label           { color: #8facc4; }

/* Fieldset boxes */
html.dark-mode .fieldset-box               { border-color: #1e3448; }
html.dark-mode .fieldset-box legend        { color: #4e6880; }

/* Toggle row */
html.dark-mode .toggle-row label           { color: #e8edf5; }

/* Modal cancel button */
html.dark-mode .btn-cancel                 { background: #0d1b2e; border-color: #1e3448; color: #8facc4; }
html.dark-mode .btn-cancel:hover           { background: #1a2d45; color: #e8edf5; }

/* Alert success */
html.dark-mode .alert-success              { background: rgba(45,186,78,.1); border-color: rgba(45,186,78,.25); color: #4ade80; }

/* ─── DARK MODE: Config code badge (inline style override) ─── */
html.dark-mode .config-table code {
    background: #1a2d45 !important;
    color: #8facc4 !important;
}

html.dark-mode .rate-badge {
    background: #1a2d45 !important;
    color: #ffffff !important;
}

html.dark-mode .count-badge {
    background: #1a2d45 !important;
    color: #ffffff !important;
}


/* ─── DARK MODE: Left Menu Management ─── */

html.dark-mode .badge-group  { background: rgba(109,40,217,.2); color: #c4b5fd; }
html.dark-mode .badge-parent { background: rgba(45,186,78,.15); color: #4ade80; }
html.dark-mode .badge-child  { background: rgba(217,119,6,.18); color: #fbbf24; }

html.dark-mode .data-table code {
    background: #1a2d45 !important;
    color: #ffffff !important;
}

html.dark-mode .icon-preview-box {
    background: #0d1b2e !important;
    border-color: #1e3448 !important;
}

html.dark-mode .icon-preview-label       { color: #4e6880; }
html.dark-mode .icon-preview-label.found { color: var(--px-green); }

html.dark-mode .sort-order-hint          { color: #4e6880; }

html.dark-mode .form-card-wrap .card     { background: #152032; border-color: #1e3448; }

html.dark-mode small code {
    background: #1a2d45 !important;
    color: #ffffff !important;
}


/* ─── DARK MODE: Roles & Users ─── */

/* Roles index — perm badge */
html.dark-mode .perm-badge            { background: rgba(45,186,78,.12); color: #4ade80; border-color: rgba(45,186,78,.25); }

/* Role/Users table action buttons */
html.dark-mode .btn-edit              { background: rgba(37,99,235,.2);  color: #60a5fa; }
html.dark-mode .btn-edit:hover        { background: rgba(37,99,235,.35); color: #93c5fd; }
html.dark-mode .btn-delete            { background: rgba(220,38,38,.18); color: #f87171; }
html.dark-mode .btn-delete:hover      { background: rgba(220,38,38,.3);  color: #fca5a5; }

/* Type badges — Users table */
html.dark-mode .type-super            { background: rgba(217,119,6,.2);  color: #fbbf24; }
html.dark-mode .type-staff            { background: rgba(45,186,78,.15); color: #4ade80; }
html.dark-mode .role-badge            { background: rgba(37,99,235,.18); color: #60a5fa; }

/* Users table admin avatar */
html.dark-mode .admin-avatar          { background: linear-gradient(135deg, rgba(45,186,78,.4), rgba(36,160,66,.4)); color: #4ade80; }

/* Create/Edit Role — role name card */
html.dark-mode .role-name-card        { background: #152032; border-color: #1e3448; }

/* Permissions outer card */
html.dark-mode .perm-outer-card       { background: #152032; border-color: #1e3448; }
html.dark-mode .perm-outer-header     { background: #0d1b2e; border-color: #1e3448; }
html.dark-mode .perm-outer-header h3  { color: #e8edf5; }

/* Permission group boxes */
html.dark-mode .perm-group-box            { border-color: #1e3448; }
html.dark-mode .perm-group-box-header     { background: #0d1b2e; border-color: #1e3448; }
html.dark-mode .perm-group-box-header:hover { background: rgba(45,186,78,.08); }
html.dark-mode .checked-header            { background: rgba(45,186,78,.12) !important; border-color: var(--px-green) !important; }
html.dark-mode .perm-group-label          { color: #8facc4; }
html.dark-mode .perm-group-count          { background: rgba(45,186,78,.15); color: #4ade80; border-color: rgba(45,186,78,.25); }

/* Permission items */
html.dark-mode .perm-item                        { background: #152032; border-color: #1e3448; }
html.dark-mode .perm-item:hover                  { background: rgba(45,186,78,.06); }
html.dark-mode .perm-item:has(input:checked)     { background: rgba(45,186,78,.12); border-color: rgba(45,186,78,.4) !important; }
html.dark-mode .perm-title                       { color: #e8edf5; }
html.dark-mode .perm-sub-badge                   { background: rgba(217,119,6,.18); color: #fbbf24; }

/* Checkmarks */
html.dark-mode .checkmark                        { border-color: #2a4a6b; background: #0d1b2e; }
html.dark-mode .perm-item:has(input:checked) .checkmark { background: var(--px-green); border-color: var(--px-green); }
html.dark-mode .perm-group-check:has(input:checked) .checkmark { background: var(--px-green); border-color: var(--px-green); }

/* Sticky form actions bar */
html.dark-mode .form-actions-sticky  { background: #0d1b2e; }

/* Outline buttons (Select All / Deselect All) */
html.dark-mode .btn-outline           { background: #0d1b2e; border-color: #1e3448; color: #8facc4; }
html.dark-mode .btn-outline:hover     { background: rgba(45,186,78,.1); border-color: var(--px-green); color: var(--px-green); }

/* Add/Edit User form card */
html.dark-mode .form-card-wrap .card  { background: #152032; border-color: #1e3448; }

html.dark-mode .perm-item:has(input:checked) {
    background: #1a2d45 !important;
    border-color: #2a4a6b !important;
}

html.dark-mode .perm-group-box-header.checked-header {
    background: #1a2d45 !important;
    border-color: #2a4a6b !important;
}

html.dark-mode .perm-group-count {
    background: #0d1b2e !important;
    color: #8facc4 !important;
    border-color: #2a4a6b !important;
}


html.dark-mode .content-area > .card,
html.dark-mode .content-area > div > .card,
html.dark-mode .form-card-wrap .card,
html.dark-mode .card.form-card {
    background: #152032 !important;
    border-color: #1e3448 !important;
}

html.dark-mode .perm-item:has(input:checked) .checkmark,
html.dark-mode .perm-group-check:has(input:checked) .checkmark {
    background: #4e6880 !important;
    border-color: #4e6880 !important;
}

html.dark-mode .btn-outline {
    background: #0d1b2e !important;
    border-color: #2a4a6b !important;
    color: #8facc4 !important;
}

html.dark-mode .btn-outline:hover {
    background: #1a2d45 !important;
    border-color: #4e6880 !important;
    color: #e8edf5 !important;
}


.swal2-confirm:focus,
.swal2-cancel:focus,
.swal2-confirm:focus-visible,
.swal2-cancel:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}
/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .stats-row           { grid-template-columns: 1fr 1fr; gap: 12px; }
    .quick-actions-grid  { grid-template-columns: 1fr; gap: 10px; }
    .stat-card           { padding: 16px; min-width: 0; }
    .stat-footer         { font-size: 11px; flex-wrap: wrap; }
    .profile-layout      { grid-template-columns: 1fr; }
    .profile-fields      { grid-template-columns: 1fr; }
    .profile-security-row { flex-direction: column; align-items: flex-start; gap: 12px; }
    .form-grid           { grid-template-columns: 1fr; }
    .perm-grid           { grid-template-columns: 1fr 1fr; }
    .content-area        { padding: 16px; }
    .modal-box           { width: 100%; max-width: 100%; margin: 0; }
    .avatar-upload-wrap  { flex-direction: column; align-items: flex-start; gap: 14px; }
    .header-btn[title="Fullscreen"],
    .header-btn[title="Notifications"] { display: none; }
    .header-search       { display: none; }
}


/* ════════════════════════════════════════════════════════════════
   SELECT-STATE — CSS ADDITIONS
   Add these rules into style.css, after the existing
   "Savings sheet — state select page" dark-mode block.
   They extend the ss-* component rules for the new sidebar layout,
   disabled Proceed button, unavailability toast, and full dark mode.
════════════════════════════════════════════════════════════════ */


/* ── 1. Sidebar width bump & map stretch ── */
.ss-sidebar {
    width: 320px;       /* was 300px — slightly more room */
}

.ss-map-panel {
    min-width: 0;       /* allow flex item to shrink below content size */
}


/* ── 2. Proceed button — disabled state ── */
.ss-float-btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.ss-float-btn--disabled,
.ss-float-btn:disabled {
    background: linear-gradient(135deg, #d1d5db, #9ca3af) !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
    opacity: 0.75;
    transform: none !important;
    color: #fff !important;
    pointer-events: auto; /* keeps JS click working for the toast */
}

.ss-float-btn--disabled:hover,
.ss-float-btn:disabled:hover {
    opacity: 0.75;
    transform: none !important;
}


/* ── 3. "State not available" toast ── */
.ss-unavail-popup {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    width: max-content;
    max-width: calc(100% - 48px);
}
.ss-unavail-popup.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.ss-unavail-inner {
    display: flex; align-items: center; gap: 12px;
    background: #fff;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.13);
}
.ss-unavail-icon {
    width: 34px; height: 34px;
    background: #fef3c7; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.ss-unavail-icon [data-lucide] { width:16px; height:16px; color:#d97706; stroke-width:2.2; }
.ss-unavail-text { font-size:13px; color:#374151; line-height:1.5; }
.ss-unavail-text strong { color:#92400e; font-weight:700; }
.ss-unavail-text span { display:block; font-size:11.5px; color:#94a3b8; margin-top:1px; }
.ss-unavail-close {
    background: none; border: none; cursor: pointer;
    color: #94a3b8; padding: 4px; border-radius: 6px;
    flex-shrink: 0; margin-left: 4px;
    display: flex; align-items: center; justify-content: center;
    transition: color 0.15s, background 0.15s;
}
.ss-unavail-close:hover { background: #f3f4f6; color: #374151; }
.ss-unavail-close [data-lucide] { width:14px; height:14px; stroke-width:2.2; }

/* Mobile toast reposition */
@media (max-width: 768px) {
    .ss-unavail-popup {
        top: auto; bottom: 130px;
        left: 12px; right: 12px;
        transform: none; width: auto; max-width: unset;
    }
    .ss-unavail-popup.show { transform: none; }
}


/* ════════════════════════════════════════════════════════════════
   DARK MODE  (html.dark-mode — matches the convention in style.css)
════════════════════════════════════════════════════════════════ */

/* Wrap background */
html.dark-mode .ss-wrap { background: #0d1b2e !important; }

/* ── Sidebar ── */
html.dark-mode .ss-sidebar {
    background: #0f1e30 !important;
    border-right-color: #1a2d45 !important;
    box-shadow: 2px 0 12px rgba(0,0,0,0.4) !important;
}
html.dark-mode .ss-sidebar-head { border-bottom-color: #1a2d45 !important; }
html.dark-mode .ss-title        { color: #e8edf5 !important; }
html.dark-mode .ss-subtitle     { color: #4e6880 !important; }

/* Search */
html.dark-mode .ss-search-wrap  { border-bottom-color: #1a2d45 !important; }
html.dark-mode .ss-search {
    background: #0d1b2e !important;
    border-color: #1e3448 !important;
    color: #e8edf5 !important;
}
html.dark-mode .ss-search::placeholder { color: #4e6880 !important; }
html.dark-mode .ss-search:focus        { border-color: #f59e0b !important; background: #0f1e30 !important; }
html.dark-mode .ss-search-icon         { color: #4e6880 !important; }

/* List scrollbar */
html.dark-mode .ss-list::-webkit-scrollbar-thumb { background: #1e3448 !important; }

/* List items */
html.dark-mode .ss-item:hover { background: #1a2d45 !important; }
html.dark-mode .ss-item.active {
    background: #1d1700 !important;
    border-left-color: #f59e0b !important;
}
html.dark-mode .ss-item.active .ss-item-name  { color: #fbbf24 !important; }
html.dark-mode .ss-item.active .ss-item-code  { background: #2e1f00 !important; color: #f59e0b !important; }
html.dark-mode .ss-item.active .ss-item-arrow { color: #f59e0b !important; }
html.dark-mode .ss-item-code  { background: #1a2d45 !important; color: #8facc4 !important; }
html.dark-mode .ss-item-name  { color: #cbd5e1 !important; }
html.dark-mode .ss-item-arrow { color: #2a4a6b !important; }
html.dark-mode .ss-empty      { color: #2a4a6b !important; }

/* Map panel */
html.dark-mode .ss-map-panel  { background: #0d1b2e !important; }
html.dark-mode .ss-map-panel::before {
    background-image:
        linear-gradient(rgba(71,85,105,0.14) 1px, transparent 1px),
        linear-gradient(90deg, rgba(71,85,105,0.14) 1px, transparent 1px) !important;
}
html.dark-mode .ss-map-loading { background: #0d1b2e !important; color: #4e6880 !important; }
html.dark-mode .ss-spinner     { border-color: #1e3448 !important; border-top-color: #f59e0b !important; }

/* SVG state paths */
html.dark-mode .india-state        { fill: #1e3a5f !important; stroke: #0d1b2e !important; }
html.dark-mode .india-state:hover  { fill: #2563ab !important; }
html.dark-mode .india-state.active { fill: #f59e0b !important; }

/* Float card */
html.dark-mode .ss-float-card {
    background: #152032 !important;
    border-color: #1e3448 !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
}
html.dark-mode .ss-float-label   { color: #4e6880 !important; }
html.dark-mode .ss-float-state   { color: #e8edf5 !important; }
html.dark-mode .ss-float-capital { color: #8facc4 !important; }

/* Proceed button enabled — keep the amber gradient, just fine-tune shadow */
html.dark-mode .ss-float-btn:not(:disabled):not(.ss-float-btn--disabled) {
    box-shadow: 0 4px 14px -4px rgba(245,158,11,0.4) !important;
}

/* Proceed button disabled in dark mode */
html.dark-mode .ss-float-btn--disabled,
html.dark-mode .ss-float-btn:disabled {
    background: linear-gradient(135deg, #1e3448, #2a3f54) !important;
    color: #4e6880 !important;
    box-shadow: none !important;
}

/* Unavailability toast */
html.dark-mode .ss-unavail-inner {
    background: #152032 !important;
    border-color: #2e1f00 !important;
    border-left-color: #f59e0b !important;
    box-shadow: 0 8px 28px rgba(0,0,0,0.5) !important;
}
html.dark-mode .ss-unavail-icon         { background: #2e1f00 !important; }
html.dark-mode .ss-unavail-icon [data-lucide] { color: #fbbf24 !important; }
html.dark-mode .ss-unavail-text         { color: #cbd5e1 !important; }
html.dark-mode .ss-unavail-text strong  { color: #fbbf24 !important; }
html.dark-mode .ss-unavail-text span    { color: #4e6880 !important; }
html.dark-mode .ss-unavail-close        { color: #4e6880 !important; }
html.dark-mode .ss-unavail-close:hover  { background: #1a2d45 !important; color: #e8edf5 !important; }




/* ── 1. Toast: top-right corner, 20px gap from top, 24px from right ── */
.ss-unavail-popup {
    left: auto !important;
    right: 24px !important;
    top: 20px !important;
    transform: translateY(-10px) !important;
    width: auto !important;
    max-width: 340px !important;
}

.ss-unavail-popup.show {
    transform: translateY(0) !important;   
}


/* ── 2. Active sidebar item — blue instead of amber/brown ── */
.ss-item.active {
    background: #eff6ff !important;            
    border-left-color: #3b82f6 !important;    
}

.ss-item.active .ss-item-name {
    color: #1d4ed8 !important;                 
    font-weight: 600;
}

.ss-item.active .ss-item-code {
    background: #dbeafe !important;          
    color: #1d4ed8 !important;
}

.ss-item.active .ss-item-arrow {
    opacity: 1;
    color: #3b82f6 !important;
}


/* ── 3. Sidebar slightly narrower ── */
.ss-sidebar {
    width: 290px !important;                   /* was 320px → tighter */
}


/* ════ DARK MODE patches (html.dark-mode) ════ */

/* Toast top-right in dark mode — position is inherited, just re-confirm */
html.dark-mode .ss-unavail-popup {
    left: auto !important;
    right: 24px !important;
}

/* Active item — blue in dark mode */
html.dark-mode .ss-item.active {
    background: rgba(37,99,235,0.15) !important;
    border-left-color: #3b82f6 !important;
}

html.dark-mode .ss-item.active .ss-item-name {
    color: #60a5fa !important;
}

html.dark-mode .ss-item.active .ss-item-code {
    background: rgba(37,99,235,0.25) !important;
    color: #60a5fa !important;
}

html.dark-mode .ss-item.active .ss-item-arrow {
    color: #3b82f6 !important;
}

/* Mobile: keep toast top-right, allow it to stretch a bit */
@media (max-width: 768px) {
    .ss-unavail-popup {
        left: auto !important;
        right: 12px !important;
        top: 12px !important;
        max-width: calc(100% - 24px) !important;
        transform: translateY(-10px) !important;
    }
    .ss-unavail-popup.show {
        transform: translateY(0) !important;
    }
}


/* ════════════════════════════════════════════════════════════════
   SELECT-STATE — PATCH v2
   Fixes:
     1. Toast popup → top-right corner
     2. Active sidebar item → AMBER in light mode (original), BLUE in dark mode
     3. Sidebar slightly narrower
════════════════════════════════════════════════════════════════ */


/* ── 1. Toast: top-right corner ── */
.ss-unavail-popup {
    left: auto !important;
    right: 24px !important;
    top: 20px !important;
    transform: translateY(-10px) !important;
    width: auto !important;
    max-width: 340px !important;
}

.ss-unavail-popup.show {
    transform: translateY(0) !important;
}


/* ── 2. Active sidebar item — LIGHT MODE: original amber ── */
.ss-item.active {
    background: #fffbeb !important;
    border-left-color: #f59e0b !important;
}

.ss-item.active .ss-item-name {
    color: #92400e !important;
    font-weight: 600;
}

.ss-item.active .ss-item-code {
    background: #fef3c7 !important;
    color: #b45309 !important;
}

.ss-item.active .ss-item-arrow {
    opacity: 1;
    color: #f59e0b !important;
}


/* ── 3. Sidebar narrower ── */
.ss-sidebar {
    width: 290px !important;
}


/* ════ DARK MODE only (html.dark-mode) ════ */

/* Toast */
html.dark-mode .ss-unavail-popup {
    left: auto !important;
    right: 24px !important;
}

/* Active item in dark mode → blue */
html.dark-mode .ss-item.active {
    background: rgba(37,99,235,0.15) !important;
    border-left-color: #3b82f6 !important;
}

html.dark-mode .ss-item.active .ss-item-name {
    color: #60a5fa !important;
}

html.dark-mode .ss-item.active .ss-item-code {
    background: rgba(37,99,235,0.25) !important;
    color: #60a5fa !important;
}

html.dark-mode .ss-item.active .ss-item-arrow {
    color: #3b82f6 !important;
}



/* ═══════════════════════════════════════════════════════════════
   DARK MODE — Job Openings / Applicants / Job Form (Bootstrap pages)
   Append to app2.css
   ═══════════════════════════════════════════════════════════════ */

/* Page text */
html.dark-mode .text-dark { color: #e8edf5 !important; }
html.dark-mode .text-muted { color: #4e6880 !important; }

/* Cards */
html.dark-mode .card {
    background: #152032 !important;
    border-color: #1e3448 !important;
}
html.dark-mode .card-header,
html.dark-mode .card-footer {
    background: #152032 !important;
    border-color: #1e3448 !important;
}
html.dark-mode .bg-light {
    background: #0d1b2e !important;
}
html.dark-mode .bg-white {
    background: #152032 !important;
}

/* Stat icon tint boxes */
html.dark-mode .bg-primary.bg-opacity-10 { background-color: rgba(37,99,235,.18) !important; }
html.dark-mode .bg-success.bg-opacity-10 { background-color: rgba(45,186,78,.18) !important; }
html.dark-mode .bg-warning.bg-opacity-10 { background-color: rgba(245,158,11,.18) !important; }
html.dark-mode .bg-danger.bg-opacity-10  { background-color: rgba(220,38,38,.18) !important; }
html.dark-mode .bg-secondary.bg-opacity-10 { background-color: rgba(148,163,184,.15) !important; }
html.dark-mode .bg-info.bg-opacity-10 { background-color: rgba(14,165,233,.18) !important; }

/* Status pill badges (rounded-pill) */
html.dark-mode .bg-success.bg-opacity-15.text-success {
    background-color: rgba(45,186,78,.18) !important;
    color: #4ade80 !important;
}
html.dark-mode .bg-secondary.bg-opacity-15.text-secondary {
    background-color: rgba(148,163,184,.15) !important;
    color: #8facc4 !important;
}

/* Plain badges (Type / Work Mode) */
html.dark-mode .badge.bg-info.bg-opacity-10.text-info {
    background-color: rgba(14,165,233,.18) !important;
    color: #38bdf8 !important;
}
html.dark-mode .badge.bg-primary.bg-opacity-10.text-primary {
    background-color: rgba(37,99,235,.18) !important;
    color: #60a5fa !important;
}

/* Table */
html.dark-mode .table {
    color: #e8edf5 !important;
    --bs-table-bg: transparent;
}
html.dark-mode .table thead.bg-light th {
    background: #0d1b2e !important;
    color: #4e6880 !important;
    border-color: #1e3448 !important;
}
html.dark-mode .table td,
html.dark-mode .table th {
    border-color: #1e3448 !important;
    color: #e8edf5 !important;
}
html.dark-mode .table-hover > tbody > tr:hover > * {
    background-color: #1a2d45 !important;
    color: #e8edf5 !important;
}

/* Inputs / selects */
html.dark-mode .form-control,
html.dark-mode .form-select,
html.dark-mode textarea.form-control {
    background-color: #0d1b2e !important;
    border-color: #1e3448 !important;
    color: #e8edf5 !important;
}
html.dark-mode .form-control::placeholder {
    color: #4e6880 !important;
}
html.dark-mode .form-control:focus,
html.dark-mode .form-select:focus {
    background-color: #0d1b2e !important;
    border-color: #2dba4e !important;
    color: #e8edf5 !important;
    box-shadow: 0 0 0 0.25rem rgba(45,186,78,.15) !important;
}
html.dark-mode .input-group-text {
    background-color: #0d1b2e !important;
    border-color: #1e3448 !important;
    color: #8facc4 !important;
}
html.dark-mode .form-label { color: #8facc4 !important; }

/* Status select dropdown (applicants) */
html.dark-mode .status-select {
    background-color: #0d1b2e !important;
    border-color: #1e3448 !important;
    color: #e8edf5 !important;
}

/* Buttons */
html.dark-mode .btn-outline-secondary {
    background: #152032 !important;
    border-color: #1e3448 !important;
    color: #8facc4 !important;
}
html.dark-mode .btn-outline-secondary:hover {
    background: #1a2d45 !important;
    color: #e8edf5 !important;
}
html.dark-mode .btn-outline-dark {
    background: #152032 !important;
    border-color: #1e3448 !important;
    color: #e8edf5 !important;
}
html.dark-mode .btn-outline-dark:hover {
    background: #1a2d45 !important;
    color: #fff !important;
}
html.dark-mode .btn-light {
    background: #152032 !important;
    border-color: #1e3448 !important;
    color: #8facc4 !important;
}
html.dark-mode .btn-light:hover {
    background: #1a2d45 !important;
    color: #e8edf5 !important;
}
html.dark-mode .btn-outline-primary {
    border-color: #2563eb !important;
    color: #60a5fa !important;
    background: transparent !important;
}
html.dark-mode .btn-outline-info {
    border-color: #0ea5e9 !important;
    color: #38bdf8 !important;
    background: transparent !important;
}
html.dark-mode .btn-outline-success {
    border-color: #2dba4e !important;
    color: #4ade80 !important;
    background: transparent !important;
}
html.dark-mode .btn-outline-danger {
    border-color: #dc2626 !important;
    color: #f87171 !important;
    background: transparent !important;
}

/* Alerts */
html.dark-mode .alert-success {
    background: rgba(45,186,78,.1) !important;
    border-color: rgba(45,186,78,.25) !important;
    color: #4ade80 !important;
}
html.dark-mode .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Modal (Bootstrap) */
html.dark-mode .modal-content {
    background: #152032 !important;
    border-color: #1e3448 !important;
    color: #e8edf5 !important;
}
html.dark-mode .modal-header,
html.dark-mode .modal-footer {
    border-color: #1e3448 !important;
}
html.dark-mode #view-cover.bg-light {
    background: #0d1b2e !important;
    border-color: #1e3448 !important;
    color: #cbd5e1 !important;
}

/* Tag input badges (job form skills/categories) */
html.dark-mode .job-form-wrapper .border {
    background: #0d1b2e !important;
    border-color: #1e3448 !important;
}
html.dark-mode .badge-skill {
    background-color: rgba(45,186,78,.15) !important;
    color: #4ade80 !important;
    border-color: rgba(45,186,78,.3) !important;
}
html.dark-mode .badge-category {
    background-color: #0d1b2e !important;
    color: #8facc4 !important;
    border-color: #1e3448 !important;
}

/* Pagination */
html.dark-mode .pagination .page-link {
    background: #152032 !important;
    border-color: #1e3448 !important;
    color: #8facc4 !important;
}
html.dark-mode .pagination .page-item.active .page-link {
    background: #2dba4e !important;
    border-color: #2dba4e !important;
    color: #fff !important;
}
html.dark-mode .pagination .page-item.disabled .page-link {
    background: #0d1b2e !important;
    border-color: #1e3448 !important;
    color: #4e6880 !important;
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE — Notifications Page + Header Notification Dropdown
   Append to app2.css
   ═══════════════════════════════════════════════════════════════ */

/* ── Notifications Page ── */
html.dark-mode .notif-page-title { color: #e8edf5 !important; }
html.dark-mode .notif-page-sub   { color: #4e6880 !important; }

html.dark-mode .notif-mark-all-btn { background: #2dba4e !important; }
html.dark-mode .notif-mark-all-btn:hover { background: #24a042 !important; }

/* Tabs */
html.dark-mode .notif-tabs { border-bottom-color: #1e3448 !important; }
html.dark-mode .notif-tab  { color: #4e6880 !important; }
html.dark-mode .notif-tab.active { color: #2dba4e !important; border-bottom-color: #2dba4e !important; }
html.dark-mode .notif-tab-badge { background: #dc2626 !important; }

/* Row cards */
html.dark-mode .notif-row {
    background: #152032 !important;
    border-color: #1e3448 !important;
}
html.dark-mode .notif-row:hover { box-shadow: 0 2px 12px rgba(0,0,0,.4) !important; }
html.dark-mode .notif-row.is-read { background: #0f1e30 !important; opacity: .65; }

/* Icon backgrounds */
html.dark-mode .color-green  { background: rgba(45,186,78,.15) !important; color: #4ade80 !important; }
html.dark-mode .color-blue   { background: rgba(37,99,235,.18) !important; color: #60a5fa !important; }
html.dark-mode .color-yellow { background: rgba(217,119,6,.18) !important; color: #fbbf24 !important; }
html.dark-mode .color-purple { background: rgba(124,58,237,.18) !important; color: #c4b5fd !important; }
html.dark-mode .color-gray   { background: rgba(148,163,184,.15) !important; color: #8facc4 !important; }

/* Body text */
html.dark-mode .notif-row-msg  { color: #e8edf5 !important; }
html.dark-mode .notif-row-sub  { color: #8facc4 !important; }
html.dark-mode .notif-row-time { color: #4e6880 !important; }

/* Actions */
html.dark-mode .notif-read-btn {
    border-color: #2dba4e !important;
    color: #2dba4e !important;
}
html.dark-mode .notif-read-btn:hover { background: #2dba4e !important; color: #fff !important; }
html.dark-mode .notif-read-label { color: #4e6880 !important; }
html.dark-mode .notif-view-btn   { color: #4ade80 !important; }

/* Empty state */
html.dark-mode .notif-empty-state { color: #4e6880 !important; }
html.dark-mode .notif-empty-state svg { stroke: #2a4a6b !important; }


/* ── Header Notification Dropdown ── */
html.dark-mode .notif-badge { background: #dc2626 !important; }

html.dark-mode .notif-dropdown {
    background: #152032 !important;
    border-color: #1e3448 !important;
    box-shadow: 0 12px 40px rgba(0,0,0,.5) !important;
}

html.dark-mode .notif-hd { border-bottom-color: #1e3448 !important; }
html.dark-mode .notif-hd-title    { color: #e8edf5 !important; }
html.dark-mode .notif-mark-all-hd { color: #4ade80 !important; }

html.dark-mode .notif-item-li { border-bottom-color: #1e3448 !important; }
html.dark-mode .notif-item-li:hover { background: #1a2d45 !important; }

html.dark-mode .ni-icon.green  { background: rgba(45,186,78,.15) !important; color: #4ade80 !important; }
html.dark-mode .ni-icon.blue   { background: rgba(37,99,235,.18) !important; color: #60a5fa !important; }
html.dark-mode .ni-icon.yellow { background: rgba(217,119,6,.18) !important; color: #fbbf24 !important; }
html.dark-mode .ni-icon.purple { background: rgba(124,58,237,.18) !important; color: #c4b5fd !important; }
html.dark-mode .ni-icon.gray   { background: rgba(148,163,184,.15) !important; color: #8facc4 !important; }

html.dark-mode .ni-msg  { color: #e8edf5 !important; }
html.dark-mode .ni-sub  { color: #8facc4 !important; }
html.dark-mode .ni-time { color: #4e6880 !important; }

html.dark-mode .ni-read-btn {
    color: #4ade80 !important;
    border-color: #2dba4e !important;
}
html.dark-mode .ni-read-btn:hover { background: #2dba4e !important; color: #fff !important; }

html.dark-mode .notif-empty-item { color: #4e6880 !important; }

html.dark-mode .notif-ft { border-top-color: #1e3448 !important; }
html.dark-mode .notif-ft a { color: #4ade80 !important; }

/* Mobile */
@media (max-width: 768px) {
    .ss-unavail-popup {
        left: auto !important;
        right: 12px !important;
        top: 12px !important;
        max-width: calc(100% - 24px) !important;
        transform: translateY(-10px) !important;
    }
    .ss-unavail-popup.show {
        transform: translateY(0) !important;
    }
}



/* ════════════════════════════════════════════════════════════════
   SELECT-STATE — PATCH v3
════════════════════════════════════════════════════════════════ */


/* ── 1. Toast: top-right corner ── */
.ss-unavail-popup {
    left: auto !important;
    right: 24px !important;
    top: 20px !important;
    transform: translateY(-10px) !important;
    width: auto !important;
    max-width: 340px !important;
}
.ss-unavail-popup.show {
    transform: translateY(0) !important;
}


/* ── 2. Active sidebar item — LIGHT MODE: original amber ── */
.ss-item.active {
    background: #fffbeb !important;
    border-left-color: #f59e0b !important;
}
.ss-item.active .ss-item-name  { color: #92400e !important; font-weight: 600; }
.ss-item.active .ss-item-code  { background: #fef3c7 !important; color: #b45309 !important; }
.ss-item.active .ss-item-arrow { opacity: 1; color: #f59e0b !important; }


/* ── 3. Sidebar — tighter to close the gap ── */
.ss-sidebar {
    width: 340px !important;   /* was 290 → 240 closes the gap */
}

/* Tighten internal padding to match narrower width */
.ss-sidebar-head {
    padding: 18px 14px 14px !important;
    gap: 10px !important;
}
.ss-item {
    padding: 10px 14px !important;
}
.ss-search-wrap {
    padding: 10px 12px !important;
}
.ss-search {
    font-size: 12px !important;
}
.ss-title    { font-size: 14px !important; }
.ss-subtitle { font-size: 11px !important; }


/* ════ DARK MODE only (html.dark-mode) ════ */
html.dark-mode .ss-unavail-popup {
    left: auto !important;
    right: 24px !important;
}
html.dark-mode .ss-item.active {
    background: rgba(37,99,235,0.15) !important;
    border-left-color: #3b82f6 !important;
}
html.dark-mode .ss-item.active .ss-item-name  { color: #60a5fa !important; }
html.dark-mode .ss-item.active .ss-item-code  { background: rgba(37,99,235,0.25) !important; color: #60a5fa !important; }
html.dark-mode .ss-item.active .ss-item-arrow { color: #3b82f6 !important; }


/* Mobile */
@media (max-width: 768px) {
    .ss-sidebar { width: 100% !important; }
    .ss-unavail-popup {
        left: auto !important;
        right: 12px !important;
        top: 12px !important;
        max-width: calc(100% - 24px) !important;
        transform: translateY(-10px) !important;
    }
    .ss-unavail-popup.show { transform: translateY(0) !important; }
}


/* ── Toast: top-right corner ── */
.ss-unavail-popup {
    left: auto !important;
    right: 24px !important;
    top: 20px !important;
    transform: translateY(-10px) !important;
    width: auto !important;
    max-width: 340px !important;
}
.ss-unavail-popup.show {
    transform: translateY(0) !important;
}

/* ── Active sidebar item — LIGHT MODE: amber ── */
.ss-item.active                { background: #fffbeb !important; border-left-color: #f59e0b !important; }
.ss-item.active .ss-item-name  { color: #92400e !important; font-weight: 600; }
.ss-item.active .ss-item-code  { background: #fef3c7 !important; color: #b45309 !important; }
.ss-item.active .ss-item-arrow { opacity: 1; color: #f59e0b !important; }

/* ── Sidebar width + tighter internal padding ── */
.ss-sidebar      { width: 340px !important; }
.ss-sidebar-head { padding: 18px 14px 14px !important; gap: 10px !important; }
.ss-item         { padding: 10px 14px !important; }
.ss-search-wrap  { padding: 10px 12px !important; }
.ss-search       { font-size: 12px !important; }
.ss-title        { font-size: 14px !important; }
.ss-subtitle     { font-size: 11px !important; }

/* ── DARK MODE ── */
html.dark-mode .ss-unavail-popup              { left: auto !important; right: 24px !important; }
html.dark-mode .ss-item.active                { background: rgba(37,99,235,0.15) !important; border-left-color: #3b82f6 !important; }
html.dark-mode .ss-item.active .ss-item-name  { color: #60a5fa !important; }
html.dark-mode .ss-item.active .ss-item-code  { background: rgba(37,99,235,0.25) !important; color: #60a5fa !important; }
html.dark-mode .ss-item.active .ss-item-arrow { color: #3b82f6 !important; }

/* ════════════════════════════════════════
   MOBILE
════════════════════════════════════════ */
@media (max-width: 768px) {

    /* 1. Outer wrap: vertical stack */
    .ss-wrap {
        flex-direction: column !important;
        height: auto !important;
        min-height: 100% !important;
        overflow: visible !important;
    }

    /* 2. Sidebar: full width, auto height */
    .ss-sidebar {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        border-right: none !important;
        border-bottom: 1px solid #e8edf3 !important;
        overflow: visible !important;
    }

    /* 3. State list: no internal scroll */
    .ss-list {
        overflow-y: visible !important;
        max-height: none !important;
    }

    /*
     * 4. KEY FIX:
     *    .ss-map-panel becomes a flex COLUMN so its children stack:
     *      [svg map]  ← fixed height via the pseudo-wrapper trick
     *      [float card] ← flows naturally below
     *    Height is auto so it expands to fit both children.
     */
    .ss-map-panel {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        height: auto !important;        /* expands to fit map + card */
        max-height: none !important;
        position: relative !important;
        overflow: visible !important;
        flex-shrink: 0 !important;
    }

    /* 5. The SVG map gets a fixed height box — wrap it with a pseudo-element */
    .ss-map-svg {
        position: relative !important;  /* back to normal flow */
        width: 100% !important;
        height: 55vw !important;        /* ~220px on a 400px phone */
        min-height: 200px !important;
        max-height: 320px !important;
        display: block !important;
        flex-shrink: 0 !important;
    }

    /* Loading overlay still covers just the map area */
    .ss-map-loading {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        height: 55vw !important;
        min-height: 200px !important;
        max-height: 320px !important;
    }

    /* 6. Float card: normal block BELOW the map SVG */
    .ss-float-card {
        position: static !important;
        display: block !important;
        width: 100% !important;
        min-width: unset !important;
        box-sizing: border-box !important;
        opacity: 1 !important;
        transform: none !important;
        pointer-events: auto !important;
        border-top: 1px solid #e8edf3 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        /* restore sensible padding since we removed the card chrome */
        padding: 16px !important;
    }

    /* 7. Toast: anchored top-right inside the map area */
    .ss-unavail-popup {
        left: auto !important;
        right: 10px !important;
        top: 10px !important;
        max-width: calc(100% - 20px) !important;
        transform: translateY(-8px) !important;
        position: absolute !important;
    }
    .ss-unavail-popup.show {
        transform: translateY(0) !important;
    }

    /* 8. Dark mode sidebar border */
    html.dark-mode .ss-sidebar {
        border-bottom-color: #1a2d45 !important;
    }
}




@media (max-width: 520px) {
    .modal-box { border-radius: var(--radius-lg); }
}



@media (max-width: 480px) {
    .stats-row       { grid-template-columns: 1fr 1fr; }
    .stat-value      { font-size: 20px; }
    .perm-grid       { grid-template-columns: 1fr; }
    .sv-fields-grid  { grid-template-columns: 1fr; }
    .sv-energy-grid  { grid-template-columns: 1fr; }
}



/* ═══════════════════════════════════════════════════════════════
   DARK MODE — Configuration page (cx-* namespace)
   ═══════════════════════════════════════════════════════════════ */

/* Cards */
html.dark-mode .cx-card { background: #152032 !important; border-color: #1e3448 !important; }
html.dark-mode .cx-hdr:hover { background: #1a2d45 !important; }
html.dark-mode .cx-hdr-title { color: #e8edf5 !important; }
html.dark-mode .cx-body { border-color: #1e3448 !important; }

/* Badges */
html.dark-mode .cx-badge { background: rgba(45,186,78,.15) !important; color: #4ade80 !important; border-color: rgba(45,186,78,.3) !important; }
html.dark-mode .cx-chev { color: #4e6880 !important; }

/* Banners */
html.dark-mode .cx-banner.blue  { background: rgba(37,99,235,.12) !important; border-color: rgba(37,99,235,.3) !important; color: #93c5fd !important; }
html.dark-mode .cx-banner.amber { background: rgba(217,119,6,.12) !important; border-color: rgba(217,119,6,.3) !important; color: #fbbf24 !important; }
html.dark-mode .cx-banner.green { background: rgba(45,186,78,.12) !important; border-color: rgba(45,186,78,.3) !important; color: #4ade80 !important; }

/* Table */
html.dark-mode .cx-table th { background: #0d1b2e !important; color: #4e6880 !important; border-color: #1e3448 !important; }
html.dark-mode .cx-table td { border-color: #1e3448 !important; color: #e8edf5 !important; }
html.dark-mode .cx-table tbody tr:hover td { background: #1a2d45 !important; }

/* Chips */
html.dark-mode .cx-code-chip { background: rgba(45,186,78,.15) !important; color: #4ade80 !important; }
html.dark-mode .cx-discom-chip { background: rgba(45,186,78,.15) !important; color: #4ade80 !important; border-color: rgba(45,186,78,.3) !important; }

/* Status badges */
html.dark-mode .cx-status-active   { background: rgba(45,186,78,.18) !important; color: #4ade80 !important; }
html.dark-mode .cx-status-inactive { background: rgba(148,163,184,.15) !important; color: #8facc4 !important; }

/* Icon buttons */
html.dark-mode .cx-icon-btn { background: #0d1b2e !important; border-color: #1e3448 !important; color: #8facc4 !important; }
html.dark-mode .cx-icon-btn:hover { background: rgba(45,186,78,.12) !important; color: #4ade80 !important; border-color: rgba(45,186,78,.3) !important; }
html.dark-mode .cx-icon-btn.cx-danger:hover { background: rgba(220,38,38,.15) !important; color: #f87171 !important; border-color: rgba(220,38,38,.3) !important; }

/* Collapse row */
html.dark-mode .cx-collapse-row { border-color: #1e3448 !important; }
html.dark-mode .cx-collapse-btn { color: #4e6880 !important; }
html.dark-mode .cx-collapse-btn:hover { background: #1a2d45 !important; color: #e8edf5 !important; }

/* Pills */
html.dark-mode .cx-pills-label { color: #4e6880 !important; }
html.dark-mode .cx-pill { background: #0d1b2e !important; border-color: #1e3448 !important; color: #4e6880 !important; }
html.dark-mode .cx-pill:hover { border-color: #2dba4e !important; color: #4ade80 !important; background: rgba(45,186,78,.08) !important; }
html.dark-mode .cx-pill.active { background: rgba(45,186,78,.15) !important; border-color: #2dba4e !important; color: #4ade80 !important; }

/* Placeholder */
html.dark-mode .cx-placeholder-icon { background: #0d1b2e !important; }
html.dark-mode .cx-placeholder h3 { color: #8facc4 !important; }
html.dark-mode .cx-placeholder p  { color: #4e6880 !important; }

/* State header */
html.dark-mode .cx-state-hdr { border-color: #1e3448 !important; }
html.dark-mode .cx-state-hdr-name { color: #e8edf5 !important; }
html.dark-mode .cx-state-hdr-code { background: rgba(45,186,78,.15) !important; color: #4ade80 !important; }
html.dark-mode .cx-state-hdr-switch { background: #0d1b2e !important; border-color: #1e3448 !important; color: #8facc4 !important; }
html.dark-mode .cx-state-hdr-switch:hover { border-color: #2dba4e !important; color: #4ade80 !important; background: rgba(45,186,78,.08) !important; }

/* Voltage tabs */
html.dark-mode .cx-vtabs { background: #0d1b2e !important; border-color: #1e3448 !important; }
html.dark-mode .cx-vtab { color: #4e6880 !important; }
html.dark-mode .cx-vtab:hover { color: #e8edf5 !important; }
html.dark-mode .cx-vtab.active { color: #4ade80 !important; border-bottom-color: #2dba4e !important; }

/* Numeric inputs — THIS fixes the black/inconsistent input backgrounds */
html.dark-mode .cx-num,
html.dark-mode .cx-charge-num {
    background: #0d1b2e !important;
    border-color: #1e3448 !important;
    color: #e8edf5 !important;
}
html.dark-mode .cx-num:focus,
html.dark-mode .cx-charge-num:focus {
    border-color: #2dba4e !important;
    box-shadow: 0 0 0 3px rgba(45,186,78,.15) !important;
}
html.dark-mode .cx-unit   { color: #4e6880 !important; }
html.dark-mode .cx-landed { color: #8facc4 !important; }

/* Open access columns */
html.dark-mode .cx-oa-col:first-child { border-color: #1e3448 !important; }
html.dark-mode .cx-charge-row { border-color: #1a2d45 !important; }
html.dark-mode .cx-charge-label { color: #8facc4 !important; }
html.dark-mode .cx-auto-divider { border-color: #1e3448 !important; }

/* Yes/No toggle */
html.dark-mode .cx-yn { border-color: #1e3448 !important; }
html.dark-mode .cx-yn-btn { background: #0d1b2e !important; color: #4e6880 !important; }
html.dark-mode .cx-yn-btn.yes.on { background: rgba(45,186,78,.18) !important; color: #4ade80 !important; }
html.dark-mode .cx-yn-btn.no.on  { background: rgba(148,163,184,.15) !important; color: #8facc4 !important; }

/* Tags */
html.dark-mode .cx-tag.amber { background: rgba(217,119,6,.15) !important; color: #fbbf24 !important; border-color: rgba(217,119,6,.3) !important; }
html.dark-mode .cx-tag.gray  { background: rgba(148,163,184,.12) !important; color: #8facc4 !important; border-color: #1e3448 !important; }

/* Save bar */
html.dark-mode .cx-save-bar { background: #0d1b2e !important; border-color: #1e3448 !important; }
html.dark-mode .cx-saved-hint { color: #4e6880 !important; }
html.dark-mode .cx-reset-btn { background: #0d1b2e !important; border-color: #1e3448 !important; color: #8facc4 !important; }
html.dark-mode .cx-reset-btn:hover { background: rgba(220,38,38,.15) !important; color: #f87171 !important; border-color: rgba(220,38,38,.3) !important; }

/* Spinner */
html.dark-mode .cx-spin-row { color: #4e6880 !important; }
html.dark-mode .cx-spinner { border-color: #1e3448 !important; border-top-color: #2dba4e !important; }

/* Source icons */
html.dark-mode .cx-src-icon.solar { color: #fbbf24 !important; }
html.dark-mode .cx-src-icon.wind  { color: #38bdf8 !important; }
html.dark-mode .cx-src-icon.hydro { color: #60a5fa !important; }


/* ═══════════════════════════════════════════════════════════════
   DARK MODE — Roles Management (index / create / edit)
   ═══════════════════════════════════════════════════════════════ */

/* Page header text (inline hardcoded colors in this page) */
html.dark-mode .page-title    { color: #e8edf5 !important; }
html.dark-mode .page-subtitle { color: #4e6880 !important; }

/* Table header */
html.dark-mode .data-table th { color: #4e6880 !important; }

/* Row cards */
html.dark-mode .data-table tbody tr {
    background: #152032 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.4) !important;
}
html.dark-mode .data-table tbody tr:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,.5) !important;
}
html.dark-mode .data-table td {
    color: #e8edf5 !important;
}
html.dark-mode .data-table tbody tr td:first-child {
    color: #4e6880 !important;
}
html.dark-mode .data-table tbody tr td:last-child { }

/* Empty state row */
html.dark-mode #empty-row td,
html.dark-mode td[style*="background: #fff"] {
    background: #152032 !important;
    color: #4e6880 !important;
}

/* Role name */
html.dark-mode .role-name { color: #e8edf5 !important; }

/* Permission badge */
html.dark-mode .perm-badge {
    background: rgba(45,186,78,.15) !important;
    color: #4ade80 !important;
    border-color: rgba(45,186,78,.3) !important;
}

/* Toggle switch track (default gray) */
html.dark-mode .toggle-slider { background: #2a4a6b !important; }
html.dark-mode .toggle-switch input:checked + .toggle-slider { background: #2dba4e !important; }

/* Action icon buttons */
html.dark-mode .btn-edit   { color: #60a5fa !important; }
html.dark-mode .btn-edit:hover   { background: rgba(37,99,235,.18) !important; }
html.dark-mode .btn-delete { color: #f87171 !important; }
html.dark-mode .btn-delete:hover { background: rgba(220,38,38,.18) !important; }

/* text-muted used for "Created" column */
html.dark-mode .data-table .text-muted { color: #4e6880 !important; }

/* SweetAlert2 popup — dark mode */
html.dark-mode .swal2-popup {
    background: #152032 !important;
    color: #e8edf5 !important;
}
html.dark-mode .swal2-title { color: #e8edf5 !important; }
html.dark-mode .swal2-html-container { color: #8facc4 !important; }


/* ═══════════════════════════════════════════════════════════════
   DARK MODE — Create / Edit Role page
   ═══════════════════════════════════════════════════════════════ */

/* Role name input card */
html.dark-mode .role-name-card {
    background: #152032 !important;
    border-color: #1e3448 !important;
}

/* checked-header override (page defines its own, needs dark variant) */
html.dark-mode .checked-header {
    background: rgba(45,186,78,.12) !important;
    border-color: #2dba4e !important;
}

/* perm-group-count border */
html.dark-mode .perm-group-count {
    border-color: rgba(45,186,78,.3) !important;
}

/* perm-item bordered card (page-specific border override) */
html.dark-mode .perm-item {
    border-color: #1e3448 !important;
}
html.dark-mode .perm-item:has(input:checked) {
    border-color: #2dba4e !important;
}



html.dark-mode .perm-item:has(input:checked) {
    border-color: #1e3448 !important;   /* same as unchecked, no green outline */
    background: rgba(45,186,78,.10) !important;  /* subtle tint instead of border */
}

.perm-item:has(input:checked) {
    border-color: var(--border) !important;
}



/* ═══════════════════════════════════════════════════════════════
   DARK MODE — Admin Users (index / create / edit)
   ═══════════════════════════════════════════════════════════════ */

/* Index: page header text */
html.dark-mode #app .page-title,
html.dark-mode .page-title { color: #e8edf5 !important; }
html.dark-mode .page-subtitle { color: #4e6880 !important; }

/* Index: table rows */
html.dark-mode .data-table tbody tr {
    background: #152032 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.4) !important;
}
html.dark-mode .data-table tbody tr:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,.5) !important;
}
html.dark-mode .data-table th { color: #4e6880 !important; }
html.dark-mode .data-table td { color: #e8edf5 !important; }
html.dark-mode .data-table tbody tr td:first-child { color: #4e6880 !important; }

/* Index: user name text (the faint "Pranav Yadav" etc.) */
html.dark-mode .admin-info { color: #e8edf5 !important; }
html.dark-mode .admin-info strong { color: #e8edf5 !important; }

/* Index: type & role badges */
html.dark-mode .type-super { background: rgba(217,119,6,.18) !important; color: #fbbf24 !important; }
html.dark-mode .type-staff { background: rgba(148,163,184,.15) !important; color: #8facc4 !important; }
html.dark-mode .role-badge { background: rgba(79,70,229,.2) !important; color: #a5b4fc !important; }
html.dark-mode .text-danger { color: #f87171 !important; }
html.dark-mode .text-muted  { color: #4e6880 !important; }

/* Index: action buttons */
html.dark-mode .btn-edit   { background: rgba(45,186,78,.15) !important; color: #4ade80 !important; }
html.dark-mode .btn-edit:hover   { background: rgba(45,186,78,.28) !important; }
html.dark-mode .btn-delete { background: rgba(220,38,38,.15) !important; color: #f87171 !important; }
html.dark-mode .btn-delete:hover { background: rgba(220,38,38,.28) !important; }

/* Empty state row (inline background:#fff) */
html.dark-mode #empty-row td { background: #152032 !important; }

/* SweetAlert popups */
html.dark-mode .swal2-popup { background: #152032 !important; color: #e8edf5 !important; }
html.dark-mode .swal2-title { color: #e8edf5 !important; }
html.dark-mode .swal2-html-container { color: #8facc4 !important; }


/* ═══════════════════════════════════════════════════════════════
   DARK MODE — Add / Edit User form inputs (blue focus, no white bg)
   ═══════════════════════════════════════════════════════════════ */

html.dark-mode #createAdminForm .form-control,
html.dark-mode #editAdminForm .form-control,
html.dark-mode .form-card-wrap .form-control {
    background: #0d1b2e !important;
    border: 1.5px solid #1e3448 !important;
    color: #e8edf5 !important;
}

html.dark-mode #createAdminForm .form-control::placeholder,
html.dark-mode #editAdminForm .form-control::placeholder {
    color: #4e6880 !important;
}

html.dark-mode #createAdminForm .form-control:focus,
html.dark-mode #editAdminForm .form-control:focus,
html.dark-mode .form-card-wrap .form-control:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59,130,246,.18) !important;
}

/* select dropdown arrow/options stay readable */
html.dark-mode #createAdminForm select.form-control option,
html.dark-mode #editAdminForm select.form-control option {
    background: #0d1b2e !important;
    color: #e8edf5 !important;
}

/* labels */
html.dark-mode .form-group label { color: #8facc4 !important; }
html.dark-mode .required { color: #f87171 !important; }

/* card wrapper */
html.dark-mode .form-card-wrap .card { background: #152032 !important; border-color: #1e3448 !important; }


/* ═══════════════════════════════════════════════════════════════
   DARK MODE — Roles: checked-header & perm-item colors (blue theme)
   ═══════════════════════════════════════════════════════════════ */

/* Group header when fully checked — blue border, background matches page tone */
html.dark-mode .checked-header {
    background: #1a2d45 !important;   /* matches sidebar hover / table hover tone */
    border-color: #3b82f6 !important;
}

/* Individual checked perm-item — same aligned background, no green tint */
html.dark-mode .perm-item:has(input:checked) {
    background: #1a2d45 !important;
    border-color: #1e3448 !important;
}

/* Checkmark itself stays blue instead of green for consistency */
html.dark-mode .perm-item:has(input:checked) .checkmark,
html.dark-mode .perm-group-check:has(input:checked) .checkmark {
    background: #3b82f6 !important;
    border-color: #3b82f6 !important;
}

/* Group count badge border to match blue accent */
html.dark-mode .perm-group-count {
    border-color: rgba(59,130,246,.3) !important;
}

/* ═══════════════════════════════════════════════════════════════
   DARK MODE — Configuration page: icon backgrounds + spinner arrows
   ═══════════════════════════════════════════════════════════════ */

/* Icon backgrounds — override inline light backgrounds (states, tariffs, charges, rates) */
html.dark-mode .cx-hdr-icon {
    background: #0d1b2e !important;
}


input.cx-num::-webkit-outer-spin-button,
input.cx-num::-webkit-inner-spin-button,
input.cx-charge-num::-webkit-outer-spin-button,
input.cx-charge-num::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    appearance: none !important;
    margin: 0 !important;
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
}

input.cx-num,
input.cx-charge-num {
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}


