/* ============================================================
   NOX ADMIN WEB — v3 Design System
   Palette : Crimson Red / Void Black / Silver White
   ============================================================ */

:root {
  color-scheme: dark;

  /* ── Backgrounds ── */
  --bg:       #060809;
  --bg-soft:  #090c0e;
  --panel:    rgba(13, 9, 9, .94);
  --panel-2:  rgba(17, 12, 12, .90);
  --panel-3:  rgba(22, 16, 16, .82);

  /* ── Borders — red-tinted ── */
  --line:        rgba(180, 18, 18, .18);
  --line-strong: rgba(210, 20, 20, .34);

  /* ── Text ── */
  --text:  #f2f2f2;
  --muted: #787878;
  --soft:  #c0c0c0;

  /* ── Brand — Crimson (logo) ── */
  --accent:      #cc1212;
  --accent-2:    #ee2424;
  --accent-dark: #7a0808;
  --accent-soft: rgba(204, 18, 18, .13);

  /* ── Danger — distinct bright red ── */
  --danger:      #ff3a3a;
  --danger-dark: #cc2020;
  --danger-soft: rgba(255, 58, 58, .13);

  /* ── Warning ── */
  --warn:      #e89820;
  --warn-soft: rgba(232, 152, 32, .14);

  /* ── Success ── */
  --success:      #22cc77;
  --success-soft: rgba(34, 204, 119, .12);

  /* ── Layout ── */
  --radius:  6px;
  --shadow:  0 24px 64px rgba(0, 0, 0, .65);
  --glow:    0 0 20px rgba(204, 18, 18, .50);
  --glow-sm: 0 0 10px rgba(204, 18, 18, .40);
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; }
h1, h2, p { margin: 0; }
section { min-width: 0; }
button, input, select { font: inherit; }
.hidden { display: none !important; }
.stack { display: grid; gap: 14px; }

/* ── Base ─────────────────────────────────────────────────── */
body {
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(140deg, rgba(130, 10, 10, .07) 0%, transparent 36%),
    linear-gradient(180deg, #0c0709 0%, var(--bg) 48%, #030405 100%);
  background-attachment: fixed;
}

/* Dot-grid overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image: radial-gradient(rgba(180, 18, 18, .10) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.7), transparent 82%);
}

/* Scanlines overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, .05) 3px,
    rgba(0, 0, 0, .05) 4px
  );
}

/* ── Typography ───────────────────────────────────────────── */
h1 {
  font-size: clamp(24px, 2.8vw, 38px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.01em;
}

/* ── Eyebrow ──────────────────────────────────────────────── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px rgba(204, 18, 18, .90);
}

/* ── Buttons ──────────────────────────────────────────────── */
button,
.discord-login {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 9px 16px;
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0;
  transition: transform .12s ease, border-color .12s ease, background .12s ease,
              box-shadow .12s ease, color .12s ease, opacity .12s ease;
}

/* Primary — red */
button {
  color: #fff;
  background: linear-gradient(180deg, #dd1515 0%, #990d0d 100%);
  box-shadow: inset 0 1px rgba(255,255,255,.18), 0 8px 24px rgba(204,18,18,.22);
}

button:hover,
.discord-login:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.14); }
button:active,
.discord-login:active { transform: translateY(0); }
button:disabled { cursor: not-allowed; opacity: .38; transform: none; }

/* Ghost */
button.ghost {
  color: var(--soft);
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.10);
  box-shadow: none;
}
button.ghost:hover { color: var(--text); background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.18); }

/* Danger */
button.danger {
  color: #fff;
  background: linear-gradient(180deg, var(--danger) 0%, var(--danger-dark) 100%);
  box-shadow: inset 0 1px rgba(255,255,255,.16), 0 8px 24px rgba(255,58,58,.18);
}
button.danger:hover { background: linear-gradient(180deg, #ff5050, #dd2020); }

/* Secondary — data-* action buttons */
button[data-action],
button[data-vehicle],
button[data-money],
button[data-mod],
button[data-offline],
#set-job, #set-gang, #give-item, #remove-item, #freeze-time, #panic-off {
  color: var(--soft);
  background: rgba(255,255,255,.04);
  border-color: var(--line);
  box-shadow: none;
}
button[data-action]:hover,
button[data-vehicle]:hover,
button[data-money]:hover,
button[data-mod]:hover,
button[data-offline]:hover,
#set-job:hover, #set-gang:hover, #give-item:hover, #remove-item:hover,
#freeze-time:hover, #panic-off:hover {
  color: var(--text);
  background: rgba(204,18,18,.10);
  border-color: rgba(204,18,18,.38);
}

