/* =============================================================
   GUARD — assets/css/style.css
   Premium Glassmorphism + Windows 11 Fluent + macOS Design System
   ============================================================= */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Custom Properties (Design Tokens) ──────────────────
   Think of these as named variables for all colors, sizes,
   shadows, and transitions used throughout the UI.
   Changing a token here updates the whole design.
   ──────────────────────────────────────────────────────────── */
:root {
    /* Background Layers */
    --bg-base:          #080812;
    --bg-surface:       #0e0e1f;

    /* Glassmorphism */
    --glass-bg:         rgba(255, 255, 255, 0.055);
    --glass-bg-hover:   rgba(255, 255, 255, 0.085);
    --glass-border:     rgba(255, 255, 255, 0.10);
    --glass-border-act: rgba(255, 255, 255, 0.22);
    --blur:             blur(24px);
    --blur-sm:          blur(12px);

    /* Accent Colors */
    --accent:           #7c3aed;  /* violet */
    --accent-2:         #2563eb;  /* blue */
    --accent-grad:      linear-gradient(135deg, #7c3aed 0%, #2563eb 100%);
    --success:          #059669;
    --success-light:    rgba(5, 150, 105, 0.15);
    --success-border:   rgba(5, 150, 105, 0.35);
    --warning:          #d97706;
    --warning-light:    rgba(217, 119, 6, 0.15);
    --warning-border:   rgba(217, 119, 6, 0.35);
    --danger:           #dc2626;
    --danger-light:     rgba(220, 38, 38, 0.15);
    --danger-border:    rgba(220, 38, 38, 0.35);
    --info:             #0ea5e9;
    --info-light:       rgba(14, 165, 233, 0.15);

    /* Typography */
    --text-100:  rgba(255, 255, 255, 0.97);
    --text-200:  rgba(255, 255, 255, 0.75);
    --text-300:  rgba(255, 255, 255, 0.50);
    --text-400:  rgba(255, 255, 255, 0.30);

    /* Shadows */
    --shadow-sm:  0 2px 8px rgba(0, 0, 0, 0.30);
    --shadow-md:  0 8px 32px rgba(0, 0, 0, 0.45);
    --shadow-lg:  0 20px 60px rgba(0, 0, 0, 0.60);
    --shadow-glow: 0 0 40px rgba(124, 58, 237, 0.25);

    /* Border Radius */
    --radius-xs:  6px;
    --radius-sm:  10px;
    --radius-md:  14px;
    --radius-lg:  20px;
    --radius-xl:  28px;

    /* Transitions */
    --ease:      cubic-bezier(0.16, 1, 0.3, 1);
    --ease-fast: cubic-bezier(0.4, 0, 0.2, 1);
    --dur-s:     150ms;
    --dur-m:     250ms;
    --dur-l:     400ms;

    /* Layout */
    --sidebar-w: 260px;
    --topbar-h:  64px;
}

/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-100);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Animated Mesh Gradient Background ───────────────────── */
/* This creates the beautiful, slowly moving color orbs behind
   all the glass UI elements. Pure CSS — no images needed. */
.bg-gradient {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-gradient::before,
.bg-gradient::after,
.bg-gradient .orb-3 {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: drift 20s ease-in-out infinite alternate;
}

.bg-gradient::before {
    width: 800px; height: 800px;
    background: radial-gradient(circle, #4c1d95 0%, transparent 70%);
    top: -200px; left: -200px;
    animation-duration: 22s;
}

.bg-gradient::after {
    width: 700px; height: 700px;
    background: radial-gradient(circle, #1e3a8a 0%, transparent 70%);
    bottom: -200px; right: -100px;
    animation-duration: 18s;
    animation-direction: alternate-reverse;
}

.bg-gradient .orb-3 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, #0c4a6e 0%, transparent 70%);
    top: 40%; left: 40%;
    animation-duration: 25s;
}

@keyframes drift {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(60px, 40px) scale(1.1); }
    100% { transform: translate(-30px, 60px) scale(0.95); }
}

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-100);
}

