/* ============================================================
   Zerion-inspired theme — dark + light variants
   ============================================================ */

:root {
    /* Brand colours and gradients are theme-agnostic */
    --brand-violet: #8B5CF6;
    --brand-indigo: #6366F1;
    --brand-blue:   #3B82F6;
    --brand-cyan:   #22D3EE;
    --brand-teal:   #14B8A6;
    --brand-pink:   #EC4899;
    --brand-orange: #F59E0B;

    --gradient-primary: linear-gradient(135deg, #8B5CF6 0%, #3B82F6 50%, #22D3EE 100%);
    --gradient-pink:    linear-gradient(135deg, #EC4899 0%, #8B5CF6 100%);
    --gradient-teal:    linear-gradient(135deg, #22D3EE 0%, #14B8A6 100%);
    --gradient-warm:    linear-gradient(135deg, #F59E0B 0%, #EC4899 100%);
}

[data-bs-theme="dark"] {
    --bg-deep:      #07070D;
    --bg-base:      #0B0D17;
    --bg-elevated:  #11142A;

    --sidebar-top:    #0B0D17;
    --sidebar-bottom: #07070D;
    --navbar-bg:      rgba(11, 13, 23, 0.65);

    --surface:        rgba(255, 255, 255, 0.04);
    --surface-strong: rgba(255, 255, 255, 0.07);
    --surface-border: rgba(255, 255, 255, 0.08);
    --surface-border-strong: rgba(255, 255, 255, 0.14);

    --text-primary:   #F4F6FF;
    --text-secondary: #A4A8BE;
    --text-muted:     #6B6F88;

    --orb-violet: rgba(139, 92, 246, 0.55);
    --orb-cyan:   rgba(34, 211, 238, 0.40);
    --orb-opacity: 0.45;

    --bs-body-bg:           var(--bg-base);
    --bs-body-color:        var(--text-primary);
    --bs-body-secondary-bg: var(--bg-deep);
    --bs-tertiary-bg:       var(--bg-deep);
    --bs-border-color:      var(--surface-border);
    --bs-link-color:        #C4B5FD;
    --bs-link-hover-color:  #DDD6FE;
}

[data-bs-theme="light"] {
    --bg-deep:      #EEF1F8;
    --bg-base:      #F7F9FC;
    --bg-elevated:  #FFFFFF;

    --sidebar-top:    #FFFFFF;
    --sidebar-bottom: #F1F4FA;
    --navbar-bg:      rgba(255, 255, 255, 0.75);

    --surface:        rgba(15, 23, 42, 0.03);
    --surface-strong: rgba(15, 23, 42, 0.06);
    --surface-border: rgba(15, 23, 42, 0.08);
    --surface-border-strong: rgba(15, 23, 42, 0.14);

    --text-primary:   #0F172A;
    --text-secondary: #475569;
    --text-muted:     #94A3B8;

    --orb-violet: rgba(139, 92, 246, 0.20);
    --orb-cyan:   rgba(34, 211, 238, 0.18);
    --orb-opacity: 0.6;

    --bs-body-bg:           var(--bg-base);
    --bs-body-color:        var(--text-primary);
    --bs-body-secondary-bg: var(--bg-deep);
    --bs-tertiary-bg:       var(--bg-deep);
    --bs-border-color:      var(--surface-border);
    --bs-link-color:        #6D28D9;
    --bs-link-hover-color:  #4C1D95;
}

/* Fallback when no data-bs-theme attribute exists yet */
:root { color-scheme: dark; }
:root[data-bs-theme="light"] { color-scheme: light; }

html, body {
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Display",
                 "Segoe UI", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.01em;
}

/* Ambient gradient orbs in the background */
body::before,
body::after {
    content: "";
    position: fixed;
    pointer-events: none;
    z-index: 0;
    border-radius: 50%;
    filter: blur(120px);
    opacity: var(--orb-opacity);
}
body::before {
    width: 520px; height: 520px;
    top: -180px; left: -120px;
    background: radial-gradient(circle, var(--orb-violet), transparent 70%);
}
body::after {
    width: 640px; height: 640px;
    bottom: -260px; right: -200px;
    background: radial-gradient(circle, var(--orb-cyan), transparent 70%);
}
.app-wrapper, .login-box { position: relative; z-index: 1; }

/* ---------- Header / navbar ---------- */
.app-header.navbar {
    background: var(--navbar-bg) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--surface-border);
}
.app-header .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
}
.app-header .nav-link:hover { color: var(--text-primary) !important; }

/* ---------- Sidebar ---------- */
.app-sidebar {
    background: linear-gradient(180deg, var(--sidebar-top) 0%, var(--sidebar-bottom) 100%) !important;
    border-right: 1px solid var(--surface-border);
}
.sidebar-brand {
    border-bottom: 1px solid var(--surface-border);
    padding: 1rem 1.25rem;
}
.brand-link {
    color: var(--text-primary) !important;
    font-weight: 600;
    letter-spacing: -0.02em;
}
.brand-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
}

.sidebar-menu .nav-link {
    color: var(--text-secondary) !important;
    border-radius: 12px;
    margin: 2px 8px;
    padding: 10px 14px;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.sidebar-menu .nav-link:hover {
    background: var(--surface);
    color: var(--text-primary) !important;
    transform: translateX(2px);
}
.sidebar-menu .nav-link.active {
    background: var(--gradient-primary);
    color: #fff !important;
    box-shadow: 0 8px 22px -10px rgba(139, 92, 246, 0.7);
}
.sidebar-menu .nav-link.active .nav-icon { color: #fff !important; }
.sidebar-menu .nav-icon {
    color: var(--text-muted);
    transition: color 0.18s ease;
}
.sidebar-menu .nav-link:hover .nav-icon { color: var(--brand-cyan); }
.nav-header {
    color: var(--text-muted) !important;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 1rem 1.25rem 0.4rem;
}

/* ---------- Content layout ---------- */
.app-main { padding: 0; }
.app-content-header {
    background: transparent;
    padding-top: 1.75rem;
    padding-bottom: 0.5rem;
}
.app-content-header h3 {
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-primary);
    font-size: 1.4rem;
}
.app-content { padding: 0.5rem 0 2.5rem; }
.app-content > .container-fluid { padding-left: 1.75rem; padding-right: 1.75rem; }
.app-content-header > .container-fluid { padding-left: 1.75rem; padding-right: 1.75rem; }

/* Page greeting block */
.eyebrow {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.display-title {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.page-greeting { padding-top: 0.25rem; }

/* ---------- Cards (glass) ---------- */
.card {
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--surface-border);
    border-radius: 18px;
    color: var(--text-primary);
    box-shadow: 0 20px 60px -30px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: var(--surface-border-strong); }
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--surface-border);
    padding: 1.1rem 1.5rem;
}
.card-title { color: var(--text-primary); font-weight: 600; font-size: 0.95rem; letter-spacing: -0.01em; }
.card-body { color: var(--text-primary); padding: 1.5rem; }

/* ---------- Stat cards (Zerion-style) ---------- */
.stat-card {
    position: relative;
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--surface-border);
    border-radius: 18px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 20px 60px -30px rgba(0, 0, 0, 0.7);
    transition: border-color 0.2s ease, transform 0.2s ease;
    overflow: hidden;
}
.stat-card:hover {
    border-color: var(--surface-border-strong);
    transform: translateY(-2px);
}
.stat-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        rgba(139, 92, 246, 0.04) 0%,
        transparent 60%);
    pointer-events: none;
}
.stat-card > * { position: relative; z-index: 1; }
.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin: 0 0 0.6rem;
}
.stat-card .stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.1;
    margin: 0 0 0.4rem;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}
