/* ============================================================
   FluentCapital Monitor — Professional Dark Theme
   ============================================================
   A refined enterprise monitoring dashboard with subtle
   glassmorphism, clean typography, and restrained accent usage.
   ============================================================ */


/* ============================================================
   1. RESET & CUSTOM PROPERTIES
   ============================================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* --- Backgrounds --- */
    --color-bg:             #06080e;
    --color-bg-alt:         #0b0f18;
    --color-surface:        rgba(12, 16, 26, 0.95);
    --color-surface-hover:  rgba(16, 21, 34, 0.98);
    --color-surface-glass:  rgba(12, 16, 26, 0.85);
    --color-surface-inset:  rgba(4, 6, 12, 0.7);

    /* --- Borders --- */
    --color-border:         rgba(148, 163, 184, 0.1);
    --color-border-hover:   rgba(148, 163, 184, 0.2);
    --color-border-subtle:  rgba(255, 255, 255, 0.06);

    /* --- Primary accent (toned-down cyan) --- */
    --accent:               #06b6d4;
    --accent-dim:           #0891b2;
    --accent-glow:          rgba(6, 182, 212, 0.3);
    --accent-subtle:        rgba(6, 182, 212, 0.1);
    --accent-muted:         rgba(6, 182, 212, 0.06);

    /* --- Semantic colors --- */
    --color-success:        #34d399;
    --color-success-dim:    #10b981;
    --color-success-bg:     rgba(52, 211, 153, 0.08);
    --color-success-glow:   rgba(52, 211, 153, 0.25);

    --color-danger:         #f43f5e;
    --color-danger-dim:     #e11d48;
    --color-danger-bg:      rgba(244, 63, 94, 0.08);
    --color-danger-glow:    rgba(244, 63, 94, 0.25);

    --color-warning:        #f59e0b;
    --color-warning-dim:    #d97706;
    --color-warning-bg:     rgba(245, 158, 11, 0.08);
    --color-warning-glow:   rgba(245, 158, 11, 0.25);

    --color-info:           #06b6d4;
    --color-info-bg:        rgba(6, 182, 212, 0.06);

    /* --- Text --- */
    --color-text:           #e2e8f4;
    --color-text-muted:     #94a3b8;
    --color-text-dim:       #64748b;

    /* --- Typography --- */
    --font:                 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono:            'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

    /* --- Radii --- */
    --radius:               8px;
    --radius-sm:            6px;
    --radius-lg:            12px;
    --radius-xl:            16px;
    --radius-pill:          100px;

    /* --- Transitions --- */
    --ease:                 cubic-bezier(0.4, 0, 0.2, 1);
    --transition:           0.25s var(--ease);

    /* --- Backdrop --- */
    --backdrop:             blur(16px) saturate(140%);

    /* Legacy compat aliases */
    --neon-cyan:            var(--accent);
    --neon-cyan-dim:        var(--accent-dim);
    --neon-cyan-glow:       var(--accent-glow);
    --neon-cyan-subtle:     var(--accent-subtle);
    --neon-magenta:         #a855f7;
    --neon-magenta-glow:    rgba(168, 85, 247, 0.2);
}


/* ============================================================
   2. BASE STYLES
   ============================================================ */

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    font-size: 14px;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Subtle ambient glow — replaces old scanline overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse at 15% 10%, rgba(6, 182, 212, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 90%, rgba(6, 182, 212, 0.015) 0%, transparent 50%);
}

/* Remove old body::after radial glow — keep empty for selector compat */
body::after {
    content: '';
    display: none;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: #22d3ee;
}

::selection {
    background: var(--accent-subtle);
    color: var(--color-text);
}

.mono {
    font-family: var(--font-mono);
}


/* ============================================================
   3. SCROLLBAR
   ============================================================ */

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(6, 182, 212, 0.12);
    border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(6, 182, 212, 0.22);
}


