/* ═══════════════════════════════════════════════════════════
   Reworked ACP — Design System v4 "Rail" (2026-10-29)
   The network style of the in-game UIs (resources/rw2/ui/gangwar + crimelife, resources/CLAUDE.md
   "Network style (Rail)"): graphite cards with soft corners and hairlines, dark card heads, the sidebar as a
   rail with an accent bar on the active item, indigo #7c8cff → cyan #3dd6ff for the main action,
   upright Rajdhani for titles / names / figures + Inter for text.
   Class names and CSS variables stay compatible with every existing page.
   ═══════════════════════════════════════════════════════════ */
@import url("https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: dark;

  /* gw5 core */
  --tint:        #7c8cff;
  --tint-hi:     #9aa6ff;
  --tint-rgb:    124, 140, 255;
  --strip:       #22252f;
  --strip-2:     #2a2e3a;
  --strip-ink:   #f1f3f8;
  --strip-ink-2: #8d91a0;
  --band: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, 0));
  --hair:        rgba(255, 255, 255, .1);
  --edge:        inset 0 0 0 1px rgba(255, 255, 255, .07);
  --bg:          #0b0c10;
  --bg-1:        rgba(21, 22, 27, .95);   /* card */
  --bg-2:        rgba(30, 32, 40, .96);   /* control, row on a card */
  --bg-3:        #282b37;                 /* hover / pressed */
  --bg-4:        #343847;
  --tag:         #111113;
  --font-cond:   "Rajdhani", "Arial Narrow", "Segoe UI", sans-serif;
  --green: #3ecf6e; --red: #e5484d; --orange: #f2994a; --yellow: #f5c542; --blue: #4c8dff;
  --green-rgb: 62, 207, 110; --red-rgb: 229, 72, 77; --orange-rgb: 242, 153, 74; --blue-rgb: 76, 141, 255;

  /* surfaces (legacy names used by the pages) */
  --bg-body:       var(--bg);
  --bg-sidebar:    rgba(13, 14, 18, .92);
  --bg-card:       var(--bg-1);
  --bg-card-solid: #15161b;
  --bg-card-alt:   rgba(30, 32, 40, .45);
  --bg-input:      var(--bg-2);
  --bg-hover:      var(--bg-3);
  --bg-overlay:    rgba(6, 7, 10, .74);
  --bg-elevated:   #1c1e25;

  /* lines */
  --border:        var(--hair);
  --border-light:  rgba(255, 255, 255, .16);
  --border-strong: rgba(255, 255, 255, .28);

  /* brand */
  --primary:        var(--tint);
  --primary-2:      var(--tint-hi);
  --primary-hover:  var(--tint-hi);
  --primary-dim:    rgba(124, 140, 255, .18);
  --primary-border: rgba(124, 140, 255, .5);
  --primary-glow:   rgba(124, 140, 255, .12);
  --primary-text:   #c3caff;
  --gradient:       linear-gradient(135deg, #7c8cff, #3dd6ff);
  --gradient-soft:  rgba(124, 140, 255, .18);

  /* states */
  --success:      var(--green);
  --success-dim:  rgba(62, 207, 110, .16);
  --danger:       var(--red);
  --danger-dim:   rgba(229, 72, 77, .16);
  --danger-hover: #d63c41;
  --warning:      var(--orange);
  --warning-dim:  rgba(242, 153, 74, .16);
  --info:         var(--blue);
  --info-dim:     rgba(76, 141, 255, .16);

  /* text */
  --text:       #eceef3;
  --text-sec:   #a9adba;
  --text-muted: #7a7e8c;
  --text-dim:   #4c505c;

  /* shape & type: soft corners */
  --radius:      10px;
  --radius-lg:   14px;
  --radius-xl:   18px;
  --sidebar-w:   264px;
  --topbar-h:    64px;
  --font:         "Inter", "Segoe UI", system-ui, sans-serif;
  --font-display: var(--font-cond);
  --font-mono:    "JetBrains Mono", "Cascadia Code", Consolas, monospace;

  /* motion */
  --ease-out:    cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --transition:  .18s var(--ease-out);

  /* depth: flat, depth comes from lightness */
  --shadow:    0 10px 30px rgba(0, 0, 0, .28);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, .5);
  --glow:      0 0 0 1px rgba(124, 140, 255, .45);
}

/* the light strip: card titles, modal heads, the selected item */
.ui-strip, .card-header, .modal-header, .pa-head {
  background-color: var(--strip);
  background-image: var(--band);
  color: var(--strip-ink);
  box-shadow: inset 0 -1px 0 var(--hair);
}

/* ─── Cross-page transitions (Chromium) ───────────────── */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vtOut .16s ease both; }
::view-transition-new(root) { animation: vtIn .28s var(--ease-out) both; }
@keyframes vtOut { to { opacity: 0; } }
@keyframes vtIn { from { opacity: 0; transform: translateY(6px); } }

/* ─── Reset & base ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-body);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}
/* ambient: tint glow top left, a floor grid fading out */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(110% 70% at 0% 0%, rgba(var(--tint-rgb), .16), rgba(var(--tint-rgb), 0) 60%),
    radial-gradient(60% 50% at 100% 100%, rgba(var(--tint-rgb), .07), rgba(var(--tint-rgb), 0) 70%),
    linear-gradient(180deg, rgba(0, 0, 0, .3), rgba(0, 0, 0, 0) 240px);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, transparent 0%, #000 55%, transparent 100%);
}

body:not(.app-ready) .dashboard { opacity: 0; }
body.app-ready .dashboard { opacity: 1; transition: opacity .25s ease; }
a { color: var(--primary-text); text-decoration: none; transition: color var(--transition); }
a:hover { color: #ddd5fd; }
::selection { background: rgba(var(--tint-rgb), .5); color: #f4f2fa; }
:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .26); background-clip: content-box; }
h1, h2, h3, h4 { font-family: var(--font-cond); font-style: normal; font-weight: 700; text-transform: uppercase; letter-spacing: .01em; }

/* condensed italic capitals: anything that names something */
.cond {
  font-family: var(--font-cond); font-style: normal; font-weight: 600; text-transform: uppercase; letter-spacing: .02em;
}