/* .btn-sm */
.btn-sm { min-height: 32px; padding: 5px 11px; font-size: 12px; }

/* ── Inputs & Selects ─────────────────────────────────────── */
input, select {
  width: 100%;
  min-height: 40px;
  color: var(--text);
  background: rgba(4, 4, 6, .72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 12px;
  outline: none;
  appearance: none;
  transition: border-color .14s ease, background .14s ease, box-shadow .14s ease;
}
input::placeholder { color: #505050; }
input:focus, select:focus {
  background: rgba(8, 6, 6, .96);
  border-color: rgba(204,18,18,.65);
  box-shadow: 0 0 0 3px rgba(204,18,18,.12);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
label input, label select { color: var(--text); font-size: 14px; font-weight: 600; }

/* ── Auth Screen ──────────────────────────────────────────── */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  position: relative;
  width: min(480px, 100%);
  overflow: hidden;
  display: grid;
  gap: 20px;
  padding: 32px;
  background:
    linear-gradient(180deg, rgba(20, 14, 14, .97), rgba(8, 6, 6, .98)),
    var(--panel);
  border: 1px solid var(--line-strong);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow), 0 0 60px rgba(204,18,18,.08);
}

.auth-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(204,18,18,.14), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,.04), transparent 30%);
  z-index: 0;
}
.auth-panel > * { position: relative; z-index: 1; }

/* Corner bracket — top-left */
.auth-panel::before {
  content: "";
  position: absolute;
  bottom: 0; right: 0;
  width: 20px; height: 20px;
  border-bottom: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  opacity: .6;
  z-index: 1;
}

.auth-brand {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.auth-panel p { color: var(--muted); margin-top: 8px; line-height: 1.5; }

.auth-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.auth-features span,
.system-pill {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.03);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  letter-spacing: .04em;
}

/* Discord login */
.discord-login {
  display: grid;
  place-items: center;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(180deg, #6470ff, #5865f2);
  box-shadow: inset 0 1px rgba(255,255,255,.20), 0 14px 30px rgba(88,101,242,.20);
}

/* Notices */
.notice {
  border-radius: var(--radius);
  padding: 11px 14px;
  background: var(--panel-2);
}
.notice.error {
  color: #ffcccc;
  border: 1px solid rgba(255,58,58,.40);
  background: var(--danger-soft);
}

/* ── App Layout ───────────────────────────────────────────── */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 20px;
  padding: 18px 14px;
  background: rgba(5, 4, 4, .97);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

/* Red glow strip at top of sidebar */
.sidebar::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 70%);
}

/* ── Brand / Logo ─────────────────────────────────────────── */
.brand {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 13px;
  padding: 2px;
}

.mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius);
  background: #0a0505;
  border: 1px solid rgba(204,18,18,.45);
  box-shadow: 0 0 20px rgba(204,18,18,.18), inset 0 0 16px rgba(204,18,18,.08);
}

.mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.mark-large {
  width: 84px;
  height: 84px;
  border-radius: var(--radius);
  box-shadow: 0 0 32px rgba(204,18,18,.25), inset 0 0 24px rgba(204,18,18,.12);
}

.brand b { display: block; line-height: 1.1; font-size: 15px; letter-spacing: .01em; }
.brand small {
  display: block;
  max-width: 170px;
  margin-top: 5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

/* ── Nav ──────────────────────────────────────────────────── */
nav { display: grid; align-content: start; gap: 4px; }

.nav {
  position: relative;
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-align: left;
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  border-left: 2px solid transparent;
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: none;
  padding-left: 10px;
  font-size: 14px;
  transition: color .14s, background .14s, border-color .14s;
}

.nav span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  color: #4a4a4a;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 7px;
  transition: background .14s, color .14s, box-shadow .14s, border-color .14s;
}

