/* ============================================================================
   IROPS Disruption Memory — operations console

   PrimeVue's Aura theme styles the components; this file only does what a
   component library cannot: the app shell, the domain-specific bits (severity
   colours, outcome scores, precedent cards), and a density pass, because Aura's
   defaults are roomier than an ops desk wants.

   Aura exposes its palette as CSS variables (--p-*), so everything below is
   expressed in those rather than hardcoded hex — the theme stays swappable.
   ============================================================================ */

:root {
  --shell-bg:   var(--p-surface-950);
  --shell-side: var(--p-surface-900);
  --line:       var(--p-surface-800);

  --good:     var(--p-green-400);
  --warning:  var(--p-amber-400);
  --serious:  var(--p-orange-400);
  --critical: var(--p-red-400);
  --accent:   var(--p-primary-400);

  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--shell-bg); }

body {
  color: var(--p-text-color);
  font-family: var(--p-font-family, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  font-size: 13.5px;
  -webkit-font-smoothing: antialiased;
}

#app { display: flex; min-height: 100vh; }

/* ----------------------------------------------------------------- shell -- */

.side {
  width: 236px; flex: none;
  background: var(--shell-side);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 18px 14px;
  position: sticky; top: 0; height: 100vh;
}

.logo { display: flex; align-items: center; gap: 11px; padding: 2px 6px 18px; }
.logochip {
  width: 36px; height: 36px; flex: none; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--p-primary-500), var(--p-violet-500));
  color: #fff; font-size: 16px;
}
.logo b { display: block; font-size: 14px; font-weight: 700; color: var(--p-text-color); }
.logo small { display: block; font-size: 10.5px; color: var(--p-text-muted-color); }

.navlabel {
  font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--p-text-muted-color); padding: 10px 8px 8px;
}

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav button {
  appearance: none; border: none; background: none; cursor: pointer;
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 8px;
  color: var(--p-text-color); font: 500 13px/1 inherit; text-align: left;
}
.nav button i { font-size: 15px; opacity: .8; }
.nav button:hover { background: var(--p-surface-800); }
.nav button.on { background: var(--p-primary-color); color: var(--p-primary-contrast-color); }
.nav button.on i { opacity: 1; }
.nav button b {
  margin-left: auto; font: 600 11px/1 var(--mono); opacity: .8;
  font-variant-numeric: tabular-nums;
}

.sideend { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.sysbox {
  display: flex; gap: 9px; align-items: flex-start;
  background: var(--p-surface-800); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 11px;
  font: 11px/1.5 var(--mono); color: var(--p-text-muted-color); word-break: break-all;
}
.sysok { color: var(--good); }
.synth { text-align: center; font-size: 10.5px; color: var(--p-text-muted-color); }

.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 4px; }
.dot.up { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 20%, transparent); }
.dot.down { background: var(--critical); }

.mainwrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 22px; position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--shell-bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar .spacer { flex: 1; }
.topbar .p-inputtext { width: 340px; }
.clock {
  font: 600 12.5px/1 var(--mono); color: var(--p-text-color);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.clock span { color: var(--p-text-muted-color); margin-left: 3px; }

main { padding: 20px 22px 40px; max-width: 1560px; width: 100%; margin: 0 auto; }

.pagehead { margin-bottom: 18px; }
.pagehead h1 { font-size: 21px; font-weight: 700; margin: 0; color: var(--p-text-color); }
.pagehead .sub { font-size: 12.5px; color: var(--p-text-muted-color); margin-top: 3px; }

/* ------------------------------------------------------------------- kpi -- */

.kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.kpi {
  display: flex; align-items: flex-start; gap: 11px;
  background: var(--p-content-background);
  border: 1px solid var(--p-content-border-color);
  border-radius: 12px; padding: 14px 15px;
}
.kchip {
  width: 38px; height: 38px; flex: none; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.kchip.blue   { background: color-mix(in srgb, var(--p-primary-400) 16%, transparent); color: var(--p-primary-400); }
.kchip.purple { background: color-mix(in srgb, var(--p-violet-400) 16%, transparent);  color: var(--p-violet-400); }
.kchip.pink   { background: color-mix(in srgb, var(--p-pink-400) 16%, transparent);    color: var(--p-pink-400); }
.kchip.green  { background: color-mix(in srgb, var(--good) 16%, transparent);          color: var(--good); }
.kchip.orange { background: color-mix(in srgb, var(--warning) 16%, transparent);       color: var(--warning); }
.kchip.red    { background: color-mix(in srgb, var(--critical) 16%, transparent);      color: var(--critical); }

.kpi .k { font-size: 11px; color: var(--p-text-muted-color); }
.kpi .v {
  font-size: 21px; font-weight: 700; line-height: 1.15;
  color: var(--p-text-color); font-variant-numeric: tabular-nums;
}
.kpi .v small { font-size: 12px; color: var(--p-text-muted-color); font-weight: 500; }
.kpi .foot { font-size: 11px; color: var(--p-text-muted-color); margin-top: 5px; }

/* ---------------------------------------------------------------- panels -- */

.step { margin-bottom: 14px; }
.step .p-panel-header { gap: 10px; flex-wrap: wrap; }
.ptitle { font-size: 14px; font-weight: 650; color: var(--p-text-color); }
.pnote { font-size: 11.5px; font-weight: 400; color: var(--p-text-muted-color); }
.pnote.pad { padding: 2px 0; }
.hdrbtn { margin-left: auto; }

.stepnum {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; flex: none; border-radius: 7px;
  background: color-mix(in srgb, var(--p-primary-400) 18%, transparent);
  color: var(--p-primary-400); font: 700 11px/1 var(--mono);
}

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 1180px) { .cols { grid-template-columns: 1fr; } }

.tblhead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tbltitle { font-size: 14px; font-weight: 650; }
.tblhead .p-selectbutton { margin-left: auto; }

/* ------------------------------------------------------------ case head -- */

/* Sticky identity strip. Sits under the topbar so that twelve rows into an
   action list you still know which flight and how bad it is. */
.casebar {
  position: sticky; top: 61px; z-index: 16;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 15px; margin-bottom: 14px;
  background: var(--p-surface-800);
  border: 1px solid var(--p-content-border-color);
  border-radius: 12px;
  box-shadow: 0 6px 18px -12px rgb(0 0 0 / .9);
}
.casebar .route { font: 650 17px/1 var(--mono); color: var(--p-text-color); }
.casebar .route em { font-style: normal; color: var(--p-text-muted-color); margin: 0 7px; }
.casebar .spacer { flex: 1; }
.cbf { font-size: 11.5px; color: var(--p-text-muted-color); }
.cbf b {
  font: 650 13.5px/1 var(--mono); color: var(--p-text-color);
  font-variant-numeric: tabular-nums; margin-right: 4px;
}

.casehead-card { margin-bottom: 14px; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 8px; }
.fact { background: var(--p-surface-800); border-radius: 9px; padding: 9px 12px; }
.fact .k {
  font-size: 10px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--p-text-muted-color); margin-bottom: 3px;
}
.fact .v { font: 650 14.5px/1.25 inherit; color: var(--p-text-color); font-variant-numeric: tabular-nums; }

.crumb { margin-bottom: 10px; }

/* -------------------------------------------------------------- evidence -- */

.prec {
  border: 1px solid var(--p-content-border-color);
  border-left: 3px solid var(--p-surface-700);
  border-radius: 0 10px 10px 0;
  background: var(--p-surface-800);
  padding: 11px 13px; margin-bottom: 9px;
}
.prec.bad  { border-left-color: var(--critical); }
.prec.mid  { border-left-color: var(--warning); }
.prec.good { border-left-color: var(--good); }