.stat-card .stat-sub {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0;
}
.stat-card .stat-icon {
    position: absolute;
    top: 1.1rem;
    right: 1.3rem;
    font-size: 1.5rem;
    color: var(--text-muted);
    opacity: 0.5;
    z-index: 1;
}

/* ---------- Theme toggle button ---------- */
.theme-toggle {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    color: var(--text-secondary);
    width: 38px; height: 38px;
    border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
    font-size: 1.05rem;
    padding: 0;
}
.theme-toggle:hover {
    background: var(--surface-strong);
    border-color: var(--surface-border-strong);
    color: var(--text-primary);
    transform: translateY(-1px);
}
.theme-toggle:focus-visible {
    outline: 2px solid var(--brand-violet);
    outline-offset: 2px;
}
.auth-theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 5;
}
.login-page { position: relative; }

/* ---------- Admin tile (clickable card) ---------- */
.admin-tile { color: var(--text-primary); transition: transform 0.18s ease, border-color 0.18s ease; }
.admin-tile:hover { transform: translateY(-2px); border-color: var(--surface-border-strong); }
.admin-tile-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: var(--gradient-primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.admin-tile h5 { font-weight: 700; letter-spacing: -0.02em; }

/* ---------- PnL up/down accents ---------- */
.pnl-pos { color: #5EEAD4 !important; }
.pnl-neg { color: #FBA5C0 !important; }
.pnl-pos .bi, .pnl-neg .bi { font-size: 0.9em; vertical-align: -0.05em; }

/* ---------- Chart container ---------- */
.chart-wrap {
    position: relative;
    height: 320px;
    width: 100%;
}

/* ---------- Unread notification row (notifications page) ---------- */
/* Soft brand tint + rounded gradient accent bar instead of a hard blue border. */
.notif-unread-row {
    position: relative;
    background: linear-gradient(90deg,
        rgba(139, 92, 246, 0.10) 0%,
        rgba(34, 211, 238, 0.05) 35%,
        transparent 70%);
}
.notif-unread-row::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55rem;
    bottom: 0.55rem;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--gradient-primary);
}
/* Subtle brand pill for the "New" tag (replaces the flat blue badge). */
.badge-accent {
    background: rgba(139, 92, 246, 0.16);
    color: #C4B5FD;
    border: 1px solid rgba(139, 92, 246, 0.35);
    font-weight: 600;
}

/* ---------- Quick links (sidebar of dashboard) ---------- */
.quick-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 0.9rem;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.quick-link i.bi { font-size: 1.05rem; }
.quick-link i.bi:first-child { color: var(--brand-cyan); }
.quick-link i.bi.ms-auto { color: var(--text-muted); font-size: 0.85rem; }
.quick-link:hover {
    background: var(--surface);
    color: var(--text-primary);
    transform: translateX(2px);
}
.quick-link:hover i.bi.ms-auto { color: var(--text-primary); }

/* ---------- Small-boxes (dashboard tiles) ---------- */
.small-box {
    border-radius: 18px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--surface-border-strong);
    box-shadow: 0 20px 50px -25px rgba(0, 0, 0, 0.75);
    color: #fff;
}
.small-box .inner h3 {
    font-weight: 700;
    font-size: 2rem;
    letter-spacing: -0.02em;
}
.small-box .icon {
    opacity: 0.25;
    font-size: 5rem;
    top: 8px; right: 12px;
}
.small-box.text-bg-primary { background: var(--gradient-primary) !important; }
.small-box.text-bg-success { background: var(--gradient-teal) !important; }
.small-box.text-bg-warning { background: var(--gradient-warm) !important; }
.small-box.text-bg-danger  { background: var(--gradient-pink) !important; }
.small-box .small-box-footer {
    background: rgba(0, 0, 0, 0.18);
    color: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(4px);
}

