/**
 * HCS Portal — global theme, motion, surfaces
 */
:root {
    --hcs-font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
    --hcs-sidebar-w: 272px;
    /* Brand (HCS logo: red + black + white) */
    --hcs-red: #ff0000;
    --hcs-red-dark: #cc0000;
    --hcs-red-soft: rgba(255, 0, 0, 0.14);
    --hcs-black: #0a0a0a;
    --hcs-sidebar-bg: #0a0a0a;
    --hcs-sidebar-fg: #f1f5f9;
    --hcs-accent: var(--hcs-red);
    --hcs-accent-2: var(--hcs-red-dark);
    --hcs-accent-glow: rgba(255, 0, 0, 0.45);
    --hcs-surface: #ffffff;
    --hcs-surface-2: rgba(255, 255, 255, 0.78);
    --hcs-border: rgba(15, 23, 42, 0.08);
    --hcs-text: #0f172a;
    --hcs-text-muted: #64748b;
    --hcs-radius: 14px;
    --hcs-radius-sm: 10px;
    --hcs-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    --hcs-shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
    --hcs-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --hcs-stagger: 60ms;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

html {
    scroll-behavior: smooth;
}

body.hcs-app {
    font-family: var(--hcs-font);
    color: var(--hcs-text);
    -webkit-font-smoothing: antialiased;
    /* Align Bootstrap 5 defaults with brand red */
    --bs-primary: #ff0000;
    --bs-primary-rgb: 255, 0, 0;
    --bs-link-color: #b91c1c;
    --bs-link-hover-color: #ff0000;
}

/* --- Main canvas --- */
.hcs-main {
    margin-left: var(--hcs-sidebar-w);
    min-height: 100vh;
    position: relative;
    background: #f4f4f5;
}

/**
 * Mesh + hue animation live on ::before so .hcs-main never uses `filter`.
 * A filtered ancestor breaks `position: fixed` for Bootstrap modals (backdrop covers dialog).
 */
.hcs-main::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        radial-gradient(ellipse 100% 80% at 0% -30%, rgba(255, 0, 0, 0.12), transparent 55%),
        radial-gradient(ellipse 70% 50% at 100% -10%, rgba(10, 10, 10, 0.06), transparent 50%),
        radial-gradient(ellipse 50% 40% at 50% 100%, rgba(255, 0, 0, 0.05), transparent 45%);
    animation: hcs-mesh-shift 18s ease-in-out infinite alternate;
}

@keyframes hcs-mesh-shift {
    0% { filter: hue-rotate(0deg) saturate(1); }
    100% { filter: hue-rotate(4deg) saturate(1.05); }
}

.hcs-content {
    padding: 1.35rem 1.5rem 2.5rem;
    position: relative;
    z-index: 1;
}

/* Bootstrap modals above .hcs-sidebar (1030); avoid trapping clicks under overlays */
.modal {
    z-index: 1060;
}
.modal-backdrop {
    z-index: 1055;
}

/* --- Topbar --- */
.hcs-topbar {
    position: relative;
    z-index: 2;
    background: var(--hcs-surface-2);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--hcs-border);
    padding: 0.9rem 1.35rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

.hcs-topbar h1 {
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #0a0a0a 0%, #334155 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

#hcsRoleBadge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: capitalize;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.12), rgba(10, 10, 10, 0.08));
    color: var(--hcs-red);
    border: 1px solid rgba(255, 0, 0, 0.22);
}