.prec .top { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; flex-wrap: wrap; }
.prec .id { font: 500 11px/1 var(--mono); color: var(--p-text-muted-color); }
.prec .meta { font: 11px/1.4 var(--mono); color: var(--p-text-muted-color); }
.prec .sim { margin-left: auto; display: flex; align-items: center; gap: 7px; font-size: 11px; }
.prec .txt { font-size: 12.5px; line-height: 1.55; margin-bottom: 8px; }
.prec .did { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.prec .did .lbl {
  font: 600 9.5px/1 inherit; letter-spacing: .08em; text-transform: uppercase;
  color: var(--p-text-muted-color);
}
.prec .did .lbl.gap { margin-left: 8px; }
.prec .note { font-size: 12px; line-height: 1.55; color: var(--p-text-muted-color); font-style: italic; }
.prec.bad .note { color: color-mix(in srgb, var(--critical) 70%, var(--p-text-color)); }

/* ----------------------------------------------------------- action plan -- */
/* One card per action type, not per passenger. Twelve identical rebook cards
   is one decision printed twelve times; grouping turns thirteen Approve clicks
   into three, and per-passenger override stays one click away. */

.grp {
  border: 1px solid var(--p-content-border-color);
  border-radius: 11px; background: var(--p-surface-800);
  margin-bottom: 10px; overflow: hidden;
}
.grp.open { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

.grphead {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; cursor: pointer;
}
.grphead:hover { background: color-mix(in srgb, var(--p-surface-700) 55%, transparent); }

.grpicon {
  width: 34px; height: 34px; flex: none; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent);
}
.grpicon.rebook     { background: color-mix(in srgb, var(--p-primary-400) 16%, transparent); color: var(--p-primary-400); }
.grpicon.hotel      { background: color-mix(in srgb, var(--p-violet-400) 16%, transparent);  color: var(--p-violet-400); }
.grpicon.prioritise { background: color-mix(in srgb, var(--warning) 16%, transparent);       color: var(--warning); }
.grpicon.escalate   { background: color-mix(in srgb, var(--critical) 16%, transparent);      color: var(--critical); }
.grpicon.notify     { background: color-mix(in srgb, var(--good) 16%, transparent);          color: var(--good); }

.grpname { min-width: 0; display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.grpname b { font-size: 14.5px; font-weight: 650; }
.grpn {
  font: 650 12px/1 var(--mono); font-variant-numeric: tabular-nums;
  background: var(--p-surface-700); color: var(--p-text-color);
  border-radius: 20px; padding: 3px 8px;
}
.grpname .dim { font-size: 11.5px; }
.grpwho {
  flex-basis: 100%; font-size: 11.5px;
  color: color-mix(in srgb, var(--warning) 75%, var(--p-text-color));
}
.grpstat { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.grpchev { color: var(--p-text-muted-color); font-size: 12px; flex: none; }

.grpbody { padding: 0 14px 12px 60px; display: flex; flex-direction: column; gap: 10px; }
.grpctl { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.grpctl .dim i { margin-right: 4px; color: var(--good); }

/* Precedent chips — the whole point of the product, placed where the decision
   is made. A reviewer can act on "ZZ2638 · 2/5 · went badly"; they cannot act
   on "ee75da89". */
.cites { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.cites .lbl {
  font: 600 9.5px/1 inherit; letter-spacing: .08em; text-transform: uppercase;
  color: var(--p-text-muted-color);
}
.cites .conf { margin-left: auto; display: flex; align-items: center; gap: 7px; font-size: 11px; }

.pchip {
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 8px; border-radius: 20px;
  background: var(--p-surface-900);
  border: 1px solid var(--p-surface-700);
  color: var(--p-text-color); font: 11.5px/1 inherit;
}
.pchip:hover { border-color: var(--accent); background: var(--p-surface-700); }
.pchip i { font-size: 10px; color: var(--p-text-muted-color); }
.pchip .pf { font: 600 11.5px/1 var(--mono); }
.pchip .pr { font: 600 11px/1 var(--mono); font-variant-numeric: tabular-nums; }
.pchip .pw { color: var(--p-text-muted-color); font-size: 11px; }
.pchip.bad  { border-color: color-mix(in srgb, var(--critical) 55%, transparent); background: color-mix(in srgb, var(--critical) 10%, var(--p-surface-900)); }
.pchip.mid  { border-color: color-mix(in srgb, var(--warning) 45%, transparent); }
.pchip.good { border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.pchip.bad .pw { color: color-mix(in srgb, var(--critical) 75%, var(--p-text-color)); }
.pchip.tiny { padding: 2px 7px; font-size: 10.5px; gap: 4px; }
.pchip.tiny .pf { font-size: 10.5px; }

/* Individual actions, revealed by "Review individually". */
.grpitems { border-top: 1px solid var(--p-content-border-color); background: var(--p-surface-900); }
.itm {
  display: grid; grid-template-columns: 8.5rem 1fr auto auto;
  gap: 12px; align-items: start;
  padding: 9px 14px; border-bottom: 1px solid var(--line);
}
.itm:last-child { border-bottom: none; }
.itm.approved { background: color-mix(in srgb, var(--good) 6%, transparent); }
.itm.rejected { background: color-mix(in srgb, var(--critical) 6%, transparent); opacity: .72; }
.itm.edited   { background: color-mix(in srgb, var(--warning) 6%, transparent); }
.itmtarget { font-size: 11.5px; padding-top: 5px; }
.itmwhy { font-size: 12.5px; line-height: 1.5; padding-top: 3px; }
.itmnote {
  display: block; margin-top: 4px; font-size: 11.5px;
  color: color-mix(in srgb, var(--warning) 80%, var(--p-text-color));
}
.itmcites { display: flex; gap: 5px; flex-wrap: wrap; padding-top: 3px; max-width: 15rem; }
.itmctl { display: flex; align-items: center; gap: 2px; }

@media (max-width: 900px) {
  .itm { grid-template-columns: 1fr; gap: 6px; }
  .itmcites { max-width: none; }
  .grpbody { padding-left: 14px; }
}

/* ------------------------------------------------------- decision bar -- */
/* Sticks to the bottom of the viewport while you read the evidence below it,
   so the repeated interaction is never more than a glance away. */

.decisionbar {
  position: sticky; bottom: 12px; z-index: 18;
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  padding: 10px 15px; margin: 0 0 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--p-surface-800) 94%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: 0 12px 30px -14px rgb(0 0 0 / .95);
}
.decisionbar.done { border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.decisionbar.done > i { color: var(--good); }
.decisionbar .spacer { flex: 1; }
.dbn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; padding: 0 7px; border-radius: 8px;
  background: var(--p-primary-color); color: var(--p-primary-contrast-color);
  font: 700 13px/1 var(--mono); font-variant-numeric: tabular-nums;
}
.dbt { font-size: 12.5px; font-weight: 500; }
.dbwarn {
  font-size: 11.5px; color: var(--critical);
  display: inline-flex; align-items: center; gap: 5px;
}

/* ------------------------------------------------------------- dialogs -- */

.dlgmeta { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.dlghead { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.dlghead > i { color: var(--p-text-muted-color); }
.dlgquote {
  font-size: 12.5px; line-height: 1.6; padding: 10px 12px;
  border-left: 3px solid var(--p-surface-600);
  background: var(--p-surface-800); border-radius: 0 8px 8px 0;
  color: var(--p-text-muted-color);
}
.dlgquote.bad  { border-left-color: var(--critical); color: color-mix(in srgb, var(--critical) 65%, var(--p-text-color)); }
.dlgquote.mid  { border-left-color: var(--warning); }
.dlgquote.good { border-left-color: var(--good); }
.dlgarea { width: 100%; }
.dlgtags { display: flex; gap: 6px; flex-wrap: wrap; }
.dlghint {
  display: flex; gap: 8px; margin-top: 10px;
  font-size: 11.5px; line-height: 1.55; color: var(--p-text-muted-color);
}
.dlghint i { color: var(--accent); margin-top: 2px; }

/* --------------------------------------------------------------- blank -- */

.blank { text-align: center; padding: 26px 14px 8px; }
.blank > i { font-size: 26px; color: var(--accent); opacity: .8; }
.blank .bt { font-size: 14px; font-weight: 650; margin-top: 10px; }
.blank .bs {
  font-size: 12.5px; color: var(--p-text-muted-color);
  margin: 5px auto 14px; max-width: 46ch; line-height: 1.55;
}

/* --------------------------------------------------- ask the memory (chat) -- */
/* A floating assistant, reachable from every view — the question arrives while
   you are looking at a case, not while you are looking at the stats page. */

.chatfab {
  position: fixed; right: 22px; bottom: 22px; z-index: 900;
  width: 54px; height: 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; appearance: none; border: none;
  background: linear-gradient(135deg, var(--p-primary-500), var(--p-violet-500));
  color: #fff; font-size: 21px;
  box-shadow: 0 10px 26px -8px rgb(0 0 0 / .8), 0 0 0 1px rgb(255 255 255 / .06) inset;
  transition: transform .16s ease, box-shadow .16s ease;
}
.chatfab:hover { transform: translateY(-2px); box-shadow: 0 14px 32px -8px rgb(0 0 0 / .9); }
.chatfab.on { background: var(--p-surface-700); }

/* One quiet pulse until it has been used once, then never again. */
.fabping {
  position: absolute; top: 3px; right: 3px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--good); border: 2px solid var(--shell-bg);
  animation: fabping 2.4s ease-out infinite;
}
@keyframes fabping {
  0%, 60%, 100% { transform: scale(1); opacity: 1; }
  30% { transform: scale(1.35); opacity: .75; }
}

.chatwin {
  position: fixed; right: 22px; bottom: 88px; z-index: 899;
  width: 430px; max-width: calc(100vw - 44px);
  height: 620px; max-height: calc(100vh - 130px);
  display: flex; flex-direction: column;
  background: var(--p-content-background);
  border: 1px solid var(--p-content-border-color);
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 26px 60px -18px rgb(0 0 0 / .95);
}

.chathead {
  display: flex; align-items: center; gap: 10px; flex: none;
  padding: 12px 10px 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--p-surface-800);
}
.chatid { display: flex; flex-direction: column; margin-right: auto; min-width: 0; }
.chatid b { font-size: 13.5px; font-weight: 650; }
.chatid small { font-size: 10.5px; color: var(--p-text-muted-color); }

.chatav {
  width: 30px; height: 30px; flex: none; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
  background: linear-gradient(135deg, var(--p-primary-500), var(--p-violet-500)); color: #fff;
}
.chatav.sm { width: 24px; height: 24px; border-radius: 7px; font-size: 11px; }
.chatav.big { width: 46px; height: 46px; border-radius: 14px; font-size: 20px; margin: 0 auto 12px; }

.chatbody {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 14px; display: flex; flex-direction: column; gap: 12px;
}

.chatempty { text-align: center; margin: auto 0; padding: 8px 4px; }
.chatempty .bt { font-size: 14px; font-weight: 650; }
.chatempty .bs {
  font-size: 12px; line-height: 1.6; color: var(--p-text-muted-color);
  margin: 6px auto 14px; max-width: 34ch;
}
.suggwrap { display: flex; flex-direction: column; gap: 7px; }
.sugg {
  appearance: none; cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 11px; border-radius: 10px;
  background: var(--p-surface-800); border: 1px solid var(--line);
  color: var(--p-text-color); font: 12px/1.4 inherit;
}
.sugg:hover { border-color: var(--accent); background: var(--p-surface-700); }
.sugg i { font-size: 10px; color: var(--accent); flex: none; }

.msg { display: flex; gap: 9px; font-size: 12.5px; line-height: 1.55; }
.msg.user {
  align-self: flex-end; max-width: 86%;
  background: var(--p-primary-color); color: var(--p-primary-contrast-color);
  padding: 9px 13px; border-radius: 14px 14px 4px 14px;
}
.msg.bot { align-items: flex-start; }
.botbody { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.botsay {
  background: var(--p-surface-800); border: 1px solid var(--line);
  padding: 10px 13px; border-radius: 14px 14px 14px 4px;
  white-space: pre-wrap;
}

.thinking {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--p-text-muted-color);
}
.thinking i {
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
  animation: blink 1.2s ease-in-out infinite;
}
.thinking i:nth-child(2) { animation-delay: .2s; }
.thinking i:nth-child(3) { animation-delay: .4s; margin-right: 5px; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* The SQL is the evidence, so it is shown by default rather than hidden behind
   a click — but it collapses, because five statements bury a one-line answer. */
.qwrap { border-top: 1px dashed var(--line); padding-top: 8px; }
.qtoggle {
  appearance: none; background: none; border: none; cursor: pointer;
  display: flex; align-items: center; gap: 6px; padding: 0;
  color: var(--p-text-color); font: 500 11px/1.4 inherit;
}
.qtoggle:hover { color: var(--accent); }
.qtoggle > i { font-size: 9px; }
.qlist { display: flex; flex-direction: column; gap: 7px; margin-top: 7px; }
.q { border-left: 2px solid var(--p-surface-600); padding-left: 8px; }
.q.bad { border-left-color: var(--critical); }
.qh { display: flex; gap: 8px; font: 10px/1.4 var(--mono); margin-bottom: 4px; }
.chatwin pre.sql, .chatwin pre.rows { font-size: 10.5px; padding: 7px 9px; }

.chatfoot {
  flex: none; display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 12px 6px; border-top: 1px solid var(--line);
  background: var(--p-surface-800);
}
.chatinput { flex: 1; max-height: 120px; font-size: 12.5px !important; resize: none; }
.chatnote {
  flex: none; padding: 0 12px 9px; background: var(--p-surface-800);
  font-size: 10px; color: var(--p-text-muted-color); text-align: center;
}

/* The sticky decision bar spans main's width, so its Reject-all button runs
   into the floating chat button on anything but a very wide screen. main is
   capped at 1560 and centred in (viewport - 236px sidebar), so the bar's right
   edge only clears the button's left edge from 1905px up — below that the bar
   reserves room for it. Derived, not eyeballed: at 1900px the gap is 2px. */
@media (max-width: 1920px) { .decisionbar { padding-right: 72px; } }

@media (max-width: 560px) {
  .chatwin {
    right: 10px; left: 10px; bottom: 80px;
    width: auto; max-width: none; max-height: calc(100vh - 108px);
  }
  .chatfab { right: 14px; bottom: 14px; }
}

pre.sql, pre.rows {
  margin: 6px 0 0; padding: 9px 11px; border-radius: 8px;
  font: 11.5px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word;
}
pre.sql {
  background: color-mix(in srgb, var(--p-primary-400) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--p-primary-400) 25%, transparent);
  color: var(--p-primary-300);
}
pre.rows {
  background: var(--p-surface-900); border: 1px solid var(--line);
  color: var(--p-text-muted-color);
}

/* ------------------------------------------------------------------ bars -- */

.bar { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.barlabel { width: 116px; flex: none; font-size: 12px; color: var(--p-text-muted-color); }
.bar .p-progressbar { flex: 1; }
.barval {
  width: 34px; flex: none; text-align: right;
  font: 600 12px/1 var(--mono); font-variant-numeric: tabular-nums;
}
.bar-5 .p-progressbar-value, .bar-4 .p-progressbar-value, .bar-approved .p-progressbar-value { background: var(--good); }
.bar-3 .p-progressbar-value, .bar-edited .p-progressbar-value { background: var(--warning); }
.bar-2 .p-progressbar-value { background: var(--serious); }
.bar-1 .p-progressbar-value, .bar-rejected .p-progressbar-value { background: var(--critical); }
.bar-awaiting .p-progressbar-value { background: var(--p-surface-600); }

/* ---------------------------------------------------------------- domain -- */

.ident { font-family: var(--mono); font-weight: 500; color: var(--p-text-color); }
.dim { color: var(--p-text-muted-color); }
.small { font-size: 11px; }
.mono { font-family: var(--mono); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.sev-minor    { font-family: var(--mono); color: var(--p-text-muted-color); }
.sev-moderate { font-family: var(--mono); color: var(--warning); }
.sev-severe   { font-family: var(--mono); color: var(--serious); }
.sev-extreme  { font-family: var(--mono); color: var(--critical); font-weight: 600; }

.score {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 11.5px/1 var(--mono); font-variant-numeric: tabular-nums;
}
.score i { width: 5px; height: 13px; border-radius: 3px; display: inline-block; }
.score.s1 { color: var(--critical); } .score.s1 i { background: var(--critical); }
.score.s2 { color: var(--serious); }  .score.s2 i { background: var(--serious); }
.score.s3 { color: var(--warning); }  .score.s3 i { background: var(--warning); }
.score.s4 { color: var(--good); }     .score.s4 i { background: var(--good); }
.score.s5 { color: var(--good); }     .score.s5 i { background: var(--good); }

.resolved-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.closeform { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.closeform .p-textarea { width: 100%; }
.closeform .p-button { margin-top: 10px; }
label.field {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--p-text-muted-color); margin-top: 8px;
}

.empty { padding: 24px 8px; text-align: center; color: var(--p-text-muted-color); font-size: 12.5px; }
.foot { font-size: 11px; color: var(--p-text-muted-color); margin-top: 10px; }

/* --------------------------------------------------------------- density -- */
/* Aura is roomier than an ops desk wants; tighten tables and panels. */

.p-datatable-tbody > tr > td { padding: 7px 10px !important; }
.p-datatable-thead > tr > th { padding: 8px 10px !important; }
.p-panel-content { padding: 13px 15px !important; }
.p-panel-header { padding: 11px 15px !important; }
.p-card-body { padding: 15px !important; }
.p-tag { font-size: 10.5px; padding: 2px 8px; }
.p-tag.mini { font-size: 9.5px; padding: 1px 6px; }
tr.clickrow { cursor: pointer; }

.p-tab { font-size: 12.5px !important; padding: 9px 14px !important; display: flex; align-items: center; gap: 7px; }
.p-tab i { font-size: 12px; opacity: .8; }
.p-tabpanels { padding: 13px 0 0 !important; background: transparent !important; }
.p-tablist-tab-list { background: transparent !important; }
.p-dialog-content { padding-bottom: 8px !important; }

/* ------------------------------------------------------------ responsive -- */

@media (max-width: 940px) {
  #app { flex-direction: column; }
  .side {
    width: 100%; height: auto; position: static;
    flex-direction: row; align-items: center; gap: 10px; padding: 10px 14px;
  }
  .logo { padding: 0; }
  .navlabel, .sideend { display: none; }
  .nav { flex-direction: row; margin-left: auto; }
  main { padding: 14px; }
  .topbar .p-inputtext { width: 100%; }
}
