/* ============================================================
   VIS Incident Report — Design System
   ============================================================ */

/* --- Tokens ------------------------------------------------ */
:root {
  --navy: #0B233F;
  --navy-mid: #1a3a5c;
  --navy-light: #e8edf3;
  --orange: #F8981D;
  --orange-dark: #d97c08;
  --orange-light: #fff4e6;
  --grey-50: #f9fafb;
  --grey-100: #f3f4f6;
  --grey-200: #e5e7eb;
  --grey-300: #d1d5db;
  --grey-500: #6b7280;
  --grey-700: #374151;
  --grey-900: #111827;
  --white: #ffffff;
  --success: #059669;
  --success-light: #ecfdf5;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --info: #2563eb;
  --info-light: #eff6ff;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.04);

  /* Legacy aliases */
  --bg: var(--grey-100);
  --card: var(--white);
  --card-muted: var(--grey-50);
  --line: var(--grey-200);
  --line-strong: var(--grey-300);
  --text: var(--grey-700);
  --muted: var(--grey-500);
  --steel: var(--grey-500);
  --shadow: var(--shadow-sm);
  --shadow-soft: var(--shadow-md);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --open: var(--warning);
  --open-bg: var(--warning-light);
  --resolved: var(--success);
  --resolved-bg: var(--success-light);
  --orange-soft: var(--orange-light);
  --blue: var(--navy-mid);
  --public-bg: var(--grey-100);
  --public-surface: var(--white);
  --public-panel: var(--grey-50);
  --public-ink-soft: var(--grey-700);
  --info-bg: var(--info-light);
  --success-bg: var(--success-light);
  --danger-bg: var(--danger-light);
  --warning-bg: var(--warning-light);
}

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

html, body {
  margin: 0;
  min-height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--grey-100);
  color: var(--grey-700);
  font-size: 14px;
  line-height: 1.6;
}

body { min-height: 100vh; }
body.public-page { background: var(--grey-100); }

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

.hidden { display: none !important; }
.screen { min-height: 100vh; }
.public-shell { min-height: 100vh; }

/* --- Public header ----------------------------------------- */
.public-hero {
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  color: var(--white);
}

.public-hero-inner,
.public-content {
  width: min(100%, 1180px);
  margin: 0 auto;
}

.public-hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 24px;
}

.public-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.public-brand { display: block; min-width: 0; }
.public-brand-copy { min-width: 0; }

.public-brand-lockup {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  min-width: 0;
}

.public-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-logo-wrap {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-logo {
  height: 36px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.public-brand-lockup .brand-fallback {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.public-brand-name {
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  padding: 0;
  line-height: 1.2;
}

.public-brand-copy h1 {
  color: var(--orange);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  padding: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.public-content { padding: 24px 24px 120px; }

/* --- Intro card ------------------------------------------- */
.public-intro-card { margin-bottom: 20px; }
.public-intro-card .muted { margin-bottom: 0; }

.public-intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.78fr);
  gap: 18px;
  padding: 0;
  overflow: hidden;
}

.public-intro-main,
.public-intro-side { padding: 20px; }

.public-intro-main { background: var(--white); }

.public-intro-side {
  display: grid;
  gap: 12px;
  background: var(--grey-50);
  border-left: 1px solid var(--grey-200);
}

.intro-side-card {
  padding: 16px;
  border-radius: 10px;
  background: var(--white);
  border: 1px solid var(--grey-200);
}

.intro-side-card-soft { background: var(--white); }

.intro-checklist {
  margin: 10px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: var(--grey-700);
  line-height: 1.6;
}

/* --- Login page ------------------------------------------- */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: var(--grey-100);
}

.login-card {
  width: min(100%, 440px);
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 40px;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  text-align: center;
}

.login-logo {
  height: 40px;
  width: auto;
}

.login-logo-fallback {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: none;
  place-items: center;
  background: var(--orange);
  color: var(--navy);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.05em;
}

.login-org {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.login-divider {
  width: 100%;
  height: 1px;
  background: var(--orange);
  margin-bottom: 24px;
}

.login-heading {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.login-subtitle {
  margin: 0 0 24px;
  font-size: 14px;
  color: var(--grey-500);
  line-height: 1.5;
}

.login-footer-note {
  margin: 20px 0 0;
  font-size: 12px;
  color: var(--grey-500);
  text-align: center;
}

.login-secondary-links {
  margin-top: 12px;
}

.login-secondary-links .btn {
  text-decoration: none;
  width: 100%;
  justify-content: center;
}

/* --- Buttons ---------------------------------------------- */
.btn {
  min-height: 40px;
  border-radius: 8px;
  border: 1.5px solid transparent;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.btn-primary:hover {
  background: var(--navy-mid);
  border-color: var(--navy-mid);
}

.btn-secondary {
  background: var(--white);
  color: var(--navy);
  border-color: var(--grey-200);
}

.btn-secondary:hover {
  background: var(--grey-50);
  border-color: var(--grey-300);
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
  border-color: var(--danger);
}

.btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

/* Public header ghost button */
.public-login-link {
  text-decoration: none;
  border: 1.5px solid rgba(255,255,255,0.3);
  background: transparent;
  color: var(--white);
  font-size: 13px;
  padding: 8px 16px;
  min-height: auto;
  border-radius: 8px;
}

.public-login-link:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.5);
  color: var(--white);
}

/* Microsoft sign-in button */
.btn-microsoft {
  width: 100%;
  background: var(--white);
  color: var(--navy);
  border: 1.5px solid var(--grey-200);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 20px;
  border-radius: 8px;
  gap: 12px;
}

.btn-microsoft:hover {
  background: var(--grey-50);
  border-color: var(--grey-300);
}

/* Logout button */
.btn-logout {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.2);
  font-size: 13px;
  padding: 7px 14px;
  min-height: auto;
}

.btn-logout:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.4);
}