/* ============================================================
   4. KEYFRAME ANIMATIONS
   ============================================================ */

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

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Gentle accent pulse — replaces neonFlicker */
@keyframes neonFlicker {
    0%, 100% {
        text-shadow: 0 0 6px var(--accent-glow);
    }
    50% {
        text-shadow: 0 0 12px var(--accent-glow);
    }
}

@keyframes neonPulse {
    0%, 100% { text-shadow: 0 0 4px var(--accent-glow); }
    50%      { text-shadow: 0 0 8px var(--accent-glow); }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 rgba(52, 211, 153, 0);
    }
    50% {
        box-shadow: 0 0 6px rgba(52, 211, 153, 0.15);
    }
}

@keyframes borderGlow {
    0%, 100% { border-color: rgba(6, 182, 212, 0.08); }
    50%      { border-color: rgba(6, 182, 212, 0.14); }
}

/* Retained for compat */
@keyframes scanline {
    0%   { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

@keyframes gridSlide {
    0%   { transform: translateY(0); }
    100% { transform: translateY(40px); }
}

@keyframes spinnerSpin {
    to { transform: rotate(360deg); }
}

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

@keyframes progressFill {
    from { width: 0; }
}

.fade-in {
    opacity: 0;
    animation: fadeInUp 0.4s var(--ease) forwards;
}


/* ============================================================
   5. NEON TEXT (toned down)
   ============================================================ */

.neon-text {
    color: var(--accent);
    text-shadow: 0 0 8px var(--accent-glow);
    animation: neonPulse 4s ease-in-out infinite;
    letter-spacing: 0.01em;
}


/* ============================================================
   5b. LOGO — Spectacular Effects
   ============================================================ */

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

@keyframes logoGlow {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.3))
                drop-shadow(0 0 20px rgba(6, 182, 212, 0.1));
    }
    50% {
        filter: drop-shadow(0 0 16px rgba(6, 182, 212, 0.5))
                drop-shadow(0 0 40px rgba(6, 182, 212, 0.2));
    }
}

@keyframes logoReveal {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-12px);
        filter: blur(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
}

@keyframes orbitalRing {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Logo wrapper (login page — large) */
.logo-showcase {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    animation: logoReveal 0.8s var(--ease) both;
}

.logo-showcase::before {
    content: '';
    position: absolute;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    border: 1px solid rgba(6, 182, 212, 0.08);
    animation: orbitalRing 20s linear infinite;
    pointer-events: none;
}

.logo-showcase::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    border: 1px dashed rgba(6, 182, 212, 0.05);
    animation: orbitalRing 15s linear infinite reverse;
    pointer-events: none;
}

.logo-img {
    width: 420px;
    height: auto;
    animation:
        logoFloat 4s ease-in-out infinite,
        logoGlow 3s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

.logo-img--sm {
    width: 240px;
    animation:
        logoGlow 4s ease-in-out infinite;
}

/* Sidebar logo */
.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0 1.25rem;
}

.sidebar-logo img {
    width: 220px;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.3));
    transition: filter var(--transition);
}

.sidebar-logo img:hover {
    filter: drop-shadow(0 0 12px rgba(6, 182, 212, 0.4));
}


/* ============================================================
   6. LOGIN PAGE
   ============================================================ */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
    position: relative;
    z-index: 1;
    background:
        radial-gradient(ellipse at 25% 40%, rgba(6, 182, 212, 0.03) 0%, transparent 50%),
        var(--color-bg);
    overflow: hidden;
}

.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.5s var(--ease) both;
}

/* Background grid lines (subtle) */
.login-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.grid-line {
    position: absolute;
    background: linear-gradient(180deg, transparent, rgba(6, 182, 212, 0.03), transparent);
    opacity: 0.3;
    animation: gridSlide 10s linear infinite;
}