a {
    color: #a78bfa;
    text-decoration: none;
    transition: color var(--dur-s) var(--ease-fast);
}
a:hover { color: #c4b5fd; text-decoration: underline; }

/* ── Glass Card Component ────────────────────────────────── */
/* The core Glassmorphism element. Used for cards, modals,
   sidebar, topbar, etc. */
.glass {
    background:           var(--glass-bg);
    backdrop-filter:      var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border:               1px solid var(--glass-border);
    border-radius:        var(--radius-lg);
    box-shadow:           var(--shadow-md);
    transition: background var(--dur-m) var(--ease-fast),
                border-color var(--dur-m) var(--ease-fast);
}

.glass:hover {
    background:    var(--glass-bg-hover);
    border-color:  var(--glass-border-act);
}

/* ── Layout Structure ────────────────────────────────────── */
.app-layout {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    position: fixed;
    top: 0; left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 0;
    background: rgba(10, 10, 28, 0.75);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-right: 1px solid var(--glass-border);
    box-shadow: 4px 0 30px rgba(0,0,0,0.4);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--glass-border);
}

.sidebar-logo-icon {
    width: 42px; height: 42px;
    background: var(--accent-grad);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
}

.sidebar-logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-100);
}

.sidebar-logo-ver {
    font-size: 0.7rem;
    color: var(--text-400);
    margin-top: 1px;
}

/* Nav section labels */
.nav-section-label {
    padding: 20px 24px 8px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-400);
}

/* Nav items */
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    margin: 2px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-200);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--dur-s) var(--ease-fast),
                color var(--dur-s) var(--ease-fast),
                box-shadow var(--dur-s) var(--ease-fast);
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-grad);
    opacity: 0;
    transition: opacity var(--dur-m) var(--ease);
    border-radius: var(--radius-sm);
}

.nav-item:hover {
    color: var(--text-100);
    background: rgba(255,255,255,0.07);
    text-decoration: none;
}

.nav-item.active {
    color: #fff;
    background: rgba(124, 58, 237, 0.25);
    border: 1px solid rgba(124, 58, 237, 0.4);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.2);
}

.nav-item.active .nav-icon {
    filter: drop-shadow(0 0 6px rgba(167, 139, 250, 0.6));
}

.nav-icon {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

/* Sidebar footer (admin user info) */
.sidebar-footer {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid var(--glass-border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
}

.sidebar-avatar {
    width: 36px; height: 36px;
    background: var(--accent-grad);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-username {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-100);
}

.sidebar-role {
    font-size: 0.72rem;
    color: var(--text-300);
}

.sidebar-logout {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-300);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    border-radius: var(--radius-xs);
    transition: color var(--dur-s), background var(--dur-s);
}

.sidebar-logout:hover {
    color: #f87171;
    background: rgba(220,38,38,0.1);
}

/* ── Main Content Area ───────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-h);
    background: rgba(10, 10, 28, 0.65);
    backdrop-filter: var(--blur-sm);
    -webkit-backdrop-filter: var(--blur-sm);
    border-bottom: 1px solid var(--glass-border);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-100);
}

.topbar-subtitle {
    font-size: 0.8rem;
    color: var(--text-300);
    margin-top: 1px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ── Page Content ────────────────────────────────────────── */
.page-content {
    padding: 32px;
    flex: 1;
}

/* ── Stats Cards ─────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--dur-m) var(--ease),
                box-shadow var(--dur-m) var(--ease),
                border-color var(--dur-m) var(--ease);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--accent-grad);
    opacity: 0;
    transition: opacity var(--dur-m) var(--ease);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border-color: rgba(124, 58, 237, 0.3);
}

.stat-card:hover::after { opacity: 1; }

.stat-icon-wrap {
    width: 52px; height: 52px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-icon-wrap.violet  { background: rgba(124,58,237,0.2); }
.stat-icon-wrap.blue    { background: rgba(37,99,235,0.2); }
.stat-icon-wrap.emerald { background: rgba(5,150,105,0.2); }
.stat-icon-wrap.amber   { background: rgba(217,119,6,0.2); }
.stat-icon-wrap.red     { background: rgba(220,38,38,0.2); }

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-100);
    line-height: 1;
    letter-spacing: -0.03em;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-300);
    font-weight: 500;
    margin-top: 4px;
}

/* ── Section / Panel ─────────────────────────────────────── */
.panel {
    background: var(--glass-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 28px;
}

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

.panel-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-100);
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-body {
    padding: 0;
}

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

.data-table thead th {
    padding: 14px 20px;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-300);
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
}

.data-table tbody tr {
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background var(--dur-s) var(--ease-fast);
}

.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.04); }