/* Submit / orange CTA */
.btn-submit {
  width: 100%;
  background: var(--orange);
  color: var(--white);
  border-color: var(--orange);
  min-width: auto;
  min-height: auto;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
}

.btn-submit:hover {
  background: var(--orange-dark);
  border-color: var(--orange-dark);
}

/* Microsoft logo */
.ms-grid {
  display: grid;
  grid-template-columns: repeat(2, 9px);
  gap: 2px;
  flex-shrink: 0;
}

.ms-grid span:nth-child(1) { background: #F25022; }
.ms-grid span:nth-child(2) { background: #7FBA00; }
.ms-grid span:nth-child(3) { background: #00A4EF; }
.ms-grid span:nth-child(4) { background: #FFB900; }
.ms-grid span { width: 9px; height: 9px; }

/* --- Topbar ----------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 56px;
  padding: 0 24px;
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar-brand,
.topbar-right,
.topbar-copy { display: flex; align-items: center; }

.topbar-brand { gap: 12px; min-width: 0; }

.topbar-copy {
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.topbar-copy strong {
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
}

.topbar-copy span {
  color: rgba(255,255,255,0.6);
  font-size: 11px;
}

.topbar-right { gap: 10px; }

.topbar-logo {
  height: 36px;
  width: auto;
}

.topbar-logo-fallback {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: none;
  place-items: center;
  background: var(--orange);
  color: var(--navy);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.05em;
}

.brand-fallback {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: none;
  place-items: center;
  background: var(--orange);
  color: var(--navy);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.05em;
}

/* User chip */
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
}

.user-chip-name {
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
}

/* Role badge */
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.role-badge-topbar {
  background: var(--orange-light);
  color: var(--orange-dark);
}

/* --- Subnav ----------------------------------------------- */
.subnav {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 0 16px;
  background: var(--white);
  border-bottom: 1px solid var(--grey-200);
  scrollbar-width: none;
}

.subnav::-webkit-scrollbar { display: none; }

.subnav-btn {
  white-space: nowrap;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 12px 16px;
  color: var(--grey-500);
  font-size: 13px;
  font-weight: 600;
  min-height: auto;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.subnav-btn:hover { color: var(--navy); }

.subnav-btn.active {
  color: var(--navy);
  border-bottom-color: var(--orange);
}

/* --- App shell -------------------------------------------- */
.app-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 24px 120px;
}

.page-header { margin-bottom: 20px; }

.page-header h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
  margin: 0;
}

/* --- Stats grid ------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.overview-panel { margin-bottom: 20px; }

.overview-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.overview-head h3 {
  margin: 0;
  color: var(--navy);
  font-size: 18px;
  font-weight: 700;
}

/* --- Cards ------------------------------------------------- */
.stat-card,
.section-card,
.incident-card,
.empty-state {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.stat-card {
  padding: 18px;
  display: grid;
  gap: 12px;
  position: relative;
  overflow: hidden;
  border-left: 3px solid var(--grey-200);
}

.stat-card.stat-open        { border-left-color: var(--warning); }
.stat-card.stat-unassigned  { border-left-color: var(--danger); }
.stat-card.stat-assigned    { border-left-color: var(--info); }
.stat-card.stat-resolved    { border-left-color: var(--success); }
.stat-card.stat-total       { border-left-color: var(--navy); }

.stat-card .label {
  color: var(--grey-500);
  font-size: 12px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.stat-card .value {
  color: var(--navy);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.stat-card .meta {
  color: var(--grey-500);
  font-size: 13px;
  line-height: 1.5;
}

/* --- Toolbar ---------------------------------------------- */
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.toolbar-surface {
  padding: 14px;
  border: 1px solid var(--grey-200);
  border-radius: 10px;
  background: var(--grey-50);
}

.toolbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.toolbar-note { margin: -2px 2px 14px; }

/* --- Inputs ----------------------------------------------- */
.input {
  width: 100%;
  min-height: 44px;
  border: 1.5px solid var(--grey-200);
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--white);
  color: var(--grey-700);
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--navy-light);
}

.input:hover { border-color: var(--grey-300); }

.public-page .input {
  min-height: auto;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--grey-200);
  background: var(--white);
  font-size: 14px;
}

.public-page .input:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--navy-light);
}