/* ---------- Buttons ---------- */
.btn {
    border-radius: 12px;
    font-weight: 600;
    padding: 0.55rem 1.1rem;
    letter-spacing: -0.01em;
    transition: transform 0.15s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary,
.btn-success {
    border: none;
    color: #fff;
    box-shadow: 0 12px 30px -15px rgba(139, 92, 246, 0.7);
}
.btn-primary { background: var(--gradient-primary); }
.btn-success { background: var(--gradient-teal); }
.btn-primary:hover, .btn-success:hover {
    filter: brightness(1.08);
    color: #fff;
}
.btn-outline-primary {
    color: #C4B5FD;
    border-color: rgba(139, 92, 246, 0.4);
    background: transparent;
}
.btn-outline-primary:hover {
    background: rgba(139, 92, 246, 0.15);
    color: #fff;
    border-color: var(--brand-violet);
}
.btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--surface-border-strong);
    background: transparent;
}
.btn-outline-secondary:hover {
    background: var(--surface);
    color: var(--text-primary);
    border-color: var(--surface-border-strong);
}
.btn-outline-success {
    color: #5EEAD4;
    border-color: rgba(20, 184, 166, 0.45);
    background: transparent;
}
.btn-outline-success:hover {
    background: rgba(20, 184, 166, 0.15);
    color: #fff;
    border-color: var(--brand-teal);
}
.btn-outline-danger {
    color: #FBA5C0;
    border-color: rgba(236, 72, 153, 0.45);
    background: transparent;
}
.btn-outline-danger:hover {
    background: rgba(236, 72, 153, 0.15);
    color: #fff;
    border-color: var(--brand-pink);
}

