:root {
  --bg: #070a09;
  --surface: #0e1210;
  --surface-2: #151b17;
  --line: #5c4e2e;
  --gold: #bca05f;
  --text: #f4f0e8;
  --muted: #a9ada8;
  --danger: #a80f12;
  --warn: #c49b25;
  --ok: #2f8f54;
  --blue: #52a7ff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(circle at top left, rgba(188,160,95,.12), transparent 34rem), var(--bg);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

button, input, textarea, select {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  min-height: 38px;
  padding: 0 16px;
  cursor: pointer;
}

button:hover { border-color: var(--gold); }

button.primary {
  background: linear-gradient(180deg, #22291f, #121712);
  color: #fff7df;
}

input, textarea, select {
  width: 100%;
  border: 1px solid #3e4942;
  background: #08100d;
  color: var(--text);
  padding: 10px 12px;
}

textarea { min-height: 96px; resize: vertical; }

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

.sidebar {
  border-right: 1px solid rgba(188,160,95,.28);
  background: rgba(5,8,7,.94);
  padding: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
}

.brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.brand strong {
  display: block;
  font-size: 20px;
}

.brand span, .muted { color: var(--muted); }

.nav {
  display: grid;
  gap: 10px;
}

.nav button {
  width: 100%;
  text-align: left;
}

.nav button.active {
  border-color: var(--gold);
  color: #fff0c7;
}

.main {
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
}

.topbar h1 {
  margin: 0;
  font-size: 32px;
}

.panel {
  border: 1px solid rgba(188,160,95,.36);
  background: rgba(14,18,16,.86);
  padding: 18px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.metric {
  min-height: 116px;
}

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

.metric .value {
  font-size: 36px;
  font-weight: 700;
  margin-top: 8px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid currentColor;
  color: var(--ok);
}

.status.red { color: #ff6b6b; }
.status.yellow { color: #ffd166; }

.list {
  display: grid;
  gap: 10px;
}

.row {
  border: 1px solid rgba(255,255,255,.11);
  background: rgba(255,255,255,.025);
  padding: 12px;
}

.row header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid .wide { grid-column: 1 / -1; }

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

.login-card {
  width: min(440px, 100%);
}

.chat {
  height: 420px;
  overflow: auto;
}

.chat-message {
  border-left: 3px solid var(--gold);
  padding: 10px 12px;
  background: rgba(255,255,255,.025);
  margin-bottom: 10px;
}

.timer {
  color: var(--blue);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid rgba(188,160,95,.28); }
  .grid.cols-2, .grid.cols-3, .grid.cols-4, .form-grid { grid-template-columns: 1fr; }
}