.grid-line--1 { left: 20%; width: 1px; height: 100%; animation-duration: 9s; }
.grid-line--2 { left: 40%; width: 1px; height: 100%; animation-duration: 13s; animation-delay: -3s; }
.grid-line--3 { left: 60%; width: 1px; height: 100%; animation-duration: 11s; animation-delay: -5s; }
.grid-line--4 { left: 80%; width: 1px; height: 100%; animation-duration: 15s; animation-delay: -7s; }

/* Login card — clean glassmorphism */
.login-card {
    background: var(--color-surface-glass);
    backdrop-filter: var(--backdrop);
    -webkit-backdrop-filter: var(--backdrop);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    position: relative;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.02) inset,
        0 20px 50px rgba(0, 0, 0, 0.4);
    animation: borderGlow 6s ease-in-out infinite;
}

.login-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-xl);
    padding: 1px;
    background: linear-gradient(
        135deg,
        rgba(6, 182, 212, 0.12),
        transparent 40%,
        transparent 60%,
        rgba(6, 182, 212, 0.06)
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.625rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--color-text);
}

.login-subtitle {
    color: var(--color-text-dim);
    font-size: 0.6875rem;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 500;
}

.login-header p {
    color: var(--color-text-dim);
    font-size: 0.6875rem;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 500;
}


/* ============================================================
   7. FORMS
   ============================================================ */

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-dim);
    pointer-events: none;
    transition: color var(--transition);
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--color-surface-inset);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    font-family: var(--font);
    font-size: 0.875rem;
    transition: all var(--transition);
    outline: none;
}

.input-wrapper .input-icon + input,
.input-wrapper input {
    padding-left: 2.75rem;
}

.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-muted);
}

.input-wrapper:focus-within .input-icon {
    color: var(--accent);
}

.form-group input::placeholder {
    color: var(--color-text-dim);
}

.captcha-group {
    display: flex;
    justify-content: center;
}


/* ============================================================
   8. BUTTONS
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    line-height: 1.4;
}

.btn-icon {
    flex-shrink: 0;
}

/* Primary accent button */
.btn-neon {
    background: var(--accent);
    color: var(--color-bg);
    font-weight: 600;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 12px var(--accent-glow);
    border: 1px solid var(--accent);
}

.btn-neon:hover {
    background: #22d3ee;
    box-shadow: 0 4px 20px var(--accent-glow);
    transform: translateY(-1px);
    color: var(--color-bg);
}

.btn-neon:active {
    transform: translateY(0);
    box-shadow: 0 1px 8px var(--accent-glow);
}

.btn-neon:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn-login {
    width: 100%;
    padding: 0.75rem 1.5rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.btn-primary {
    width: 100%;
    background: var(--accent);
    color: var(--color-bg);
    box-shadow: 0 2px 12px var(--accent-subtle);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.btn-primary:hover {
    background: #22d3ee;
    box-shadow: 0 4px 20px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Back / secondary button */
.btn-back {
    background: var(--color-surface);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    backdrop-filter: var(--backdrop);
    margin-bottom: 1.5rem;
}

.btn-back:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-border-hover);
    color: var(--accent);
}


/* ============================================================
   9. INLINE ALERTS (form messages)
   ============================================================ */

.alert {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    margin-bottom: 1.25rem;
}

.alert-error {
    background: var(--color-danger-bg);
    border: 1px solid rgba(244, 63, 94, 0.2);
    color: var(--color-danger);
}

.alert-success {
    background: var(--color-success-bg);
    border: 1px solid rgba(52, 211, 153, 0.2);
    color: var(--color-success);
}

.alert-warning {
    background: var(--color-warning-bg);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: var(--color-warning);
}


/* ============================================================
   10. LOGIN FOOTER
   ============================================================ */

.login-footer {
    text-align: center;
    margin-top: 1.75rem;
    padding-top: 1.5rem;
}

.login-footer-line {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-border-subtle), transparent);
    margin-bottom: 1rem;
}

.login-footer p {
    font-size: 0.6875rem;
    color: var(--color-text-dim);
    letter-spacing: 0.06em;
}


