:root {
  --bg: #10110f;
  --panel: #1a1c18;
  --panel-2: #22241f;
  --line: #34372e;
  --text: #f1f0e9;
  --muted: #9ea092;
  --orange: #e8892c;
  --orange-2: #ffad54;
  --green: #62c979;
  --red: #e45c52;
  --yellow: #e1b64b;
  --shadow: 0 18px 60px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 80% 0%, rgba(232,137,44,.09), transparent 35%),
    linear-gradient(135deg, #11120f 0%, #0d0e0c 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.noise {
  position: fixed; inset: 0; pointer-events: none; opacity: .16;
  background-image: linear-gradient(rgba(255,255,255,.015) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.015) 1px, transparent 1px);
  background-size: 32px 32px;
}
.panel { background: linear-gradient(145deg, rgba(31,33,28,.98), rgba(24,26,22,.98)); border: 1px solid var(--line); box-shadow: var(--shadow); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(430px, 100%); padding: 42px; border-radius: 6px; }
.brand-mark { width: 58px; height: 58px; display: grid; place-items: center; background: var(--orange); color: #17130d; font-weight: 950; font-size: 32px; border-radius: 4px; box-shadow: 7px 7px 0 #553316; }
.brand-mark.small { width: 38px; height: 38px; font-size: 21px; box-shadow: 4px 4px 0 #553316; }
.eyebrow { margin: 24px 0 7px; color: var(--orange-2); font-size: 11px; letter-spacing: .2em; font-weight: 800; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(30px, 6vw, 44px); letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-size: 28px; }
h3 { margin-bottom: 0; font-size: 19px; }
.muted, .hint { color: var(--muted); }
label { display: grid; gap: 9px; color: #c8c9bf; font-size: 13px; font-weight: 700; }
input { width: 100%; padding: 13px 14px; color: var(--text); background: #11130f; border: 1px solid #3b3f34; border-radius: 3px; outline: none; }
input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232,137,44,.12); }
#login-form { margin-top: 28px; display: grid; gap: 17px; }
.button { padding: 10px 15px; border: 1px solid #4a4e40; border-radius: 3px; color: var(--text); background: #2a2d26; font-weight: 760; transition: .16s ease; }
.button:hover { transform: translateY(-1px); border-color: #696e5c; }
.button:disabled { opacity: .45; cursor: wait; transform: none; }
.button.primary { color: #1d1409; background: var(--orange); border-color: var(--orange); }
.button.danger { background: #3a211e; border-color: #74372f; color: #ffaaa2; }
.button.warning { background: #382f1d; border-color: #6c5727; color: #f6d77e; }
.button.ghost { background: transparent; }
.button.wide { width: 100%; padding: 13px; }
.error { min-height: 18px; margin: 0; color: #ff8176; font-size: 13px; }
.app { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 18px; background: #151713; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.brand { display: flex; gap: 14px; align-items: center; padding: 0 9px 30px; }
.brand strong, .brand span { display: block; }
.brand strong { letter-spacing: .07em; }
.brand span { margin-top: 3px; color: var(--muted); font-size: 11px; }
nav { display: grid; gap: 5px; }
.nav-item { padding: 12px 14px; text-align: left; color: #b8baaf; background: transparent; border: 1px solid transparent; border-radius: 3px; font-weight: 700; }
.nav-item:hover { background: #1d201a; color: white; }
.nav-item.active { color: #1d1409; background: var(--orange); }
.sidebar-footer { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.indicator { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); }
.indicator.ok { background: var(--green); box-shadow: 0 0 12px rgba(98,201,121,.5); }
.link-button { margin-left: auto; color: var(--muted); background: none; border: 0; }
main { padding: 34px clamp(22px, 4vw, 58px) 60px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 34px; }
.topbar .eyebrow { margin: 0 0 6px; }
.server-pill { display: flex; align-items: center; gap: 9px; padding: 9px 13px; border: 1px solid var(--line); background: #171914; border-radius: 20px; color: var(--muted); font-size: 12px; font-weight: 750; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--yellow); }
.status-dot.online { background: var(--green); box-shadow: 0 0 12px rgba(98,201,121,.6); }
.status-dot.offline { background: var(--red); }
.view { display: none; }
.view.active { display: block; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.metric { min-height: 150px; padding: 22px; border-radius: 4px; display: flex; flex-direction: column; }
.metric span, .metric small { color: var(--muted); }
.metric span { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.metric strong { margin: auto 0 2px; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.05em; }
.metric small { font-size: 11px; }
.grid.two { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; }
.section-card { padding: 24px; border-radius: 4px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.section-heading .eyebrow { margin: 0 0 5px; }
.details { margin: 0; display: grid; }
.details div { padding: 13px 0; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }
.details div:last-child { border-bottom: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; font-weight: 750; }
.empty { min-height: 190px; display: grid; place-items: center; color: var(--muted); border: 1px dashed #3b3e34; }
.player-chip { padding: 11px 13px; margin-bottom: 8px; background: var(--panel-2); border-left: 3px solid var(--green); }
.form-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: 16px; margin-bottom: 22px; }
.actions { display: flex; gap: 10px; }
.actions.wrap { flex-wrap: wrap; }
.hint { margin: 18px 0 0; font-size: 12px; }
.table-wrap table { width: 100%; border-collapse: collapse; }
.table-wrap th, .table-wrap td { padding: 13px 11px; text-align: left; border-bottom: 1px solid var(--line); }
.table-wrap th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.tag { display: inline-block; padding: 4px 8px; border-radius: 12px; color: #a9e9b7; background: #1c3723; font-size: 11px; }
.notice { padding: 16px; border: 1px solid; border-radius: 3px; }
.warning-notice { color: #f3d27b; border-color: #5f4c25; background: #2b2619; }
.log-card pre { max-height: 60vh; overflow: auto; margin: 0; padding: 18px; color: #c9d2bd; background: #0c0e0b; border: 1px solid #303329; font: 12px/1.65 "SFMono-Regular", Consolas, monospace; white-space: pre-wrap; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: 380px; padding: 13px 17px; color: #17130d; background: var(--green); border-radius: 3px; box-shadow: var(--shadow); font-weight: 750; transform: translateY(140%); transition: .2s ease; z-index: 10; }
.toast.show { transform: translateY(0); }
.toast.bad { color: white; background: var(--red); }

@media (max-width: 950px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .grid.two { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 18px; }
  .brand { padding-bottom: 16px; }
  nav { grid-template-columns: repeat(3, 1fr); }
  .nav-item { padding: 9px; text-align: center; font-size: 12px; }
  .sidebar-footer { margin-top: 16px; }
  main { padding: 25px 16px 50px; }
  .topbar { align-items: flex-end; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 125px; }
  .form-grid { grid-template-columns: 1fr; }
}
