
:root {
  --bg: #0c0f12;
  --panel: #14191e;
  --panel-2: #1a2026;
  --border: rgba(255,255,255,.08);
  --text: #f4f6f8;
  --muted: #98a2ad;
  --accent: #d7ff3f;
  --accent-ink: #11150b;
  --danger: #ff5c67;
  --warning: #ffbf4a;
  --success: #56d58d;
  --radius: 16px;
  --shadow: 0 14px 40px rgba(0,0,0,.22);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin:0; min-height:100%; background:var(--bg); color:var(--text); }
body { min-height:100vh; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
.hidden { display:none !important; }
.muted { color:var(--muted); }

.app { min-height:100vh; display:grid; grid-template-columns:250px 1fr; }
.sidebar {
  position:sticky; top:0; height:100vh; border-right:1px solid var(--border);
  background:linear-gradient(180deg,#11161a 0%,#0e1215 100%);
  padding:22px 16px; display:flex; flex-direction:column;
}
.brand { display:flex; align-items:center; gap:12px; padding:0 8px 22px; }
.brand strong { display:block; letter-spacing:.08em; font-size:15px; }
.brand span { display:block; color:var(--accent); font-size:11px; letter-spacing:.2em; margin-top:2px; }
.brand-mark {
  width:54px; height:54px; border-radius:15px; display:grid; place-items:center;
  background:var(--accent); color:var(--accent-ink); font-weight:900; letter-spacing:-.04em;
  box-shadow:0 10px 30px rgba(215,255,63,.12);
}
.brand-mark.small { width:42px; height:42px; border-radius:12px; font-size:14px; }
.nav { display:flex; flex-direction:column; gap:6px; }
.nav-item {
  border:0; background:transparent; color:var(--muted); text-align:left;
  padding:12px 14px; border-radius:11px; cursor:pointer;
}
.nav-item:hover { background:rgba(255,255,255,.04); color:var(--text); }
.nav-item.active { background:rgba(215,255,63,.09); color:var(--accent); }
.sidebar-bottom { margin-top:auto; padding:16px 8px 4px; border-top:1px solid var(--border); }
.admin-identity span { display:block; font-weight:700; }
.admin-identity small { display:block; color:var(--muted); margin-top:4px; }
.side-link { display:block; margin-top:14px; color:var(--muted); text-decoration:none; font-size:13px; }

.main { min-width:0; padding:26px 30px 50px; }
.topbar { display:flex; justify-content:space-between; gap:20px; align-items:center; margin-bottom:26px; }
.topbar h1 { margin:0; font-size:28px; }
.topbar p { margin:6px 0 0; color:var(--muted); }
.topbar-actions { display:flex; align-items:center; gap:10px; }

.view { display:none; }
.view.active { display:block; }

.hero-grid { display:grid; grid-template-columns:minmax(0,1.55fr) minmax(280px,.8fr); gap:18px; }
.section-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; margin-top:18px; }
.card {
  background:linear-gradient(180deg,rgba(255,255,255,.025),rgba(255,255,255,.012)), var(--panel);
  border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow);
  padding:20px;
}
.server-card { min-height:280px; }
.card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.card-head h2, .card-head h3 { margin:0; }
.eyebrow { display:block; color:var(--muted); font-size:10px; font-weight:800; letter-spacing:.18em; margin-bottom:7px; }

.status-pill {
  display:inline-flex; align-items:center; min-height:30px; padding:0 10px; border-radius:999px;
  font-size:12px; font-weight:800; border:1px solid var(--border);
}
.status-pill.ok { color:var(--success); background:rgba(86,213,141,.08); }
.status-pill.bad { color:var(--danger); background:rgba(255,92,103,.08); }
.status-pill.warn { color:var(--warning); background:rgba(255,191,74,.08); }
.status-pill.neutral { color:var(--muted); background:rgba(255,255,255,.03); }

.metric-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin:28px 0 22px; }
.metric { padding:14px; border-radius:13px; background:var(--panel-2); border:1px solid var(--border); }
.metric span { display:block; color:var(--muted); font-size:12px; margin-bottom:6px; }
.metric strong { font-size:18px; }