/* ============================================================
   11. DASHBOARD LAYOUT
   ============================================================ */

.dashboard-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    background: var(--color-bg);
}


/* ============================================================
   12. SIDEBAR
   ============================================================ */

.sidebar {
    width: 240px;
    background: var(--color-surface);
    backdrop-filter: var(--backdrop);
    -webkit-backdrop-filter: var(--backdrop);
    border-right: 1px solid var(--color-border);
    padding: 1.5rem 1.25rem;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 10;
}

.sidebar-brand {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--color-border);
}

.sidebar-brand h2 {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--color-text);
}

.brand-sub {
    display: block;
    font-size: 0.625rem;
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.25rem;
    font-weight: 500;
}

.sidebar-brand span {
    display: block;
    font-size: 0.625rem;
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Sidebar nav */
.sidebar-nav {
    list-style: none;
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    color: var(--color-text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all var(--transition);
    position: relative;
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
}

.sidebar-nav li a:hover {
    background: var(--accent-muted);
    color: var(--color-text);
}

.sidebar-nav li a:hover .nav-icon {
    opacity: 1;
}

.sidebar-nav li.active a {
    background: var(--accent-subtle);
    color: var(--accent);
}

.sidebar-nav li.active a .nav-icon {
    opacity: 1;
}

.sidebar-nav li.active a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 55%;
    background: var(--accent);
    border-radius: var(--radius-pill);
}

/* Language toggle */
.sidebar-lang {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.lang-btn {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--color-text-dim);
    text-decoration: none;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: all var(--transition);
    letter-spacing: 0.04em;
}

.lang-btn:hover {
    color: var(--color-text-muted);
}

.lang-active {
    color: var(--accent);
    background: var(--accent-muted);
}

.lang-sep {
    color: var(--color-text-dim);
    font-size: 0.6875rem;
}

/* Sidebar user */
.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-dim), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-bg);
    flex-shrink: 0;
}

.user-name {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    font-weight: 500;
}


/* ============================================================
   13. MAIN CONTENT AREA
   ============================================================ */

.main-content {
    flex: 1;
    padding: 2rem 2.5rem;
    overflow-y: auto;
    position: relative;
    z-index: 1;
    min-width: 0;
}

.page-header {
    margin-bottom: 2rem;
    animation: fadeInUp 0.35s var(--ease) both;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.page-header h1 {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--color-border-subtle), transparent);
    margin-left: 0.75rem;
}


/* ============================================================
   14. STATS ROW
   ============================================================ */

.stats-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    animation: fadeInUp 0.4s var(--ease) both;
}

.stat-card {
    background: var(--color-surface);
    backdrop-filter: var(--backdrop);
    -webkit-backdrop-filter: var(--backdrop);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    min-width: 140px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    opacity: 0.3;
    transition: opacity var(--transition);
}

.stat-card:hover {
    border-color: var(--color-border-hover);
}

.stat-card:hover::before {
    opacity: 0.6;
}

.stat-card--success::before { background: var(--color-success); }
.stat-card--danger::before  { background: var(--color-danger); }
.stat-card--success:hover   { border-color: rgba(52, 211, 153, 0.15); }
.stat-card--danger:hover    { border-color: rgba(244, 63, 94, 0.15); }

.stat-value {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--color-text);
    line-height: 1.2;
    animation: countUp 0.5s var(--ease) both;
}

.stat-card--success .stat-value { color: var(--color-success); }
.stat-card--danger .stat-value  { color: var(--color-danger); }

.stat-label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.375rem;
}

/* Legacy .stat compat */
.stat {
    display: flex;
    flex-direction: column;
}
.stat .stat-value {
    font-size: 1.25rem;
    font-weight: 500;
}
.stat .stat-label {
    font-size: 11px;
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.status-ok {
    background: var(--color-success-bg);
    color: var(--color-success);
}


/* ============================================================
   15. SERVER GRID (Cards)
   ============================================================ */

.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
}