/* ─── Layout ─────────────────────────────────────────── */
.dashboard { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  box-shadow: inset -1px 0 0 var(--hair);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 200; overflow-y: auto; overflow-x: hidden;
  transition: transform .35s var(--ease-out);
}
.sidebar-header { height: var(--topbar-h); flex-shrink: 0; display: flex; align-items: stretch; box-shadow: inset 0 -1px 0 var(--hair); }
.sidebar-brand {
  display: flex; align-items: center; gap: 14px; min-width: 0;
  font-family: var(--font-cond); font-style: normal; font-size: 1.55rem; font-weight: 800; color: var(--text);
  text-transform: uppercase; line-height: 1.02; letter-spacing: .01em;
}
.sidebar-brand small {
  display: block; font-family: var(--font-cond); font-style: normal; font-size: .82rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-muted); margin-top: 1px; white-space: nowrap;
}
.brand-mark {
  width: var(--topbar-h); height: var(--topbar-h); flex-shrink: 0; display: grid; place-items: center;
  background-color: var(--strip); background-image: var(--band); color: var(--strip-ink);
  box-shadow: inset -4px 0 0 var(--tint);
  font-family: var(--font-cond); font-style: normal; font-weight: 800; font-size: 1.7rem; letter-spacing: -.02em;
}
.brand-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  background-color: var(--strip); background-image: var(--band); color: var(--strip-ink);
  box-shadow: inset -3px 0 0 var(--tint);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-cond); font-style: normal; font-weight: 800; font-size: 20px;
}

.sidebar-nav { flex: 1; padding: 14px 0 12px; }
.nav-section { margin-bottom: 14px; }
.nav-section-title {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-cond); font-style: normal; font-size: .86rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); padding: 0 18px; margin-bottom: 4px;
}
.nav-section-title::after { content: ""; flex: 1; height: 1px; background: var(--hair); }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  height: 38px; padding: 0 18px; margin: 1px 0;
  color: var(--text-sec);
  font-family: var(--font-cond); font-style: normal; font-size: 1.1rem; font-weight: 600; text-transform: uppercase; letter-spacing: .01em;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color var(--transition), color var(--transition);
  animation: navIn .45s var(--ease-out) both;
}
.nav-item:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .7; transition: opacity var(--transition); }
.nav-item:hover svg { opacity: 1; }
.nav-item.active {
  color: var(--strip-ink);
  background-color: var(--strip); background-image: var(--band);
  box-shadow: inset 4px 0 0 var(--tint);
}
.nav-item.active svg { opacity: 1; color: var(--strip-ink); }
@keyframes navIn { from { opacity: 0; transform: translateX(-8px); } }

.sidebar-footer { padding: 10px 0 12px; box-shadow: inset 0 1px 0 var(--hair); }
.sidebar-user {
  display: flex; align-items: center; gap: 12px; padding: 8px 18px; text-decoration: none;
  transition: background-color var(--transition);
}
.sidebar-user:hover { background: rgba(255, 255, 255, .05); }
.user-avatar {
  width: 38px; height: 38px; flex-shrink: 0; position: relative;
  background: linear-gradient(145deg, rgba(var(--tint-rgb), .75), var(--bg-3));
  display: flex; align-items: center; justify-content: center;
  color: #f4f2fa; font-family: var(--font-cond); font-style: normal; font-size: 19px; font-weight: 800;
}
.user-avatar::after { content: ""; position: absolute; right: 0; bottom: 0; width: 9px; height: 9px; background: var(--green); box-shadow: 0 0 0 2px var(--bg-card-solid); }
.sidebar-user .user-info { overflow: hidden; min-width: 0; }
.sidebar-user .user-name { font-family: var(--font-cond); font-style: normal; font-size: 1.05rem; font-weight: 700; text-transform: uppercase; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.15; }
.sidebar-user .user-role  { font-family: var(--font-cond); font-style: normal; font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.sidebar-footer .nav-item { animation: none; }

.main-content {
  flex: 1; margin-left: var(--sidebar-w);
  padding: 0 36px 56px; min-width: 0;
}
.main-content > * { animation: riseIn .5s var(--ease-out) both; }
.main-content > *:nth-child(2) { animation-delay: .04s; }
.main-content > *:nth-child(3) { animation-delay: .08s; }
.main-content > *:nth-child(4) { animation-delay: .12s; }
.main-content > *:nth-child(5) { animation-delay: .16s; }
.main-content > *:nth-child(n+6) { animation-delay: .2s; }
@keyframes riseIn { from { opacity: 0; transform: translateY(12px); } }

/* ─── Topbar (injected by panel.js) ──────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 150;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px;
  margin: 0 -36px 30px; padding: 0 22px 0 36px;
  background: rgba(13, 14, 18, .88);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 -1px 0 var(--hair);
  animation: none !important;
}
.topbar-menu { display: none; }
.topbar-crumbs {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  font-family: var(--font-cond); font-style: normal; font-size: 1.05rem; font-weight: 600; text-transform: uppercase; color: var(--text-muted);
}
.topbar-crumbs strong { color: var(--text); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-crumbs .sep { opacity: .5; }
.topbar-spacer { flex: 1; }
.topbar-status {
  display: inline-flex; align-items: center; gap: 9px;
  height: 40px; padding: 0 13px;
  background: rgba(255, 255, 255, .05);
  font-family: var(--font-cond); font-style: normal; font-size: 1rem; font-weight: 600; text-transform: uppercase; color: var(--text-sec);
  transition: background-color var(--transition);
}
.topbar-status .pulse { width: 8px; height: 8px; background: var(--text-dim); position: relative; }
.topbar-status.online .pulse { background: var(--success); }
.topbar-status.online .pulse::after {
  content: ""; position: absolute; inset: -4px;
  border: 2px solid var(--success); opacity: 0; animation: pulse 2s ease-out infinite;
}
.topbar-status.offline .pulse { background: var(--danger); }
.topbar-status .players { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
@keyframes pulse { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(1.8); opacity: 0; } }

/* game mode switch: a segmented strip (light block = selected mode) */
.topbar-server {
  display: inline-flex; align-items: stretch; height: 40px;
  background: rgba(255, 255, 255, .05);
  font-family: var(--font-cond); font-style: normal; font-weight: 600; text-transform: uppercase; color: var(--text-sec);
}
.topbar-server[hidden] { display: none; }
.topbar-server .mode-label { display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; font-size: .9rem; letter-spacing: .04em; color: var(--text-muted); }
.topbar-server svg { width: 15px; height: 15px; color: var(--tint-hi); flex-shrink: 0; }
.topbar-server .label { display: inline-flex; align-items: center; padding: 0 14px; font-size: 1.05rem; color: var(--strip-ink); background-color: var(--strip); background-image: var(--band); box-shadow: inset 0 -3px 0 var(--tint); }
.topbar-server button {
  border: 0; background: transparent; color: var(--text-sec); cursor: pointer; padding: 0 15px;
  font: inherit; font-size: 1.08rem; text-transform: uppercase;
  transition: background-color var(--transition), color var(--transition);
}
.topbar-server button:hover { background: rgba(255, 255, 255, .07); color: var(--text); }
.topbar-server button.active { color: var(--strip-ink); background-color: var(--strip); background-image: var(--band); box-shadow: inset 0 -3px 0 var(--tint); cursor: default; }
.topbar-server select {
  background: transparent; border: none; color: var(--text); font: inherit; font-size: 1.05rem;
  padding: 0 10px; cursor: pointer; outline: none;
}
.topbar-server select option { background: var(--bg-card-solid); color: var(--text); font-style: normal; }
.topbar-time {
  font-family: var(--font-cond); font-style: normal; font-weight: 700; font-size: 1.15rem; color: var(--text-sec);
  font-variant-numeric: tabular-nums; padding: 0 6px;
}

/* ─── Page Header: huge italic title + crumb ─────────── */
.page-header { margin-bottom: 26px; }
.page-title {
  font-family: var(--font-cond); font-style: normal; font-size: 3.1rem; font-weight: 800; color: var(--text);
  text-transform: uppercase; letter-spacing: 0; line-height: .95;
}
.page-sub {
  font-family: var(--font-cond); font-style: normal; font-weight: 600; font-size: 1rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); margin-top: 8px;
}
.page-header-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ─── Cards: a charcoal panel, the strip carries its title ─── */
.card {
  position: relative;
  background: var(--bg-card);
  border: 0;
  overflow: hidden;
  box-shadow: var(--edge), var(--shadow);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 20px 14px; gap: 12px; flex-wrap: wrap; border-bottom: 0;
}
.card-title {
  font-family: var(--font-cond); font-style: normal; font-size: 1.45rem; font-weight: 700; text-transform: uppercase;
  color: var(--strip-ink); line-height: 1.05; letter-spacing: 0;
}
.card-header .text-muted, .card-header .page-sub { color: var(--strip-ink-2); }
.card-header .btn-ghost, .card-header .btn-icon { background: var(--strip-ink); color: var(--strip); box-shadow: none; }
.card-header .btn-ghost:hover:not(:disabled), .card-header .btn-icon:hover { background: #2a2338; color: #f4f2fa; }
.card-header .form-select, .card-header .form-input, .card-header .search-input { background-color: rgba(22, 18, 30, .92); }
.card-body { padding: 20px; }
.card-section-label {
  font-family: var(--font-cond); font-style: normal; font-size: .95rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); margin-bottom: 10px;
}