/* --- Sidebar --- */
.hcs-sidebar {
    width: var(--hcs-sidebar-w);
    background: linear-gradient(180deg, #141414 0%, var(--hcs-sidebar-bg) 45%, #050505 100%);
    color: var(--hcs-sidebar-fg);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 1030;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 4px 0 40px rgba(0, 0, 0, 0.25);
}

.hcs-sidebar .brand {
    padding: 1rem 1rem 1.15rem;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.03em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    background: linear-gradient(90deg, rgba(255, 0, 0, 0.12), transparent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hcs-brand-logo {
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 4.5rem;
    object-fit: contain;
    display: block;
}

.hcs-brand-fallback i {
    background: linear-gradient(135deg, #ff4d4d, #ff0000);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 12px var(--hcs-accent-glow));
}

.hcs-sidebar .nav-section {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #64748b;
    padding: 1.15rem 1rem 0.4rem;
    font-weight: 600;
}

.hcs-sidebar .nav-link {
    color: #94a3b8;
    padding: 0.55rem 1rem;
    border-radius: 10px;
    margin: 0.12rem 0.55rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    transition: color 0.2s var(--hcs-ease-out), background 0.25s var(--hcs-ease-out), transform 0.2s var(--hcs-ease-out);
    position: relative;
    overflow: hidden;
}

.hcs-sidebar .nav-link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 0;
    border-radius: 0 4px 4px 0;
    background: linear-gradient(180deg, #ff2a2a, var(--hcs-red));
    transition: height 0.25s var(--hcs-ease-out), transform 0.25s var(--hcs-ease-out);
}

.hcs-sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(2px);
}

.hcs-sidebar .nav-link:hover::before {
    height: 60%;
    transform: translateY(-50%) scaleY(1);
}

.hcs-sidebar .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.35), rgba(10, 10, 10, 0.45));
    box-shadow: 0 4px 20px rgba(255, 0, 0, 0.22);
}

.hcs-sidebar .nav-link.active::before {
    height: 70%;
    transform: translateY(-50%) scaleY(1);
}

@media (max-width: 991px) {
    .hcs-sidebar {
        transform: translateX(-100%);
        transition: transform 0.35s var(--hcs-ease-out);
    }
    .hcs-sidebar.show {
        transform: translateX(0);
    }
    .hcs-main {
        margin-left: 0;
    }
}

/* --- Cards (global) --- */
.hcs-app .card {
    border: 1px solid var(--hcs-border);
    border-radius: var(--hcs-radius);
    box-shadow: var(--hcs-shadow);
    transition: box-shadow 0.3s var(--hcs-ease-out), transform 0.3s var(--hcs-ease-out);
    overflow: hidden;
}

.hcs-app .card:hover {
    box-shadow: var(--hcs-shadow-lg);
}

.hcs-app .card-header {
    background: rgba(248, 250, 252, 0.9);
    border-bottom: 1px solid var(--hcs-border);
    font-weight: 600;
}

/* --- Dashboard --- */
.hcs-dash-hero {
    position: relative;
    border-radius: calc(var(--hcs-radius) + 4px);
    padding: 1.75rem 1.85rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
    background: linear-gradient(135deg, #1a0505 0%, #7f0d0d 42%, #b91c1c 100%);
    color: #fff;
    box-shadow: 0 20px 50px rgba(255, 0, 0, 0.28);
}

.hcs-dash-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 120%, rgba(255, 255, 255, 0.12), transparent 45%),
        radial-gradient(circle at 90% -20%, rgba(0, 0, 0, 0.25), transparent 40%);
    pointer-events: none;
}

.hcs-dash-hero-inner {
    position: relative;
    z-index: 1;
}

.hcs-dash-hero h2 {
    font-weight: 800;
    letter-spacing: -0.04em;
    font-size: clamp(1.35rem, 2.5vw, 1.85rem);
    margin-bottom: 0.35rem;
}

.hcs-dash-hero .lead {
    opacity: 0.88;
    font-size: 0.95rem;
    max-width: 42rem;
}

.hcs-dash-time {
    font-variant-numeric: tabular-nums;
    font-size: 0.8rem;
    opacity: 0.75;
    margin-top: 0.75rem;
}

.hcs-stat-card {
    position: relative;
    border-radius: var(--hcs-radius);
    border: 1px solid var(--hcs-border);
    background: var(--hcs-surface);
    padding: 1.15rem 1.2rem 1.2rem;
    height: 100%;
    overflow: hidden;
    box-shadow: var(--hcs-shadow);
    transition: transform 0.35s var(--hcs-ease-out), box-shadow 0.35s var(--hcs-ease-out);
    opacity: 0;
    animation: hcs-fade-up 0.65s var(--hcs-ease-out) forwards;
}

.hcs-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hcs-shadow-lg);
}

.hcs-stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--hcs-red), var(--hcs-red-dark), #0a0a0a);
    opacity: 0.9;
}