.nav span svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
  transition: stroke .14s, filter .14s;
}

.nav:hover span { color: var(--soft); background: rgba(255,255,255,.06); }
.nav:hover span svg { stroke: var(--soft); }

.nav.active span svg {
  stroke: #fff;
  filter: drop-shadow(0 0 5px rgba(255,255,255,.55));
}

.nav:hover {
  color: var(--soft);
  background: rgba(255,255,255,.04);
  border-left-color: rgba(204,18,18,.30);
  transform: none;
}

.nav.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(204,18,18,.12), rgba(204,18,18,.04));
  border-left-color: var(--accent);
}

.nav.active span {
  color: #fff;
  background: var(--accent);
  border-color: rgba(204,18,18,.70);
  box-shadow: var(--glow-sm);
}

/* ── Sidebar footer ───────────────────────────────────────── */
.sidebar-footer { display: grid; gap: 10px; }

.status-card {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
  background: rgba(204,18,18,.06);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.status-card b { display: block; font-size: 13px; }
.status-card small { color: var(--muted); font-weight: 700; font-size: 11px; }

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(204,18,18,.85);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 6px rgba(204,18,18,.65); opacity: .85; }
  50%       { box-shadow: 0 0 18px rgba(204,18,18,1); opacity: 1; }
}

/* ── Content area ─────────────────────────────────────────── */
.content {
  width: min(100%, 1820px);
  display: grid;
  gap: 20px;
  align-content: start;
  padding: 26px 30px 42px;
}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(200px, 1fr) auto minmax(300px, 540px);
  gap: 16px;
  align-items: center;
  padding: 14px 0 14px;
  background:
    linear-gradient(90deg, rgba(204, 18, 18, .05) 0%, transparent 30%),
    rgba(6, 7, 9, .96);
  border-bottom: 1px solid rgba(204, 18, 18, .28);
  backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 rgba(204, 18, 18, .10), 0 4px 24px rgba(0, 0, 0, .40);
}

/* Red accent stripe left edge of topbar */
.topbar::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), transparent);
  border-radius: 0 2px 2px 0;
}

.title-block { display: grid; gap: 5px; }

/* Compact h1 inside topbar only */
.topbar h1 {
  font-size: clamp(18px, 2vw, 26px);
  letter-spacing: -0.01em;
}

.top-status { display: flex; gap: 8px; align-items: center; justify-content: center; }

/* Pills — red style */
.system-pill {
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(204, 18, 18, .06);
  font-size: 11px;
  font-weight: 900;
  color: var(--soft);
  letter-spacing: .04em;
}

.top-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; }

/* ── Pages ────────────────────────────────────────────────── */
.page { display: none; }
.page.active { display: grid; gap: 18px; }

/* Panels / sections */
.page > section,
.grid > section,
.search-results {
  position: relative;
  padding: 18px;
  background: linear-gradient(180deg, rgba(17, 12, 12, .88), rgba(11, 8, 8, .93));
  border: 1px solid var(--line);
  border-top: 1px solid rgba(204,18,18,.28);
  border-radius: var(--radius);
  box-shadow: 0 1px rgba(255,255,255,.02), 0 16px 40px rgba(0,0,0,.30);
  overflow: hidden;
}

/* Corner bracket — top-left */
.page > section::before,
.grid > section::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 14px; height: 14px;
  border-top: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
  opacity: .60;
  pointer-events: none;
}

/* Corner bracket — bottom-right */
.page > section::after,
.grid > section::after {
  content: "";
  position: absolute;
  bottom: 0; right: 0;
  width: 14px; height: 14px;
  border-bottom: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  opacity: .40;
  pointer-events: none;
}

/* ── Stats cards ──────────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
}

.stat {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 10px;
  min-height: 130px;
  padding: 18px;
  background: linear-gradient(145deg, rgba(18, 11, 11, .92), rgba(11, 7, 7, .95));
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  /* Futuristic cut corner */
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}

/* Red glow bottom-right */
.stat::after {
  content: "";
  position: absolute;
  bottom: -20px; right: -20px;
  width: 80px; height: 80px;
  background: radial-gradient(circle, rgba(204,18,18,.14), transparent 70%);
  pointer-events: none;
}