.quick-actions, .dialog-actions { display:flex; gap:10px; flex-wrap:wrap; }
.btn {
  border:1px solid transparent; border-radius:11px; min-height:40px; padding:0 14px;
  cursor:pointer; font-weight:750;
}
.btn-primary { background:var(--accent); color:var(--accent-ink); }
.btn-secondary { background:var(--panel-2); border-color:var(--border); }
.btn-danger { background:rgba(255,92,103,.12); color:#ff9da4; border-color:rgba(255,92,103,.22); }
.btn-ghost { background:transparent; border-color:var(--border); color:var(--muted); }
.btn-large { min-height:48px; display:inline-flex; align-items:center; justify-content:center; text-decoration:none; }
.link-btn { background:none; border:0; color:var(--accent); cursor:pointer; padding:0; }

.stat-list { margin-top:14px; display:grid; gap:2px; }
.stat-list > div { display:flex; justify-content:space-between; gap:20px; padding:13px 0; border-bottom:1px solid var(--border); }
.stat-list > div:last-child { border-bottom:0; }
.stat-list span { color:var(--muted); }

.list { margin-top:12px; }
.list-row { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:12px 0; border-bottom:1px solid var(--border); }
.list-row:last-child { border-bottom:0; }
.list-main strong { display:block; }
.list-main small { display:block; color:var(--muted); margin-top:3px; }
.empty-state { color:var(--muted); min-height:76px; display:flex; align-items:center; }

.toolbar { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:14px; }
.input {
  min-height:42px; border-radius:11px; border:1px solid var(--border); background:var(--panel);
  color:var(--text); padding:0 13px; outline:none; width:min(420px,100%);
}
textarea.input { padding:12px 13px; min-height:110px; resize:vertical; }
.select { width:auto; min-width:180px; }

.cards-list { display:grid; gap:12px; }
.player-card, .ticket-card {
  display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 18px;
  border:1px solid var(--border); border-radius:14px; background:var(--panel);
}
.player-card h3, .ticket-card h3 { margin:0; font-size:16px; }
.player-card p, .ticket-card p { margin:5px 0 0; color:var(--muted); font-size:13px; }

.feed { padding:0 18px; }
.feed-row { display:grid; grid-template-columns:86px 1fr; gap:12px; padding:14px 0; border-bottom:1px solid var(--border); }
.feed-row:last-child { border-bottom:0; }
.feed-time { color:var(--muted); font-variant-numeric:tabular-nums; font-size:12px; }

.table-wrap { overflow:auto; padding:0; }
table { width:100%; border-collapse:collapse; min-width:780px; }
th, td { padding:13px 15px; text-align:left; border-bottom:1px solid var(--border); font-size:13px; }
th { color:var(--muted); font-size:11px; letter-spacing:.08em; text-transform:uppercase; }
td code { color:#dfe8a7; }

.dialog {
  width:min(820px,calc(100% - 24px)); max-height:90vh; padding:0; color:var(--text);
  border:1px solid var(--border); border-radius:18px; background:var(--panel); box-shadow:0 30px 100px rgba(0,0,0,.55);
}
.dialog::backdrop { background:rgba(0,0,0,.65); backdrop-filter:blur(5px); }
.small-dialog { width:min(600px,calc(100% - 24px)); }
.dialog-shell { padding:22px; }
.dialog-head { display:flex; justify-content:space-between; gap:18px; align-items:flex-start; }
.dialog-head h2 { margin:0; }
.dialog-head p { margin:5px 0 0; }
.icon-btn { width:36px; height:36px; border-radius:10px; border:1px solid var(--border); background:transparent; cursor:pointer; font-size:22px; }
.player-detail-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin:22px 0; }
.detail-stat { background:var(--panel-2); border:1px solid var(--border); border-radius:12px; padding:13px; }
.detail-stat span { color:var(--muted); display:block; font-size:11px; margin-bottom:6px; }
.action-panel { border-top:1px solid var(--border); padding-top:18px; }
.action-panel h3 { margin:0 0 12px; }
.action-grid { display:flex; gap:8px; flex-wrap:wrap; }
.form-stack { display:grid; gap:13px; margin:20px 0; }
.form-row { display:grid; gap:7px; }
.form-row label { color:var(--muted); font-size:12px; }
.dialog-actions { justify-content:flex-end; }
.mini-history { margin-top:20px; border-top:1px solid var(--border); padding-top:16px; }

.login-gate { min-height:100vh; display:grid; place-items:center; padding:20px; }
.login-card { width:min(420px,100%); text-align:center; border:1px solid var(--border); border-radius:20px; background:var(--panel); padding:32px; box-shadow:var(--shadow); }
.login-card .brand-mark { margin:0 auto 18px; }
.login-card h1 { margin:0; }
.login-card p { color:var(--muted); margin:10px 0 22px; }

.toast-host { position:fixed; z-index:9999; right:18px; top:18px; display:grid; gap:9px; pointer-events:none; }
.toast { background:#1c242a; border:1px solid var(--border); border-radius:12px; padding:12px 14px; box-shadow:var(--shadow); min-width:260px; }
.toast.error { border-color:rgba(255,92,103,.3); }
.toast.success { border-color:rgba(86,213,141,.3); }

.toggle { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:13px; }
.mobile-nav { display:none; }

@media (max-width:1050px) {
  .metric-grid { grid-template-columns:repeat(2,1fr); }
  .hero-grid { grid-template-columns:1fr; }
}
@media (max-width:820px) {
  .app { display:block; }
  .sidebar { display:none; }
  .main { padding:18px 14px 88px; }
  .topbar { align-items:flex-start; }
  .topbar h1 { font-size:24px; }
  .topbar p { display:none; }
  .section-grid { grid-template-columns:1fr; }
  .mobile-nav {
    position:fixed; z-index:30; display:grid; grid-template-columns:repeat(5,1fr);
    left:10px; right:10px; bottom:10px; background:rgba(20,25,30,.94); backdrop-filter:blur(14px);
    border:1px solid var(--border); border-radius:16px; padding:7px; box-shadow:var(--shadow);
  }
  .mobile-nav button { border:0; background:transparent; color:var(--muted); min-height:45px; font-size:11px; border-radius:10px; }
  .mobile-nav button.active { background:rgba(215,255,63,.1); color:var(--accent); }
  .player-detail-grid { grid-template-columns:repeat(2,1fr); }
}
@media (max-width:560px) {
  .metric-grid { grid-template-columns:1fr 1fr; }
  .toolbar { align-items:stretch; flex-direction:column; }
  .input { width:100%; }
  .player-card, .ticket-card { align-items:flex-start; flex-direction:column; }
  .player-card .btn, .ticket-card .btn { width:100%; }
}