.hcs-stat-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-bottom: 0.65rem;
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.12), rgba(10, 10, 10, 0.06));
    color: var(--hcs-red);
}

.hcs-stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--hcs-text-muted);
}

.hcs-stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, #0a0a0a, #475569);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hcs-stat-hint {
    font-size: 0.78rem;
    color: var(--hcs-text-muted);
    margin-top: 0.35rem;
}

.hcs-chart-card {
    border-radius: var(--hcs-radius);
    border: 1px solid var(--hcs-border);
    background: var(--hcs-surface);
    padding: 1.15rem 1.2rem 1rem;
    box-shadow: var(--hcs-shadow);
    height: 100%;
    opacity: 0;
    animation: hcs-fade-up 0.7s var(--hcs-ease-out) forwards;
}

.hcs-chart-card h6 {
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    color: #334155;
}

.hcs-quick-card {
    border-radius: var(--hcs-radius);
    border: 1px solid var(--hcs-border);
    background: var(--hcs-surface);
    padding: 1.2rem;
    height: 100%;
    transition: transform 0.3s var(--hcs-ease-out), border-color 0.3s;
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: hcs-fade-up 0.75s var(--hcs-ease-out) forwards;
}

.hcs-quick-card::before {
    content: "";
    position: absolute;
    inset: auto -40% -60% -40%;
    height: 120%;
    background: radial-gradient(circle, rgba(255, 0, 0, 0.1), transparent 65%);
    transition: transform 0.5s var(--hcs-ease-out);
    transform: translateY(20%);
}

.hcs-quick-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 0, 0, 0.28);
}

.hcs-quick-card:hover::before {
    transform: translateY(0) scale(1.05);
}

.hcs-quick-card h6 {
    font-weight: 700;
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
}

.hcs-quick-card p {
    position: relative;
    z-index: 1;
}

.hcs-app .btn-primary {
    background: linear-gradient(135deg, var(--hcs-red) 0%, var(--hcs-red-dark) 100%);
    border: none;
    font-weight: 600;
    color: #fff;
}

.hcs-app .btn-primary:hover {
    background: linear-gradient(135deg, #ff1a1a 0%, var(--hcs-red) 100%);
    color: #fff;
}

.hcs-app .btn-outline-primary {
    border-color: rgba(255, 0, 0, 0.5);
    color: var(--hcs-red);
    font-weight: 600;
}

.hcs-app .btn-outline-primary:hover {
    background: rgba(255, 0, 0, 0.08);
    border-color: var(--hcs-red);
    color: var(--hcs-red-dark);
}

@keyframes hcs-fade-up {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hcs-skeleton {
    background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
    background-size: 200% 100%;
    animation: hcs-shimmer 1.2s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes hcs-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- Login page (body.hcs-login) --- */
body.hcs-login {
    font-family: var(--hcs-font);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    background: #0a0a0a;
}

body.hcs-login::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        radial-gradient(ellipse 80% 60% at 20% 0%, rgba(255, 0, 0, 0.35), transparent 50%),
        radial-gradient(ellipse 60% 50% at 100% 100%, rgba(255, 0, 0, 0.18), transparent 45%),
        radial-gradient(ellipse 40% 30% at 50% 50%, rgba(255, 255, 255, 0.04), transparent 50%);
    animation: hcs-mesh-shift 22s ease-in-out infinite alternate;
}

.hcs-login-card .logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.hcs-login-logo {
    max-width: min(100%, 280px);
    height: auto;
    max-height: 7.5rem;
    object-fit: contain;
    display: inline-block;
}

.hcs-login-card {
    width: 100%;
    max-width: 430px;
    padding: 2.25rem 2rem;
    border-radius: calc(var(--hcs-radius) + 6px);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    animation: hcs-fade-up 0.8s var(--hcs-ease-out) forwards;
}

.hcs-login-card .logo i {
    font-size: 3rem;
    background: linear-gradient(135deg, #ff4d4d, var(--hcs-red));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(255, 0, 0, 0.45));
}

.hcs-login-card h3 {
    color: #fff;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.hcs-login-card .text-muted {
    color: #94a3b8 !important;
}

.hcs-login-card .form-control,
.hcs-login-card .input-group-text {
    background: rgba(15, 23, 42, 0.5);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f1f5f9;
}

.hcs-login-card .form-control:focus {
    border-color: rgba(255, 0, 0, 0.55);
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.2);
    background: rgba(15, 23, 42, 0.65);
    color: #fff;
}

.hcs-login-card .input-group-text {
    color: #f87171;
}

.hcs-login-card .btn-login {
    background: linear-gradient(135deg, var(--hcs-red) 0%, var(--hcs-red-dark) 100%);
    border: none;
    color: #fff;
    font-weight: 700;
    padding: 0.75rem;
    border-radius: 10px;
    transition: transform 0.2s var(--hcs-ease-out), box-shadow 0.2s;
}

.hcs-login-card .btn-login:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(255, 0, 0, 0.45);
}

.hcs-login-card a {
    color: #fca5a5;
}

.hcs-login-card a:hover {
    color: #fecaca;
}

.hcs-login-theme-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 3;
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(15, 23, 42, 0.45);
    color: #f1f5f9;
    line-height: 1;
}

