/* Halo evidence portal. Dark, near-black surfaces with a single amber accent,
   matching the evidence-management visual language the portal is modelled on
   and the amber in the Halo mark. */

:root {
  --page: #0d0d0f;
  --surface: #17171a;
  --surface-raised: #1d1d21;
  --surface-input: #121215;
  --line: #2c2c31;
  --line-strong: #3a3a41;
  --text: #f2f2f4;
  --muted: #9b9ba4;
  --muted-dim: #6e6e78;
  --accent: #ffc72c;
  --accent-hover: #ffd45c;
  --accent-ink: #17130a;
  --red: #d05a5a;
  --green: #4f9b6c;
  --blue: #6f8fbe;
  --radius: 4px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--text);
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.hidden { display: none !important; }

/* ---------- Sign in ---------- */

.auth-shell { min-height: 100%; display: grid; grid-template-rows: auto 1fr auto; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  height: 56px;
  background: #0a0a0c;
  border-bottom: 1px solid var(--line);
}
.topbar-brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; letter-spacing: .5px; }
.topbar-brand img { width: 26px; height: 26px; object-fit: contain; }
.topbar-link { color: var(--muted); text-decoration: none; font-size: 13px; }
.topbar-link:hover { color: var(--text); text-decoration: underline; }

.auth-main { display: grid; place-content: center; justify-items: center; gap: 18px; padding: 40px 20px; }