.data-table tbody td {
    padding: 14px 20px;
    color: var(--text-200);
    vertical-align: middle;
}

.data-table .empty-row td {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-400);
}

/* ── Badges / Pills ──────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.badge-success  { background: var(--success-light); color: #6ee7b7; border: 1px solid var(--success-border); }
.badge-warning  { background: var(--warning-light); color: #fcd34d; border: 1px solid var(--warning-border); }
.badge-danger   { background: var(--danger-light);  color: #fca5a5; border: 1px solid var(--danger-border);  }
.badge-info     { background: var(--info-light);    color: #7dd3fc; border: 1px solid rgba(14,165,233,0.35); }
.badge-neutral  { background: rgba(255,255,255,0.07); color: var(--text-300); border: 1px solid var(--glass-border); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: transform var(--dur-s) var(--ease),
                box-shadow var(--dur-s) var(--ease),
                opacity var(--dur-s);
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.1);
    opacity: 0;
    transition: opacity var(--dur-s);
}
.btn:hover::after { opacity: 1; }
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: var(--accent-grad);
    color: #fff;
    box-shadow: 0 4px 16px rgba(124,58,237,0.35);
}
.btn-primary:hover {
    box-shadow: 0 6px 24px rgba(124,58,237,0.5);
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}

.btn-secondary {
    background: rgba(255,255,255,0.08);
    color: var(--text-200);
    border: 1px solid var(--glass-border);
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.12);
    color: var(--text-100);
    text-decoration: none;
}

.btn-success {
    background: rgba(5,150,105,0.2);
    color: #6ee7b7;
    border: 1px solid var(--success-border);
}
.btn-success:hover { background: rgba(5,150,105,0.3); color: #6ee7b7; text-decoration: none; }

.btn-danger {
    background: rgba(220,38,38,0.15);
    color: #fca5a5;
    border: 1px solid var(--danger-border);
}
.btn-danger:hover { background: rgba(220,38,38,0.25); color: #fca5a5; text-decoration: none; }

.btn-warning {
    background: rgba(217,119,6,0.15);
    color: #fcd34d;
    border: 1px solid var(--warning-border);
}
.btn-warning:hover { background: rgba(217,119,6,0.25); color: #fcd34d; text-decoration: none; }

.btn-sm {
    padding: 5px 12px;
    font-size: 0.78rem;
    border-radius: var(--radius-xs);
    gap: 5px;
}

.btn-icon {
    padding: 8px;
    border-radius: var(--radius-xs);
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--glass-border);
    color: var(--text-200);
    cursor: pointer;
    font-size: 0.9rem;
    transition: background var(--dur-s), color var(--dur-s);
}
.btn-icon:hover { background: rgba(255,255,255,0.12); color: var(--text-100); }

/* ── Form Elements ───────────────────────────────────────── */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-200);
    margin-bottom: 7px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-100);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color var(--dur-s) var(--ease-fast),
                background var(--dur-s) var(--ease-fast),
                box-shadow var(--dur-s) var(--ease-fast);
    appearance: none;
}

.form-control:focus {
    border-color: rgba(124, 58, 237, 0.7);
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.form-control::placeholder { color: var(--text-400); }

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

select.form-control option {
    background: #1a1a2e;
    color: var(--text-100);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* Search input */
.search-wrap {
    position: relative;
}
.search-wrap .search-icon {
    position: absolute;
    left: 12px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-400);
    pointer-events: none;
    font-size: 0.9rem;
}
.search-wrap .form-control {
    padding-left: 36px;
    width: 240px;
}

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dur-m) var(--ease),
                visibility var(--dur-m) var(--ease);
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: rgba(16, 16, 40, 0.90);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.94) translateY(16px);
    transition: transform var(--dur-l) var(--ease);
}

.modal-overlay.open .modal {
    transform: scale(1) translateY(0);
}

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

.modal-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.modal-close {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--glass-border);
    color: var(--text-300);
    width: 32px; height: 32px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    transition: background var(--dur-s), color var(--dur-s);
}
.modal-close:hover { background: var(--danger-light); color: #f87171; border-color: var(--danger-border); }

.modal-body { padding: 24px; }

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--glass-border);
}