.hcs-login-theme-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* =============================================================================
   Dark mode (html[data-hcs-theme="dark"])
   Preference stored in localStorage key hcs_color_mode; head script sets before paint.
   ============================================================================= */
html[data-hcs-theme="dark"] {
    color-scheme: dark;
}

html[data-hcs-theme="dark"] body.hcs-app {
    --hcs-text: #e8eaed;
    --hcs-text-muted: #94a3b8;
    --hcs-border: rgba(255, 255, 255, 0.1);
    --hcs-surface: #1c1d22;
    --hcs-surface-2: rgba(30, 31, 36, 0.94);
    --hcs-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
    --hcs-shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);
    --bs-body-color: #e8eaed;
    --bs-body-bg: #121214;
    --bs-border-color: rgba(255, 255, 255, 0.12);
    --bs-primary: #ff3333;
    --bs-primary-rgb: 255, 51, 51;
    --bs-link-color: #f87171;
    --bs-link-hover-color: #fca5a5;
}

html[data-hcs-theme="dark"] .hcs-main {
    background: #121214;
}

html[data-hcs-theme="dark"] .hcs-main::before {
    background-image:
        radial-gradient(ellipse 100% 80% at 0% -30%, rgba(255, 0, 0, 0.14), transparent 55%),
        radial-gradient(ellipse 70% 50% at 100% -10%, rgba(255, 255, 255, 0.04), transparent 50%),
        radial-gradient(ellipse 50% 40% at 50% 100%, rgba(255, 0, 0, 0.06), transparent 45%);
}

html[data-hcs-theme="dark"] .hcs-topbar {
    background: rgba(24, 25, 30, 0.92);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

html[data-hcs-theme="dark"] .hcs-topbar h1 {
    background: linear-gradient(135deg, #f1f5f9 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

html[data-hcs-theme="dark"] #hcsRoleBadge {
    color: #fecaca;
    border-color: rgba(255, 0, 0, 0.25);
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.12), rgba(0, 0, 0, 0.2));
}

html[data-hcs-theme="dark"] #hcsUserName {
    color: #e8eaed !important;
}