.stat > span,
.section-title,
.action-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .10em;
  text-transform: uppercase;
}

/* Stat number — monospace */
.stat b {
  font-size: 44px;
  line-height: .92;
  font-family: 'Courier New', 'Consolas', 'Lucida Console', monospace;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.stat small { color: var(--muted); font-weight: 800; font-size: 11px; }

/* ── Grid ─────────────────────────────────────────────────── */
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.players-grid { grid-template-columns: minmax(320px, .72fr) minmax(440px, 1fr); }

/* ── Section title ────────────────────────────────────────── */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-left: 12px;
  position: relative;
}

.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(204,18,18,.6);
}

.section-actions { display: flex; gap: 8px; align-items: center; }
.action-label { margin: 16px 0 10px; padding-left: 12px; position: relative; }
.action-label::before {
  content: "";
  position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 12px;
  background: rgba(204,18,18,.5);
  border-radius: 2px;
}

/* ── List ─────────────────────────────────────────────────── */
.list { display: grid; gap: 7px; }

/* ── Row ──────────────────────────────────────────────────── */
.row,
.selected {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.03);
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 13px;
  border-left: 2px solid transparent;
  transition: background .12s, border-color .12s, border-left-color .12s;
}

.row.clickable { cursor: pointer; }

.row.clickable:hover,
.row.selected-row {
  background: rgba(204,18,18,.08);
  border-color: rgba(204,18,18,.35);
  border-left-color: var(--accent);
}

.row.empty {
  grid-template-columns: 1fr;
  color: var(--muted);
  border-style: dashed;
  background: rgba(255,255,255,.02);
  justify-items: center;
  padding: 18px;
  font-size: 13px;
  border-left: 1px dashed var(--line);
}

/* ── Identity ─────────────────────────────────────────────── */
.identity {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
}

.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--accent), var(--accent-dark));
  border-radius: var(--radius);
  font-weight: 900;
  font-size: 14px;
  box-shadow: inset 0 1px rgba(255,255,255,.18), 0 4px 14px rgba(0,0,0,.40);
  flex-shrink: 0;
  overflow: hidden;
  letter-spacing: .02em;
}

/* Avatar with a Discord photo */
.avatar.avatar-photo {
  background: #111;
  padding: 0;
}

.avatar.avatar-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.row-main, .target-main { min-width: 0; }