.server-card {
    background: var(--color-surface);
    backdrop-filter: var(--backdrop);
    -webkit-backdrop-filter: var(--backdrop);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    overflow: hidden;
    transition: all var(--transition);
}

.server-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    pointer-events: none;
    transition: all 0.4s var(--ease);
    opacity: 0;
    background: linear-gradient(
        135deg,
        rgba(6, 182, 212, 0.04),
        transparent 50%
    );
}

.server-card:hover {
    border-color: var(--color-border-hover);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.server-card:hover::before {
    opacity: 1;
}

/* Card header */
.server-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.server-card-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.3;
}

.server-card-header h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
}

/* Status badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-pill);
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-badge--lg {
    padding: 0.3rem 0.875rem;
    font-size: 0.6875rem;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-ok {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid rgba(52, 211, 153, 0.15);
}

.status-ok .status-dot {
    background: var(--color-success);
    box-shadow: 0 0 4px var(--color-success-glow);
}

.status-error {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border: 1px solid rgba(244, 63, 94, 0.15);
}

.status-error .status-dot {
    background: var(--color-danger);
    box-shadow: 0 0 4px var(--color-danger-glow);
}

.status-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.15);
}

.status-warning .status-dot {
    background: var(--color-warning);
    box-shadow: 0 0 4px var(--color-warning-glow);
}

.status-unknown {
    background: rgba(61, 74, 92, 0.12);
    color: var(--color-text-dim);
    border: 1px solid rgba(61, 74, 92, 0.15);
}

.status-unknown .status-dot {
    background: var(--color-text-dim);
}

/* Power state badge variants */
.status-poweron { color: var(--color-success); }
.status-poweron .status-dot {
    background: var(--color-success);
    box-shadow: 0 0 4px var(--color-success-glow);
}
.status-poweroff { color: var(--color-danger); }
.status-poweroff .status-dot {
    background: var(--color-danger);
    box-shadow: 0 0 4px var(--color-danger-glow);
}

/* Specs grid */
.server-card-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.spec-item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.spec-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--color-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.spec-value {
    font-size: 0.8125rem;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-family: var(--font-mono);
    font-weight: 400;
}

.spec-sub {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
}

/* Power dot */
.power-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.power-poweron  { background: var(--color-success); box-shadow: 0 0 4px var(--color-success-glow); }
.power-poweroff { background: var(--color-danger);  box-shadow: 0 0 4px var(--color-danger-glow); }
.power-unknown  { background: var(--color-text-dim); }

/* Card footer */
.server-card-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border);
    align-items: center;
}

.meta-tag {
    font-size: 0.6875rem;
    color: var(--color-text-dim);
    background: var(--color-surface-inset);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-weight: 400;
    white-space: nowrap;
}

.meta-time {
    font-size: 0.6875rem;
    color: var(--color-text-dim);
    font-family: var(--font-mono);
    font-weight: 400;
    margin-left: auto;
}

/* Legacy compat */
.server-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.server-lastcheck {
    font-size: 0.6875rem;
    color: var(--color-text-dim);
    margin-top: 0.75rem;
    font-family: var(--font-mono);
}


/* ============================================================
   16. TAGS / BADGES
   ============================================================ */

.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.03em;
}

.tag--sm {
    padding: 0.125rem 0.4rem;
    font-size: 0.625rem;
}

.tag--success {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid rgba(52, 211, 153, 0.15);
}

.tag--danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border: 1px solid rgba(244, 63, 94, 0.15);
}

.tag--warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.15);
}

.tag--muted {
    background: rgba(61, 74, 92, 0.12);
    color: var(--color-text-dim);
    border: 1px solid rgba(61, 74, 92, 0.15);
}


/* ============================================================
   17. ALERTS SECTION (Dashboard + Detail)
   ============================================================ */

.alerts-section {
    margin-top: 2rem;
    animation: fadeInUp 0.4s var(--ease) 0.15s both;
}

