:root {
  --void:    #131319;
  --panel:   #1b1c24;
  --panel-2: #21222c;
  --seam:    #2a2b36;
  --seam-lo: #212229;
  --ink:     #eef0f5;
  --dim:     #8d8fa0;
  --faint:   #5c5e6c;
  --brand:   #8b7fff;
  --brand-dim: rgba(139,127,255,.14);

  --open:     #f2a93c;
  --progress: #5b9dff;
  --resolved: #4fc38a;
  --closed:   #6d6f7d;
  --urgent:   #ff5d5d;

  --radius: 8px;
  --radius-lg: 12px;
  --gap: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--void); color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display { font-family: 'Space Grotesk', 'Inter', sans-serif; }
.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }

a { color: var(--brand); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── Layout: fixed left sidebar + main content column ── */
#app.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 252px; flex: none;
  background: var(--panel); border-right: 1px solid var(--seam);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 100;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 22px 22px 20px; border-bottom: 1px solid var(--seam);
}
.sidebar-brand img.logo-mark { height: 27px; width: auto; opacity: .95; flex: none; }
.sidebar-brand .brand-word { font-family: 'Space Grotesk', sans-serif; font-size: 15.5px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.sidebar-brand .brand-sub {
  font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; font-weight: 500;
  color: var(--brand); letter-spacing: 1.2px; margin-top: 2px;
}

.side-nav { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; }
.side-link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 8px;
  background: none; border: none; color: var(--dim);
  font-size: 13.5px; font-weight: 500; font-family: 'Inter', sans-serif;
  text-align: left; cursor: pointer; position: relative; width: 100%;
  transition: background .15s ease, color .15s ease;
}
.side-link svg { flex: none; opacity: .8; transition: opacity .15s ease; }
.side-link:hover { background: var(--panel-2); color: var(--ink); }
.side-link.active { background: var(--brand-dim); color: var(--brand); }
.side-link.active svg { opacity: 1; }
.side-link .count-badge { margin-left: auto; font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--faint); }
.side-link.active .count-badge { color: var(--brand); }

.sidebar-foot { padding: 14px 16px 18px; border-top: 1px solid var(--seam); display: flex; flex-direction: column; gap: 10px; }
.staff-card { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.staff-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'IBM Plex Mono', monospace;
  background: var(--panel-2); color: var(--dim); border: 1px solid var(--seam);
  border-radius: 5px; padding: 4px 10px; font-size: 11px; letter-spacing: .3px;
}
.staff-name { font-size: 12.5px; color: var(--ink); font-weight: 500; }
.staff-logout {
  background: none; border: 1px solid var(--seam); color: var(--dim);
  border-radius: 7px; padding: 8px 12px; font-size: 12px; cursor: pointer; font-family: inherit; text-align: center;
}
.staff-logout:hover { color: var(--ink); border-color: var(--urgent); }

.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page-header {
  padding: 26px 36px 20px; border-bottom: 1px solid var(--seam);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.page-header h1 { font-family: 'Space Grotesk', sans-serif; font-size: 24px; font-weight: 600; color: var(--ink); letter-spacing: -.3px; }
.page-header .page-subtitle { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; color: var(--faint); margin-top: 5px; letter-spacing: .2px; }
.page-header-meta {
  font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--faint);
  text-align: right; letter-spacing: .4px; text-transform: uppercase; white-space: nowrap;
}

main { flex: 1; padding: 26px 36px 48px; max-width: 900px; width: 100%; }

@media (max-width: 900px) {
  #app.shell { flex-direction: column; }
  .sidebar { position: static; height: auto; width: 100%; flex-direction: row; align-items: center; }
  .sidebar-brand { border-bottom: none; border-right: 1px solid var(--seam); padding: 14px 16px; }
  .side-nav { flex-direction: row; overflow-x: auto; padding: 10px; }
  .side-link span { white-space: nowrap; }
  .sidebar-foot { border-top: none; border-left: 1px solid var(--seam); flex-direction: row; align-items: center; padding: 10px 16px; }
  .page-header, main { padding-left: 20px; padding-right: 20px; }
}