/* ---------- Forms ---------- */
.form-control,
.form-select {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--surface-border-strong);
    color: var(--text-primary);
    border-radius: 12px;
    padding: 0.7rem 0.9rem;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.form-control:focus,
.form-select:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--brand-violet);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
    color: var(--text-primary);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:disabled { background: rgba(255, 255, 255, 0.02); color: var(--text-muted); }
.form-label { color: var(--text-secondary); font-weight: 500; font-size: 0.9rem; }
.input-group .input-group-text {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--surface-border-strong);
    border-left: 0;
    color: var(--text-secondary);
    border-radius: 12px;
}

/* ---------- Tables ---------- */
.table {
    color: var(--text-primary);
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.025);
    --bs-table-striped-color: var(--text-primary);
    --bs-table-border-color: var(--surface-border);
}
.table thead th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--surface-border-strong);
    padding: 0.9rem 1rem;
}
.table tbody td { padding: 0.9rem 1rem; vertical-align: middle; border-color: var(--surface-border); }

/* ---------- Badges ---------- */
.badge {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.4em 0.7em;
    letter-spacing: 0.02em;
}
.text-bg-success { background: rgba(20, 184, 166, 0.18) !important; color: #5EEAD4 !important; }
.text-bg-warning { background: rgba(245, 158, 11, 0.18) !important; color: #FCD34D !important; }
.text-bg-secondary { background: rgba(255, 255, 255, 0.06) !important; color: var(--text-secondary) !important; }
.text-bg-danger { background: rgba(236, 72, 153, 0.18) !important; color: #FBA5C0 !important; }

/* ---------- Alerts ---------- */
.alert {
    border-radius: 14px;
    border: 1px solid;
    backdrop-filter: blur(12px);
}
.alert-success {
    background: rgba(20, 184, 166, 0.12);
    border-color: rgba(20, 184, 166, 0.35);
    color: #99F6E4;
}
.alert-warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #FCD34D;
}
.alert-danger {
    background: rgba(236, 72, 153, 0.12);
    border-color: rgba(236, 72, 153, 0.35);
    color: #FBA5C0;
}

/* ---------- Login / auth layout ---------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-base);
}
.login-box {
    width: 100%;
    max-width: 420px;
    padding: 1rem;
}
.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}
.login-logo a {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-decoration: none;
}
.login-card-body { padding: 2rem; }
.login-box-msg {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

/* ---------- Footer ---------- */
.app-footer {
    background: transparent;
    border-top: 1px solid var(--surface-border);
    color: var(--text-muted);
    padding: 1rem 1.5rem;
}

/* ---------- Misc text helpers ---------- */
.text-body-secondary { color: var(--text-secondary) !important; }
.text-success { color: #5EEAD4 !important; }
.text-danger  { color: #FBA5C0 !important; }
code {
    background: rgba(139, 92, 246, 0.12);
    color: #DDD6FE;
    padding: 0.15em 0.4em;
    border-radius: 6px;
    font-size: 0.88em;
}

/* Brand gradient text utility */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Status hero card on dashboard */
.status-hero {
    background: linear-gradient(135deg,
        rgba(139, 92, 246, 0.15) 0%,
        rgba(34, 211, 238, 0.10) 100%);
    border: 1px solid var(--surface-border-strong);
}

/* ---------- OAuth divider + Google button ---------- */
.oauth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0 1rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}
.oauth-divider::before,
.oauth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--surface-border-strong);
}

.btn-oauth-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #1f2937;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 0.65rem 1rem;
    font-weight: 600;
    box-shadow: 0 8px 20px -12px rgba(0, 0, 0, 0.55);
}
.btn-oauth-google:hover {
    background: #f7f7fa;
    color: #1f2937;
    transform: translateY(-1px);
}