.auth-card {
  width: min(420px, calc(100vw - 40px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-section { padding: 26px 28px; }
.card-agency { background: var(--surface-raised); border-bottom: 1px solid var(--line); }
.card-eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase; }
.card-agency h1 { margin: 0; font-size: 21px; font-weight: 600; line-height: 1.25; }
.card-host { margin: 5px 0 0; color: var(--muted); font-size: 13px; font-family: Consolas, "SF Mono", monospace; }
.link-button { margin-top: 12px; padding: 0; border: 0; background: none; color: var(--accent); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.link-button:hover { color: var(--accent-hover); }

.card-signin h2 { margin: 0 0 10px; font-size: 18px; font-weight: 600; }
.card-help { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.55; }

.field { display: grid; gap: 7px; margin-bottom: 20px; }
.field label { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .4px; }
.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 13px; top: 50%; width: 7px; height: 7px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.field select, .field input {
  width: 100%; height: 42px; padding: 0 34px 0 12px;
  background: var(--surface-input); border: 1px solid var(--line-strong); border-radius: var(--radius);
  appearance: none;
}
.field select:focus, .field input:focus { outline: 2px solid var(--accent); outline-offset: -2px; }

.button-primary, .button-secondary {
  display: block; width: 100%; height: 44px; line-height: 42px;
  border-radius: var(--radius); text-align: center; text-decoration: none;
  font-size: 14px; font-weight: 600;
}
.button-primary { border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); }
.button-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button-primary[disabled] { opacity: .55; cursor: not-allowed; }
.button-secondary { border: 1px solid var(--line-strong); background: transparent; color: var(--text); }
.button-secondary:hover { border-color: var(--muted); background: #1f1f24; }

.card-links { margin: 14px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.card-links a { color: var(--accent); text-decoration: none; }
.card-links a:hover { text-decoration: underline; }

.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--muted-dim); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.auth-note { max-width: 420px; margin: 0; color: var(--red); font-size: 13px; text-align: center; line-height: 1.5; }
.auth-note:empty { display: none; }

.footer {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 24px; height: 44px;
  background: #0a0a0c; border-top: 1px solid var(--line);
  color: var(--muted-dim); font-size: 12px;
}

/* ---------- Portal ---------- */

.portal { min-height: 100%; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; padding: 22px 12px 18px; background: #0a0a0c; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 20px; letter-spacing: 3px; }
.brand img { width: 30px; height: 30px; object-fit: contain; }
.agency-chip { display: grid; gap: 3px; margin: 0 4px 18px; padding: 10px 12px; background: var(--surface-raised); border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; }
.agency-chip-code { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: 1px; }
.agency-chip-name { color: var(--muted); font-size: 11px; line-height: 1.35; }
.side-link { margin: 2px 0; padding: 11px 14px; color: #d7d7dc; text-decoration: none; font-size: 14px; border-radius: var(--radius); }
.side-link.active, .side-link:hover { color: var(--accent-ink); background: var(--accent); font-weight: 600; }
.side-change { margin: 10px 4px 0; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: transparent; color: var(--muted); font-size: 12px; }
.side-change:hover { color: var(--text); border-color: var(--muted); }
.side-bottom { margin-top: auto; padding: 12px; color: var(--muted-dim); font-size: 12px; }

.content { min-width: 0; padding: 30px 36px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.overline { margin: 0 0 6px; color: var(--accent); font-size: 11px; font-weight: 700; letter-spacing: 1.6px; }
h1 { margin: 0; font-size: 26px; font-weight: 600; }
.user { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 14px; }
.user button, #reset, #direction, .sort { border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--text); background: var(--surface-raised); padding: 8px 11px; }
.user button:hover, #reset:hover, #direction:hover { border-color: var(--accent); }

.filters { display: grid; grid-template-columns: minmax(200px, 2fr) repeat(3, minmax(125px, 1fr)) auto; gap: 10px; padding: 20px 0; }
.filters label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.filters input, .filters select { min-width: 0; height: 40px; padding: 0 10px; color: var(--text); background: var(--surface-input); border: 1px solid var(--line-strong); border-radius: var(--radius); }
.filters input:focus, .filters select:focus, .supervisor-controls textarea:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.filters button { align-self: end; height: 40px; }

.list-bar { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 4px 0 14px; color: var(--muted); font-size: 13px; }
.list-bar b { color: var(--text); }
.list-bar em { margin-left: 8px; color: var(--accent); font-style: normal; }
.sort { border-color: transparent; padding: 5px 8px; }
.sort.selected { color: var(--accent-ink); background: var(--accent); }

.table-shell { position: relative; min-height: 440px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; min-width: 900px; border-collapse: collapse; text-align: left; }
th { padding: 13px 16px; color: var(--muted); background: var(--surface-raised); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
td { padding: 13px 16px; border-top: 1px solid var(--line); color: #e3e3e7; font-size: 13px; }
tbody tr:hover { background: var(--surface-raised); }
.recording { font-family: Consolas, "SF Mono", monospace; color: var(--text); font-size: 12px; }
.officer { display: grid; gap: 3px; }
.officer small { color: var(--muted); }
.badge { display: inline-block; padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 2px; color: var(--muted); font-size: 11px; text-transform: capitalize; }
.badge.pending { border-color: #8a6f19; color: var(--accent); }
.badge.approved { border-color: #3f6f52; color: #94d8ac; }
.badge.returned { border-color: #4d5f7a; color: #b6c9e6; }
.badge.deleted { border-color: #8a4646; color: #eaa8a8; }
.flag-unmasked { margin-left: 6px; color: var(--red); font-size: 11px; }
.review { padding: 7px 10px; border: 1px solid var(--accent); border-radius: var(--radius); color: var(--accent-ink); background: var(--accent); font-weight: 600; }
.review:hover { background: var(--accent-hover); }
.empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: var(--muted); }
.empty h2 { margin: 0 0 8px; color: var(--text); font-size: 18px; }
.empty p { margin: 0; }

dialog { width: min(900px, calc(100% - 30px)); padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--text); background: var(--surface); }
dialog::backdrop { background: rgba(0, 0, 0, .72); }
.review-panel { padding: 24px; }
.review-panel h2 { margin: 0; font-size: 19px; }
.close { float: right; border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--text); background: var(--surface-raised); padding: 7px 10px; }
.review-info { color: var(--muted); font-size: 13px; }
.review-panel video { display: block; width: 100%; aspect-ratio: 16/9; margin-top: 18px; background: #000; }
.missing { margin: 12px 0 0; padding: 12px; color: var(--muted); background: var(--surface-input); border-radius: var(--radius); }
.supervisor-controls { margin-top: 18px; }
.supervisor-controls label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.supervisor-controls textarea { min-height: 70px; padding: 9px; color: var(--text); background: var(--surface-input); border: 1px solid var(--line-strong); border-radius: var(--radius); resize: vertical; }
.supervisor-controls > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.supervisor-controls button { border: 0; border-radius: var(--radius); padding: 10px 13px; font-weight: 600; }
.secondary { color: var(--text); background: #4a4a52; }
.remove { color: #fff; background: var(--red); }
.approve { color: var(--accent-ink); background: var(--accent); }

@media (max-width: 900px) {
  .portal { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px; }
  .brand { padding: 0 10px 0 0; }
  .agency-chip { margin: 0; }
  .side-link, .side-change { margin: 0; }
  .side-bottom { display: none; }
  .content { padding: 24px 18px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .wide { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .content { padding: 18px 12px; }
  header { align-items: flex-start; }
  .user { flex-direction: column; align-items: flex-end; gap: 6px; }
  .filters { grid-template-columns: 1fr; }
  .filters .wide { grid-column: auto; }
  .list-bar { align-items: flex-start; flex-direction: column; }
  .brand strong { display: none; }
  .card-section { padding: 22px 20px; }
}