/* ── Cards ── */
.card {
  background: var(--panel); border: 1px solid var(--seam); border-radius: var(--radius-lg);
  padding: var(--gap);
  box-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 20px 40px -28px rgba(0,0,0,.6);
}
.card + .card { margin-top: var(--gap); }
.card-title { font-family: 'Space Grotesk', sans-serif; font-size: 15px; font-weight: 600; margin-bottom: 10px; }

.panel-section + .panel-section {
  border-top: 1px solid var(--seam); margin-top: 20px; padding-top: 20px;
}
.panel-section-label {
  display: flex; align-items: baseline; gap: 6px;
  font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .6px; color: var(--faint); margin-bottom: 12px; font-weight: 500;
}

/* ── Form fields ── */
.field-stack { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field-stack:last-child { margin-bottom: 0; }
.field-stack label {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--faint);
  text-transform: uppercase; letter-spacing: .4px;
}
.field-stack input {
  background: var(--panel-2); border: 1px solid var(--seam); color: var(--ink);
  border-radius: 6px; padding: 9px 11px; font-size: 13px; font-family: 'Inter', sans-serif;
}
.field-stack input, .field-stack select {
  background: var(--panel-2); border: 1px solid var(--seam); color: var(--ink);
  border-radius: 6px; padding: 9px 11px; font-size: 13px; font-family: 'Inter', sans-serif;
}
.field-stack input:focus, .field-stack select:focus { outline: none; border-color: var(--brand); }
.field-hint { font-size: 11px; color: var(--faint); margin-top: 2px; }
.field-row-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 480px) { .field-row-2 { grid-template-columns: 1fr; } }

.inline-input-row { display: flex; gap: 8px; align-items: center; }
.inline-input-row input {
  flex: 1; background: var(--panel-2); border: 1px solid var(--seam); color: var(--ink);
  border-radius: 6px; padding: 9px 11px; font-size: 13px; font-family: 'Inter', sans-serif;
}
.inline-input-row input:focus { outline: none; border-color: var(--brand); }

/* ── Filters ── */
.filter-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filter-row input[type="search"] {
  flex: 1; min-width: 220px; background: var(--panel-2); border: 1px solid var(--seam); color: var(--ink);
  border-radius: 6px; padding: 8px 12px; font-size: 13px; font-family: 'IBM Plex Mono', monospace;
}
.filter-row input[type="search"]::placeholder { font-family: 'Inter', sans-serif; }
.filter-row input[type="search"]:focus { outline: none; border-color: var(--brand); }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  color: var(--faint); font-family: 'IBM Plex Mono', monospace; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .6px; padding: 8px 12px 10px; text-align: left;
  border-bottom: 1px solid var(--seam); font-weight: 500;
}
td { padding: 0 12px; border-bottom: 1px solid var(--seam-lo); vertical-align: middle; height: 52px; }
tr.hub-row { cursor: pointer; }
tr.hub-row:hover td { background: rgba(139,127,255,.05); }
tr:last-child td { border-bottom: none; }

/* ── Modals ── */
.modal-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(6,6,9,.72); z-index: 300; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--seam); border-radius: var(--radius-lg);
  padding: 22px 24px 24px;
  box-shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 20px 40px -28px rgba(0,0,0,.6);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h3 { font-family: 'Space Grotesk', sans-serif; font-size: 17px; font-weight: 600; }
