/* =====================================================================
   GryphonGuard — GLTHS Conflict Resolution & Bullying Reports
   "Clean & airy" theme in GLTHS colors (sampled from the school crest).
   ===================================================================== */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
}

:root {
  /* GLTHS palette */
  --navy: #283b84;          /* crest navy: primary */
  --navy-hover: #1f2f6b;
  --navy-tint: #eef1fa;
  --navy-ring: rgba(40, 59, 132, 0.25);
  --gold: #fdc93a;          /* crest gold: accent */
  --gold-hover: #f3bb1c;
  --gold-tint: #fff6d6;
  --tan: #9a8a62;           /* griffin tan: decorative only */

  /* Neutrals (tinted toward navy) */
  --page: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --border: #e2e5ee;
  --border-strong: #cdd2df;
  --text: #1b2133;
  --muted: #5c6780;

  /* Meaning only */
  --danger: #c4141b;
  --danger-tint: #fdecec;
  --success: #1f7a4d;
  --success-tint: #e8f5ee;

  /* Shape */
  --radius: 12px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 56, 0.04), 0 2px 6px rgba(16, 24, 56, 0.05);
  --shadow-lg: 0 4px 12px rgba(16, 24, 56, 0.08), 0 12px 32px rgba(16, 24, 56, 0.08);
  --topbar-h: 64px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--page);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; color: var(--text); }
p { margin: 0 0 12px; }
a { color: var(--navy); text-underline-offset: 2px; }
a:hover { color: var(--navy-hover); }
:focus-visible { outline: 3px solid var(--navy-ring); outline-offset: 2px; border-radius: 6px; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 100; border-radius: 8px; box-shadow: var(--shadow-lg); }
.small { font-size: 0.85rem; }
.muted { color: var(--muted); }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 1px 0 var(--border);
}
.topbar-inner { display: flex; align-items: center; gap: 24px; min-height: var(--topbar-h); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); flex-shrink: 0; }
.brand img { height: 40px; width: auto; display: block; }
.brand-name { display: block; font-weight: 750; font-size: 1.05rem; color: var(--navy); letter-spacing: -0.01em; }
.brand-sub { display: block; font-size: 0.75rem; color: var(--muted); line-height: 1.2; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a {
  position: relative; padding: 8px 14px; border-radius: 999px; white-space: nowrap;
  text-decoration: none; color: var(--muted); font-weight: 550; font-size: 0.93rem;
}
.nav a:hover { color: var(--navy); background: var(--navy-tint); }
.nav a.active { color: var(--navy); background: var(--navy-tint); }
.nav a.active::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: -13px; height: 3px;
  background: var(--navy); border-radius: 3px 3px 0 0;
}
.userbox { display: flex; align-items: center; gap: 12px; margin-left: auto; font-size: 0.9rem; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); color: #fff; font-weight: 650; font-size: 0.85rem;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--gold);
}
.userbox .who { line-height: 1.2; }
.userbox .who strong { display: block; font-weight: 600; }
.userbox .who span { color: var(--muted); font-size: 0.78rem; }

/* ---------- Page ---------- */
main.container { padding-top: 36px; padding-bottom: 96px; min-height: calc(100vh - var(--topbar-h) - 80px); }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.eyebrow { font-size: 0.75rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 6px; }
.page-header h1 { margin: 0; font-size: 1.75rem; font-weight: 750; color: var(--navy); }
.page-meta { margin: 6px 0 0; color: var(--muted); font-size: 0.9rem; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lead { font-size: 1.05rem; color: var(--muted); max-width: 70ch; }
.site-footer { border-top: 1px solid var(--border); padding: 20px 0 32px; color: var(--muted); font-size: 0.8rem; }
.site-footer .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.site-footer .container::before { content: none; }

/* ---------- Cards / sections ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin: 0 0 20px;
  min-width: 0;
}
.card h2, .section-title {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 16px; font-size: 1.1rem; font-weight: 700; color: var(--text);
}
.card h2::before, fieldset.card > legend::before {
  content: ''; width: 4px; height: 1.1em; border-radius: 2px; background: var(--gold); flex-shrink: 0;
}
.section-title { margin-top: 32px; }
fieldset.card { position: relative; }
fieldset.card > legend {
  float: left; width: 100%; padding: 0; margin: 0 0 18px;
  display: flex; align-items: center; gap: 10px;
  font-size: 1.1rem; font-weight: 700; color: var(--text);
}
fieldset.card > legend + * { clear: both; }
.sub { font-size: 0.95rem; font-weight: 650; color: var(--navy); margin: 20px 0 10px; padding-top: 16px; border-top: 1px dashed var(--border); }
.sub:first-of-type { border-top: 0; padding-top: 0; margin-top: 4px; }
.label-like { font-weight: 600; font-size: 0.92rem; margin: 16px 0 8px; }

/* Numbered sections on the public report form */
form.numbered { counter-reset: section; }
form.numbered fieldset.card > legend::before {
  counter-increment: section; content: counter(section);
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--navy); color: #fff; font-size: 0.85rem; font-weight: 700;
  box-shadow: 0 0 0 3px var(--gold-tint);
}

