:root {
    --bg: #070b14;
    --bg-soft: #0a1020;
    --surface: #0f172a;
    --surface-2: #111c32;
    --surface-3: #16233d;
    --border: rgba(148, 163, 184, .16);
    --border-strong: rgba(148, 163, 184, .28);
    --text: #f8fafc;
    --muted: #94a3b8;
    --muted-2: #64748b;
    --primary: #3b82f6;
    --primary-2: #2563eb;
    --cyan: #22d3ee;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 20px 60px rgba(0, 0, 0, .30);
    --sidebar: 278px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 85% 0%, rgba(37, 99, 235, .20), transparent 30%),
        radial-gradient(circle at 20% 100%, rgba(34, 211, 238, .10), transparent 28%),
        var(--bg);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
svg { width: 1.2em; height: 1.2em; stroke: currentColor; stroke-width: 1.8; }

.app-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar);
    z-index: 30;
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    background: linear-gradient(180deg, rgba(15,23,42,.98), rgba(7,11,20,.98));
    border-right: 1px solid var(--border);
    box-shadow: 16px 0 50px rgba(0,0,0,.18);
}
.brand { display: flex; align-items: center; gap: 13px; padding: 2px 8px 24px; border-bottom: 1px solid var(--border); }
.brand-mark {
    width: 46px; height: 46px; display: grid; place-items: center;
    border-radius: 14px; color: white;
    background: linear-gradient(145deg, #2563eb, #22d3ee);
    box-shadow: 0 10px 24px rgba(37,99,235,.35);
}
.brand-mark svg { width: 25px; height: 25px; }
.brand-copy { display: grid; line-height: 1.05; }
.brand-copy strong { font-size: 22px; letter-spacing: .08em; }
.brand-copy span { margin-top: 7px; font-size: 11px; color: var(--muted); letter-spacing: .16em; text-transform: uppercase; }
.nav-label { margin: 27px 12px 10px; color: var(--muted-2); font-size: 10px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.sidebar-menu { display: grid; gap: 7px; }
.menu-item {
    position: relative; display: flex; align-items: center; gap: 13px;
    min-height: 48px; padding: 0 14px; border-radius: 13px;
    color: #aebbd0; font-size: 14px; font-weight: 650;
    transition: .2s ease;
}
.menu-item:hover { color: white; background: rgba(255,255,255,.055); transform: translateX(2px); }
.menu-item.active {
    color: white;
    background: linear-gradient(90deg, rgba(37,99,235,.32), rgba(37,99,235,.08));
    border: 1px solid rgba(59,130,246,.26);
    box-shadow: inset 3px 0 0 #3b82f6;
}
.menu-icon { width: 24px; display: grid; place-items: center; color: #7f91ad; }
.menu-item.active .menu-icon { color: #60a5fa; }
.sidebar-spacer { flex: 1; }
.server-card {
    padding: 15px; border-radius: 15px; background: rgba(16,185,129,.075);
    border: 1px solid rgba(16,185,129,.20); display: grid; gap: 7px;
}
.server-card-head { display: flex; align-items: center; gap: 9px; color: #d1fae5; font-size: 13px; }
.server-card > span { color: #6ee7b7; font-size: 12px; }
.server-card small { color: var(--muted); }
.pulse-dot, .server-dot, .live-pill i, .badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px rgba(16,185,129,.12); }
.sidebar-footer { padding: 15px 6px 0; color: #475569; font-size: 10px; letter-spacing: .07em; text-align: center; text-transform: uppercase; }

.main-content { grid-column: 2; min-width: 0; }
.topbar {
    min-height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
    padding: 24px 34px; border-bottom: 1px solid var(--border);
    background: rgba(7,11,20,.66); backdrop-filter: blur(18px);
    position: sticky; top: 0; z-index: 20;
}
.page-heading .eyebrow { color: #60a5fa; font-size: 10px; font-weight: 800; letter-spacing: .2em; }
.page-heading h1 { margin: 6px 0 4px; font-size: clamp(24px, 2.2vw, 34px); letter-spacing: -.035em; }
.page-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 13px; }
.server-indicator { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 999px; color: #cbd5e1; font-size: 12px; background: rgba(15,23,42,.70); }
.admin-avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; font-weight: 800; font-size: 12px; background: linear-gradient(145deg,#1e40af,#2563eb); box-shadow: 0 10px 25px rgba(37,99,235,.25); }
.mobile-menu { display: none; border: 0; background: transparent; color: white; }
.content-wrap { padding: 30px 34px 44px; }

.hero-strip {
    position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; gap: 24px;
    padding: 30px 32px; margin-bottom: 22px; border-radius: 22px;
    background: linear-gradient(110deg, #172554 0%, #1d4ed8 55%, #0891b2 120%);
    box-shadow: 0 22px 60px rgba(29,78,216,.22);
}
.hero-strip::after { content:""; position:absolute; width:280px; height:280px; right:-70px; top:-130px; border-radius:50%; border:52px solid rgba(255,255,255,.09); }
.hero-strip > * { position: relative; z-index: 1; }
.hero-kicker, .panel-kicker { display:block; margin-bottom:8px; color:#93c5fd; font-size:10px; font-weight:800; letter-spacing:.18em; text-transform:uppercase; }
.hero-strip h2 { max-width: 720px; margin: 0 0 8px; font-size: clamp(23px,3vw,38px); letter-spacing:-.04em; }
.hero-strip p { margin:0; color:#dbeafe; }

.button {
    min-height: 40px; display: inline-flex; align-items:center; justify-content:center; gap:8px;
    padding: 0 15px; border-radius: 10px; border: 1px solid transparent;
    color:white; background:#2563eb; font-weight:700; font-size:12px; transition:.18s ease;
}
.button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.button:disabled { opacity:.55; cursor:not-allowed; transform:none; }
.button-light { color:#0f172a; background:white; box-shadow:0 9px 22px rgba(0,0,0,.16); }
.button-secondary { color:#dbeafe; background:rgba(59,130,246,.10); border-color:rgba(96,165,250,.24); }
.button-dark { background:#0f172a; border-color:#334155; }
.button-success { background:#059669; }
.button-warning { background:#d97706; }
.button-danger { background:#dc2626; }
.button-small { min-height:32px; padding:0 11px; font-size:11px; border-radius:8px; }

.metric-grid, .summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; margin-bottom:22px; }
.metric-card, .summary-card {
    position:relative; overflow:hidden; min-height:132px; display:flex; align-items:center; gap:16px;
    padding:21px; border-radius:var(--radius); background:linear-gradient(145deg,rgba(17,28,50,.96),rgba(15,23,42,.96));
    border:1px solid var(--border); box-shadow:0 15px 35px rgba(0,0,0,.14); transition:.2s ease;
}
.metric-card:hover, .summary-card:hover { transform:translateY(-3px); border-color:rgba(96,165,250,.30); }
.metric-card::after, .summary-card::after { content:""; position:absolute; right:-28px; bottom:-48px; width:115px; height:115px; border-radius:50%; background:rgba(59,130,246,.06); }
.metric-icon { width:50px; height:50px; flex:0 0 auto; display:grid; place-items:center; border-radius:15px; }
.metric-icon svg { width:24px; height:24px; }
.metric-icon.neutral { background:rgba(148,163,184,.12); color:#cbd5e1; }
.metric-icon.success { background:rgba(16,185,129,.12); color:#34d399; }
.metric-icon.primary { background:rgba(59,130,246,.14); color:#60a5fa; }
.metric-icon.danger { background:rgba(239,68,68,.12); color:#f87171; }
.metric-card span, .summary-label { color:var(--muted); font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; }
.metric-card strong, .summary-value { display:block; margin:5px 0 2px; font-size:34px; line-height:1; letter-spacing:-.045em; }
.metric-card small { color:var(--muted-2); font-size:11px; }
.online-text { color:#34d399; }
.blocked-text { color:#f87171; }

.dashboard-grid { display:grid; grid-template-columns:minmax(0,1.55fr) minmax(320px,.75fr); gap:18px; }
.panel, .release-card {
    border:1px solid var(--border); border-radius:var(--radius); background:linear-gradient(160deg,rgba(17,28,50,.97),rgba(10,16,32,.98));
    box-shadow:var(--shadow); overflow:hidden;
}
.panel { padding:22px; margin-bottom:20px; }
.panel-header { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; margin-bottom:20px; }
.panel-header h2 { margin:0 0 5px; font-size:18px; letter-spacing:-.02em; }
.panel-header p { margin:0; color:var(--muted); font-size:12px; }
.live-pill { display:inline-flex; align-items:center; gap:8px; padding:7px 10px; border-radius:999px; color:#6ee7b7; background:rgba(16,185,129,.09); border:1px solid rgba(16,185,129,.18); font-size:10px; font-weight:800; letter-spacing:.1em; }
.health-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.health-item { padding:18px; min-height:112px; border-radius:14px; background:rgba(7,11,20,.47); border:1px solid var(--border); }
.health-item span { color:var(--muted); font-size:11px; }
.health-item strong { display:block; margin:13px 0 5px; font-size:25px; }
.health-item small { color:var(--muted-2); font-size:10px; }
.version-value { color:#93c5fd; }
.online-value { color:#34d399; font-size:18px!important; }
.quick-links { display:grid; gap:10px; }
.quick-links a { display:grid; grid-template-columns:42px 1fr auto; align-items:center; gap:12px; padding:14px; border:1px solid var(--border); border-radius:14px; background:rgba(7,11,20,.40); transition:.18s ease; }
.quick-links a:hover { border-color:rgba(96,165,250,.35); background:rgba(37,99,235,.08); transform:translateX(3px); }
.quick-icon { width:42px; height:42px; display:grid; place-items:center; border-radius:12px; color:#60a5fa; background:rgba(59,130,246,.12); }
.quick-links strong, .quick-links small { display:block; }
.quick-links strong { font-size:12px; }
.quick-links small { margin-top:4px; color:var(--muted); font-size:10px; }
.quick-links b { color:#64748b; font-size:22px; }

.notification { margin:0 0 16px; padding:12px 14px; border-radius:11px; border:1px solid rgba(16,185,129,.25); background:rgba(16,185,129,.09); color:#a7f3d0; font-size:12px; }
.notification.error { border-color:rgba(239,68,68,.25); background:rgba(239,68,68,.09); color:#fecaca; }
.notification.hidden { display:none; }

.table-wrapper { overflow:auto; border:1px solid var(--border); border-radius:14px; background:rgba(7,11,20,.36); }
table { width:100%; border-collapse:separate; border-spacing:0; min-width:1250px; }
th { position:sticky; top:0; z-index:3; padding:13px 12px; color:#7f91ad; background:#0d1628; border-bottom:1px solid var(--border); font-size:10px; font-weight:800; text-align:left; letter-spacing:.08em; text-transform:uppercase; }
td { padding:13px 12px; border-bottom:1px solid rgba(148,163,184,.10); color:#cbd5e1; font-size:12px; vertical-align:middle; }
tbody tr { transition:.15s ease; }
tbody tr:hover { background:rgba(59,130,246,.055); }
tbody tr:last-child td { border-bottom:0; }
.device-code, .computer-name { color:white; font-weight:750; }
.small-text { margin-top:4px; color:var(--muted-2); font-size:10px; }
.empty-state, .update-empty { padding:45px!important; text-align:center; color:var(--muted); }
.form-control, input, select, textarea {
    min-height:37px; width:100%; padding:8px 10px; border-radius:9px; color:#e2e8f0;
    background:#0b1220; border:1px solid #26344c; outline:none; transition:.16s ease;
}
.form-control:focus, input:focus, select:focus, textarea:focus { border-color:#3b82f6; box-shadow:0 0 0 3px rgba(59,130,246,.13); }
.form-control.compact { min-width:112px; }
textarea { min-height:110px; resize:vertical; }
label { display:block; margin-bottom:7px; color:#aebbd0; font-size:11px; font-weight:700; }
.checkbox-row { display:flex; flex-wrap:wrap; gap:10px; }
.checkbox-label { display:inline-flex; align-items:center; gap:7px; color:#cbd5e1; font-size:11px; }
.checkbox-label input { width:15px; min-height:auto; accent-color:#2563eb; }
.badge, .release-badge { display:inline-flex; align-items:center; gap:7px; padding:6px 9px; border-radius:999px; font-size:9px; font-weight:850; letter-spacing:.07em; }
.badge-online, .badge-active, .status-published { color:#6ee7b7; background:rgba(16,185,129,.10); border:1px solid rgba(16,185,129,.22); }
.badge-offline { color:#94a3b8; background:rgba(148,163,184,.09); border:1px solid rgba(148,163,184,.18); }
.badge-pending, .status-draft { color:#fcd34d; background:rgba(245,158,11,.10); border:1px solid rgba(245,158,11,.22); }
.badge-blocked, .status-force { color:#fca5a5; background:rgba(239,68,68,.10); border:1px solid rgba(239,68,68,.22); }

.update-toolbar { display:flex; justify-content:space-between; align-items:center; gap:18px; margin-bottom:18px; padding:20px 22px; border-radius:18px; background:linear-gradient(110deg,rgba(30,64,175,.35),rgba(8,145,178,.15)); border:1px solid rgba(96,165,250,.20); }
.update-toolbar h2 { margin:0 0 5px; }
.update-toolbar p { margin:0; color:var(--muted); font-size:12px; }
.release-list { display:grid; gap:20px; }
.release-card { overflow:hidden; }
.release-header { display:flex; justify-content:space-between; align-items:center; gap:20px; padding:20px 22px; border-bottom:1px solid var(--border); background:rgba(255,255,255,.018); }
.release-identity { display:flex; align-items:center; gap:14px; }
.release-logo { width:48px; height:48px; display:grid; place-items:center; border-radius:14px; font-weight:900; letter-spacing:.05em; background:linear-gradient(145deg,#1d4ed8,#0891b2); box-shadow:0 10px 24px rgba(37,99,235,.25); }
.release-title-row { display:flex; flex-wrap:wrap; align-items:center; gap:9px; }
.release-title-row h3 { margin:0; font-size:18px; }
.release-meta { margin-top:6px; color:var(--muted); font-size:10px; }
.release-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:7px; }
.release-body { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(260px,.55fr); gap:18px; padding:22px; }
.release-notes, .release-info { padding:17px; border:1px solid var(--border); border-radius:14px; background:rgba(7,11,20,.36); }
.section-label { margin-bottom:12px; color:#60a5fa; font-size:9px; font-weight:850; letter-spacing:.14em; text-transform:uppercase; }
.release-notes pre { margin:0; color:#cbd5e1; font:12px/1.7 Inter,sans-serif; white-space:pre-wrap; }
.release-info { display:grid; gap:10px; }
.release-info > div:not(.section-label) { display:flex; justify-content:space-between; gap:12px; color:var(--muted); font-size:11px; }
.release-info strong { color:white; }
.release-files { padding:0 22px 22px; }
.section-heading { margin-bottom:12px; }
.section-heading h4 { margin:0 0 4px; }
.section-heading p { margin:0; color:var(--muted); font-size:11px; }
.file-list { border:1px solid var(--border); border-radius:13px; overflow:hidden; }
.file-row { display:grid; grid-template-columns:minmax(280px,1.4fr) .45fr .4fr .5fr auto; align-items:center; gap:12px; padding:12px 14px; border-bottom:1px solid var(--border); color:#cbd5e1; font-size:11px; }
.file-row:last-child { border-bottom:0; }
.file-main { display:flex; align-items:center; gap:10px; min-width:0; }
.file-icon, .upload-icon { width:36px; height:36px; display:grid; place-items:center; flex:0 0 auto; border-radius:10px; color:#60a5fa; background:rgba(59,130,246,.11); }
.file-name { color:white; font-weight:750; }
.file-sha { max-width:430px; margin-top:3px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted-2); font-size:9px; }
.no-file { padding:25px; text-align:center; color:var(--muted); }
.upload-zone { display:grid; grid-template-columns:42px minmax(160px,.45fr) minmax(220px,1fr) auto; align-items:end; gap:12px; margin-top:13px; padding:15px; border:1px dashed rgba(96,165,250,.30); border-radius:13px; background:rgba(37,99,235,.04); }
.field { min-width:0; }
.update-empty { border:1px dashed var(--border-strong); border-radius:18px; background:rgba(15,23,42,.55); }
.update-empty strong, .update-empty span { display:block; }
.update-empty strong { margin:10px 0 5px; color:white; }
.empty-cloud { font-size:34px; }

.modal { position:fixed; inset:0; z-index:70; display:none; place-items:center; padding:20px; background:rgba(2,6,23,.78); backdrop-filter:blur(10px); }
.modal.show { display:grid; }
.modal-dialog { width:min(620px,100%); max-height:90vh; overflow:auto; border:1px solid var(--border-strong); border-radius:20px; background:#0f172a; box-shadow:0 30px 100px rgba(0,0,0,.55); }
.modal-header, .modal-footer { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:18px 20px; border-bottom:1px solid var(--border); }
.modal-footer { border-top:1px solid var(--border); border-bottom:0; justify-content:flex-end; }
.modal-header h3 { margin:0; }
.modal-body { display:grid; gap:15px; padding:20px; }
.modal-close { border:0; color:var(--muted); background:transparent; font-size:25px; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }

.mobile-overlay { display:none; }
@media (max-width: 1180px) {
    .metric-grid, .summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .dashboard-grid { grid-template-columns:1fr; }
    .health-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .release-body { grid-template-columns:1fr; }
}
@media (max-width: 900px) {
    .app-shell { grid-template-columns:1fr; }
    .sidebar { transform:translateX(-102%); transition:.24s ease; }
    body.sidebar-open .sidebar { transform:translateX(0); }
    .main-content { grid-column:1; }
    .mobile-menu { display:grid; place-items:center; width:40px; height:40px; flex:0 0 auto; border-radius:10px; background:#111c32; }
    .mobile-overlay { position:fixed; inset:0; z-index:25; background:rgba(2,6,23,.72); }
    body.sidebar-open .mobile-overlay { display:block; }
    .topbar { padding:18px 20px; }
    .content-wrap { padding:20px; }
    .server-indicator { display:none; }
    .file-row { grid-template-columns:1fr; }
    .upload-zone { grid-template-columns:1fr; align-items:stretch; }
}
@media (max-width: 640px) {
    .metric-grid, .summary-grid, .health-grid { grid-template-columns:1fr; }
    .topbar { align-items:flex-start; }
    .page-heading p { display:none; }
    .admin-avatar { display:none; }
    .hero-strip, .update-toolbar, .release-header { align-items:flex-start; flex-direction:column; }
    .content-wrap { padding:15px; }
    .panel { padding:16px; }
    .form-grid { grid-template-columns:1fr; }
}
