:root {
    --bg: #050506;
    --panel: #171717;
    --panel-2: #1f1f1f;
    --line: rgba(255,255,255,.08);
    --muted: #9ca3af;
    --text: #f5f5f5;
    --blue: #2680ff;
    --orange: #ff9418;
    --orange-2: #ff4b22;
    --green: #22c55e;
    --red: #ef4444;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 28% 18%, rgba(255,148,24,.10), transparent 28%),
        radial-gradient(circle at 78% 72%, rgba(255,75,34,.12), transparent 34%),
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
        var(--bg);
    background-size: auto, auto, 48px 48px, 48px 48px;
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body:not(.ready) .login-view,
body:not(.ready) .app {
    opacity: 0;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.hidden { display: none !important; }

.login-view {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(560px, 100%);
    padding: 40px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(20,20,20,.96), rgba(8,8,8,.96));
    box-shadow: 0 30px 90px rgba(0,0,0,.45);
}

.brand, .brand-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--orange), var(--orange-2));
    color: #050505;
    font-weight: 900;
    box-shadow: 0 12px 28px rgba(255,98,24,.25);
}

.brand strong { display: block; font-size: 18px; }
.brand small { color: var(--muted); letter-spacing: .12em; }

.eyebrow {
    color: var(--muted);
    letter-spacing: .16em;
    text-transform: uppercase;
    font-size: 12px;
}

.login-card h1 {
    margin: 28px 0 14px;
    font-size: clamp(36px, 6vw, 58px);
    line-height: .95;
}

.login-card p {
    color: var(--muted);
    line-height: 1.6;
    font-size: 17px;
}

.primary, .button, .card button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 22px;
    border: 0;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--orange), var(--orange-2));
    color: #070707;
    font-weight: 900;
    cursor: pointer;
    transition: transform .18s ease, filter .18s ease;
}

.primary:hover, .button:hover, .card button:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

.primary.wide { width: 100%; margin-top: 18px; }
.note { margin-top: 18px; font-size: 13px !important; }

.app {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px 1fr;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 28px;
    border-right: 1px solid var(--line);
    background: rgba(8,8,8,.78);
    backdrop-filter: blur(18px);
    display: flex;
    flex-direction: column;
}

.nav {
    display: grid;
    gap: 10px;
    margin-top: 38px;
}

.nav-link {
    padding: 14px 16px;
    border-radius: 10px;
    color: #b9bec8;
    font-weight: 800;
    transition: .18s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
    background: rgba(255,148,24,.16);
}

.sidebar-bottom {
    margin-top: auto;
    display: grid;
    gap: 12px;
}

.panel-link {
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255,255,255,.04);
    color: #c7cbd3;
    font-weight: 800;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.main {
    padding: 0 36px 48px;
}

.topbar {
    height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    border-bottom: 1px solid var(--line);
}

.search {
    width: min(430px, 100%);
    height: 44px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #070707;
    color: #fff;
}

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

.demo-pill {
    border: 1px solid rgba(255,148,24,.7);
    color: var(--orange);
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 900;
    font-size: 13px;
}

.icon-dot {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    color: var(--muted);
}

.avatar, .user-avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--orange), var(--orange-2));
    color: #050505;
    font-weight: 900;
}

.content {
    max-width: 1120px;
    margin: 0 auto;
    padding-top: 42px;
}

.page-head {
    margin-bottom: 26px;
}

.page-head h1 {
    margin: 8px 0 0;
    font-size: clamp(38px, 5vw, 58px);
    line-height: 1;
}

.view { display: none; }
.active-view { display: block; animation: fadeUp .26s ease both; }

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

.hero-card {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background:
        radial-gradient(circle at 12% 0%, rgba(38,128,255,.18), transparent 36%),
        linear-gradient(135deg, rgba(24,24,24,.98), rgba(9,9,9,.98));
    margin-bottom: 22px;
}

.hero-card h2 { margin: 10px 0 4px; font-size: 24px; }
.hero-card p { margin: 0; color: var(--muted); }

.stats-grid, .dashboard-grid, .server-grid, .settings-grid {
    display: grid;
    gap: 14px;
}

.stats-grid { grid-template-columns: repeat(3, 1fr); margin-bottom: 18px; }
.dashboard-grid { grid-template-columns: 1.45fr .95fr; }
.server-grid { grid-template-columns: 1fr; }

.card, .stat-card, .server-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(30,30,30,.96), rgba(12,12,12,.96));
    box-shadow: 0 20px 60px rgba(0,0,0,.24);
}

.stat-card {
    padding: 22px;
}

.stat-card span {
    display: block;
    color: var(--muted);
    margin-bottom: 10px;
}

.stat-card strong {
    font-size: 30px;
}

.card {
    padding: 24px;
}

.card-head, .server-row, .detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.card h2, .card h3, .server-card h3 {
    margin: 4px 0 12px;
    font-size: 25px;
}

.card p { color: var(--muted); line-height: 1.45; }

.server-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.server-row {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255,255,255,.035);
}

.server-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 7px rgba(34,197,94,.12);
}

.status-offline { background: var(--red); box-shadow: 0 0 0 7px rgba(239,68,68,.12); }

.server-row small, .server-card small {
    color: var(--muted);
    display: block;
}

.server-card {
    padding: 22px;
}

.server-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.badge {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(34,197,94,.16);
    color: #39e58b;
    font-size: 12px;
    font-weight: 900;
}

.badge.offline {
    background: rgba(239,68,68,.14);
    color: #ff7b7b;
}

.details {
    display: grid;
    gap: 12px;
    margin: 20px 0;
}

.detail-row {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
}

.detail-row strong {
    color: #fff;
}

.progress {
    height: 6px;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    overflow: hidden;
}

.progress span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--blue), var(--orange));
    border-radius: inherit;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.button.ghost, button.ghost {
    background: transparent;
    color: #fff;
    border: 1px solid var(--line);
}

.empty-state {
    max-width: 720px;
    min-height: 260px;
    display: grid;
    align-content: center;
}

.green { color: #39e58b !important; }
.muted { color: var(--muted); }

@media (max-width: 980px) {
    .app { grid-template-columns: 1fr; }
    .sidebar {
        position: relative;
        height: auto;
        padding: 20px;
    }
    .nav { grid-template-columns: repeat(2, 1fr); margin-top: 22px; }
    .sidebar-bottom { margin-top: 22px; }
    .main { padding: 0 18px 36px; }
    .topbar { height: auto; padding: 18px 0; align-items: flex-start; flex-direction: column; }
    .stats-grid, .dashboard-grid, .settings-grid { grid-template-columns: 1fr; }
}