/* ─── Stats ──────────────────────────────────────────── */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px; margin-bottom: 26px;
}
.stat-card {
  position: relative; overflow: hidden;
  background: var(--bg-card);
  border: 0;
  padding: 16px 20px 16px 22px;
  box-shadow: var(--edge), inset 3px 0 0 var(--tint), var(--shadow);
  transition: background-color .25s var(--ease-out), transform .3s var(--ease-out);
  animation: riseIn .55s var(--ease-out) both;
}
.stat-card::after {
  content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 46%; pointer-events: none;
  background: linear-gradient(118deg, rgba(255, 255, 255, 0) 0 40%, rgba(255, 255, 255, .025) 40% 62%, rgba(255, 255, 255, 0) 62%);
}
.stats-grid .stat-card:nth-child(2) { animation-delay: .05s; }
.stats-grid .stat-card:nth-child(3) { animation-delay: .1s; }
.stats-grid .stat-card:nth-child(4) { animation-delay: .15s; }
.stats-grid .stat-card:nth-child(n+5) { animation-delay: .2s; }
.stat-card:hover { background: var(--bg-2); transform: translateY(-2px); }
.stat-label {
  font-family: var(--font-cond); font-style: normal; font-size: .98rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); margin-bottom: 6px;
}
.stat-value {
  font-family: var(--font-cond); font-style: normal; font-size: 2.5rem; font-weight: 800; color: var(--text);
  line-height: 1; font-variant-numeric: tabular-nums;
}
.stat-sub { font-family: var(--font-cond); font-style: normal; font-weight: 600; font-size: .92rem; text-transform: uppercase; letter-spacing: .02em; color: var(--text-muted); margin-top: 8px; }