.alerts-section h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1.25rem;
    background: var(--color-surface);
    backdrop-filter: var(--backdrop);
    -webkit-backdrop-filter: var(--backdrop);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}

.alert-item:hover {
    border-color: var(--color-border-hover);
    border-left-color: inherit;
    background: var(--color-surface-hover);
}

.alert-item.alert-critical {
    border-left-color: var(--color-danger);
}

.alert-item.alert-warning {
    border-left-color: var(--color-warning);
}

.alert-item.alert-info {
    border-left-color: var(--accent);
}

.alert-severity {
    font-weight: 600;
    min-width: 64px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-family: var(--font-mono);
}

.alert-item.alert-critical .alert-severity { color: var(--color-danger); }
.alert-item.alert-warning .alert-severity  { color: var(--color-warning); }
.alert-item.alert-info .alert-severity     { color: var(--accent); }

.alert-message {
    flex: 1;
    color: var(--color-text-muted);
}

.alert-time {
    color: var(--color-text-dim);
    font-size: 0.6875rem;
    font-family: var(--font-mono);
    font-weight: 400;
    white-space: nowrap;
}


/* ============================================================
   18. SERVER DETAIL PAGE
   ============================================================ */

.detail-header {
    margin-bottom: 2rem;
}

.detail-title-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* Detail grid (2 columns) */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 2rem;
    animation: fadeInUp 0.4s var(--ease) both;
}

.detail-section {
    background: var(--color-surface);
    backdrop-filter: var(--backdrop);
    -webkit-backdrop-filter: var(--backdrop);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: border-color var(--transition);
}

.detail-section:hover {
    border-color: var(--color-border-hover);
}

.detail-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.detail-section h3 {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.section-icon {
    flex-shrink: 0;
    opacity: 0.6;
}

/* Detail rows */
.detail-rows {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.025);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row--block {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
}

.detail-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
    min-width: 100px;
}

.detail-value {
    font-size: 0.8125rem;
    font-family: var(--font-mono);
    font-weight: 400;
    color: var(--color-text);
    text-align: right;
    word-break: break-all;
}

.detail-row--block .detail-value {
    text-align: left;
}

/* Disk list */
.disk-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.disk-item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    padding: 0.375rem 0.625rem;
    background: var(--color-surface-inset);
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--accent-dim);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--color-text);
}

.disk-desc {
    font-size: 0.6875rem;
    color: var(--color-text-dim);
    font-family: var(--font);
}

/* Detail action (KVM) */
.detail-action {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

/* KVM button */
.kvm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--color-bg);
    background: var(--accent);
    box-shadow: 0 2px 12px var(--accent-glow);
    transition: all var(--transition);
    letter-spacing: 0.02em;
}

.kvm-btn:hover {
    background: #22d3ee;
    box-shadow: 0 4px 20px var(--accent-glow);
    transform: translateY(-1px);
    color: var(--color-bg);
}

.kvm-btn:active {
    transform: translateY(0);
}


/* ============================================================
   19. PROGRESS BARS
   ============================================================ */

.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--color-surface-inset);
    border-radius: var(--radius-pill);
    overflow: hidden;
    position: relative;
}

.progress-bar--sm {
    height: 3px;
}

.progress-bar--lg {
    height: 6px;
}

.progress-bar-fill {
    height: 100%;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, var(--accent-dim), var(--accent));
    transition: width 0.6s var(--ease);
    position: relative;
    min-width: 0;
    animation: progressFill 0.8s var(--ease) both;
}

/* Semantic progress variants */
.progress-bar-fill--success {
    background: linear-gradient(90deg, var(--color-success-dim), var(--color-success));
}

.progress-bar-fill--warning {
    background: linear-gradient(90deg, var(--color-warning-dim), var(--color-warning));
}

.progress-bar-fill--danger {
    background: linear-gradient(90deg, var(--color-danger-dim), var(--color-danger));
}

/* Progress bar with label */
.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.375rem;
}

