/* AxisLauncher Control Center — red-accented charcoal theme shared with the AxisClient menus. */
:root {
  color-scheme: dark;
  --bg: #0a0a0c;
  --surface: #131316;
  --surface-2: #1a1a1e;
  --surface-3: #222227;
  --input: #0f0f12;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --faint: #71717a;
  --accent: #ff4b4b;
  --accent-2: #ff7a59;
  --accent-soft: rgba(255, 75, 75, 0.12);
  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
  --ok: #3dc98a;
  --danger: #f05d6c;
  --warn: #f5a524;
  --r-lg: 16px;
  --r: 11px;
  --r-sm: 8px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 32px -12px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scrollbar-color: #2e2e33 transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

code {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-3);
  color: #fda4a4;
  font-size: 12.5px;
}

.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12px; }
.nowrap { white-space: nowrap; }
.align-right { text-align: right; }
.muted, small, p { color: var(--muted); }
p { margin: 0 0 14px; }
small { font-size: 12px; }

.icon { width: 18px; height: 18px; flex: 0 0 auto; }

/* ================= Shell ================= */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  display: flex;
  flex-direction: column;
  flex: 0 0 256px;
  width: 256px;
  height: 100vh;
  position: sticky;
  top: 0;
  padding: 18px 12px 14px;
  overflow-y: auto;
  background: linear-gradient(180deg, #121215, #0d0d10);
  border-right: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 12px; padding: 6px 10px 18px; }
.brand-logo { width: 38px; height: 30px; object-fit: contain; }
.brand-text { display: grid; line-height: 1.15; }
.brand-text strong { font-size: 15px; font-weight: 800; }
.brand-text small {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sidebar nav { display: grid; gap: 2px; align-content: start; flex: 1; }

.nav-group {
  margin: 14px 12px 4px;
  color: var(--faint);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  color: #c4c4cc;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.sidebar nav a .icon { color: var(--faint); transition: color 0.15s; }
.sidebar nav a:hover { background: rgba(255, 255, 255, 0.04); color: #fff; }
.sidebar nav a:hover .icon { color: #d4d4d8; }
.sidebar nav a.active {
  background: linear-gradient(90deg, rgba(255, 75, 75, 0.18), rgba(255, 75, 75, 0.03));
  box-shadow: inset 2px 0 0 var(--accent);
  color: #fff;
}
.sidebar nav a.active .icon { color: var(--accent); }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}
.sidebar-user .who { flex: 1; min-width: 0; line-height: 1.25; }
.sidebar-user .who strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user .who small { font-size: 11px; }

.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--grad);
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;
  box-shadow: 0 6px 16px -6px rgba(255, 75, 75, 0.6);
}
.avatar--sm { width: 30px; height: 30px; border-radius: 8px; font-size: 13px; box-shadow: none; }

.content {
  flex: 1;
  min-width: 0;
  max-width: 1480px;
  padding: 34px 40px 64px;
  background:
    radial-gradient(900px 380px at 100% 0, rgba(255, 75, 75, 0.06), transparent 70%);
}

/* ================= Page header ================= */

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}
.page-head h1 { margin: 2px 0 4px; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.page-head p { max-width: 680px; margin: 0; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.page-actions form { display: block; }

.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ================= Surfaces ================= */

.panel {
  margin-bottom: 20px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin: -2px 0 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2, .panel > h2 { margin: 0 0 3px; font-size: 16px; font-weight: 700; }
.panel-head p { margin: 0; font-size: 13px; }

.panel--note { background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.panel--note h2 { margin-bottom: 12px; }
.note-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; color: var(--muted); }
.note-list li { padding-left: 16px; position: relative; }
.note-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.two-col {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(400px, 1.1fr);
  gap: 20px;
  align-items: start;
}
.two-col--wide { grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.8fr); }
.two-col--even { grid-template-columns: 1fr 1fr; }
.two-col > * { min-width: 0; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ================= Stats ================= */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat {
  position: relative;
  padding: 18px 20px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.stat::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 75, 75, 0.14), transparent 70%);
}
.stat label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.stat span {
  display: block;
  margin: 6px 0 2px;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat small { color: var(--faint); }
.stat--live label::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(61, 201, 138, 0.2);
  vertical-align: 1px;
}
.stat--warn::after { background: radial-gradient(circle, rgba(245, 165, 36, 0.16), transparent 70%); }
.stat--inline { padding: 12px 18px; box-shadow: none; background: var(--surface-2); }
.stat--inline span { font-size: 22px; margin: 2px 0 0; }

/* ================= Auth ================= */

.shell--auth {
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(700px 420px at 15% 20%, rgba(255, 75, 75, 0.14), transparent 70%),
    radial-gradient(600px 400px at 90% 90%, rgba(255, 122, 89, 0.08), transparent 70%),
    var(--bg);
}
.shell--auth .content { flex: 0 1 940px; padding: 0; background: none; }

.auth-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8);
}