.row b, .selected b {
  display: block;
  color: var(--text);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row small, .row p, .selected small {
  color: var(--muted);
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  line-height: 1.35;
  font-size: 12px;
}

.row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

/* ── Chips & Badges ───────────────────────────────────────── */
.mini-chip,
.badge {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.03);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.mini-chip { padding: 3px 8px; }
.badge     { padding: 4px 9px; }

.badge.done    { color: var(--success); border-color: rgba(34,204,119,.40); background: var(--success-soft); }
.badge.failed  { color: #ffb0b0; border-color: rgba(255,58,58,.42); background: var(--danger-soft); }
.badge.queued,
.badge.running { color: #f5c060; border-color: rgba(232,152,32,.42); background: var(--warn-soft); }

/* ── Selected player box ──────────────────────────────────── */
.selected {
  display: grid;
  gap: 6px;
  min-height: 86px;
  padding: 14px;
  border-radius: var(--radius);
}

.selected:not(.empty) {
  background: linear-gradient(135deg, rgba(204,18,18,.10), rgba(80,8,8,.04));
  border-color: rgba(204,18,18,.40);
  border-left: 3px solid var(--accent);
}

.empty {
  color: var(--muted);
  border-style: dashed;
  background: rgba(255,255,255,.02);
}

/* ── Button grids / form grids ────────────────────────────── */
.button-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  align-items: end;
}

.form-grid.compact { grid-template-columns: minmax(220px, 1fr) 150px; }
.form-grid.wide    { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

/* ── Search results ───────────────────────────────────────── */
.search-results { border-top: 1px solid var(--line); }

/* ── Player tabs ──────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 2px;
  margin: 14px 0 12px;
  border-bottom: 1px solid var(--line);
}

.tab-btn {
  color: var(--muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 7px 16px;
  min-height: 36px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .02em;
  margin-bottom: -1px;
  transition: color .12s, border-color .12s;
}

.tab-btn:hover { color: var(--soft); background: transparent; transform: none; }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); box-shadow: 0 4px 12px rgba(204,18,18,.20); }

.player-tab-content { display: none; }
.player-tab-content.active { display: block; }

/* ── Player info tab ──────────────────────────────────────── */
.details-panel { padding: 4px 0; }
.details-empty { color: var(--muted); font-size: 13px; padding: 14px 0; }

.info-grid { display: grid; gap: 5px; }

.info-row {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 5px;
  background: rgba(255,255,255,.025);
  border: 1px solid var(--line);
  border-left: 2px solid rgba(204,18,18,.25);
}

.info-row span { color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.info-row b    { font-size: 13px; font-weight: 700; }

.text-accent { color: var(--accent-2); }
.text-warn   { color: var(--warn); }
.text-danger { color: var(--danger); }
.text-muted  { color: var(--muted); }

/* ── Notes tab ────────────────────────────────────────────── */
.notes-list { display: grid; gap: 8px; }

.note-card {
  padding: 12px 14px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}

.note-card p {
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 8px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
}

.note-meta {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

/* ── Confirmation modal ───────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0,0,0,.65);
  display: grid;
  place-items: center;
  backdrop-filter: blur(6px);
}

.modal {
  width: min(440px, calc(100vw - 32px));
  padding: 30px;
  background: linear-gradient(180deg, rgba(20, 13, 13, .99), rgba(10, 7, 7, .99));
  border: 1px solid var(--line-strong);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow), 0 0 40px rgba(204,18,18,.08);
  display: grid;
  gap: 14px;
  position: relative;
  overflow: hidden;
}

.modal::before {
  content: "";
  position: absolute;
  bottom: 0; right: 0;
  width: 14px; height: 14px;
  border-bottom: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  opacity: .5;
}

.modal h2 { font-size: 18px; font-weight: 900; }
.modal p  { color: var(--muted); line-height: 1.5; }

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}

/* ── Log filters ──────────────────────────────────────────── */
.log-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
  margin-top: 10px;
}

/* ── Pagination ───────────────────────────────────────────── */
.pagination-bar {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

.page-btn {
  min-height: 30px;
  padding: 4px 11px;
  font-size: 12px;
  color: var(--soft);
  background: rgba(255,255,255,.04);
  border-color: var(--line);
  box-shadow: none;
}

.page-btn:hover:not(.disabled) { background: rgba(204,18,18,.10); border-color: rgba(204,18,18,.35); color: var(--text); }

.page-btn.active {
  color: #fff;
  background: linear-gradient(180deg, #dd1515, #990d0d);
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(204,18,18,.25);
}

.page-btn.disabled { opacity: .30; pointer-events: none; }
.page-info { color: var(--muted); font-size: 11px; font-weight: 800; margin-left: 6px; }

/* ── Chart container ──────────────────────────────────────── */
.chart-container { min-height: 80px; padding: 6px 0; }
.chart-empty { color: var(--muted); font-size: 13px; padding: 18px 0; text-align: center; }

/* ── Staff page chips ─────────────────────────────────────── */
.role-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--muted);
}

.role-chip.chip-god   { color: #f4d060; border-color: rgba(244,208,96,.45);  background: rgba(244,208,96,.08); }
.role-chip.chip-admin { color: var(--accent-2); border-color: rgba(204,18,18,.42); background: var(--accent-soft); }
.role-chip.chip-mod   { color: #c8c8c8; border-color: rgba(200,200,200,.28); background: rgba(200,200,200,.05); }

.perm-chip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  color: #ffaaaa;
  border: 1px solid rgba(255,100,100,.28);
  background: rgba(204,18,18,.07);
}

/* Permission checkboxes */
.perm-checkboxes { display: flex; flex-wrap: wrap; gap: 8px; }
.perm-check-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.perm-check-label input { width: auto; min-height: auto; }

/* ── Toast system ─────────────────────────────────────────── */
.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
  max-width: min(420px, calc(100vw - 40px));
}

.toast {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-weight: 900;
  font-size: 13px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  transition: opacity .26s ease, transform .26s ease;
  pointer-events: auto;
  line-height: 1.4;
}

.toast-info    { color: var(--text); background: rgba(16, 12, 12, .96); border: 1px solid var(--line-strong); }
.toast-success { color: #fff; background: linear-gradient(135deg, #1a7a44, #0d4a28); border: 1px solid rgba(34,204,119,.45); }
.toast-error   { color: #fff; background: linear-gradient(135deg, #8a0d0d, #580808); border: 1px solid rgba(204,18,18,.55); }
.toast-warn    { color: #1a1000; background: linear-gradient(135deg, #e89820, #b87010); border: 1px solid rgba(232,152,32,.55); }

.toast-out { opacity: 0; transform: translateX(18px); }

/* ── Section "section-actions" helpers ────────────────────── */
.section-actions { display: flex; gap: 8px; align-items: center; }

/* ── Responsive ───────────────────────────────────────────── */
/* ── Stats row 2 ─────────────────────────────────────────── */
.stats-row2 { margin-top: 12px; }
.stat-warn::before    { background: linear-gradient(90deg, var(--warn),    transparent); }
.stat-info::before    { background: linear-gradient(90deg, #4488cc,        transparent); }
.stat-appeal::before  { background: linear-gradient(90deg, var(--danger),  transparent); }
.stat-warn .stat b    { color: var(--warn); }
.stat-appeal .stat b,
.stat-appeal b        { color: var(--danger); }

/* ── Nav badge ────────────────────────────────────────────── */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: auto;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  box-shadow: 0 0 10px rgba(255,58,58,.5);
}

/* ── Sidebar shortcuts hint ───────────────────────────────── */
.sidebar-shortcuts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px 4px;
}
.sidebar-shortcuts span {
  font-size: 10px;
  font-weight: 700;
  color: #444;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 4px;
  padding: 2px 6px;
}

/* ── Action color chips ───────────────────────────────────── */
.action-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .03em;
  white-space: nowrap;
  margin-right: 4px;
}
.cat-danger    { color: #ffb0b0; background: rgba(255,58,58,.13);  border: 1px solid rgba(255,58,58,.30); }
.cat-warn      { color: #f5c060; background: rgba(232,152,32,.13); border: 1px solid rgba(232,152,32,.30); }
.cat-success   { color: #a0e8c0; background: rgba(34,204,119,.12); border: 1px solid rgba(34,204,119,.30); }
.cat-money     { color: #f4d060; background: rgba(244,208,96,.12); border: 1px solid rgba(244,208,96,.30); }
.cat-money-neg { color: #ffb070; background: rgba(255,100,32,.10); border: 1px solid rgba(255,100,32,.30); }
.cat-item      { color: #b0d0ff; background: rgba(100,160,255,.12);border: 1px solid rgba(100,160,255,.30); }
.cat-item-neg  { color: #ffb0c8; background: rgba(255,80,140,.10); border: 1px solid rgba(255,80,140,.30); }
.cat-info      { color: #c0b0ff; background: rgba(140,100,255,.12);border: 1px solid rgba(140,100,255,.30); }
.cat-server    { color: #c8c8c8; background: rgba(200,200,200,.07);border: 1px solid rgba(200,200,200,.18); }
.cat-note      { color: #a0d0d0; background: rgba(100,200,200,.10);border: 1px solid rgba(100,200,200,.28); }
.cat-vehicle   { color: #ffd0a0; background: rgba(255,160,64,.10); border: 1px solid rgba(255,160,64,.28); }
.cat-default   { color: var(--muted); background: rgba(255,255,255,.04); border: 1px solid var(--line); }

/* ── Count badge (tabs) ───────────────────────────────────── */
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
}

/* ── Mod tab content ──────────────────────────────────────── */
.mod-tab-content { display: none; padding-top: 12px; }
.mod-tab-content.active { display: block; }

/* ── Target selector (Sanctions page) ────────────────────── */
.target-selector {
  margin-bottom: 16px;
  padding: 14px;
  background: rgba(204,18,18,.05);
  border: 1px solid rgba(204,18,18,.22);
  border-radius: var(--radius);
}
.target-selector-label {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .10em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.target-selector-label::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: var(--glow-sm);
}
.target-search-wrap { position: relative; }
.player-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  z-index: 20;
  background: rgba(14, 10, 10, .98);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 240px;
  overflow-y: auto;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background .12s;
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover { background: rgba(204,18,18,.10); }
.dropdown-item b { display: block; font-size: 13px; }
.dropdown-item small { color: var(--muted); font-size: 11px; }
.dropdown-empty { padding: 12px; color: var(--muted); font-size: 13px; text-align: center; }
.mod-selected-empty {
  margin-top: 8px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.mod-selected-preview {
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(204,18,18,.08);
  border: 1px solid rgba(204,18,18,.35);
  border-radius: var(--radius);
}

/* ── History entries ──────────────────────────────────────── */
.history-entry {
  border-left: 3px solid var(--line);
  padding-left: 12px;
  position: relative;
  grid-template-columns: 1fr;
}
.history-entry::before {
  content: "";
  position: absolute;
  left: -5px; top: 50%;
  transform: translateY(-50%);
  width: 7px; height: 7px;
  background: var(--panel);
  border: 2px solid var(--accent);
  border-radius: 50%;
}

/* ── Appeal badge ─────────────────────────────────────────── */
.appeal-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  margin-top: 6px;
  border: 1px solid;
}
.appeal-pending  { color: var(--warn);    border-color: rgba(232,152,32,.45); background: var(--warn-soft); }
.appeal-accepted { color: var(--success); border-color: rgba(34,204,119,.40); background: var(--success-soft); }
.appeal-rejected { color: var(--danger);  border-color: rgba(255,58,58,.40);  background: var(--danger-soft); }

.appeal-response-form { margin-top: 10px; }
.appeal-btns { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* ── Online pill ──────────────────────────────────────────── */
.online-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  margin-left: 5px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 900;
  color: var(--success);
  background: var(--success-soft);
  border: 1px solid rgba(34,204,119,.35);
  vertical-align: middle;
  letter-spacing: .04em;
}

/* ── Screen viewer modal ──────────────────────────────────── */
.screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(0, 0, 0, .82);
  display: grid;
  place-items: center;
  backdrop-filter: blur(8px);
  padding: 20px;
}

.screen-viewer {
  width: min(1200px, 100%);
  display: grid;
  grid-template-rows: auto 1fr;
  background: #06080a;
  border: 1px solid var(--line-strong);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow), 0 0 60px rgba(204, 18, 18, .12);
  overflow: hidden;
  max-height: calc(100vh - 40px);
}

.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(14, 10, 10, .95);
  border-bottom: 1px solid var(--line);
  gap: 16px;
}

.screen-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.screen-live-label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .14em;
  color: var(--accent);
}

#screen-player-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.screen-stat {
  font-size: 11px;
  font-weight: 900;
  color: var(--muted);
  font-family: 'Courier New', monospace;
  letter-spacing: .04em;
}

.screen-body {
  position: relative;
  background: #000;
  min-height: 300px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

#screen-img {
  width: 100%;
  height: auto;
  display: block;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  image-rendering: auto;
}

.screen-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  background: #000;
}

.screen-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(204, 18, 18, .2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 1180px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    grid-template-rows: auto;
  }
  .sidebar::before { display: none; }
  .sidebar-footer {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
  nav { grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); }
  .nav {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    border-left: none;
    border-bottom: 2px solid transparent;
    border-radius: var(--radius) var(--radius) 0 0;
    padding-left: 0;
  }
  .nav.active  { border-bottom-color: var(--accent); border-left-color: transparent; }
  .nav:hover   { border-bottom-color: rgba(204,18,18,.30); border-left-color: transparent; }
  .topbar {
    position: static;
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .top-status { justify-content: flex-start; }
  .stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid.two, .players-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .auth-shell, .content { padding: 14px; }
  .auth-brand { grid-template-columns: 64px minmax(0,1fr); }
  .mark-large { width: 64px; height: 64px; }
  .auth-features, .stats, .top-actions, .form-grid.compact { grid-template-columns: 1fr; }
  .sidebar { padding: 12px; }
  nav { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .sidebar-footer { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; }
  .button-grid, .form-grid, .form-grid.wide { grid-template-columns: 1fr; }
  .log-filters { grid-template-columns: 1fr; }
  .stat { clip-path: none; }
  .modal-actions { grid-template-columns: 1fr; }
}
