/* BettorHub — moderation console styles (demo).
 * Loaded after theme.css. Every colour uses the shared --bh-* custom properties with
 * a self-contained fallback, so admin.html is readable even before theme.css exists.
 */

/* ------------------------------------------------------------------ *
 * Base
 * ------------------------------------------------------------------ */
*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bh-bg, #0b1020);
  color: var(--bh-text, #e8ecf8);
  font-family: var(--bh-font, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
  font-size: 15px;
  line-height: 1.5;
}

h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
p { margin: 0 0 .75rem; }
ul, ol { margin: 0; }
a { color: var(--bh-accent, #7aa2ff); }
a:hover { color: var(--bh-accent-strong, #a8c0ff); }
strong { font-weight: 700; }
code, .mono {
  font-family: var(--bh-mono, ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace);
  font-size: .9em;
}

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

:focus-visible {
  outline: 3px solid var(--bh-accent, #7aa2ff);
  outline-offset: 2px;
  border-radius: 4px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 120;
  padding: 10px 18px;
  border: 0;
  border-radius: 0 0 var(--bh-radius, 12px) 0;
  background: var(--bh-accent, #5b8cff);
  color: #04101f;
  font-weight: 700;
  cursor: pointer;
}
.skip-link:focus {
  left: 0;
}

.muted-text { color: var(--bh-muted, #9aa6c4); }

/* ------------------------------------------------------------------ *
 * Boot / error states
 * ------------------------------------------------------------------ */
.boot-error {
  margin: 16px;
  padding: 14px 16px;
  border: 1px solid var(--bh-danger, #ef5a6f);
  border-left-width: 4px;
  border-radius: var(--bh-radius, 12px);
  background: rgba(239, 90, 111, .08);
  color: var(--bh-text, #e8ecf8);
  font-size: 14px;
}
.boot-error-detail { margin: .5rem 0 0; font-family: var(--bh-mono, monospace); font-size: 12.5px; }

/* ------------------------------------------------------------------ *
 * Demo login gate
 * ------------------------------------------------------------------ */
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}
.login-card {
  width: min(520px, 100%);
  background: var(--bh-panel, #111832);
  border: 1px solid var(--bh-line, #26304f);
  border-radius: calc(var(--bh-radius, 12px) + 4px);
  padding: clamp(20px, 4vw, 34px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
}
.login-card h1 {
  font-size: clamp(1.55rem, 1.2rem + 2vw, 2.1rem);
  margin-bottom: .4rem;
}
.login-lead { color: var(--bh-muted, #9aa6c4); font-size: 14px; }
.login-lead strong { color: var(--bh-text, #e8ecf8); }
.credential-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  margin: 16px 0 20px;
  padding: 10px 14px;
  border: 1px dashed var(--bh-accent, #5b8cff);
  border-radius: var(--bh-radius, 12px);
  background: rgba(91, 140, 255, .08);
}
.credential-label {
  font-size: 11.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--bh-muted, #9aa6c4);
  font-weight: 700;
}
.credential-value {
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--bh-accent-strong, #a8c0ff);
  background: var(--bh-panel-2, #1a2445);
  border: 1px solid var(--bh-line, #26304f);
  border-radius: 8px;
  padding: 3px 12px;
}
.field-label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--bh-muted, #9aa6c4);
}
.hint { color: var(--bh-muted, #9aa6c4); font-size: 12.5px; margin: 6px 0 12px; }
.hint code { color: var(--bh-text, #e8ecf8); }
.form-error {
  margin: 0 0 12px;
  padding: 8px 11px;
  border: 1px solid var(--bh-danger, #ef5a6f);
  border-radius: 8px;
  background: rgba(239, 90, 111, .1);
  color: var(--bh-danger, #ff8a99);
  font-size: 13px;
}
.btn-block { width: 100%; margin-top: 4px; }
.login-notes {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  color: var(--bh-muted, #9aa6c4);
  font-size: 12.5px;
}
.login-notes li::before { content: "· "; color: var(--bh-accent, #5b8cff); font-weight: 700; }
.fineprint { margin: 18px 0 0; font-size: 12.5px; color: var(--bh-muted, #9aa6c4); }

/* ------------------------------------------------------------------ *
 * App header
 * ------------------------------------------------------------------ */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.app-header {
  background: var(--bh-panel, #111832);
  border-bottom: 1px solid var(--bh-line, #26304f);
}
.header-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 16px;
}
.brand-block { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
  color: #fff;
  background: linear-gradient(135deg, var(--bh-accent, #5b8cff), var(--bh-accent-strong, #3f6df0));
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { font-size: 15.5px; }
.brand-sub { font-size: 12px; color: var(--bh-muted, #9aa6c4); }
.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--bh-line, #26304f);
  border-radius: 999px;
  background: var(--bh-panel-2, #1a2445);
  color: var(--bh-muted, #9aa6c4);
  font-size: 12px;
  white-space: nowrap;
}
.demo-banner {
  margin: 0;
  padding: 8px 16px;
  border-top: 1px dashed rgba(242, 184, 75, .4);
  background: rgba(242, 184, 75, .08);
  color: var(--bh-warn, #f2b84b);
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
}
.storage-warning {
  margin: 0;
  padding: 8px 16px;
  border-top: 1px solid var(--bh-line, #26304f);
  background: rgba(239, 90, 111, .1);
  color: var(--bh-danger, #ff8a99);
  font-size: 12.5px;
  text-align: center;
}

/* ------------------------------------------------------------------ *
 * Layout: top nav on small screens, sidebar from 1000px
 * ------------------------------------------------------------------ */
.app-body { display: block; }
.sidebar {
  padding: 10px 16px;
  background: var(--bh-panel, #111832);
  border-bottom: 1px solid var(--bh-line, #26304f);
}
.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: var(--bh-radius, 12px);
  color: var(--bh-muted, #9aa6c4);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
}
.nav-link:hover {
  color: var(--bh-text, #e8ecf8);
  border-color: var(--bh-line, #26304f);
  background: var(--bh-panel-2, #1a2445);
}
.nav-link[aria-current="page"] {
  color: var(--bh-text, #e8ecf8);
  background: var(--bh-panel-2, #1a2445);
  border-color: var(--bh-line, #26304f);
  box-shadow: inset 3px 0 0 var(--bh-accent, #5b8cff);
}
.nav-icon { color: var(--bh-accent, #7aa2ff); font-size: 13px; }
.nav-badge {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bh-danger, #ef5a6f);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}
.sidebar-foot { display: none; }
.main {
  min-width: 0;
  padding: 20px 16px 44px;
}
.view { animation: view-in .18s ease-out; }
@keyframes view-in {
  from { opacity: .4; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------------ *
 * View headers
 * ------------------------------------------------------------------ */
.view-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 20px;
  margin: 0 0 18px;
}
.view-head > div { min-width: 0; }
.view-head h1 {
  margin: 0 0 4px;
  font-size: clamp(1.45rem, 1.15rem + 1.4vw, 1.95rem);
}
.eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--bh-accent, #7aa2ff);
}
.view-sub {
  margin: 0;
  max-width: 78ch;
  color: var(--bh-muted, #9aa6c4);
  font-size: 13.5px;
}
.data-note { margin: 0; color: var(--bh-muted, #9aa6c4); font-size: 12px; }

/* ------------------------------------------------------------------ *
 * Panels, KPIs, chart
 * ------------------------------------------------------------------ */
.panel {
  margin: 0 0 18px;
  padding: 16px;
  background: var(--bh-panel, #111832);
  border: 1px solid var(--bh-line, #26304f);
  border-radius: var(--bh-radius, 12px);
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 18px;
  margin-bottom: 12px;
}
.panel-head h2 { margin: 0; font-size: 1.05rem; }
.panel-sub { margin: 0; max-width: 72ch; color: var(--bh-muted, #9aa6c4); font-size: 12.5px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}
.kpi-card {
  min-width: 0;
  padding: 14px 16px;
  background: var(--bh-panel, #111832);
  border: 1px solid var(--bh-line, #26304f);
  border-radius: var(--bh-radius, 12px);
}
.kpi-label {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--bh-muted, #9aa6c4);
}
.kpi-value {
  margin: 0;
  font-size: clamp(1.35rem, 1.05rem + 1vw, 1.85rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.kpi-note { margin: 5px 0 0; font-size: 12px; color: var(--bh-muted, #9aa6c4); }

.chart { display: grid; gap: 20px; }
.chart-group { min-width: 0; }
.chart-group h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--bh-muted, #9aa6c4);
}
.bars { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.bar-row {
  display: grid;
  grid-template-columns: minmax(0, 42%) minmax(0, 1fr) 2.6rem;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 12.5px;
}
.bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--bh-text, #e8ecf8);
}
.bar-track {
  display: block;
  height: 10px;
  border-radius: 999px;
  background: var(--bh-panel-2, #1a2445);
  border: 1px solid var(--bh-line, #26304f);
  overflow: hidden;
}
.bar-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--bh-accent, #5b8cff);
  transition: width .25s ease;
}
.bar-value {
  text-align: right;
  color: var(--bh-muted, #9aa6c4);
  font-variant-numeric: tabular-nums;
}

.pack-status { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pack-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 9px 12px;
  background: var(--bh-panel-2, #1a2445);
  border: 1px solid var(--bh-line, #26304f);
  border-radius: var(--bh-radius, 12px);
  font-size: 13px;
}
.pack-item.is-missing { border-style: dashed; opacity: .85; }
.pack-flag { font-size: 16px; line-height: 1; }
.pack-name { font-weight: 700; }
.pack-code { font-size: 11px; color: var(--bh-muted, #9aa6c4); }
.pack-meta { margin-left: auto; color: var(--bh-muted, #9aa6c4); font-size: 12px; }

/* ------------------------------------------------------------------ *
 * Buttons, inputs, toolbars
 * ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--bh-line, #26304f);
  border-radius: var(--bh-radius, 12px);
  background: var(--bh-panel-2, #1a2445);
  color: var(--bh-text, #e8ecf8);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.btn:hover { border-color: var(--bh-accent, #7aa2ff); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:disabled:hover { border-color: var(--bh-line, #26304f); }
.btn-primary {
  border-color: transparent;
  background: var(--bh-accent-strong, #3f6df0);
  color: #fff;
}
.btn-primary:hover { background: var(--bh-accent, #5b8cff); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--bh-panel-2, #1a2445); }
.btn-danger {
  border-color: var(--bh-danger, #ef5a6f);
  background: transparent;
  color: var(--bh-danger, #ff8a99);
}
.btn-danger:hover { background: rgba(239, 90, 111, .14); border-color: var(--bh-danger, #ef5a6f); }
.btn-warn {
  border-color: var(--bh-warn, #f2b84b);
  background: transparent;
  color: var(--bh-warn, #f2b84b);
}
.btn-warn:hover { background: rgba(242, 184, 75, .13); border-color: var(--bh-warn, #f2b84b); }
.btn-xs { min-height: 30px; padding: 4px 9px; font-size: 12px; border-radius: 8px; }

.input,
.select,
.textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--bh-line, #26304f);
  border-radius: var(--bh-radius, 12px);
  background: var(--bh-panel-2, #1a2445);
  color: var(--bh-text, #e8ecf8);
  transition: border-color .15s ease;
}
.textarea { min-height: 96px; resize: vertical; }
.input::placeholder,
.textarea::placeholder { color: var(--bh-muted, #9aa6c4); }
.input:hover,
.select:hover,
.textarea:hover { border-color: var(--bh-accent, #7aa2ff); }
.input[aria-invalid="true"],
.textarea[aria-invalid="true"] { border-color: var(--bh-danger, #ef5a6f); }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--bh-accent, #5b8cff); cursor: pointer; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  margin: 0 0 14px;
}
.toolbar-inline { align-items: center; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-grow { flex: 1 1 240px; }
.field-action { flex: 0 0 auto; }
.field > label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--bh-muted, #9aa6c4);
}
.field .select { min-width: 170px; }

.summary { margin: 0 0 12px; color: var(--bh-muted, #9aa6c4); font-size: 12.5px; }
.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 12px;
  background: var(--bh-panel, #111832);
  border: 1px dashed var(--bh-line, #26304f);
  border-radius: var(--bh-radius, 12px);
}
.bulk-count { margin-right: auto; color: var(--bh-muted, #9aa6c4); font-size: 12.5px; font-weight: 600; }

.empty-state {
  margin: 0 0 16px;
  padding: 28px 18px;
  background: var(--bh-panel, #111832);
  border: 1px dashed var(--bh-line, #26304f);
  border-radius: var(--bh-radius, 12px);
  color: var(--bh-muted, #9aa6c4);
  text-align: center;
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------ *
 * Tags / badges
 * ------------------------------------------------------------------ */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
  line-height: 1.5;
}
.tag-open { color: var(--bh-danger, #ff8a99); border-color: currentColor; }
.tag-hidden { color: var(--bh-warn, #f2b84b); border-color: currentColor; }
.tag-dismissed { color: var(--bh-muted, #9aa6c4); border-color: currentColor; }
.tag-visible { color: var(--bh-muted, #9aa6c4); border-color: currentColor; }
.tag-pinned { color: var(--bh-accent, #7aa2ff); border-color: currentColor; }
.tag-warn { color: var(--bh-warn, #f2b84b); border-color: currentColor; }
.tag-warned { color: var(--bh-warn, #f2b84b); border-color: currentColor; }
.tag-muted { color: var(--bh-warn, #f2b84b); border-color: currentColor; }
.tag-banned { color: var(--bh-danger, #ff8a99); border-color: currentColor; }
.tag-mod { color: var(--bh-accent, #7aa2ff); border-color: currentColor; }
.tag-neutral { color: var(--bh-muted, #9aa6c4); border-color: var(--bh-line, #26304f); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  border: 1px solid var(--bh-line, #26304f);
  color: var(--bh-muted, #9aa6c4);
  white-space: nowrap;
}
.badge-tipster { color: var(--bh-accent, #7aa2ff); border-color: currentColor; }
.badge-mod { color: var(--bh-warn, #f2b84b); border-color: currentColor; }
.badge-member { color: var(--bh-muted, #9aa6c4); }
.badge-newbie { color: var(--bh-muted, #9aa6c4); border-style: dashed; }

/* ------------------------------------------------------------------ *
 * Report queue
 * ------------------------------------------------------------------ */
.report-list { display: grid; gap: 12px; }
.report-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 14px 16px;
  background: var(--bh-panel, #111832);
  border: 1px solid var(--bh-line, #26304f);
  border-left: 3px solid var(--bh-danger, #ef5a6f);
  border-radius: var(--bh-radius, 12px);
}
.report-main { min-width: 0; }
.report-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 0 0 6px;
  color: var(--bh-muted, #9aa6c4);
  font-size: 12px;
}
.report-id { font-size: 11px; }
.report-title { margin: 0 0 6px; font-size: 1.02rem; overflow-wrap: anywhere; }
.report-excerpt { margin: 0 0 8px; color: var(--bh-muted, #9aa6c4); font-size: 13.5px; overflow-wrap: anywhere; }
.report-reason { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }

.link-btn {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--bh-text, #e8ecf8);
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn:hover { text-decoration-color: currentColor; }

/* ------------------------------------------------------------------ *
 * Tables
 * ------------------------------------------------------------------ */
.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  background: var(--bh-panel, #111832);
  border: 1px solid var(--bh-line, #26304f);
  border-radius: var(--bh-radius, 12px);
}
.data-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 13.5px;
}
#users-table { min-width: 940px; }
#audit-table { min-width: 720px; }
.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--bh-line, #26304f);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bh-panel-2, #1a2445);
  color: var(--bh-muted, #9aa6c4);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: rgba(127, 150, 255, .055); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table .col-check { width: 38px; }
.data-table .col-actions { width: 1%; white-space: nowrap; }
.data-table tr.is-hidden { background: rgba(242, 184, 75, .05); }
.data-table tr.is-hidden td { color: var(--bh-muted, #9aa6c4); }
.cell-thread { min-width: 220px; }
.row-title {
  display: block;
  max-width: 38ch;
  font-weight: 700;
  white-space: normal;
  overflow-wrap: anywhere;
}
.row-id {
  display: block;
  margin-top: 2px;
  color: var(--bh-muted, #9aa6c4);
  font-family: var(--bh-mono, monospace);
  font-size: 11px;
  overflow-wrap: anywhere;
}
.country-cell { white-space: nowrap; }
.user-handle { display: block; font-weight: 700; overflow-wrap: anywhere; }
.row-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.roi-pos { color: var(--bh-accent, #4fd1a1); font-weight: 700; }
.roi-neg { color: var(--bh-danger, #ff8a99); font-weight: 700; }

/* ------------------------------------------------------------------ *
 * Banned words
 * ------------------------------------------------------------------ */
.word-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  margin-bottom: 8px;
}
.word-form .field { flex: 1 1 260px; }
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 36px;
  margin: 12px 0 4px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 6px 4px 11px;
  background: var(--bh-panel-2, #1a2445);
  border: 1px solid var(--bh-line, #26304f);
  border-radius: 999px;
  font-size: 13px;
}
.chip-text { overflow-wrap: anywhere; }
.chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--bh-muted, #9aa6c4);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.chip-remove:hover { color: var(--bh-danger, #ff8a99); background: rgba(239, 90, 111, .14); }
.word-test-output {
  min-height: 86px;
  margin: 0 0 10px;
  padding: 12px 14px;
  border: 1px solid var(--bh-line, #26304f);
  border-left: 3px solid var(--bh-warn, #f2b84b);
  border-radius: var(--bh-radius, 12px);
  background: var(--bh-panel-2, #1a2445);
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.word-test-output .placeholder { color: var(--bh-muted, #9aa6c4); font-style: italic; }
.word-test-output mark {
  padding: 0 2px;
  border-radius: 3px;
  background: var(--bh-warn, #f2b84b);
  color: #1a1405;
  font-weight: 700;
}

/* ------------------------------------------------------------------ *
 * Audit log
 * ------------------------------------------------------------------ */
.audit-time { white-space: nowrap; color: var(--bh-muted, #9aa6c4); font-size: 12px; font-variant-numeric: tabular-nums; }
.audit-action { font-weight: 700; white-space: nowrap; }
.audit-entity { font-family: var(--bh-mono, monospace); font-size: 12px; }
.audit-detail { overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ *
 * Thread preview dialog
 * ------------------------------------------------------------------ */
.dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: min(86vh, 920px);
  padding: 0;
  border: 1px solid var(--bh-line, #26304f);
  border-radius: calc(var(--bh-radius, 12px) + 4px);
  background: var(--bh-panel, #111832);
  color: var(--bh-text, #e8ecf8);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
  overflow: hidden;
}
.dialog[open] { display: flex; flex-direction: column; }
.dialog::backdrop { background: rgba(4, 8, 20, .68); }
.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--bh-line, #26304f);
}
.dialog-head > div { min-width: 0; }
.dialog-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--bh-muted, #9aa6c4);
  overflow-wrap: anywhere;
}
.dialog-head h2 { margin: 0; font-size: 1.16rem; overflow-wrap: anywhere; }
.dialog-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--bh-line, #26304f);
  border-radius: 8px;
  background: var(--bh-panel-2, #1a2445);
  color: var(--bh-text, #e8ecf8);
  font-size: 15px;
  cursor: pointer;
}
.dialog-close:hover { border-color: var(--bh-danger, #ef5a6f); color: var(--bh-danger, #ff8a99); }
.dialog-body { padding: 16px 18px; overflow-y: auto; }
.dialog-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--bh-line, #26304f);
}
.thread-meta { margin: 0 0 12px; color: var(--bh-muted, #9aa6c4); font-size: 12.5px; overflow-wrap: anywhere; }
.thread-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.thread-body p { margin: 0 0 10px; white-space: pre-line; overflow-wrap: anywhere; }
.dialog-subhead {
  margin: 18px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--bh-line, #26304f);
  font-size: .98rem;
}
.reply-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.reply { padding-left: 12px; border-left: 2px solid var(--bh-line, #26304f); }
.reply-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  color: var(--bh-muted, #9aa6c4);
  font-size: 12px;
}
.reply-body { margin: 0; font-size: 13.5px; white-space: pre-line; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ *
 * Toast
 * ------------------------------------------------------------------ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  max-width: min(540px, calc(100vw - 32px));
  padding: 10px 16px;
  border: 1px solid var(--bh-line, #26304f);
  border-left: 3px solid var(--bh-accent, #5b8cff);
  border-radius: var(--bh-radius, 12px);
  background: var(--bh-panel-2, #1a2445);
  color: var(--bh-text, #e8ecf8);
  font-size: 13.5px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .4);
  opacity: 0;
  transform: translate(-50%, 18px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------------ *
 * Footer
 * ------------------------------------------------------------------ */
.app-footer {
  margin-top: auto;
  padding: 18px 16px 30px;
  border-top: 1px solid var(--bh-line, #26304f);
  color: var(--bh-muted, #9aa6c4);
  font-size: 12.5px;
}
.app-footer .demo-banner {
  margin: 0 0 12px;
  border: 1px solid rgba(242, 184, 75, .4);
  border-radius: var(--bh-radius, 12px);
  text-align: center;
}
.footer-note,
.footer-legal { max-width: 110ch; margin: 0 0 8px; }
.footer-legal { margin-bottom: 0; }

/* ------------------------------------------------------------------ *
 * Responsive — mobile-first top nav, desktop sidebar at >= 1000px
 * ------------------------------------------------------------------ */
@media (min-width: 640px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .report-card { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .report-actions { flex-direction: column; align-items: stretch; }
  .report-actions .btn { width: 100%; }
  .dialog-body { padding: 18px 22px; }
  .pack-status { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1000px) {
  .app-body {
    display: grid;
    grid-template-columns: 238px minmax(0, 1fr);
    align-items: start;
  }
  .sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    max-height: 100vh;
    overflow-y: auto;
    padding: 22px 14px;
    border-right: 1px solid var(--bh-line, #26304f);
    border-bottom: 0;
  }
  .nav-list { flex-direction: column; flex-wrap: nowrap; }
  .nav-link { width: 100%; }
  .sidebar-foot {
    display: block;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--bh-line, #26304f);
    color: var(--bh-muted, #9aa6c4);
    font-size: 12px;
  }
  .sidebar-foot p { margin: 0 0 8px; }
  .main {
    max-width: 1320px;
    padding: 28px 32px 56px;
  }
  .kpi-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .view { animation: none; }
  .chart { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-footer { padding: 20px 32px 34px; }
}

@media (min-width: 1280px) {
  .chart { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .header-actions .btn { min-height: 34px; padding: 6px 10px; font-size: 12.5px; }
  .chip { font-size: 11.5px; padding: 3px 8px; }
  .field .select { min-width: 0; }
  .view-head { align-items: flex-start; }
  .report-card { border-left-width: 2px; }
  .bulk-bar .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
