@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-main: #090d16;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-card-hover: rgba(30, 41, 59, 0.8);
    --bg-input: rgba(15, 23, 42, 0.6);
    --border: rgba(255, 255, 255, 0.08);
    --border-focus: #6366f1;
    --border-glow: rgba(99, 102, 241, 0.25);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --accent: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0ea5e9;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.05) inset;
    --shadow-glow: 0 0 20px -5px rgba(99, 102, 241, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: radial-gradient(circle at 10% 0%, #1e1b4b 0%, var(--bg-main) 40%), radial-gradient(circle at 90% 100%, #064e3b 0%, var(--bg-main) 40%), var(--bg-main);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Header & Nav */
.header-hero {
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px);
    background: rgba(9, 13, 22, 0.75);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-main);
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: var(--shadow-glow);
}

.brand-title {
    font-weight: 800;
    font-size: 16px;
    letter-spacing: -0.02em;
    background: linear-gradient(to right, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-sub {
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 500;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.nav-item {
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

    .nav-item:hover {
        color: var(--text-main);
        background: rgba(255, 255, 255, 0.05);
    }

    .nav-item.active {
        color: #fff;
        background: var(--primary);
        box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
    }

.user-block {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* KPI Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-card);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

    .stat-card:hover {
        transform: translateY(-2px);
        border-color: rgba(255, 255, 255, 0.15);
    }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
}

.stat-val {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Layout Container */
.main-container {
    max-width: 1400px;
    margin: 28px auto;
    padding: 0 24px;
}

/* Card */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 14px;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Search Input */
.search-box {
    position: relative;
    width: 280px;
}

    .search-box input {
        width: 100%;
        padding: 9px 12px 9px 36px;
        border-radius: var(--radius-sm);
        border: 1px solid var(--border);
        background: var(--bg-input);
        color: var(--text-main);
        font-size: 13px;
        outline: none;
        transition: all 0.2s ease;
    }

        .search-box input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px var(--border-glow);
        }

.search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--text-dim);
}

/* Tables */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: rgba(10, 15, 29, 0.4);
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    white-space: nowrap;
}

    .table th {
        background: rgba(255, 255, 255, 0.02);
        color: var(--text-dim);
        font-size: 11px;
        text-transform: uppercase;
        font-weight: 700;
        letter-spacing: 0.06em;
        padding: 12px 16px;
        border-bottom: 1px solid var(--border);
    }

    .table td {
        padding: 12px 16px;
        border-bottom: 1px solid var(--border);
        vertical-align: middle;
        font-size: 13px;
    }

    .table tbody tr {
        transition: background 0.15s ease;
    }

        .table tbody tr:hover {
            background: rgba(255, 255, 255, 0.02);
        }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    color: #fff;
    background: var(--primary);
}

    .btn:hover {
        background: var(--primary-hover);
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
        transform: translateY(-1px);
    }

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border);
    color: var(--text-main);
}

    .btn-secondary:hover {
        background: rgba(255, 255, 255, 0.09);
        border-color: rgba(255, 255, 255, 0.2);
    }

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

    .btn-danger:hover {
        background: var(--danger);
        color: #fff;
    }

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
}

/* Inputs */
.input {
    width: 100%;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 13px;
    outline: none;
    transition: all 0.2s ease;
}

    .input:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px var(--border-glow);
        background: rgba(15, 23, 42, 0.9);
    }

/* Badges & Status */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid transparent;
}

.badge--online {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.badge--offline {
    background: rgba(100, 116, 139, 0.15);
    border-color: rgba(100, 116, 139, 0.3);
    color: var(--text-dim);
}

.badge--admin {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

.badge--warn {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.badge--error {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.badge--info {
    background: rgba(14, 165, 233, 0.12);
    border-color: rgba(14, 165, 233, 0.3);
    color: #38bdf8;
}

.badge--mode {
    background: rgba(168, 85, 247, 0.12);
    border-color: rgba(168, 85, 247, 0.3);
    color: #c084fc;
}

/* Status Indicator Dot */
.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

    .status-dot.online {
        background: var(--accent);
        box-shadow: 0 0 8px var(--accent);
        animation: pulseDot 2s infinite;
    }

    .status-dot.offline {
        background: var(--text-dim);
    }

@keyframes pulseDot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.85);
    }
}

code {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #e2e8f0;
}

/* Code & Details View */
details {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    margin-top: 6px;
}

summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
}

    summary:hover {
        color: var(--text-main);
    }

pre {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.4;
    padding: 10px;
    background: #040711;
    border-radius: var(--radius-sm);
    margin-top: 8px;
    overflow-x: auto;
    color: #a5f3fc;
    border: 1px solid var(--border);
}