.modal-close {
  background: none; border: 1px solid var(--seam); color: var(--dim);
  border-radius: 6px; padding: 6px 10px; cursor: pointer; font-family: inherit; flex: none;
}
.modal-close:hover { color: var(--ink); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 6px; font-size: 13px; font-weight: 500;
  border: none; cursor: pointer; transition: opacity .15s, transform .1s; font-family: inherit;
}
.btn:active { transform: scale(.98); }
.btn:hover { opacity: .88; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary  { background: var(--brand); color: #0f0f14; font-weight: 600; box-shadow: 0 6px 16px -6px rgba(139,127,255,.55); }
.btn-danger   { background: var(--urgent); color: #1a0d0d; font-weight: 600; }
.btn-ghost    { background: transparent; border: 1px solid var(--seam); color: var(--ink); }
.btn-sm       { padding: 5px 11px; font-size: 12px; }
.btn-block    { width: 100%; justify-content: center; }

/* ── Pills / badges ── */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 4px; font-size: 11px; font-weight: 600;
  font-family: 'IBM Plex Mono', monospace; letter-spacing: .2px;
  white-space: nowrap;
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-resolved { background: rgba(79,195,138,.13);  color: var(--resolved); }
.pill-open     { background: rgba(242,169,60,.13);  color: var(--open); }
.pill-urgent   { background: rgba(255,93,93,.13);   color: var(--urgent); }
.pill-progress { background: rgba(91,157,255,.13);  color: var(--progress); }
.pill-closed   { background: rgba(109,111,125,.16); color: var(--closed); }

/* ── Detail panel (slide-in from the right) ── */
.detail-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(8,8,11,.7); z-index: 200; justify-content: flex-end;
}
.detail-backdrop.open { display: flex; }
.detail-panel {
  background: var(--void); border-left: 4px solid var(--seam);
  width: 100%; max-width: 620px; height: 100%; overflow-y: auto;
  padding: 0 0 60px;
  box-shadow: -30px 0 60px rgba(0,0,0,.35);
}
.detail-head {
  padding: 24px 32px 20px; border-bottom: 1px solid var(--seam);
  position: sticky; top: 0; background: var(--void); z-index: 5;
}
.detail-head-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.detail-close {
  background: none; border: 1px solid var(--seam); color: var(--dim);
  border-radius: 6px; padding: 6px 10px; cursor: pointer; font-family: inherit; flex: none;
}
.detail-close:hover { color: var(--ink); }
.detail-title { font-family: 'Space Grotesk', sans-serif; font-size: 20px; font-weight: 600; margin: 0 0 6px; }
.detail-subtitle { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; color: var(--faint); }
.detail-pills { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }

.detail-body { padding: 24px 32px 40px; }
.detail-section { margin-bottom: 26px; padding-bottom: 26px; border-bottom: 1px solid var(--seam); }
.detail-section:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.detail-section h4 {
  font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .6px; color: var(--faint); margin-bottom: 12px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
}

/* ── Small info rows / lists reused across Security, Moderation, Warnings, Notes ── */
.item-list { display: flex; flex-direction: column; gap: 9px; }
.item-row {
  background: var(--panel-2); border: 1px solid var(--seam); border-radius: 8px; padding: 11px 13px;
}
.item-row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.item-row-title { font-size: 12.5px; color: var(--ink); }
.item-row-meta { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; color: var(--faint); margin-top: 4px; }
.item-row-actions { display: flex; gap: 6px; flex: none; }

/* ── Danger zone ── */
.danger-zone-box {
  border: 1px solid rgba(255,93,93,.25); background: rgba(255,93,93,.05);
  border-radius: 10px; padding: 16px 18px;
}
.danger-zone-box p { color: var(--dim); font-size: 12.5px; line-height: 1.6; margin-bottom: 14px; }

.verify-banner {
  background: rgba(242,169,60,.08); border: 1px solid rgba(242,169,60,.25); border-radius: 9px;
  padding: 12px 14px; font-size: 12.5px; color: var(--dim); line-height: 1.6;
}

/* ── Empty state ── */
.empty-state { text-align: center; padding: 52px 24px; color: var(--dim); font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; letter-spacing: .2px; }

/* ── Toast ── */
#toast {
  position: fixed; bottom: 24px; right: 24px; padding: 11px 18px; border-radius: 8px;
  background: var(--resolved); color: #0d1a13; font-size: 13px; font-weight: 600;
  transform: translateY(20px); opacity: 0; transition: .22s; pointer-events: none; z-index: 999;
}
#toast.show { transform: translateY(0); opacity: 1; }
#toast.error { background: var(--urgent); color: #1a0d0d; }

.hidden { display: none !important; }
