/* Sokaity staff console. Brand: Ocean gradient #1F3BFF -> #00C2B2, ink #0B0D17, signal red #FF3D2E,
   "ai" yellow #FFD60A. The staff twist: a dark ink sidebar and a red-to-yellow mark, so it never looks like
   the member app. */
:root {
  --blue: #1F3BFF; --teal: #00C2B2; --teal-dark: #00756B; --ink: #0B0D17; --ink-soft: #3A3D4A; --muted: #5B5F70;
  --red: #FF3D2E; --red-dark: #C4200F; --yellow: #FFD60A; --amber: #8A5A00; --amber-bg: #FFF1C2;
  --paper: #FFFFFF; --canvas: #F2F4FF; --line: #C9CEE8; --ok: #0E7A3E; --ok-bg: #DDF5E7; --red-bg: #FFE3E0;
  --radius: 12px; --shadow: 0 1px 2px rgba(11, 13, 23, .06), 0 6px 20px rgba(11, 13, 23, .06);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--canvas); font-size: 15px; line-height: 1.45; }
a { color: var(--blue); }
button { font: inherit; cursor: pointer; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #fff; display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; font-weight: 800; font-size: 19px; }
.brand img { width: 30px; height: 30px; }
.brand .ai { color: var(--yellow); }
.brand small { display: block; font-weight: 600; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #FF8A7F; }
.nav-label { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #8B90A8; padding: 14px 10px 6px; }
.nav a { display: flex; justify-content: space-between; align-items: center; color: #E7E9F5; text-decoration: none;
  padding: 9px 10px; border-radius: 9px; font-weight: 600; }
.nav a:hover { background: #1B1E2E; }
.nav a.on { background: linear-gradient(90deg, var(--blue), var(--teal)); color: #fff; }
.badge { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: #2A2E44; font-size: 12px; text-align: center; }
.badge.hot { background: var(--red); color: #fff; }
.side-foot { margin-top: auto; border-top: 1px solid #23273A; padding: 14px 8px 0; font-size: 13px; }
.side-foot .who { font-weight: 700; }
.side-foot button { margin-top: 10px; width: 100%; background: transparent; color: #E7E9F5; border: 1px solid #3A3F5A; border-radius: 9px; padding: 8px; }
.main { display: flex; flex-direction: column; min-width: 0; }
.top { display: flex; align-items: center; gap: 14px; padding: 16px 28px; background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.top h1 { font-size: 20px; }
.top .grow { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill.staging { background: var(--yellow); color: var(--ink); }
.content { padding: 24px 28px 60px; max-width: 1200px; width: 100%; }

/* ---- cards, tables, chips ---- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; }
.card h2 { font-size: 16px; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.count { display: inline-block; padding: 1px 9px; border-radius: 999px; background: var(--canvas); border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--ink-soft); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 11px 10px; border-bottom: 1px solid #E6E9F7; vertical-align: middle; }
tr.link { cursor: pointer; }
tr.link:hover td { background: #F7F8FF; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--canvas); color: var(--ink-soft); border: 1px solid var(--line); white-space: nowrap; }
.chip.red { background: var(--red-bg); color: var(--red-dark); border-color: #FFB8B0; }
.chip.amber { background: var(--amber-bg); color: var(--amber); border-color: #F2D27A; }
.chip.ok { background: var(--ok-bg); color: var(--ok); border-color: #A9E2C2; }
.chip.ink { background: var(--ink); color: #fff; border-color: var(--ink); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 18px 4px; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 6px 14px; font-weight: 600; color: var(--ink-soft); }
.tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- buttons ---- */
.btn { border: 0; border-radius: 10px; padding: 9px 16px; font-weight: 700; background: var(--ink); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: linear-gradient(90deg, var(--blue), var(--teal-dark)); }
.btn.ghost { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--red-dark); }
.btn.warn { background: #6B4A00; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .tabs button:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* ---- forms ---- */
label { display: block; font-weight: 700; font-size: 13px; margin: 12px 0 6px; }
input, select, textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
textarea { min-height: 84px; resize: vertical; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.error { color: var(--red-dark); font-weight: 600; margin-top: 10px; }

/* ---- sign-in ---- */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 0% 0%, #1F3BFF22, transparent), radial-gradient(900px 500px at 100% 100%, #00C2B222, transparent), var(--canvas); }
.signin .card { width: 100%; max-width: 420px; padding: 28px; }
.signin .brand { color: var(--ink); padding: 0 0 18px; }
.signin .brand small { color: var(--red-dark); }
.signin .qr { display: grid; place-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin: 10px 0; }
.signin .qr img { width: 180px; height: 180px; }
.code-input { font-size: 22px; letter-spacing: .4em; text-align: center; font-family: ui-monospace, Menlo, monospace; }

/* ---- modal (centred, per the architecture) ---- */
.backdrop { position: fixed; inset: 0; background: rgba(11, 13, 23, .55); display: grid; place-items: center; padding: 16px; z-index: 10; }
.modal { background: var(--paper); border-radius: 16px; width: 100%; max-width: 520px; padding: 22px 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); max-height: 90vh; overflow: auto; }
.modal h3 { font-size: 18px; margin-bottom: 6px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ---- chat (hostile input: shown as text only) ---- */
.thread { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.msg { max-width: 80%; padding: 9px 12px; border-radius: 12px; white-space: pre-wrap; word-break: break-word; }
.msg.reported { align-self: flex-start; background: #FFF0EE; border: 1px solid #FFC9C2; }
.msg.reporter { align-self: flex-end; background: #EEF1FF; border: 1px solid #CBD3FF; }
.msg .meta { font-size: 11px; color: var(--muted); margin-bottom: 3px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.notice { background: var(--amber-bg); border: 1px solid #F2D27A; color: #4D3300; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 10px; }
.notice.red { background: var(--red-bg); border-color: #FFB8B0; color: #5C0D05; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.tile .n { font-size: 28px; font-weight: 800; }
.tile .l { color: var(--muted); font-size: 13px; font-weight: 600; }
.tile.alert .n { color: var(--red-dark); }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 20; font-weight: 600; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px; padding: 10px 12px; }
  .brand { padding: 0 8px 0 0; }
  .nav-label, .side-foot .who, .side-foot .muted { display: none; }
  .nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; }
  .side-foot button { margin: 0; width: auto; }
  .top, .content { padding-left: 16px; padding-right: 16px; }
  .grid2 { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
}

/* Tables scroll inside their card on narrow screens; the page itself never scrolls sideways. */
.card { overflow-x: auto; }
.side .brand img { background: #fff; border-radius: 8px; padding: 3px; }
