:root {
  --bg: #0b0f14;
  --bg-2: #10151d;
  --panel: #121923;
  --panel-2: #161f2b;
  --line: #253041;
  --line-soft: #1b2532;
  --text: #f0f4f8;
  --muted: #8b98a9;
  --accent: #d93c3c;
  --accent-hover: #ef4d4d;
  --green: #42c98a;
  --amber: #eab85f;
  --red: #f15f64;
  --shadow: 0 24px 70px rgba(0,0,0,.35);
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: radial-gradient(circle at 70% -10%, rgba(217,60,60,.08), transparent 28%), var(--bg); color: var(--text); font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 245px 1fr; }
.sidebar { min-height: 100vh; position: sticky; top: 0; height: 100vh; padding: 24px 16px; border-right: 1px solid var(--line-soft); background: linear-gradient(180deg, rgba(18,25,35,.97), rgba(9,13,18,.98)); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 24px; }
.brand strong { display: block; letter-spacing: .02em; }
.brand span, .user-card span { display: block; color: var(--muted); font-size: 10px; letter-spacing: .16em; margin-top: 2px; }
.logo-mark { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 12px; font-weight: 900; font-size: 26px; color: #fff; background: linear-gradient(145deg, #f15151, #8c1717); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), 0 12px 30px rgba(217,60,60,.22); }
.logo-mark.small { width: 38px; height: 38px; border-radius: 9px; font-size: 20px; }
nav { display: grid; gap: 6px; }
.nav-item { border: 0; color: #aab5c4; background: transparent; text-align: left; padding: 11px 12px; border-radius: 8px; transition: .15s ease; font-weight: 650; }
.nav-item:hover { background: #17202b; color: #fff; }
.nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(217,60,60,.22), rgba(217,60,60,.04)); box-shadow: inset 3px 0 var(--accent); }
.sidebar-bottom { margin-top: auto; display: grid; gap: 12px; }
.user-card { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line-soft); background: rgba(255,255,255,.02); border-radius: 10px; overflow: hidden; }
.avatar { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 50%; background: #273347; overflow: hidden; font-weight: 800; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.main { min-width: 0; padding: 0 32px 40px; }
.topbar { height: 104px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line-soft); margin-bottom: 24px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 26px; margin-bottom: 0; }
h2 { font-size: 18px; margin-bottom: 0; }
h3 { font-size: 15px; }
.eyebrow { margin-bottom: 4px; color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .18em; }
.server-pill { display: inline-flex; align-items: center; gap: 8px; color: #c5d0dd; border: 1px solid var(--line); background: var(--panel); padding: 8px 12px; border-radius: 999px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(66,201,138,.12); }
.dot.offline { background: var(--red); box-shadow: 0 0 0 4px rgba(241,95,100,.12); }
.view { display: none; }
.view.active { display: block; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 14px; }
.stat-card, .panel { border: 1px solid var(--line-soft); background: linear-gradient(180deg, rgba(20,28,39,.96), rgba(15,21,29,.96)); border-radius: var(--radius); box-shadow: 0 12px 30px rgba(0,0,0,.08); }
.stat-card { padding: 19px; }
.stat-card span, .kv-grid span { color: var(--muted); display: block; font-size: 12px; }
.stat-card strong { display: block; font-size: 26px; line-height: 1.1; margin: 8px 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-card small { color: #6f7d90; }
.grid-2 { display: grid; grid-template-columns: 1.1fr .9fr; gap: 14px; }
.panel { padding: 18px; overflow: hidden; }
.panel-head { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.head-actions { display: flex; gap: 8px; align-items: center; }
.players-head .input { min-width: 360px; }
.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.kv-grid > div { padding: 14px; border-radius: 10px; background: #0e141c; border: 1px solid var(--line-soft); }
.kv-grid strong { display: block; margin-top: 6px; }
.activity-list { display: grid; gap: 9px; }
.activity-item { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.activity-item:last-child { border-bottom: 0; }
.activity-item .activity-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.activity-item span { color: var(--muted); font-size: 12px; }
.btn { border: 1px solid transparent; border-radius: 8px; padding: 9px 12px; color: #fff; font-weight: 700; background: #222d3b; transition: .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { background: #8d252c; border-color: #a93239; }
.btn.ghost { background: #141c27; border-color: var(--line); color: #c0c9d4; }
.btn.tiny { padding: 6px 9px; font-size: 12px; }
.btn.wide { width: 100%; text-align: center; display: inline-block; text-decoration: none; }
.input { min-height: 38px; border-radius: 8px; border: 1px solid #2b3748; background: #0b1119; color: var(--text); padding: 8px 10px; outline: none; }
.input:focus { border-color: #7e3138; box-shadow: 0 0 0 3px rgba(217,60,60,.10); }
.textarea { min-height: 88px; resize: vertical; }
.file { padding: 7px; }
.table-wrap { overflow: auto; margin: 0 -18px -18px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 12px 18px; text-align: left; border-top: 1px solid var(--line-soft); vertical-align: middle; }
th { color: #77869a; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; background: rgba(6,10,15,.35); }
td { color: #c9d3df; }
.player-cell strong { display: block; color: #fff; }
.player-cell span { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 750; border: 1px solid; }
.badge.green { color: #8ee2ba; border-color: rgba(66,201,138,.3); background: rgba(66,201,138,.08); }
.badge.red { color: #ff9fa3; border-color: rgba(241,95,100,.3); background: rgba(241,95,100,.08); }
.badge.amber { color: #f4d18f; border-color: rgba(234,184,95,.3); background: rgba(234,184,95,.08); }
.badge.gray { color: #aeb9c6; border-color: #344153; background: rgba(255,255,255,.03); }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.notice { margin: 10px 0 16px; border: 1px solid #634047; background: #26171b; color: #ffb0b4; border-radius: 8px; padding: 10px 12px; }
.notice.ok { border-color: #315a46; background: #10251b; color: #91dfb8; }
.raw-output { max-height: 280px; overflow: auto; margin-top: 14px; padding: 14px; border: 1px solid var(--line-soft); border-radius: 8px; background: #070b10; color: #8fa2b8; white-space: pre-wrap; font-size: 12px; }
.empty-state { color: var(--muted); padding: 14px 0; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 30px; background: radial-gradient(circle at 50% 20%, rgba(217,60,60,.12), transparent 30%); }
.login-card { width: min(430px, 100%); padding: 34px; text-align: center; border: 1px solid var(--line); border-radius: 18px; background: rgba(16,22,30,.97); box-shadow: var(--shadow); }
.login-card .logo-mark { margin: 0 auto 22px; }
.login-card h1 { font-size: 30px; margin-bottom: 10px; }
.login-card > p:not(.eyebrow) { color: var(--muted); margin-bottom: 22px; }
.login-note { margin-top: 16px; font-size: 11px; color: #647286; }
.modal { width: min(520px, calc(100vw - 30px)); color: var(--text); background: #111923; border: 1px solid #2c3949; border-radius: 14px; padding: 0; box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(0,0,0,.70); backdrop-filter: blur(3px); }
.modal > form, .modal > div { padding: 22px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.icon-btn { border: 0; background: #202b39; color: #cdd6df; width: 32px; height: 32px; border-radius: 8px; font-size: 20px; line-height: 1; }
.modal label { display: grid; gap: 6px; margin: 12px 0; color: #c6d0dc; font-size: 12px; font-weight: 700; }
.modal .input { width: 100%; }
.hint { color: #718096; font-weight: 500; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.wide-modal { width: min(820px, calc(100vw - 30px)); }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.profile-box { border: 1px solid var(--line-soft); background: #0c1219; border-radius: 9px; padding: 12px; }
.profile-box span { display: block; color: var(--muted); font-size: 11px; }
.profile-box strong { display: block; margin-top: 5px; overflow-wrap: anywhere; }
.profile-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.alt-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.alt-row:last-child { border-bottom: 0; }
.inline-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-top: 10px; }
@media (max-width: 1050px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; min-height: 0; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .sidebar nav { grid-template-columns: repeat(5, minmax(0,1fr)); overflow-x: auto; }
  .nav-item { white-space: nowrap; text-align: center; }
  .sidebar-bottom { display: none; }
  .main { padding: 0 14px 30px; }
  .topbar { height: 90px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .players-head { align-items: flex-start; flex-direction: column; }
  .head-actions { width: 100%; }
  .players-head .input { min-width: 0; width: 100%; }
  .profile-grid { grid-template-columns: 1fr; }
  .inline-form { grid-template-columns: 1fr; }
}
@media (max-width: 480px) { .stat-grid { grid-template-columns: 1fr; } .server-pill { display: none; } }