.public-page .input:hover { border-color: var(--grey-300); }
.public-page .textarea { min-height: 110px; }

.input[aria-invalid="true"],
.input.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-light);
}

.textarea {
  min-height: 132px;
  resize: vertical;
  line-height: 1.6;
}

.toolbar-search { flex: 1 1 280px; }
.toolbar-select { width: auto; min-width: 190px; }

/* --- Incident list ---------------------------------------- */
.incident-list { display: grid; gap: 10px; }

.incident-card {
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.incident-card:hover {
  border-color: var(--grey-300);
  box-shadow: var(--shadow-md);
}

.incident-card.card-open       { border-left: 3px solid var(--warning); }
.incident-card.card-assigned   { border-left: 3px solid var(--info); }
.incident-card.card-resolved   { border-left: 3px solid var(--success); }
.incident-card.card-unassigned { border-left: 3px solid var(--danger); }

.incident-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.reference {
  font-family: 'Courier New', monospace;
  color: var(--navy);
  font-weight: 700;
  font-size: 13px;
}

/* --- Status badges ---------------------------------------- */
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.status-SUBMITTED       { background: var(--warning-light); color: var(--warning); }
.status-ASSIGNED        { background: var(--info-light); color: var(--info); }
.status-IN_PROGRESS     { background: var(--navy-light); color: var(--navy); }
.status-ACTION_COMPLETED { background: var(--success-light); color: var(--success); }
.status-PENDING_CLOSURE { background: #f3e8ff; color: #7c3aed; }
.status-CLOSED          { background: var(--success-light); color: #047857; }
.status-OPEN            { background: var(--warning-light); color: var(--warning); }
.status-RESOLVED        { background: var(--success-light); color: var(--success); }

.workflow-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--grey-200);
  background: var(--grey-50);
  color: var(--grey-500);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.assignment-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.assignment-assigned   { background: var(--info-light);   color: var(--info); }
.assignment-unassigned { background: var(--danger-light); color: var(--danger); }

/* --- Incident card layout --------------------------------- */
.incident-card-head,
.incident-card-main,
.incident-card-metrics,
.incident-card-footer {
  display: flex;
  gap: 12px;
}

.incident-card-head,
.incident-card-footer {
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.incident-card-main {
  flex-direction: column;
  margin-bottom: 12px;
}

.incident-card-main h3 { margin: 0; }

.incident-card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.incident-card-summary { display: grid; gap: 8px; }
.incident-card-metrics { flex-wrap: wrap; margin-top: 6px; }

.incident-metric {
  min-width: 124px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--grey-50);
  border: 1px solid var(--grey-200);
}

.incident-metric-label {
  display: block;
  color: var(--grey-500);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.incident-metric-value {
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.incident-summary { color: var(--grey-500); line-height: 1.6; }

.incident-footer { margin-top: 0; color: var(--grey-500); font-size: 12px; }

.incident-footer-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.incident-footer-cta { color: var(--navy); font-weight: 700; }

.dashboard-list-panel { padding: 20px; }

.incident-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
}

.empty-state {
  padding: 28px;
  text-align: center;
  color: var(--grey-500);
}

/* --- Report form ------------------------------------------ */
.report-form { display: grid; gap: 20px; }

.section-card { padding: 24px; }

.public-page .section-card {
  padding: 24px;
  border-radius: 12px;
  box-shadow: var(--shadow-xs);
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  align-items: flex-start;
}

.section-title-row.compact { margin-bottom: 16px; }

.section-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}

.public-page .section-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
}

/* --- Grid / field layout ---------------------------------- */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.field { display: flex; flex-direction: column; gap: 6px; }
.public-page .field { gap: 6px; }

.public-section > .field + .field,
.public-section > .grid + .field,
.public-section > .field + .grid,
.public-section > .field + [id],
.public-section > [id] + .field { margin-top: 20px; }

.public-section .grid { gap: 20px 16px; }
.field-full { grid-column: 1 / -1; }

.field label,
.checkbox-line span {
  font-size: 13px;
  font-weight: 600;
  color: var(--grey-700);
  letter-spacing: 0.01em;
}

.public-page .field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--grey-700);
}