/* "From the initial submission" sections on the Dean update page */
fieldset.original { background: var(--surface-2); }
fieldset.original > legend::after {
  content: 'Original submission'; margin-left: auto;
  font-size: 0.72rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px;
}
fieldset.original input[type=text], fieldset.original input[type=date], fieldset.original input[type=time],
fieldset.original select, fieldset.original textarea { background: #f0f2f7; }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 6px; }
.help { color: var(--muted); font-size: 0.88rem; margin: 0 0 12px; }
.req {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  background: var(--navy-tint); color: var(--navy);
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; vertical-align: 1px;
}
input[type=text], input[type=email], input[type=date], input[type=time], input[type=search], select, textarea {
  width: 100%; min-height: 44px;
  font: inherit; font-size: 0.97rem; font-weight: 400; color: var(--text);
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
input:hover, select:hover, textarea:hover { border-color: #b4bbcc; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-ring); background: #fff; }
textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23283b84' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
select.short, input.short { max-width: 240px; }
.field-error { color: var(--danger); font-size: 0.86rem; font-weight: 550; margin: 6px 0 0; }
.field:has(.field-error) input, .field:has(.field-error) select, .field:has(.field-error) textarea {
  border-color: var(--danger); background: var(--danger-tint);
}
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 24px; align-items: start; }
.pairs { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 0 24px; }
.pairs.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.stack > * { margin-bottom: 12px; }
form.inline { display: inline; }

/* Option tiles: radios and checkboxes */
.radio-group { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.radio-group > legend { font-weight: 600; font-size: 0.92rem; margin-bottom: 10px; padding: 0; }
.radio-group:not(.inline-radios), .checkbox-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; align-content: start;
}
.radio-group:not(.inline-radios) > legend { grid-column: 1 / -1; float: left; width: 100%; }
.radio-group > .field-error { grid-column: 1 / -1; }
label.radio {
  display: flex; align-items: center; gap: 10px; margin: 0;
  padding: 11px 14px; min-height: 46px;
  font-weight: 500; font-size: 0.93rem; line-height: 1.3;
  background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  cursor: pointer; transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
label.radio:hover { border-color: var(--navy); background: var(--navy-tint); }
label.radio:has(input:checked) {
  border-color: var(--navy); background: var(--navy-tint); color: var(--navy); font-weight: 600;
  box-shadow: inset 3px 0 0 var(--gold);
}
label.radio:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--navy-ring); }
label.radio input { accent-color: var(--navy); width: 18px; height: 18px; margin: 0; flex-shrink: 0; }
.checkbox-grid { margin-bottom: 16px; }

/* Yes/No segmented control */
.inline-radios { display: flex; flex-wrap: wrap; align-items: center; gap: 0; }
.inline-radios > legend { width: 100%; }
.inline-radios label.radio {
  border-radius: 0; min-width: 96px; justify-content: center; margin-left: -1px; box-shadow: none;
}
.inline-radios label.radio:first-of-type { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; }
.inline-radios label.radio:last-of-type { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.inline-radios label.radio:has(input:checked) { position: relative; z-index: 1; box-shadow: inset 0 -3px 0 var(--gold); }
.inline-radios > .field-error { width: 100%; }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 18px;
  font: inherit; font-size: 0.93rem; font-weight: 600; line-height: 1.2; text-decoration: none; white-space: nowrap;
  color: var(--navy); background: #fff;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  box-shadow: 0 1px 2px rgba(16, 24, 56, 0.05);
  cursor: pointer; transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.05s;
}
.button:hover { border-color: var(--navy); background: var(--navy-tint); color: var(--navy); }
.button:active { transform: translateY(1px); }
.button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--navy-ring); }
.button.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.button.primary:hover { background: var(--navy-hover); border-color: var(--navy-hover); color: #fff; }
.button.accent { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.button.accent:hover { background: var(--gold-hover); border-color: var(--gold-hover); color: var(--navy-hover); }
.button.subtle, .button.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.button.subtle:hover, .button.ghost:hover { background: var(--navy-tint); color: var(--navy); border-color: transparent; }
.button.danger { color: var(--danger); }
.button.danger:hover { background: var(--danger-tint); border-color: var(--danger); color: var(--danger); }
.button.small { min-height: 34px; padding: 6px 12px; font-size: 0.85rem; }
.button.lg { min-height: 50px; padding: 12px 24px; font-size: 1rem; }
.button.block { width: 100%; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--navy); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-button.danger { color: var(--danger); }
.actions { margin: 20px 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions .help { margin: 0; }
details > summary.button { list-style: none; }
details > summary.button::-webkit-details-marker { display: none; }

/* Sticky bottom action bar for long forms */
.action-bar {
  position: sticky; bottom: 16px; z-index: 40;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 24px 0 0; padding: 12px 16px;
  background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(6px);
  border: 1px solid var(--border); border-top: 3px solid var(--gold);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.action-bar .help { margin: 0; }

/* ---------- Alerts ---------- */
.flash {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; margin: 0 0 20px;
  background: var(--success-tint); color: #144d31;
  border: 1px solid #cbe6d6; border-left: 4px solid var(--success); border-radius: var(--radius-sm);
  font-size: 0.94rem;
}
.flash.warn, .flash.info { background: var(--gold-tint); color: #4a3a05; border-color: #f6e2a4; border-left-color: var(--gold); }
.flash.error { background: var(--danger-tint); color: #7d0d11; border-color: #f4c3c3; border-left-color: var(--danger); }
.flash > div { flex: 1; }

/* ---------- Key/value display ---------- */
.kv { display: grid; grid-template-columns: minmax(170px, 32%) 1fr; gap: 0; margin: 0; }
.kv dt, .kv dd { padding: 10px 0; border-bottom: 1px solid var(--border); margin: 0; }
.kv dt { color: var(--muted); font-size: 0.88rem; font-weight: 550; padding-right: 16px; }
.kv dd { font-size: 0.95rem; }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }
.kv.compact dt, .kv.compact dd { padding: 4px 0; border: 0; }
.kv.compact { grid-template-columns: minmax(110px, 35%) 1fr; }
.pre, .kv dd.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
dt.changed-text::after {
  content: 'Changed'; display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px;
  background: var(--danger-tint); color: var(--danger); font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}
.changed-text { color: var(--danger) !important; font-weight: 600; }
.was { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(196, 20, 27, 0.5); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 650; white-space: nowrap;
}
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.big { font-size: 0.88rem; padding: 5px 12px; }
.status-open { background: var(--gold-tint); color: #6b4e00; }
.status-open::before { background: var(--gold); box-shadow: 0 0 0 2px #f7dd8e; }
.status-active { background: var(--navy-tint); color: var(--navy); }
.status-closed { background: #eceef2; color: #4a5263; }
.status-closed::before { background: #8a93a6; }

/* ---------- Steps ---------- */
.steps { display: flex; gap: 8px; list-style: none; margin: 0 0 24px; padding: 0; counter-reset: step; flex-wrap: wrap; }
.steps li {
  counter-increment: step; display: flex; align-items: center; gap: 10px;
  font-size: 0.88rem; font-weight: 600; color: var(--muted);
}
.steps li::before {
  content: counter(step); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; border: 2px solid var(--border-strong); color: var(--muted); font-size: 0.8rem;
}
.steps li:not(:last-child)::after { content: ''; width: 36px; height: 2px; background: var(--border-strong); border-radius: 2px; }
.steps li.done { color: var(--navy); }
.steps li.done::before { content: '\2713'; background: var(--navy); border-color: var(--navy); color: #fff; }
.steps li.done::after { background: var(--navy); }
.steps li.current { color: var(--navy); }
.steps li.current::before { background: var(--gold); border-color: var(--gold); color: var(--navy); }

/* ---------- Landing ---------- */
.hero { text-align: center; padding: 40px 32px 32px; }
.hero .wordmark { width: 100%; max-width: 420px; height: auto; margin: 0 auto 20px; display: block; }
.hero h1 { font-size: 1.9rem; font-weight: 750; color: var(--navy); margin: 0 0 12px; }
.hero .lead { margin: 0 auto 20px; }
.hero .flash { text-align: left; max-width: 760px; margin: 0 auto 12px; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.choice { display: flex; flex-direction: column; transition: box-shadow 0.15s, transform 0.15s; }
.choice:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.choice .icon {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 14px;
  background: var(--navy-tint); color: var(--navy);
}
.choice.anon .icon { background: var(--gold-tint); color: #7a5a00; }
.choice h2::before { display: none; }
.choice p { color: var(--muted); flex: 1; }
.choice .button { margin-top: 8px; }

/* Confirmation */
.confirm { text-align: center; padding: 48px 32px; max-width: 640px; margin: 0 auto 20px; }
.confirm .check {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 18px; display: grid; place-items: center;
  background: var(--success-tint); color: var(--success);
}
.confirm h2 { justify-content: center; font-size: 1.4rem; }
.confirm h2::before { display: none; }
.confirm .report-no { font-size: 2.6rem; font-weight: 800; color: var(--navy); letter-spacing: -0.02em; margin: 4px 0 12px; }
.confirm .actions { justify-content: center; }

/* ---------- Admin list ---------- */
.toolbar-card { padding: 0; overflow: hidden; }
.filters { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-end; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.filters label { margin: 0; font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.filters label > input, .filters label > select { margin-top: 4px; }
.filters input, .filters select { width: auto; min-width: 150px; min-height: 40px; padding-top: 8px; padding-bottom: 8px; }
.filters input[type=search] { min-width: 240px; }
.filters .status-filter { flex-basis: 100%; }
.filters label.grow { flex: 1 1 260px; }
.filters label.grow input { width: 100%; }
.card.filters { padding: 18px 20px; border-bottom: 1px solid var(--border); }
.card:not(.toolbar-card) > .filters { padding: 0; border: 0; }
main > .table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; }
main > .count { padding: 0 2px 10px; }
.segmented { display: inline-flex; background: var(--page); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented a { padding: 6px 12px; border-radius: 8px; font-size: 0.85rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.segmented a:hover { color: var(--navy); }
.segmented a.active { background: #fff; color: var(--navy); box-shadow: var(--shadow); }
.count { margin: 0; padding: 14px 20px; font-size: 0.9rem; color: var(--muted); }
.count strong { color: var(--text); }
.table-wrap { overflow-x: auto; }
.card > .table-wrap { margin: 0 -24px -24px; }
.toolbar-card > .table-wrap { margin: 0; }
table.data { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 0.92rem; }
table.data th {
  position: sticky; top: 0;
  background: var(--surface-2); text-align: left; white-space: nowrap;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
table.data th a { color: inherit; text-decoration: none; }
table.data th a:hover { color: var(--navy); }
table.data th.sorted { color: var(--navy); }
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background-color 0.1s; }
table.data tbody tr:hover { background: #fafbfe; }
table.data tr[data-href] { cursor: pointer; }
table.data td.id a { font-weight: 700; text-decoration: none; }
table.data td.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.pager { margin: 16px 0; display: flex; gap: 6px; flex-wrap: wrap; }
.pager a, .pager strong { min-width: 36px; height: 36px; display: grid; place-items: center; padding: 0 10px; border-radius: 8px; text-decoration: none; font-size: 0.9rem; }
.pager a { background: #fff; border: 1px solid var(--border); }
.pager a:hover { border-color: var(--navy); }
.pager strong { background: var(--navy); color: #fff; }
.hints { margin: 0 0 16px; padding-left: 20px; color: var(--muted); font-size: 0.88rem; }

/* ---------- Detail page ---------- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.detail-aside { position: sticky; top: calc(var(--topbar-h) + 20px); display: grid; gap: 20px; max-height: calc(100vh - var(--topbar-h) - 40px); overflow: auto; }
.detail-aside .card { margin: 0; }
.status-card .badge { margin-bottom: 12px; }
.status-card .kv { grid-template-columns: 76px 1fr; }
.status-card .kv dt, .status-card .kv dd { padding: 6px 0; font-size: 0.85rem; }
.status-card .actions { margin: 16px 0 0; }
.status-card .actions .button { flex: 1; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; }
.subnav { display: inline-flex; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px; gap: 2px; margin-bottom: 24px; flex-wrap: wrap; box-shadow: var(--shadow); }
.subnav a { padding: 8px 16px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 0.9rem; color: var(--muted); }
.subnav a:hover { color: var(--navy); background: var(--navy-tint); }
.subnav a.active { background: var(--navy); color: #fff; }

/* History timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 22px; }
.timeline li::before { content: ''; position: absolute; left: 4px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px var(--gold-tint); }
.timeline li:not(:last-child)::after { content: ''; position: absolute; left: 8px; top: 20px; bottom: 0; width: 1px; background: var(--border); }
.timeline .when { font-size: 0.78rem; color: var(--muted); }
.timeline .what { font-weight: 650; font-size: 0.9rem; }
.timeline .reason { font-weight: 400; }
table.diff { border-collapse: collapse; margin-top: 8px; font-size: 0.82rem; width: 100%; }
table.diff th, table.diff td { border-bottom: 1px solid var(--border); padding: 6px 8px; text-align: left; vertical-align: top; }
table.diff th { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); background: var(--surface-2); }
.card table.diff.big { font-size: 0.92rem; }
.card table.diff.big th, .card table.diff.big td { padding: 10px 12px; }
table.audit pre { white-space: pre-wrap; font-size: 0.78rem; max-width: 420px; margin: 6px 0 0; background: var(--surface-2); padding: 8px; border-radius: 8px; }

/* Dean update page header */
.incident-top { display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: center; justify-content: space-between; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.incident-top .big { font-size: 1.5rem; font-weight: 800; color: var(--navy); }
.incident-top .id-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 650; display: block; }
.inline-field { display: flex; align-items: center; gap: 10px; margin: 0; }
.inline-field label { margin: 0; }
.inline-field select { width: auto; min-width: 160px; }
.original-block { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px; }
.incident-header .sub { border-top: 0; padding-top: 0; margin-top: 0; }

/* ---------- Responsive ---------- */
@media screen and (max-width: 960px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-aside { position: static; max-height: none; order: -1; }
  .brand-sub { display: none; }
}
@media screen and (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; gap: 8px 12px; padding-top: 10px; padding-bottom: 10px; }
  .brand img { height: 34px; }
  .nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; margin: 0 -8px; }
  .nav a.active::after { bottom: -4px; }
  .userbox .who { display: none; }
  main.container { padding-top: 20px; }
  .page-header h1 { font-size: 1.4rem; }
  .card { padding: 18px; border-radius: 10px; }
  .card > .table-wrap { margin: 0 -18px -18px; }
  .toolbar-card { padding: 0; }
  .toolbar-card > .table-wrap { margin: 0; }
  .filters { padding: 16px; }
  table.data td, table.data th { white-space: nowrap; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { border-bottom: 0; padding-bottom: 0; }
  .pairs, .pairs.even { grid-template-columns: 1fr; }
  .filters input, .filters select, .filters input[type=search] { min-width: 0; width: 100%; }
  .filters label { flex: 1 1 140px; }
  .hero { padding: 28px 18px; }
  .hero h1 { font-size: 1.45rem; }
  .action-bar { bottom: 8px; }
  .steps li:not(:last-child)::after { width: 16px; }
}