.progress-label-text {
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.progress-label-value {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text);
}


/* ============================================================
   20. LATENCY INDICATOR
   ============================================================ */

.latency-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 400;
}

.latency-indicator::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Green: < 30ms */
.latency-indicator--good {
    color: var(--color-success);
}

.latency-indicator--good::before {
    background: var(--color-success);
    box-shadow: 0 0 4px var(--color-success-glow);
}

/* Yellow: < 100ms */
.latency-indicator--fair {
    color: var(--color-warning);
}

.latency-indicator--fair::before {
    background: var(--color-warning);
    box-shadow: 0 0 4px var(--color-warning-glow);
}

/* Red: > 100ms */
.latency-indicator--poor {
    color: var(--color-danger);
}

.latency-indicator--poor::before {
    background: var(--color-danger);
    box-shadow: 0 0 4px var(--color-danger-glow);
}

/* Unknown / no data */
.latency-indicator--unknown {
    color: var(--color-text-dim);
}

.latency-indicator--unknown::before {
    background: var(--color-text-dim);
}


/* ============================================================
   21. STAT BAR GROUP
   ============================================================ */

.stat-bar-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.stat-bar-group .progress-label {
    margin-bottom: 0.25rem;
}


/* ============================================================
   22. MINI BAR
   ============================================================ */

.mini-bar {
    width: 100%;
    height: 2px;
    background: var(--color-surface-inset);
    border-radius: var(--radius-pill);
    overflow: hidden;
    margin-top: 0.25rem;
}

.mini-bar-fill {
    height: 100%;
    border-radius: var(--radius-pill);
    background: var(--accent);
    transition: width 0.5s var(--ease);
    min-width: 0;
}

.mini-bar-fill--success {
    background: var(--color-success);
}

.mini-bar-fill--warning {
    background: var(--color-warning);
}

.mini-bar-fill--danger {
    background: var(--color-danger);
}


/* ============================================================
   23. SPINNER
   ============================================================ */

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--color-bg);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spinnerSpin 0.6s linear infinite;
    vertical-align: middle;
}


/* ============================================================
   24. CONSOLE PAGE (KVM Proxy)
   ============================================================ */

.console-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--color-bg);
}

.console-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--color-surface);
    backdrop-filter: var(--backdrop);
    -webkit-backdrop-filter: var(--backdrop);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.console-header h2 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
}

.console-frame {
    flex: 1;
    background: #000;
    position: relative;
}

.console-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}


/* ============================================================
   25. EMPTY STATE
   ============================================================ */

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--color-text-dim);
    animation: fadeInUp 0.4s var(--ease) both;
}

.empty-state--compact {
    padding: 2rem;
}

.empty-icon {
    margin-bottom: 1rem;
    opacity: 0.25;
}

.empty-icon svg {
    color: var(--accent);
}

.empty-state p {
    font-size: 0.8125rem;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}


/* ============================================================
   26. UTILITY CLASSES
   ============================================================ */

.text-success { color: var(--color-success); }
.text-danger  { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-accent  { color: var(--accent); }
.text-muted   { color: var(--color-text-muted); }
.text-dim     { color: var(--color-text-dim); }

.font-mono { font-family: var(--font-mono); }


/* ============================================================
   27. RESPONSIVE
   ============================================================ */

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

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .main-content {
        padding: 1.25rem;
    }

    .server-grid {
        grid-template-columns: 1fr;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .stats-row {
        flex-wrap: wrap;
    }

    .stat-card {
        flex-basis: calc(50% - 0.5rem);
        min-width: 0;
    }

    .page-header h1,
    .page-title {
        font-size: 1.25rem;
    }

    .server-card-specs {
        grid-template-columns: 1fr;
    }

    .login-card {
        padding: 1.75rem;
    }

    .detail-title-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .stat-card {
        flex-basis: 100%;
    }

    .main-content {
        padding: 1rem;
    }

    .login-header h1 {
        font-size: 1.375rem;
    }
}