.field label { line-height: 1.45; }

.required-mark {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--grey-100);
  color: var(--grey-700);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--grey-200);
  vertical-align: middle;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

/* --- Choice pills ----------------------------------------- */
.choice-row { display: flex; flex-wrap: wrap; gap: 10px; }

.choice-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 1 1 120px;
  min-height: 44px;
  border: 1.5px solid var(--grey-200);
  border-radius: 999px;
  background: var(--white);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.public-page .choice-pill {
  min-height: auto;
  flex: 0 0 auto;
}

.choice-pill input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.choice-pill span {
  width: 100%;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--navy);
  text-align: center;
}

.public-page .choice-pill span { padding: 8px 20px; }

.choice-pill:hover { border-color: var(--grey-300); }

.choice-pill:has(input:checked) {
  border-color: var(--navy);
  background: var(--navy);
}

.choice-pill:has(input:checked) span { color: var(--white); }

/* --- Public section cards --------------------------------- */
.public-section {
  position: relative;
  background: var(--white);
}

/* --- Typography helpers ----------------------------------- */
.section-kicker,
.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 700;
  color: var(--orange);
}

.panel-label {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 700;
  color: var(--grey-500);
}

.muted,
.helper-copy,
.tiny-note {
  color: var(--grey-500);
  line-height: 1.6;
}

.section-lead {
  margin: 8px 0 0;
  color: var(--grey-500);
  line-height: 1.6;
  font-size: 14px;
}

.helper-inline { margin-top: -2px; }
.tiny-note { margin: 14px 0 0; font-size: 12px; }

.section-marker {
  display: inline-flex;
  align-items: center;
  min-height: auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--grey-100);
  border: 1px solid var(--grey-200);
  color: var(--grey-500);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.public-flow-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.flow-chip {
  display: inline-flex;
  align-items: center;
  min-height: auto;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--grey-200);
  color: var(--navy);
  font-size: 11px;
  font-weight: 600;
}

/* --- Upload field ----------------------------------------- */
.upload-field {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1.5px dashed var(--grey-300);
  border-radius: 10px;
  background: var(--grey-50);
}

.upload-copy { display: grid; gap: 5px; }
.upload-copy strong { color: var(--navy); font-size: 15px; }
.upload-copy span { color: var(--grey-500); line-height: 1.5; }
.file-input { padding: 10px 12px; background: var(--white); }

.attachment-list { margin-top: 12px; display: grid; gap: 8px; }

.attachment-chip {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--grey-50);
  border: 1px solid var(--grey-200);
  color: var(--grey-700);
  font-size: 12px;
}

/* --- Final step card ------------------------------------------- */
.final-step-card {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px 32px;
  margin-top: 8px;
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.final-step-header { display: grid; gap: 6px; }

.final-step-header strong {
  color: var(--navy);
  font-size: 16px;
  font-weight: 700;
}

.final-step-header span {
  color: var(--grey-500);
  font-size: 13px;
  line-height: 1.5;
}

.turnstile-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  background: var(--grey-50);
  border: 1px solid var(--grey-200);
  border-radius: 10px;
}