/* ── Alert Boxes ─────────────────────────────────────────── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 16px;
    line-height: 1.5;
}

.alert-success { background: var(--success-light); border: 1px solid var(--success-border); color: #a7f3d0; }
.alert-warning { background: var(--warning-light); border: 1px solid var(--warning-border); color: #fde68a; }
.alert-danger  { background: var(--danger-light);  border: 1px solid var(--danger-border);  color: #fecaca; }
.alert-info    { background: var(--info-light);    border: 1px solid rgba(14,165,233,.35);  color: #bae6fd; }

/* ── Toast Notifications ─────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(20, 20, 50, 0.92);
    backdrop-filter: var(--blur-sm);
    -webkit-backdrop-filter: var(--blur-sm);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    pointer-events: all;
    min-width: 280px;
    max-width: 380px;
    transform: translateX(120%);
    transition: transform var(--dur-l) var(--ease);
    border: 1px solid var(--glass-border);
}

.toast.show { transform: translateX(0); }
.toast.hide { transform: translateX(120%); }

.toast-icon { font-size: 1.2rem; flex-shrink: 0; }
.toast-msg  { font-size: 0.875rem; color: var(--text-100); flex: 1; }

.toast.success { border-color: var(--success-border); }
.toast.success .toast-icon::before { content: '✅'; }
.toast.error   { border-color: var(--danger-border);  }
.toast.error   .toast-icon::before { content: '❌'; }
.toast.warning { border-color: var(--warning-border); }
.toast.warning .toast-icon::before { content: '⚠️'; }
.toast.info    { border-color: rgba(14,165,233,0.35); }
.toast.info    .toast-icon::before { content: 'ℹ️'; }

/* ── Login Page ──────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(14, 14, 36, 0.85);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: slideUp var(--dur-l) var(--ease) both;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 32px;
    gap: 12px;
}

.login-logo-icon {
    width: 64px; height: 64px;
    background: var(--accent-grad);
    border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
    box-shadow: 0 8px 32px rgba(124,58,237,0.45);
    animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 8px 32px rgba(124,58,237,0.45); }
    to   { box-shadow: 0 8px 48px rgba(124,58,237,0.70); }
}

.login-title    { font-size: 1.5rem; font-weight: 800; color: var(--text-100); }
.login-subtitle { font-size: 0.85rem; color: var(--text-300); }

/* ── Misc Utilities ──────────────────────────────────────── */
.text-muted    { color: var(--text-300); }
.text-sm       { font-size: 0.8rem; }
.text-xs       { font-size: 0.72rem; }
.font-mono     { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.8rem; }
.d-flex        { display: flex; }
.align-center  { align-items: center; }
.gap-8         { gap: 8px; }
.gap-12        { gap: 12px; }
.mt-8          { margin-top: 8px; }
.mt-16         { margin-top: 16px; }
.mb-0          { margin-bottom: 0; }
.w-100         { width: 100%; }
.truncate      { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.divider       { border: none; border-top: 1px solid var(--glass-border); margin: 16px 0; }

/* Spinner */
.spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Hardware ID display */
.hw-id {
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.78rem;
    color: var(--text-300);
    background: rgba(255,255,255,0.04);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.07);
    max-width: 180px;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* Heartbeat indicator */
.heartbeat-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
.heartbeat-dot.online  { background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,0.25); animation: pulse 2s ease-in-out infinite; }
.heartbeat-dot.offline { background: #6b7280; }
.heartbeat-dot.stale   { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.2); }

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(16,185,129,0.25); }
    50%       { box-shadow: 0 0 0 6px rgba(16,185,129,0.10); }
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 16px 24px;
    border-top: 1px solid var(--glass-border);
    justify-content: flex-end;
}

.pagination .btn { min-width: 36px; height: 36px; padding: 0 12px; }
.pagination .active-page { background: rgba(124,58,237,0.3); border-color: rgba(124,58,237,0.5); color: #c4b5fd; }

/* ── Scrollbar Styling ───────────────────────────────────── */
::-webkit-scrollbar            { width: 6px; height: 6px; }
::-webkit-scrollbar-track      { background: transparent; }
::-webkit-scrollbar-thumb      { background: rgba(255,255,255,0.12); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover{ background: rgba(255,255,255,0.22); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform var(--dur-m) var(--ease); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .page-content { padding: 20px 16px; }
    .search-wrap .form-control { width: 180px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .modal { border-radius: var(--radius-lg); }
    .login-card { padding: 28px 20px; }
}