html[data-hcs-theme="dark"] .hcs-sidebar {
    background: linear-gradient(180deg, #0f0f10 0%, #0a0a0b 50%, #050506 100%);
    border-right-color: rgba(255, 255, 255, 0.06);
}

html[data-hcs-theme="dark"] .hcs-sidebar .brand {
    background: linear-gradient(90deg, rgba(255, 0, 0, 0.1), transparent);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

html[data-hcs-theme="dark"] .hcs-sidebar .nav-section {
    color: #64748b;
}

html[data-hcs-theme="dark"] .hcs-sidebar .nav-link {
    color: #a8b0bd;
}

html[data-hcs-theme="dark"] .hcs-app .card {
    background: #1a1b20;
    border-color: rgba(255, 255, 255, 0.08);
}

html[data-hcs-theme="dark"] .hcs-app .card-header {
    background: rgba(28, 29, 34, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    color: #e8eaed;
}

html[data-hcs-theme="dark"] .hcs-dash-hero {
    background: linear-gradient(135deg, #1a0505 0%, #5c0a0a 45%, #8f1111 100%);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

html[data-hcs-theme="dark"] .hcs-stat-card,
html[data-hcs-theme="dark"] .hcs-chart-card,
html[data-hcs-theme="dark"] .hcs-quick-card {
    background: #1a1b20;
    border-color: rgba(255, 255, 255, 0.08);
}

html[data-hcs-theme="dark"] .hcs-stat-value {
    background: linear-gradient(135deg, #f8fafc, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

html[data-hcs-theme="dark"] .hcs-chart-card h6,
html[data-hcs-theme="dark"] .hcs-quick-card h6 {
    color: #cbd5e1;
}

html[data-hcs-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

html[data-hcs-theme="dark"] .hcs-app .table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.04);
    color: #e8eaed;
    border-color: rgba(255, 255, 255, 0.1);
}

html[data-hcs-theme="dark"] .hcs-app .table thead th {
    border-bottom-color: rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
}

html[data-hcs-theme="dark"] .hcs-app .form-control,
html[data-hcs-theme="dark"] .hcs-app .form-select {
    background-color: #25262c;
    border-color: rgba(255, 255, 255, 0.12);
    color: #e8eaed;
}

html[data-hcs-theme="dark"] .hcs-app .form-control:focus,
html[data-hcs-theme="dark"] .hcs-app .form-select:focus {
    background-color: #2a2b32;
    border-color: rgba(255, 0, 0, 0.45);
    color: #fff;
}

html[data-hcs-theme="dark"] .hcs-app .modal-content {
    background: #1c1d22;
    color: #e8eaed;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

html[data-hcs-theme="dark"] .hcs-app .modal-header,
html[data-hcs-theme="dark"] .hcs-app .modal-footer {
    border-color: rgba(255, 255, 255, 0.1);
}

html[data-hcs-theme="dark"] .hcs-app .btn-close {
    filter: invert(1) grayscale(1);
    opacity: 0.65;
}

html[data-hcs-theme="dark"] .hcs-app .alert-secondary {
    background: #2a2b32;
    border-color: rgba(255, 255, 255, 0.08);
    color: #e8eaed;
}

html[data-hcs-theme="dark"] .hcs-app .pagination .page-link {
    background-color: #25262c;
    border-color: rgba(255, 255, 255, 0.12);
    color: #e8eaed;
}

html[data-hcs-theme="dark"] .hcs-app .pagination .page-item.active .page-link {
    background-color: var(--hcs-red);
    border-color: var(--hcs-red);
    color: #fff;
}

html[data-hcs-theme="dark"] #hcsThemeToggle,
html[data-hcs-theme="dark"] #hcsLogoutBtn {
    border-color: rgba(255, 255, 255, 0.2);
    color: #e8eaed;
}

html[data-hcs-theme="dark"] #hcsThemeToggle:hover,
html[data-hcs-theme="dark"] #hcsLogoutBtn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

html[data-hcs-theme="dark"] #hcsToggleSidebar {
    background: #25262c;
    border-color: rgba(255, 255, 255, 0.12);
    color: #e8eaed;
}

/* Login page dark */
html[data-hcs-theme="dark"] body.hcs-login {
    background: #0a0a0a;
}

html[data-hcs-theme="dark"] body.hcs-login::before {
    background-image:
        radial-gradient(ellipse 80% 60% at 20% 0%, rgba(255, 0, 0, 0.28), transparent 50%),
        radial-gradient(ellipse 60% 50% at 100% 100%, rgba(255, 0, 0, 0.12), transparent 45%),
        radial-gradient(ellipse 40% 30% at 50% 50%, rgba(255, 255, 255, 0.03), transparent 50%);
}

html[data-hcs-theme="dark"] .hcs-login-card {
    background: rgba(22, 23, 28, 0.88);
    border-color: rgba(255, 255, 255, 0.1);
}

html[data-hcs-theme="dark"] .hcs-login-card h3 {
    color: #f1f5f9;
}

html[data-hcs-theme="dark"] .hcs-login-theme-btn {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.35);
    color: #f1f5f9;
}