.turnstile-label {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.turnstile-wrap {
  display: flex;
  justify-content: center;
}

/* --- Detail drawer ---------------------------------------- */
.detail-drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  justify-content: flex-end;
}

.drawer-scrim {
  position: absolute;
  inset: 0;
  background: rgba(11,35,63,0.4);
}

.drawer-panel {
  position: relative;
  width: min(720px, 100vw);
  height: 100%;
  background: var(--white);
  box-shadow: -8px 0 32px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--grey-200);
  background: var(--white);
}

.drawer-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.drawer-body {
  padding: 20px 24px;
  overflow-y: auto;
  display: grid;
  gap: 16px;
  background: var(--white);
}

/* Drawer hero — clean white card replacing dark panel */
.drawer-hero {
  padding: 20px;
  border-radius: 12px;
  background: var(--white);
  border: 1px solid var(--grey-200);
  box-shadow: var(--shadow-xs);
  color: var(--grey-700);
}

.drawer-hero-head,
.drawer-hero-meta,
.drawer-hero-assignment {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.drawer-hero-head { align-items: center; justify-content: space-between; }

.drawer-hero h4 {
  margin: 10px 0 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.drawer-hero p { margin: 0; color: var(--grey-500); }

.drawer-hero-meta,
.drawer-hero-assignment { margin-top: 12px; }

.drawer-meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--grey-100);
  border: 1px solid var(--grey-200);
  color: var(--grey-700);
  font-size: 12px;
  font-weight: 600;
}

/* Detail cards */
.detail-card {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: 12px;
  padding: 20px;
}

.detail-card h4 {
  margin: 0 0 14px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey-500);
  font-weight: 700;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-item label {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--grey-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-item div,
.timeline-note,
.detail-card p {
  color: var(--grey-700);
  line-height: 1.6;
}

.detail-full { grid-column: 1 / -1; }

/* Status overview */
.status-overview { display: grid; gap: 14px; }

.status-highlight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.status-highlight {
  padding: 14px;
  border-radius: 10px;
  background: var(--grey-50);
  border: 1px solid var(--grey-200);
}

.status-highlight label {
  display: block;
  margin-bottom: 6px;
  color: var(--grey-500);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-highlight strong {
  display: block;
  color: var(--navy);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.status-highlight p {
  margin: 4px 0 0;
  color: var(--grey-500);
  line-height: 1.5;
  font-size: 13px;
}

.status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--grey-200);
  background: var(--white);
}

.status-banner-copy { display: grid; gap: 4px; }

.status-banner-title {
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
}

.status-banner-copy p {
  margin: 0;
  color: var(--grey-500);
  font-size: 13px;
}

/* --- Timeline --------------------------------------------- */
.timeline { display: grid; gap: 10px; }

.timeline-item {
  border-left: 2px solid var(--grey-200);
  padding: 2px 0 2px 12px;
}

.timeline-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.timeline-title { font-weight: 700; color: var(--navy); font-size: 13px; }
.timeline-meta { color: var(--grey-500); font-size: 12px; }

/* --- Actions ---------------------------------------------- */
.action-grid { display: grid; gap: 12px; }
.action-row { display: flex; gap: 10px; flex-wrap: wrap; }
.action-note { font-size: 12px; color: var(--grey-500); }

/* --- Attachment links ------------------------------------- */
.attachment-links { display: grid; gap: 8px; }

.attachment-links a {
  color: var(--info);
  text-decoration: none;
  font-weight: 600;
}

/* --- User management -------------------------------------- */
.user-card { cursor: default; }

.user-table-wrap {
  border: 1px solid var(--grey-200);
  border-radius: 12px;
  overflow: hidden;
  max-height: calc(100vh - 280px);
  overflow-y: auto;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.user-table { width: 100%; border-collapse: collapse; font-size: 14px; }

.user-table thead { position: sticky; top: 0; z-index: 2; }

.user-table thead th {
  background: var(--navy);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 12px 14px;
  text-align: left;
  border-bottom: 2px solid var(--orange);
  white-space: nowrap;
}

.user-table tbody tr {
  border-bottom: 1px solid var(--grey-200);
  transition: background 0.1s ease;
}

.user-table tbody tr:last-child { border-bottom: none; }
.user-table tbody tr:nth-child(even) { background: var(--grey-50); }
.user-table tbody tr:hover { background: var(--orange-light); }

.user-table td { padding: 9px 14px; vertical-align: middle; line-height: 1.4; }
.user-table .col-email { color: var(--grey-500); font-size: 13px; }

.user-table .col-role,
.user-table .col-action { white-space: nowrap; width: 1%; }

.user-name { font-weight: 600; color: var(--navy); display: block; }

.user-email-mobile {
  display: none;
  color: var(--grey-500);
  font-size: 12px;
  margin-top: 2px;
}

.user-role-select {
  min-height: 34px;
  border: 1.5px solid var(--grey-300);
  border-radius: 8px;
  padding: 5px 8px;
  background: var(--white);
  color: var(--grey-700);
  font: inherit;
  font-size: 13px;
  width: auto;
  cursor: pointer;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.user-role-select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--navy-light);
}

.btn-save-role {
  min-height: 32px;
  padding: 5px 14px;
  border-radius: 8px;
  border: 1px solid var(--grey-300);
  background: var(--white);
  color: var(--grey-500);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: not-allowed;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.btn-save-role:not(:disabled) {
  background: var(--orange);
  color: var(--white);
  border-color: var(--orange);
  cursor: pointer;
}

.btn-save-role:not(:disabled):hover {
  background: var(--orange-dark);
  border-color: var(--orange-dark);
}

/* --- User avatars ----------------------------------------- */
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.user-avatar-initials {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--orange);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.04em;
  user-select: none;
}

.user-table .col-avatar { width: 44px; padding-right: 4px; }

/* --- Role filter tabs ------------------------------------- */
.role-filter-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  margin-bottom: 12px;
  scrollbar-width: none;
}