.auth-hero {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 40px;
  background:
    radial-gradient(420px 320px at 0% 0%, rgba(255, 75, 75, 0.28), transparent 70%),
    radial-gradient(360px 260px at 100% 100%, rgba(255, 122, 89, 0.14), transparent 70%),
    #111114;
  border-right: 1px solid var(--line);
}
.auth-logo { width: 150px; height: auto; object-fit: contain; align-self: flex-start; }
.auth-hero h2 { margin: 4px 0 8px; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.auth-hero p { margin-bottom: 20px; }
.auth-points { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; color: #d4d4d8; }
.auth-points li { display: flex; align-items: center; gap: 10px; }
.auth-points .icon {
  width: 22px;
  height: 22px;
  padding: 4px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
}
.auth-hero > small { color: var(--faint); }

.auth-form { display: flex; flex-direction: column; justify-content: center; padding: 44px 40px; }
.auth-form h1 { margin: 0 0 6px; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.auth-form > p { margin-bottom: 24px; }
.auth-form form { gap: 16px; }
.auth-form input { padding: 12px 14px; }
.auth-step { margin-top: 18px; color: var(--faint); text-align: center; }

.code-input {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 22px !important;
  letter-spacing: 0.5em;
  text-align: center;
}

.qr-row { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.qr-box { flex: 0 0 auto; padding: 10px; background: #fff; border-radius: var(--r); }
.qr-box svg { display: block; width: 150px; height: auto; }
.setup-key { display: grid; gap: 8px; color: var(--muted); font-size: 12px; }
.setup-key code { overflow-wrap: anywhere; padding: 10px 12px; color: var(--text); font-size: 13px; letter-spacing: 0.08em; }

/* ================= Forms ================= */

form { display: grid; gap: 14px; }

label {
  display: grid;
  gap: 6px;
  color: #c4c4cc;
  font-size: 12.5px;
  font-weight: 600;
}

input, textarea, select, button, .btn {
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  padding: 10px 12px;
  background: var(--input);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, color 0.15s, filter 0.15s;
}
input:hover, textarea:hover, select:hover { border-color: rgba(255, 255, 255, 0.2); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder, textarea::placeholder { color: #55555c; }
input:disabled, textarea:disabled, select:disabled { opacity: 0.5; cursor: not-allowed; }
textarea { resize: vertical; }

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  border-color: transparent;
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 20px -10px rgba(255, 75, 75, 0.7);
}
button:hover:not(:disabled), .btn:hover { filter: brightness(1.08); color: #fff; }
button:active:not(:disabled) { filter: brightness(0.95); }
button:disabled { cursor: not-allowed; opacity: 0.4; box-shadow: none; }

.btn-ghost, button.btn-ghost {
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: #e4e4e7;
  box-shadow: none;
}
.btn-ghost:hover:not(:disabled), button.btn-ghost:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
  filter: none;
}

button.danger {
  background: rgba(240, 93, 108, 0.08);
  border-color: rgba(240, 93, 108, 0.35);
  color: var(--danger);
  box-shadow: none;
}
button.danger:hover:not(:disabled) { background: var(--danger); border-color: var(--danger); color: #fff; filter: none; }

.btn-sm, button.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-block { width: 100%; padding: 12px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.row-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.row-form .grow { flex: 1 1 220px; }

.form-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.form-grid__full, .check-grid { grid-column: 1 / -1; }

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px 16px;
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
}

/* Toggle switches */
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #e4e4e7;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}
.check input[type="checkbox"] {
  appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: 34px;
  height: 20px;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  cursor: pointer;
}
.check input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #8b8b93;
  transition: transform 0.18s, background 0.18s;
}
.check input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.check input[type="checkbox"]:checked::before { transform: translateX(14px); background: #fff; }

/* ================= Lists ================= */

.item-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.item-list > li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  transition: border-color 0.15s;
}
.item-list > li:hover { border-color: var(--line-strong); }
.item-list > li.is-current { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.item-main { display: grid; flex: 1; min-width: 0; gap: 2px; }
.item-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-note { color: #d4d4d8; font-size: 13px; }
.item-actions { display: flex; gap: 6px; }
.item-actions form { display: block; }

.empty { padding: 28px 12px !important; color: var(--faint); text-align: center; }
.empty--boxed { margin-bottom: 16px; border: 1px dashed var(--line-strong); border-radius: var(--r); }
.item-list > li.empty { justify-content: center; background: none; border-style: dashed; }

/* ================= Chips, pills, tags ================= */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: #d4d4d8;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.chip--accent { background: var(--accent-soft); border-color: rgba(255, 75, 75, 0.3); color: #ff8a8a; }
.chip--live { padding: 6px 12px; font-size: 13px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.chip-row:empty { display: none; }

.live-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(61, 201, 138, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 7px rgba(61, 201, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 201, 138, 0); }
}
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-pill--enabled { background: rgba(61, 201, 138, 0.12); color: var(--ok); }
.status-pill--required { background: rgba(240, 93, 108, 0.12); color: var(--danger); }

.tag {
  display: inline-block;
  margin: 0 4px 4px 0;
  padding: 2px 8px;
  border-radius: 6px;
  background: color-mix(in srgb, currentColor 14%, transparent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.tag-vip { color: #fb923c; }
.tag-dev { color: #ef4444; }
.tag-admin { color: #ff3131; }
.tag-axis { color: #dc2626; }
.legend { display: flex; flex-wrap: wrap; gap: 2px; }

.user-cell { display: flex; align-items: center; gap: 12px; }

.toggle-group {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.toggle-group form { display: block; }
button.seg {
  padding: 5px 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--faint);
  font-size: 12px;
  box-shadow: none;
}
button.seg:hover:not(:disabled) { background: var(--surface-3); color: #fff; filter: none; }
button.seg.is-on { background: var(--accent-soft); color: #ff8a8a; }
button.seg.is-on:hover:not(:disabled) { background: rgba(240, 93, 108, 0.2); color: var(--danger); }

/* ================= Page specifics ================= */

.banner-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--r);
  background: linear-gradient(90deg, rgba(255, 75, 75, 0.22), rgba(255, 122, 89, 0.08));
  border: 1px solid rgba(255, 75, 75, 0.35);
}
.banner-preview__text { flex: 1; min-width: 0; font-weight: 600; white-space: pre-wrap; }
.banner-preview__text:empty::before { content: "Your banner message appears here."; color: var(--faint); font-weight: 400; }
.banner-preview__link {
  padding: 5px 12px;
  border-radius: 7px;
  background: #fff;
  color: #18181b;
  font-size: 12.5px;
  font-weight: 700;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.mode-card { display: grid; gap: 14px; margin: 0; align-content: start; }
.mode-card .panel-head { margin-bottom: 2px; }
.mode-card.is-on { border-color: rgba(240, 93, 108, 0.45); }
.mode-card--danger { background: linear-gradient(180deg, rgba(240, 93, 108, 0.06), var(--surface) 60%); }
.mode-card.license-system { margin-bottom: 20px; }

.sticky-bar {
  position: sticky;
  bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding: 12px 14px 12px 18px;
  background: rgba(26, 26, 30, 0.95);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.8);
  color: var(--muted);
}

.admin-card { display: grid; gap: 16px; margin: 0; }
.admin-card__status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.player-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 20px 0 14px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.player-summary .user-cell { flex: 1 1 260px; }
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.tool {
  grid-template-columns: 1fr auto;
  align-items: end;
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.btn-pair { display: flex; gap: 6px; }

/* Cosmetics: page tabs, player card, owned/not-owned grid */
.page-tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.page-tabs a {
  padding: 7px 14px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.page-tabs a:hover { background: var(--surface-3); color: #fff; }
.page-tabs a.active { background: var(--grad); color: #fff; }
.page-tabs__count, .filter-btn__count { margin-left: 4px; opacity: 0.75; font-weight: 500; }

.player-card { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.player-card__head { width: 64px; height: 64px; border-radius: 12px; background: var(--surface-2); image-rendering: pixelated; }
.player-card__who { flex: 1 1 220px; display: grid; gap: 2px; }
.player-card__who h2 { margin: 0; font-size: 20px; }
.player-card .tool-grid { margin: 0; }

.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.bulk-bar__count { flex: 1; color: var(--muted); font-size: 13px; }

.cos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  max-height: 640px;
  overflow: auto;
}
.cos-grid__empty { grid-column: 1 / -1; }
.cos-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.cos-card[hidden] { display: none; }
.cos-card.is-owned { border-color: rgba(61, 201, 138, 0.35); background: linear-gradient(180deg, rgba(61, 201, 138, 0.06), var(--surface-2)); }
.cos-card__pick { padding-top: 2px; }
.cos-card__body { display: grid; gap: 2px; min-width: 0; }
.cos-card__body strong, .cos-card__body small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip--ok { background: rgba(61, 201, 138, 0.12); border-color: rgba(61, 201, 138, 0.3); color: var(--ok); }

/* Collapsible create panel */
.collapsible { padding: 0; }
.collapsible > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  cursor: pointer;
  list-style: none;
}
.collapsible > summary::-webkit-details-marker { display: none; }
.collapsible > summary > span:first-child { display: grid; gap: 2px; }
.collapsible > summary strong { font-size: 16px; }
.collapsible[open] > summary { border-bottom: 1px solid var(--line); }
.collapsible[open] > summary .btn { background: var(--surface-3); box-shadow: none; }
.collapsible > form { padding: 20px 22px 22px; }

/* Catalog row editor: a CSS-only modal; the summary's backdrop closes it on click. */
.row-edit-cell { width: 1%; text-align: right; }
.row-edit > summary { list-style: none; }
.row-edit > summary::-webkit-details-marker { display: none; }
.row-edit[open] > summary::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(5, 5, 7, 0.72);
  cursor: default;
}
.row-edit__body {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 41;
  display: grid;
  gap: 16px;
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 22px;
  transform: translate(-50%, -50%);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.9);
  text-align: left;
}
.row-edit__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
}
.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(240, 93, 108, 0.25);
  border-radius: var(--r);
  background: rgba(240, 93, 108, 0.05);
}

/* ================= Filters & tables ================= */

.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 14px; }
.filter-search { flex: 0 1 340px; min-width: min(340px, 100%); }
.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  background: var(--input);
  border: 1px solid var(--line);
  border-radius: 10px;
}
button.filter-btn {
  padding: 6px 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  box-shadow: none;
}
button.filter-btn:hover:not(:disabled) { background: var(--surface-3); color: #fff; filter: none; }
button.filter-btn.active { background: var(--grad); color: #fff; }

.table-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}
.table-scroll table { min-width: 760px; }
.table-scroll--catalog { max-height: 680px; }
.table-scroll--player { max-height: 440px; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
tbody tr:last-child td { border-bottom: 0; }

.inline { display: inline-grid; margin: 2px 0 2px 4px; }

/* ================= Flash ================= */

.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  color: var(--text);
}
.flash::before { content: ""; width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--muted); }
.flash.success { background: rgba(61, 201, 138, 0.08); border-color: rgba(61, 201, 138, 0.3); }
.flash.success::before { background: var(--ok); }
.flash.error { background: rgba(240, 93, 108, 0.08); border-color: rgba(240, 93, 108, 0.3); }
.flash.error::before { background: var(--danger); }

/* AJAX results show as a toast so they're visible from inside the row editor. */
.flash[data-ajax-flash] {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  max-width: min(420px, calc(100vw - 48px));
  margin: 0;
  background: #1c1c21;
  box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.9);
}

/* ================= Responsive ================= */

@media (max-width: 1000px) {
  .two-col, .two-col--wide, .two-col--even { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .shell { display: block; }
  .sidebar { position: static; width: auto; height: auto; }
  .content { padding: 24px 16px 48px; }
  .auth-card { grid-template-columns: 1fr; }
  .auth-hero { gap: 18px; padding: 28px; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-points, .auth-hero > small { display: none; }
  .auth-form { padding: 28px; }
  .field-row { grid-template-columns: 1fr; }
  .qr-row { flex-direction: column; align-items: stretch; }
  .qr-box { align-self: center; }
  .item-list > li { flex-wrap: wrap; }
}