/* ─── Buttons ────────────────────────────────────────── */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px;
  font-family: var(--font-cond); font-style: normal; font-size: 1.1rem; font-weight: 600; text-transform: uppercase; letter-spacing: .01em;
  border: 0; cursor: pointer; white-space: nowrap; text-decoration: none; line-height: 1;
  transition: transform .12s var(--ease-out), background-color .16s ease, color .16s ease, box-shadow .16s ease;
  user-select: none;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primary { background: var(--tint); color: #f4f2fa; }
.btn-primary:hover:not(:disabled) { background: var(--tint-hi); color: #fff; }
.btn-ghost { background: var(--bg-2); color: var(--text); box-shadow: var(--edge); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-3); color: var(--text); }
.btn-danger { background: rgba(var(--red-rgb), .18); color: #f07a7e; box-shadow: inset 0 -2px 0 rgba(var(--red-rgb), .55); }
.btn-danger:hover:not(:disabled) { background: var(--red); color: #fff; box-shadow: none; }
.btn-success { background: rgba(var(--green-rgb), .16); color: var(--green); box-shadow: inset 0 -2px 0 rgba(var(--green-rgb), .5); }
.btn-success:hover:not(:disabled) { background: #2fb85c; color: #0c0914; box-shadow: none; }
.btn-warning { background: rgba(var(--orange-rgb), .16); color: var(--orange); box-shadow: inset 0 -2px 0 rgba(var(--orange-rgb), .5); }
.btn-warning:hover:not(:disabled) { background: var(--orange); color: #f1f3f8; box-shadow: none; }
.btn-light { background-color: var(--strip); background-image: var(--band); color: var(--strip-ink); }
.btn-light:hover:not(:disabled) { background-color: #d2d0dc; }
.btn-sm { height: 33px; padding: 0 13px; font-size: .98rem; }
.btn-xs { height: 26px; padding: 0 9px; font-size: .88rem; gap: 5px; }
.btn-xs svg { width: 13px; height: 13px; }
.btn-icon {
  width: 32px; height: 32px; padding: 0;
  background: var(--bg-2); border: 0; box-shadow: var(--edge); color: var(--text-sec);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background-color var(--transition), color var(--transition), transform .12s var(--ease-out);
}
.btn-icon:hover { background: var(--tint); color: #f4f2fa; }
.btn-icon:active { transform: scale(.92); }
.btn-icon svg { width: 15px; height: 15px; }
.btn-group { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ripple {
  position: absolute; pointer-events: none; z-index: -1;
  background: rgba(255, 255, 255, .22); transform: scale(0); animation: ripple .55s ease-out forwards;
}
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

/* ─── Tags (badges) & chips ──────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 7px;
  font-family: var(--font-cond); font-style: normal; font-size: .87rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
  white-space: nowrap; border: 0;
  background: var(--tag); color: var(--text); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}
.badge-purple { background: var(--tint); color: #f4f2fa; box-shadow: none; }
.badge-green  { background: rgba(var(--green-rgb), .18); color: var(--green); box-shadow: none; }
.badge-red    { background: rgba(var(--red-rgb), .85); color: #fff; box-shadow: none; }
.badge-yellow { background: rgba(var(--orange-rgb), .18); color: var(--orange); box-shadow: none; }
.badge-blue   { background: rgba(var(--blue-rgb), .18); color: #8db5ff; box-shadow: none; }
.badge-muted  { background: var(--tag); color: var(--text-sec); }
.badge-light  { background: var(--strip); color: var(--strip-ink); box-shadow: none; }
.badge .dot { width: 6px; height: 6px; display: inline-block; background: currentColor; }
/* on a light strip the tinted tags become solid blocks */
:is(.card-header, .modal-header, .pa-head, .st-head, .lv-hero, .ui-strip) .badge-blue   { background: var(--blue); color: #fff; }
:is(.card-header, .modal-header, .pa-head, .st-head, .lv-hero, .ui-strip) .badge-green  { background: #2fb85c; color: var(--strip-ink); }
:is(.card-header, .modal-header, .pa-head, .st-head, .lv-hero, .ui-strip) .badge-yellow { background: var(--orange); color: var(--strip-ink); }

.status-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 12px;
  font-family: var(--font-cond); font-style: normal; font-size: 1rem; font-weight: 700; text-transform: uppercase;
  border: 0;
}
.status-chip .dot { width: 8px; height: 8px; position: relative; }
.status-chip.online  { background: rgba(var(--green-rgb), .16); color: var(--green); }
.status-chip.online .dot  { background: var(--green); }
.status-chip.online .dot::after { content: ""; position: absolute; inset: -4px; border: 2px solid var(--green); animation: pulse 2s ease-out infinite; }
.status-chip.offline { background: rgba(var(--red-rgb), .16); color: #f07a7e; }
.status-chip.offline .dot { background: var(--red); }

/* ─── Forms ──────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; margin-bottom: 6px;
  font-family: var(--font-cond); font-style: normal; font-size: .98rem; font-weight: 600; text-transform: uppercase; letter-spacing: .03em;
  color: var(--text-sec);
}
.form-input, .form-select, .form-textarea {
  width: 100%; min-height: 42px; padding: 10px 14px; background: var(--bg-2);
  border: 0; box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .14);
  color: var(--text); font-size: .95rem; font-family: var(--font);
  transition: box-shadow var(--transition), background-color var(--transition); outline: none;
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-dim); }
.form-input:hover, .form-select:hover, .form-textarea:hover { background-color: rgba(46, 39, 68, .9); }
.form-input:focus, .form-select:focus, .form-textarea:focus { box-shadow: inset 0 -2px 0 var(--tint); background-color: rgba(46, 39, 68, .95); }
.form-input:disabled { opacity: .55; cursor: not-allowed; }
.form-textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.form-select {
  appearance: none; cursor: pointer; color-scheme: dark;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23bebbc9' stroke-width='2.6'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
.form-select option { background: var(--bg-elevated); color: var(--text); }
.form-row { display: flex; gap: 14px; }
.form-row > * { flex: 1; }
.form-inline { display: flex; gap: 8px; align-items: end; }
.form-check { display: flex; align-items: center; gap: 10px; font-size: .95rem; color: var(--text-sec); cursor: pointer; user-select: none; }
.form-check input[type="checkbox"] {
  appearance: none; width: 18px; height: 18px;
  border: 0; box-shadow: inset 0 0 0 1.5px var(--border-strong);
  background: var(--bg-2); cursor: pointer; position: relative; flex-shrink: 0;
  transition: background-color .15s ease, box-shadow .15s ease, transform .12s var(--ease-spring);
}
.form-check input[type="checkbox"]:hover { box-shadow: inset 0 0 0 1.5px var(--tint); }
.form-check input[type="checkbox"]:active { transform: scale(.88); }
.form-check input[type="checkbox"]:checked { background: var(--tint); box-shadow: none; }
.form-check input[type="checkbox"]:checked::after {
  content: ''; position: absolute; top: 2px; left: 6px;
  width: 4px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
  animation: checkIn .22s var(--ease-spring);
}
@keyframes checkIn { from { transform: rotate(45deg) scale(0); } }
input[type="checkbox"], input[type="radio"], input[type="range"] { accent-color: var(--tint); }

/* ─── Tables ─────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
thead th {
  position: sticky; top: 0; z-index: 1;
  padding: 10px 16px;
  font-family: var(--font-cond); font-style: normal; font-size: .95rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); text-align: left;
  background: rgba(13, 14, 18, .96);
  border-bottom: 1px solid var(--hair); white-space: nowrap;
}
tbody td {
  padding: 11px 16px; font-size: .93rem; color: var(--text-sec);
  border-bottom: 1px solid var(--hair);
  transition: background-color .15s ease, color .15s ease;
}
tbody tr { transition: background-color .15s ease; animation: rowIn .3s ease both; }
tbody tr:nth-child(2) { animation-delay: .02s; }
tbody tr:nth-child(3) { animation-delay: .04s; }
tbody tr:nth-child(4) { animation-delay: .06s; }
tbody tr:nth-child(5) { animation-delay: .08s; }
tbody tr:nth-child(6) { animation-delay: .1s; }
tbody tr:nth-child(7) { animation-delay: .12s; }
tbody tr:nth-child(8) { animation-delay: .14s; }
tbody tr:nth-child(n+9) { animation-delay: .16s; }
tbody tr:hover td { background: rgba(var(--tint-rgb), .09); color: var(--text); }
tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--tint); }
tbody tr:last-child td { border-bottom: none; }
tbody.live tr, .live tbody tr { animation: none; }
@keyframes rowIn { from { opacity: 0; } }

/* ─── Tabs & chips (light block = selected) ──────────── */
.tabs { display: flex; gap: 2px; padding: 0; background: rgba(13, 14, 18, .55); box-shadow: inset 0 -1px 0 var(--hair); overflow-x: auto; border-bottom: 0; }
.tab-btn {
  position: relative; height: 46px; padding: 0 20px;
  font-family: var(--font-cond); font-style: normal; font-size: 1.15rem; font-weight: 600; text-transform: uppercase;
  color: var(--text-sec); background: none; border: none; cursor: pointer; white-space: nowrap;
  transition: color var(--transition), background-color var(--transition);
}
.tab-btn::after { content: none; }
.tab-btn:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.tab-btn.active { color: var(--strip-ink); background-color: var(--strip); background-image: var(--band); box-shadow: inset 0 -3px 0 var(--tint); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn .3s var(--ease-out); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } }

.filter-pills { display: inline-flex; align-items: center; gap: 2px; flex-wrap: wrap; padding: 0; background: transparent; border: 0; }
.filter-pill {
  height: 33px; padding: 0 14px; border: 0; background: var(--bg-1); box-shadow: var(--edge); color: var(--text-sec);
  font-family: var(--font-cond); font-style: normal; font-size: 1.02rem; font-weight: 600; text-transform: uppercase;
  cursor: pointer; transition: background-color .16s ease, color .16s ease;
}
.filter-pill:hover { color: var(--text); background: var(--bg-2); }
.filter-pill.active { background-color: var(--strip); background-image: var(--band); color: var(--strip-ink); box-shadow: inset 0 -2px 0 var(--tint); }

/* ─── Toolbar & search ───────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: 8px; padding: 14px 20px; flex-wrap: wrap; }
.toolbar-between { justify-content: space-between; }
.search-input {
  flex: 1; min-width: 200px; height: 40px; padding: 0 14px 0 38px;
  background-color: var(--bg-2); border: 0; box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .14);
  color: var(--text); font-size: .95rem; font-family: var(--font); outline: none;
  transition: box-shadow var(--transition), background-color var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%237a768c' stroke-width='2.4'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 13px center;
}
.search-input::placeholder { color: var(--text-dim); font-family: var(--font-cond); font-style: normal; font-weight: 600; text-transform: uppercase; font-size: 1rem; }
.search-input:focus { box-shadow: inset 0 -2px 0 var(--tint); background-color: rgba(46, 39, 68, .95); }

/* ─── Modals & dialogs ───────────────────────────────── */
.modal-overlay, .confirm-overlay {
  display: none; position: fixed; inset: 0; background: var(--bg-overlay);
  z-index: 999; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.confirm-overlay { z-index: 10000; }
.modal-overlay.active, .confirm-overlay.active { display: flex; animation: overlayIn .22s ease; }
@keyframes overlayIn { from { opacity: 0; } }
.modal {
  background: var(--bg-card-solid);
  border: 0; box-shadow: var(--edge), var(--shadow-lg);
  width: 100%; max-width: 540px;
  max-height: 88vh; overflow-y: auto;
  animation: modalIn .38s var(--ease-out);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px 15px 22px; border-bottom: 0;
  position: sticky; top: 0; z-index: 2;
}
.modal-header h3 { font-family: var(--font-cond); font-style: normal; font-size: 1.65rem; font-weight: 700; text-transform: uppercase; color: var(--strip-ink); line-height: 1.05; }
.modal-header .page-sub { color: var(--strip-ink-2); }
.modal-close {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: var(--strip-ink); border: 0; color: var(--strip);
  font-size: 20px; cursor: pointer; line-height: 1;
  transition: background-color var(--transition), color var(--transition);
}
.modal-close:hover { color: #fff; background: var(--red); }
.modal-body { padding: 22px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; background: rgba(0, 0, 0, .2); box-shadow: inset 0 1px 0 var(--hair); border-top: 0; }
.confirm-box {
  background: var(--bg-card-solid);
  border: 0; box-shadow: var(--edge), inset 0 3px 0 var(--orange), var(--shadow-lg);
  padding: 28px 26px 22px; max-width: 420px; width: 100%;
  text-align: center;
  animation: modalIn .38s var(--ease-out);
}
.confirm-box::before {
  content: "!"; display: flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; margin: 0 auto 16px;
  background: var(--orange); color: var(--strip-ink); font-family: var(--font-cond); font-style: normal; font-weight: 800; font-size: 28px;
}
.confirm-box p { font-size: 1rem; color: var(--text-sec); margin-bottom: 22px; line-height: 1.55; }
.confirm-box .btn-group { justify-content: center; }
.confirm-box .btn { min-width: 110px; }

.editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.editor-field-wide { grid-column: 1 / -1; }

/* ─── Action sheet ───────────────────────────────────── */
.action-sheet { display: flex; flex-direction: column; gap: 4px; }
.action-row {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 10px 13px; font-family: var(--font);
  border: 0; background: var(--bg-2); box-shadow: var(--edge);
  color: var(--text-sec); cursor: pointer; text-align: left;
  transition: background-color .18s var(--ease-out), color .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
.action-row:hover { background: var(--bg-3); color: var(--text); box-shadow: inset 3px 0 0 var(--tint); }
.action-row-danger:hover { box-shadow: inset 3px 0 0 var(--red); }
.action-row-warning:hover { box-shadow: inset 3px 0 0 var(--orange); }
.action-row-icon {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--tag); color: var(--text-sec); flex-shrink: 0;
}
.action-row-icon svg { width: 16px; height: 16px; }
.action-row-danger .action-row-icon { background: rgba(var(--red-rgb), .2); color: #f07a7e; }
.action-row-warning .action-row-icon { background: rgba(var(--orange-rgb), .2); color: var(--orange); }
.action-row-copy { flex: 1; font-family: var(--font-cond); font-style: normal; font-size: 1.08rem; font-weight: 600; text-transform: uppercase; color: inherit; }
.action-row-arrow { color: var(--text-muted); display: inline-flex; transition: transform .2s var(--ease-out); }
.action-row:hover .action-row-arrow { transform: translateX(3px); color: var(--tint-hi); }
.action-row-arrow svg { width: 14px; height: 14px; }

/* ─── Toasts ─────────────────────────────────────────── */
.toast-container { position: fixed; top: 76px; right: 18px; z-index: 20000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  position: relative; overflow: hidden; pointer-events: auto;
  padding: 12px 16px 14px 14px; font-size: .95rem; font-weight: 500;
  display: flex; align-items: center; gap: 11px; max-width: 380px; min-width: 260px;
  background: rgba(21, 22, 27, .96); color: var(--text);
  border: 0; box-shadow: var(--edge), inset 3px 0 0 var(--tint), var(--shadow-lg);
  animation: toastIn .4s var(--ease-out);
}
.toast svg { width: 18px; height: 18px; flex-shrink: 0; padding: 4px; box-sizing: content-box; }
.toast::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: currentColor; opacity: .5; transform-origin: left;
  animation: toastBar var(--toast-duration, 3.5s) linear forwards;
}
.toast-success { box-shadow: var(--edge), inset 3px 0 0 var(--green), var(--shadow-lg); }
.toast-error   { box-shadow: var(--edge), inset 3px 0 0 var(--red), var(--shadow-lg); }
.toast-warning { box-shadow: var(--edge), inset 3px 0 0 var(--orange), var(--shadow-lg); }
.toast-info    { box-shadow: var(--edge), inset 3px 0 0 var(--blue), var(--shadow-lg); }
.toast-success svg { color: var(--green); background: var(--success-dim); }
.toast-error svg   { color: #f07a7e; background: var(--danger-dim); }
.toast-warning svg { color: var(--orange); background: var(--warning-dim); }
.toast-info svg    { color: #8db5ff; background: var(--info-dim); }
.toast-success::after { background: var(--green); }
.toast-error::after   { background: var(--red); }
.toast-warning::after { background: var(--orange); }
.toast-info::after    { background: var(--blue); }
@keyframes toastIn { from { opacity: 0; transform: translateX(36px); } }
@keyframes toastBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ─── Console ────────────────────────────────────────── */
.console-box {
  background: #09070f;
  font-family: var(--font-mono); font-size: .8rem; line-height: 1.65;
  padding: 14px 16px; max-height: 560px; overflow-y: auto;
  color: #d3cfe0; white-space: pre-wrap; word-break: break-word;
  box-shadow: var(--edge);
}
.console-line {
  display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: start;
  padding: 3px 0; border-bottom: 1px solid rgba(255, 255, 255, .04);
  animation: consoleIn .3s ease both;
}
@keyframes consoleIn { from { opacity: 0; transform: translateX(-4px); } }
.console-line:last-child { border-bottom: none; }
.console-time { color: #625d78; font-size: .72rem; user-select: none; }
.console-badge {
  display: inline-flex; align-items: center; min-height: 19px; padding: 0 7px;
  border: 0; font-family: var(--font-cond); font-style: normal; text-transform: uppercase;
  font-size: .8rem; font-weight: 700; line-height: 1.2; white-space: nowrap; user-select: none;
}
.console-badge--default { background: var(--tag); color: #cbd5e1; }
.console-badge--script  { background: rgba(var(--tint-rgb), .22); color: #c2b4fa; }
.console-badge--system  { background: rgba(var(--blue-rgb), .18); color: #93c5fd; }
.console-badge--cmd     { background: rgba(var(--orange-rgb), .18); color: #fcd34d; }
.console-badge--ucp     { background: rgba(45, 212, 191, .16); color: #5eead4; }
.console-message { min-width: 0; color: #d3cfe0; }
.console-line--muted .console-message { color: #98a2b3; }
.console-line--info .console-message { color: #dbeafe; }
.console-line--warn .console-message { color: #fde68a; }
.console-line--error .console-message { color: #fca5a5; }
.console-line--success .console-message { color: #86efac; }
.console-line--command .console-message { color: #c2b4fa; }
.console-line--command .console-time { color: var(--tint-hi); }
.console-line--error .console-badge { background: rgba(var(--red-rgb), .2); color: #fca5a5; }
.console-line--warn .console-badge { background: rgba(var(--orange-rgb), .2); color: #fcd34d; }
.console-message strong { font-weight: 700; color: inherit; }
.console-message .console-keyword-error { color: #f87171; font-weight: 700; }
.console-message .console-keyword-warn { color: #fbbf24; font-weight: 700; }
.console-message .console-keyword-ok { color: #4ade80; font-weight: 700; }
.console-message .console-path { color: #93c5fd; word-break: break-all; }
.console-message .console-inline { color: #e9d5ff; }
.console-empty { padding: 28px 0; text-align: center; color: var(--text-muted); }
.console-input-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; background: rgba(6, 4, 12, .92); box-shadow: inset 0 1px 0 var(--hair);
  transition: box-shadow var(--transition);
}
.console-input-row:focus-within { box-shadow: inset 0 -2px 0 var(--tint); }
.console-prompt { color: var(--tint-hi); font-family: var(--font-mono); font-size: .86rem; font-weight: 700; }
.console-input-row input {
  flex: 1; background: none; border: none; color: var(--text);
  font-family: var(--font-mono); font-size: .83rem; outline: none;
}

/* ─── Grids & misc components ────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.perm-grid .form-check { padding: 6px 8px; transition: background-color var(--transition); }
.perm-grid .form-check:hover { background: var(--bg-2); }
.perm-cloud { display: flex; flex-wrap: wrap; gap: 4px; }
.staff-cell { display: flex; align-items: center; gap: 10px; }
.staff-link { color: inherit; font-weight: inherit; }
.staff-link:hover { color: var(--primary-text); }
.user-avatar-inline {
  width: 34px; height: 34px;
  background: linear-gradient(145deg, rgba(var(--tint-rgb), .75), var(--bg-3));
  color: #f4f2fa; display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-cond); font-style: normal; font-weight: 800; font-size: 1.05rem; flex-shrink: 0;
}

.server-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 0 16px 0 0; margin-bottom: 26px; min-height: 64px;
  background: var(--bg-card); border: 0; box-shadow: var(--edge), var(--shadow);
}
.server-bar .server-status { display: flex; align-items: center; gap: 14px; flex: 1; align-self: stretch; }
.server-bar .server-status .status-chip { height: auto; align-self: stretch; padding: 0 18px; }
.server-bar .server-name { font-family: var(--font-cond); font-style: normal; font-weight: 700; font-size: 1.6rem; text-transform: uppercase; }

.kv-row { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; font-size: .93rem; border-bottom: 1px dashed var(--hair); }
.kv-row:last-child { border-bottom: none; }
.kv-row .kv-label { color: var(--text-muted); font-family: var(--font-cond); font-style: normal; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.kv-row .kv-value { color: var(--text); font-weight: 600; text-align: right; }

.progress { height: 8px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.progress-bar { height: 100%; background: var(--tint); transition: width .6s var(--ease-out); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 2px; padding: 14px 18px; }
.pagination button {
  min-width: 34px; height: 34px; padding: 0 10px;
  font-family: var(--font-cond); font-style: normal; font-size: 1rem; font-weight: 700;
  background: var(--bg-2); border: 0; box-shadow: var(--edge);
  color: var(--text-sec); cursor: pointer; transition: background-color .16s ease, color .16s ease;
}
.pagination button:hover:not(:disabled) { background: var(--bg-3); color: var(--text); }
.pagination button.active { background-color: var(--strip); background-image: var(--band); color: var(--strip-ink); box-shadow: inset 0 -2px 0 var(--tint); }
.pagination button:disabled { opacity: .3; cursor: not-allowed; }

/* ─── Empty / loading ────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 20px; color: var(--text-muted); text-align: center;
}
.empty-state svg { width: 42px; height: 42px; margin-bottom: 14px; opacity: .35; }
.empty-state h3 { font-size: 1.3rem; color: var(--text-sec); margin-bottom: 4px; }
.empty-state p { font-size: .9rem; }
.spinner {
  width: 26px; height: 26px;
  border: 3px solid rgba(255, 255, 255, .14); border-top-color: var(--tint); border-right-color: var(--tint);
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-center { display: flex; align-items: center; justify-content: center; padding: 44px; }
.skeleton {
  min-height: 12px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .04) 0%, rgba(255, 255, 255, .09) 50%, rgba(255, 255, 255, .04) 100%);
  background-size: 200% 100%; animation: shimmerBg 1.4s ease-in-out infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes shimmerBg { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ─── Helpers ────────────────────────────────────────── */
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-6  { gap: 6px; }
.gap-10 { gap: 10px; }
.mb-12  { margin-bottom: 12px; }
.mb-16  { margin-bottom: 16px; }
.mb-24  { margin-bottom: 24px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.hidden { display: none !important; }
.mono   { font-family: var(--font-mono); }
.mono-small { font-family: var(--font-mono); font-size: .78rem; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-success { color: var(--green); }
.text-danger  { color: #f07a7e; }
.text-warning { color: var(--orange); }
.text-muted   { color: var(--text-muted); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-family: var(--font-cond); font-style: normal; font-weight: 600; text-transform: uppercase; font-size: .92rem; color: var(--text-sec); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 9px; height: 9px; }
.chart-wrap { position: relative; }

/* ─── Login: tint field with square shards, strip-headed card ─── */
.login-page {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px; overflow: hidden;
  background:
    radial-gradient(90% 70% at 15% 10%, rgba(var(--tint-rgb), .32), rgba(var(--tint-rgb), 0) 60%),
    radial-gradient(70% 60% at 90% 95%, rgba(var(--tint-rgb), .18), rgba(var(--tint-rgb), 0) 65%);
}
.login-orb { position: absolute; pointer-events: none; background: rgba(var(--tint-rgb), .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); animation: shard 22s ease-in-out infinite alternate; }
.login-orb.a { width: 420px; height: 420px; top: -140px; left: -120px; transform: rotate(18deg); }
.login-orb.b { width: 300px; height: 300px; bottom: -110px; right: -70px; transform: rotate(-12deg); animation-delay: -7s; background: rgba(var(--tint-rgb), .1); }
.login-orb.c { display: block; width: 120px; height: 120px; top: 18%; right: 14%; transform: rotate(32deg); animation-delay: -12s; background: rgba(190, 187, 201, .07); }
@keyframes shard { to { translate: 30px 24px; rotate: 8deg; } }
.login-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px; padding: 0 30px 26px;
  background: rgba(21, 22, 27, .9);
  border: 0; box-shadow: var(--edge), var(--shadow-lg);
  animation: modalIn .55s var(--ease-out) both;
}
.login-header {
  position: relative; margin: 0 -30px 26px; padding: 18px 26px 18px 82px; text-align: left;
  background-color: var(--strip); background-image: var(--band); color: var(--strip-ink);
  box-shadow: inset 0 -3px 0 var(--tint); min-height: 86px;
}
.login-header .brand-icon {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%); margin: 0;
  width: 48px; height: 48px; font-size: 24px; background: var(--strip-ink); background-image: none; color: var(--strip);
  box-shadow: inset -3px 0 0 var(--tint);
}
.login-header h1 { font-size: 2rem; font-weight: 800; color: var(--strip-ink); line-height: 1; }
.login-header p { font-family: var(--font-cond); font-style: normal; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; font-size: .92rem; color: var(--strip-ink-2); margin-top: 4px; }
.login-error {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  background: rgba(var(--red-rgb), .16); color: #f07a7e; padding: 10px 14px;
  font-family: var(--font-cond); font-style: normal; text-transform: uppercase; font-size: 1rem; font-weight: 700; margin-bottom: 18px;
  box-shadow: inset 3px 0 0 var(--red); animation: shake .45s ease;
}
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 14px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; transition: color var(--transition); }
.input-icon .form-input { padding-left: 42px; height: 46px; }
.input-icon:focus-within svg { color: var(--tint-hi); }
.input-icon .toggle-pw {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 6px;
  display: inline-flex;
}
.input-icon .toggle-pw:hover { color: var(--text); background: var(--bg-3); }
.input-icon .toggle-pw svg { position: static; transform: none; }
.login-card .btn-primary { width: 100%; height: 48px; font-size: 1.3rem; margin-top: 8px; }
.login-footer { margin-top: 20px; text-align: center; font-family: var(--font-cond); font-style: normal; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; font-size: .86rem; color: var(--text-dim); }
.btn .btn-spinner { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .7s linear infinite; }

/* ─── Mobile ─────────────────────────────────────────── */
.sidebar-backdrop { display: none; position: fixed; inset: 0; z-index: 190; background: var(--bg-overlay); }
@media (max-width: 1100px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-105%); box-shadow: var(--shadow-lg); background: rgba(13, 14, 18, .98); }
  .sidebar.open { transform: none; }
  .sidebar.open ~ .sidebar-backdrop, body.sidebar-open .sidebar-backdrop { display: block; animation: overlayIn .25s ease; }
  .main-content { margin-left: 0; padding: 0 16px 40px; }
  .topbar { margin: 0 -16px 20px; padding: 0 12px; }
  .topbar-menu {
    display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; flex-shrink: 0;
    background: rgba(255, 255, 255, .05); border: 0; color: var(--text); cursor: pointer;
  }
  .topbar-menu svg { width: 18px; height: 18px; }
  .topbar-time, .topbar-crumbs span, .topbar-crumbs .sep, .topbar-server .mode-label { display: none; }
  .page-title { font-size: 2.3rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .form-row { flex-direction: column; }
  .editor-grid { grid-template-columns: 1fr; }
  .perm-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .stats-grid { grid-template-columns: 1fr; }
  .topbar-status .label { display: none; }
  .topbar-server button { padding: 0 9px; font-size: .95rem; }
}

/* ─── Reduced motion ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ─── Player action panel ────────────────────────────── */
.modal.pa-modal { max-width: 640px; }
.pa-head { display: flex; align-items: center; gap: 14px; padding: 16px 16px 17px 18px; }
.pa-avatar {
  width: 54px; height: 54px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--strip-ink); color: var(--strip);
  font-family: var(--font-cond); font-style: normal; font-weight: 800; font-size: 1.7rem;
  box-shadow: inset -3px 0 0 var(--tint);
}
.pa-ident { flex: 1; min-width: 0; }
.pa-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pa-name-row h3 { font-family: var(--font-cond); font-style: normal; font-size: 1.75rem; font-weight: 800; text-transform: uppercase; color: var(--strip-ink); line-height: 1; word-break: break-word; }
.pa-sub { font-size: .8rem; color: var(--strip-ink-2); margin-top: 4px; font-family: var(--font-mono); word-break: break-all; }
.pa-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; padding: 2px; background: rgba(0, 0, 0, .25); border: 0; }
.pa-stat { padding: 12px 16px; background: var(--bg-1); min-width: 0; border: 0; }
.pa-stat-label { font-family: var(--font-cond); font-style: normal; font-size: .9rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); font-weight: 600; }
.pa-stat-value { font-family: var(--font-cond); font-style: normal; font-size: 1.35rem; font-weight: 700; color: var(--text); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.pa-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 4px; padding: 16px 22px; }
.pa-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 8px; cursor: pointer;
  font-family: var(--font-cond); font-style: normal; font-size: 1.02rem; font-weight: 600; text-transform: uppercase;
  background: var(--bg-2); border: 0; box-shadow: var(--edge); color: var(--text-sec);
  transition: background-color .16s ease, color .16s ease, box-shadow .16s ease, transform .12s var(--ease-out);
}
.pa-btn svg { width: 19px; height: 19px; }
.pa-btn:hover { color: var(--text); background: var(--bg-3); box-shadow: inset 0 -3px 0 var(--tint); }
.pa-btn:active { transform: scale(.96); }
.pa-btn.tone-info:hover    { color: #8db5ff; box-shadow: inset 0 -3px 0 var(--blue); }
.pa-btn.tone-warning:hover { color: var(--orange); box-shadow: inset 0 -3px 0 var(--orange); }
.pa-btn.tone-danger:hover  { color: #f07a7e; box-shadow: inset 0 -3px 0 var(--red); }
.pa-btn.tone-success:hover { color: var(--green); box-shadow: inset 0 -3px 0 var(--green); }
.pa-btn.tone-ban { color: #f07a7e; background: rgba(var(--red-rgb), .16); box-shadow: inset 0 -2px 0 rgba(var(--red-rgb), .55); }
.pa-btn.tone-ban:hover { color: #fff; background: var(--red); box-shadow: none; }
.pa-links { display: flex; gap: 6px; padding: 0 22px 16px; flex-wrap: wrap; }
.pa-section { padding: 14px 22px 20px; box-shadow: inset 0 1px 0 var(--hair); border-top: 0; }
.pa-id-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--hair); }
.pa-id-row:last-child { border-bottom: none; }
.pa-id-kind { width: 76px; flex-shrink: 0; font-family: var(--font-cond); font-style: normal; font-size: .92rem; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.pa-id-value { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: .8rem; color: var(--text-sec); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pa-id-row .btn-icon { width: 28px; height: 28px; }
@media (max-width: 600px) {
  .pa-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ─── Page: Staff & Groups (staff.html keeps its own inline styles; these win by specificity) ─── */
.main-content .st-item { border: 0; }
.main-content .st-item:hover { background: rgba(255, 255, 255, .05); }
.main-content .st-item.active { color: var(--strip-ink); background-color: var(--strip); background-image: var(--band); box-shadow: inset 4px 0 0 var(--tint); border-color: transparent; }
.main-content .st-item.active .st-name { color: var(--strip-ink); }
.main-content .st-item.active .st-sub { color: var(--strip-ink-2); }
.main-content .st-item.active .st-prio { background: var(--strip-ink); color: var(--strip); }
.main-content .st-item .st-name { font-family: var(--font-cond); font-style: normal; font-size: 1.12rem; font-weight: 700; text-transform: uppercase; }
.main-content .st-item .st-prio { font-family: var(--font-cond); font-style: normal; font-weight: 700; font-size: .9rem; background: var(--tag); }
.main-content .st-head { background-color: var(--strip); background-image: var(--band); color: var(--strip-ink); box-shadow: inset 0 -3px 0 var(--tint); border-bottom: 0; }
.main-content .st-head h2 { font-size: 1.6rem; font-weight: 800; color: var(--strip-ink); }
.main-content .st-head .text-muted { color: var(--strip-ink-2); }
.main-content .st-head .btn-ghost { background: var(--strip-ink); color: var(--strip); box-shadow: none; }
.main-content .st-cat { border-top: 0; box-shadow: inset 0 1px 0 var(--hair); }
.main-content .st-cat-title, .main-content .st-matrix tr.cat td { font-family: var(--font-cond); font-style: normal; font-size: .98rem; font-weight: 600; letter-spacing: .04em; }
.main-content .st-perm { border: 0; background: var(--bg-2); box-shadow: var(--edge); }
.main-content .st-perm:hover { box-shadow: inset 0 0 0 1px var(--primary-border); }
.main-content .st-perm.checked { background: rgba(var(--tint-rgb), .2); box-shadow: inset 3px 0 0 var(--tint); }
.main-content .seg { border: 0; gap: 2px; }
.main-content .seg button { font-family: var(--font-cond); font-style: normal; font-size: .95rem; text-transform: uppercase; background: var(--bg-2); }
.main-content .seg button + button { border-left: 0; }
.main-content .seg button.on.inherit { background: var(--strip); color: var(--strip-ink); }
.main-content .eff { font-family: var(--font-cond); font-style: normal; text-transform: uppercase; font-size: .88rem; }
.main-content .st-info { border: 0; background: var(--bg-1); box-shadow: var(--edge), inset 3px 0 0 var(--tint); }
.main-content .st-footer { border-top: 0; box-shadow: inset 0 1px 0 var(--hair); background: rgba(0, 0, 0, .18); }

/* ═══ Rail layer (2026-10-29): sidebar as a rail, gradient main action, rounded controls ═══ */
.sidebar { background: #0d0e12; box-shadow: inset -1px 0 0 rgba(255, 255, 255, .06); }
.nav-item { margin: 2px 12px; padding-left: 14px; border-radius: 10px; position: relative; }
.nav-item.active { background: var(--bg-2); color: #fff; box-shadow: none; }
.nav-item.active svg { color: #3dd6ff; }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--gradient); }
.btn-primary, .btn.primary, button.primary { background: var(--gradient); color: #0b0c10; border-color: transparent; }
.btn-primary:hover, .btn.primary:hover, button.primary:hover { background: var(--gradient); filter: brightness(1.08); }
.card { border-radius: var(--radius-lg); overflow: hidden; }
.card-header, .modal-header, .pa-head { background-color: transparent; }
.stat-card { border-radius: var(--radius-lg); box-shadow: var(--edge), var(--shadow); }
.stat-card::after { display: none; }
.brand-mark { width: 44px; height: 44px; margin: 10px 0 10px 14px; border-radius: 12px; background: var(--gradient); color: #0b0c10; box-shadow: none; font-size: 1.25rem; }
.login-header { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.login-header .brand-icon { border-radius: 12px; background: var(--gradient); color: #0b0c10; box-shadow: none; }
.login-card { border-radius: var(--radius-xl); overflow: hidden; }
.login-orb { display: none !important; }
.login-page { background: radial-gradient(60% 70% at 85% 0%, rgba(61, 214, 255, .14), rgba(61, 214, 255, 0) 70%), radial-gradient(70% 80% at 0% 100%, rgba(124, 140, 255, .22), rgba(124, 140, 255, 0) 70%), linear-gradient(160deg, #11131b, #08090d); }
tbody tr:hover td:first-child, .action-row:hover { box-shadow: inset 3px 0 0 #3dd6ff; }

/* IP addresses (public/js/panel.js, lib/privacy.js): always blurred; with the right a click shows / hides them */
.ip-mask { filter: blur(5px); cursor: pointer; user-select: none; border-radius: 4px; transition: filter .2s; }
.ip-mask.shown { filter: none; user-select: text; }
.ip-mask.locked { cursor: not-allowed; }