.role-filter-tabs::-webkit-scrollbar { display: none; }

.role-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--grey-200);
  background: var(--white);
  color: var(--grey-700);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.role-tab:hover:not(.active) {
  background: var(--grey-50);
  border-color: var(--grey-300);
}

.role-tab.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.tab-count {
  background: rgba(255,255,255,0.2);
  color: inherit;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}

.role-tab:not(.active) .tab-count {
  background: var(--grey-100);
  color: var(--grey-500);
}

/* --- Assign combobox -------------------------------------- */
.assign-dropdown-wrap { position: relative; }

.assign-combobox-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.assign-combobox-input {
  width: 100%;
  min-height: 44px;
  border: 1.5px solid var(--grey-200);
  border-radius: 8px;
  padding: 10px 36px 10px 14px;
  background: var(--white);
  color: var(--grey-700);
  font: inherit;
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.assign-combobox-input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px var(--navy-light);
}

.assign-combobox-input:hover { border-color: var(--grey-300); }
.assign-combobox-input:disabled { opacity: 0.6; cursor: not-allowed; }
.assign-combobox-input::placeholder { color: var(--grey-500); }

.assign-dropdown-caret {
  position: absolute;
  right: 12px;
  pointer-events: none;
  color: var(--grey-500);
  font-size: 10px;
}

.assign-dropdown-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1.5px solid var(--grey-200);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  max-height: 260px;
  overflow-y: auto;
  z-index: 50;
}

.assign-dropdown-list.hidden { display: none; }

.assign-dropdown-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.1s ease;
}

.assign-dropdown-option.hidden { display: none; }

.assign-dropdown-option:hover,
.assign-dropdown-option[aria-selected="true"],
.assign-dropdown-option.is-active { background: var(--orange-light); }

.assign-dropdown-option-name {
  flex: 1;
  font-weight: 500;
  color: var(--grey-700);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assign-dropdown-option-role { font-size: 12px; color: var(--grey-500); white-space: nowrap; }

/* --- Toast / loading --------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--navy);
  color: var(--white);
  border-radius: 8px;
  padding: 10px 18px;
  box-shadow: var(--shadow-md);
  z-index: 100;
  font-size: 14px;
  font-weight: 500;
}

.loading {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  gap: 14px;
  background: rgba(11,35,63,0.3);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: var(--orange);
  animation: spin 0.8s linear infinite;
}

#loading-label { color: var(--white); font-weight: 600; }

@keyframes spin { to { transform: rotate(360deg); } }

/* -------------------------------------------------------------------------
   Status timeline
   ------------------------------------------------------------------------- */
.status-timeline {
  display: flex;
  align-items: flex-start;
  width: 100%;
  padding: 16px 0 24px;
}

.status-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.status-step-row { display: flex; align-items: center; width: 100%; }

.status-step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
  line-height: 1;
  transition: box-shadow 0.2s;
}