/* ---------- Password show/hide toggle ---------- */
.input-group .pwd-toggle {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease, background 0.15s ease;
}
.input-group .pwd-toggle:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.07);
}
.pwd-wrap { position: relative; }
.pwd-wrap > .pwd-toggle-btn {
    position: absolute;
    right: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.3rem 0.4rem;
    line-height: 1;
    border-radius: 8px;
    transition: color 0.15s ease, background 0.15s ease;
}
.pwd-wrap > .pwd-toggle-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.07);
}
.pwd-wrap > input { padding-right: 2.6rem !important; }

/* ============================================================
   Light-theme readability overrides
   The accents above are tuned for a dark background; on the light
   theme they wash out (pale teal/pink amounts, pale lavender code).
   These swap in darker, conventional, WCAG-AA-readable colours.
   ============================================================ */
[data-bs-theme="light"] .pnl-pos,
[data-bs-theme="light"] .text-success { color: #15803d !important; }   /* green-700  ~5:1  */
[data-bs-theme="light"] .pnl-neg,
[data-bs-theme="light"] .text-danger  { color: #b91c1c !important; }   /* red-700    ~6:1  */

/* Addresses / inline code */
[data-bs-theme="light"] code {
    background: rgba(109, 40, 217, 0.10);
    color: #6d28d9;                                                    /* violet-700 ~7:1  */
}

/* Status badges — darker text on a readable tint */
[data-bs-theme="light"] .text-bg-success   { background: rgba(21, 128, 61, 0.14) !important;  color: #15803d !important; }
[data-bs-theme="light"] .text-bg-warning   { background: rgba(180, 83, 9, 0.15) !important;   color: #b45309 !important; }
[data-bs-theme="light"] .text-bg-danger    { background: rgba(185, 28, 28, 0.13) !important;  color: #b91c1c !important; }
[data-bs-theme="light"] .text-bg-secondary { background: rgba(15, 23, 42, 0.08) !important;   color: var(--text-secondary) !important; }

/* Alerts */
[data-bs-theme="light"] .alert-success { background: rgba(21, 128, 61, 0.10); border-color: rgba(21, 128, 61, 0.30); color: #14532d; }
[data-bs-theme="light"] .alert-warning { background: rgba(180, 83, 9, 0.10);  border-color: rgba(180, 83, 9, 0.30);  color: #7c2d12; }
[data-bs-theme="light"] .alert-danger  { background: rgba(185, 28, 28, 0.10); border-color: rgba(185, 28, 28, 0.30); color: #7f1d1d; }

/* Table headers were near-invisible muted grey on white */
[data-bs-theme="light"] .table thead th { color: var(--text-secondary); }

/* Sortable column-header links */
.table thead th a.th-sort { color: inherit; text-decoration: none; cursor: pointer; white-space: nowrap; }
.table thead th a.th-sort:hover { color: var(--text-primary); }
.table thead th a.th-sort .bi { font-size: 0.85em; }