.status-step-circle.completed {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

.status-step-circle.current {
  width: 32px;
  height: 32px;
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  box-shadow: 0 0 0 4px var(--navy-light);
  animation: status-pulse 2s ease-in-out infinite;
}

.status-step-circle.upcoming {
  background: var(--white);
  border-color: var(--grey-300);
  color: var(--grey-300);
}

.status-step-tick { font-size: 13px; line-height: 1; }

.status-step-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  display: block;
}

.status-step-line { flex: 1; height: 2px; margin-top: 0; }
.status-step-line.completed { background: var(--orange); }
.status-step-line.upcoming { background: var(--grey-200); }

.status-step-label {
  font-size: 11px;
  text-align: center;
  margin-top: 6px;
  color: var(--grey-500);
  word-break: break-word;
  padding: 0 2px;
}

.status-step-label.current-label { font-weight: 700; color: var(--navy); }

@keyframes status-pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--navy-light); }
  50%       { box-shadow: 0 0 0 7px rgba(11,35,63,0.06); }
}

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .stats-grid,
  .grid-2,
  .detail-grid { grid-template-columns: 1fr 1fr; }

  .public-intro-grid { grid-template-columns: 1fr; }

  .public-intro-side {
    border-left: 0;
    border-top: 1px solid var(--grey-200);
  }
}

@media (max-width: 640px) {
  .public-hero-inner { padding: 12px 16px; }

  .public-brand-lockup { gap: 8px; flex-wrap: nowrap; }
  .public-brand-lockup .brand-logo { height: 28px; }
  .public-brand-lockup .brand-fallback { width: 32px; height: 32px; }

  .public-content { padding-top: 16px; }

  .overview-head,
  .incident-card-head,
  .incident-card-title-row,
  .incident-card-footer,
  .submit-bar-card,
  .status-banner {
    flex-direction: column;
    align-items: stretch;
  }

  .status-highlight-grid { grid-template-columns: 1fr; }

  .login-card { padding: 28px 24px; }

  .topbar {
    min-height: auto;
    padding: 10px 16px;
    flex-wrap: wrap;
  }

  .topbar-right { width: 100%; justify-content: space-between; }

  .user-chip-name {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stats-grid,
  .grid-2,
  .detail-grid { grid-template-columns: 1fr; }

  .section-card,
  .detail-card,
  .incident-card,
  .stat-card { padding: 16px; }

  .public-intro-main,
  .public-intro-side { padding: 18px; }

  .section-card h3 { font-size: 16px; }
  .dashboard-list-panel { padding: 16px; }

  .subnav { padding: 0 10px; }

  .drawer-panel { width: 100%; }
  .drawer-head { padding: 16px 18px; }
  .drawer-body { padding: 16px 18px; }

  .upload-field { padding: 14px; }

  .final-step-card { padding: 20px 16px; gap: 20px; border-radius: 10px; }
  .btn-submit { width: 100%; min-width: 0; }

  .drawer-hero h4 { font-size: 18px; }
  .toolbar-surface { padding: 12px; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions .btn { flex: 1 1 0; }
}

@media (max-width: 640px) {
  .user-table .col-email { display: none; }
  .user-email-mobile { display: block; }
  .user-table-wrap { max-height: calc(100vh - 320px); }
}

@media (max-width: 520px) {
  .status-step-circle { width: 22px; height: 22px; font-size: 11px; }
  .status-step-circle.current { width: 26px; height: 26px; }
  .status-step-dot { width: 6px; height: 6px; }
  .status-step-label { font-size: 9px; }
}

@media (max-width: 420px) {
  .public-content,
  .app-shell { padding-left: 12px; padding-right: 12px; }

  .choice-pill { flex-basis: 100%; }

  .required-mark,
  .section-marker { font-size: 9px; }
}
