/* ============================================================
   iMe: the application frame and page vocabulary.

   Built on the Ikeja Electric design system 2 (2026-09-29), taken
   from 04-User-Access-Portal: a charcoal sidebar kept dark in both
   themes, group labels, an amber pill on the active item, an
   amber-to-red stripe at its foot, and a sidebar that collapses
   into a page picker in the top bar.

   Colour, radius and shadow come from ie-design-tokens.css only;
   PrimeFaces widgets are themed by ie-primefaces.css. Nothing here
   restyles a .ui-* class except where noted.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
h1, h2, h3, h4 { margin: 0; color: var(--text); }
.muted { color: var(--text-2); }
.tiny { font-size: 12px; color: var(--text-3); }
.mono, .ie-num { font-family: var(--font-mono); }
.ie-num { text-align: right; white-space: nowrap; }
:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); border-radius: 6px; }

/* ---------------------------------------------------------------- frame -- */
.ws-shell { display: flex; min-height: 100vh; }

.ws-side {
  position: sticky; top: 0; height: 100vh; flex: none;
  width: 252px; overflow: hidden;
  background: var(--sidebar, #1A1512);
  display: flex; flex-direction: column; z-index: 30;
  transition: width .28s cubic-bezier(.2,.8,.2,1);
}
.ws-side::after {               /* amber-to-red base stripe */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
.ws-side > * { width: 252px; }  /* content keeps its width while the rail animates shut */

.ws-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.ws-brand .mark {
  width: 38px; height: 38px; border-radius: 10px; background: #fff; flex: none;
  display: flex; align-items: center; justify-content: center; padding: 5px;
}
.ws-brand .mark img { height: 100%; width: auto; display: block; }
.ws-brand .name { font-weight: 800; font-size: 15px; color: #fff; line-height: 1.1; }
.ws-brand .org { font-size: 9.5px; font-weight: 700; letter-spacing: .08em; color: rgba(255,255,255,.45); }

.ws-nav { flex: 1; overflow-y: auto; padding: 8px 12px 16px; scrollbar-width: none; }
.ws-nav::-webkit-scrollbar { display: none; }
.ws-nav .group {
  font-size: 9.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: rgba(255,255,255,.35); padding: 14px 13px 5px;
}
.ws-nav .item {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 9px 13px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500; color: rgba(255,255,255,.72);
  white-space: nowrap; transition: background .12s, color .12s;
}
.ws-nav .item i { font-size: 15px; width: 18px; text-align: center; color: rgba(255,255,255,.5); }
.ws-nav .item span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.ws-nav .item:hover { background: rgba(255,255,255,.06); color: #F6B42E; }
.ws-nav .item:hover i { color: #F6B42E; }
.ws-nav .item.active { background: rgba(246,180,46,.12); color: #fff; font-weight: 700; }
.ws-nav .item.active i { color: #F6B42E; }
.ws-nav .item.active::before {  /* the amber pill */
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: #F6B42E;
}
/* span.count, to outrank ".ws-nav .item span { flex:1 }": the badge stretched and cut its label. */
.ws-nav .item span.count {
  flex: none; background: var(--accent); color: #fff;
  font-size: 10.5px; font-weight: 800; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
}

.ws-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 17px; border-top: 1px solid rgba(255,255,255,.08);
}
.avatar {
  width: 34px; height: 34px; border-radius: 999px; flex: none;
  background: var(--primary); color: var(--on-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12.5px;
}
.ws-user .who { flex: 1; min-width: 0; line-height: 1.2; }
.ws-user .who b { display: block; font-size: 13px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-user .who small { display: block; font-size: 11px; color: rgba(255,255,255,.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-user .out {
  width: 32px; height: 32px; border-radius: 8px; flex: none;
  background: rgba(255,255,255,.06); color: rgba(255,255,255,.65);
  display: flex; align-items: center; justify-content: center;
}
.ws-user .out:hover { color: #F6B42E; }

/* Collapsed: the rail closes and the page picker in the top bar takes over. */
html.side-collapsed .ws-side { width: 0; }
.ws-picker { display: none; position: relative; flex: none; }
html.side-collapsed .ws-picker { display: block; }

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

.ws-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px; padding: 12px 28px;
  background: color-mix(in srgb, var(--canvas) 86%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.ws-top .spacer { flex: 1; }
.icon-btn {
  flex: none; width: 40px; height: 40px; border-radius: 10px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px;
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--text); }
.crumb { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text-3); min-width: 0; white-space: nowrap; }
.crumb b { color: var(--text); font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.theme-btn {
  flex: none; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 12px 6px 8px; font: 700 12.5px var(--font-sans); color: var(--text);
}
.theme-btn .swatch {
  width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 50%, var(--accent) 50%);
}

.picker-btn {
  display: flex; align-items: center; gap: 10px; cursor: pointer; text-align: left;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 5px 10px 5px 6px; font-family: var(--font-sans);
}
.picker-btn:hover { border-color: var(--primary); }
.picker-btn .ic {
  width: 28px; height: 28px; border-radius: 7px; background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.picker-btn .lbl { display: flex; flex-direction: column; line-height: 1.1; }
.picker-btn .lbl small { font-size: 9px; font-weight: 700; letter-spacing: .07em; color: var(--text-3); text-transform: uppercase; }
.picker-btn .lbl b { font-size: 13px; color: var(--text); white-space: nowrap; }
.picker-menu {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; width: 250px;
  max-height: 70vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 6px; animation: ws-pop .16s ease;
}
.ws-picker.open .picker-menu { display: block; }
.picker-menu .group { font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 9px 10px 4px; }
.picker-menu .item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--text); }
.picker-menu .item i { color: var(--text-3); width: 16px; text-align: center; }
.picker-menu .item:hover { background: var(--surface-3); color: var(--text); }
.picker-menu .item.active { background: var(--primary-soft); font-weight: 700; }
.picker-menu .item.active i { color: var(--primary); }
.picker-menu .count { display: none; }

.ws-content { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 24px 28px 64px; }

/* Phones and narrow windows: the rail is always closed; the picker is the menu. */
@media (max-width: 900px) {
  .ws-side { position: fixed; width: 0; }
  .ws-picker { display: block; }
  #ws-side-toggle, .crumb { display: none; }
  .ws-top { padding: 10px 16px; }
  .ws-content { padding: 18px 16px 48px; }
  .theme-btn .lbl { display: none; }
}

@keyframes ws-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ws-fadeup { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.fadeup { animation: ws-fadeup .38s cubic-bezier(.2,.8,.2,1) both; }
@media (prefers-reduced-motion: reduce) { .fadeup, .picker-menu { animation: none; } .ws-side { transition: none; } }

/* --------------------------------------------------------- messages ----- */
.ws-content > .ui-messages { margin: 0 0 16px; }
/* An empty notice strip still rendered its border: a stray line under the top bar. */
.ui-messages:empty { display: none; }

/* ------------------------------------------------------------ page head -- */
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .titles { flex: 1; min-width: 240px; }
.page-head .eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); }
.page-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.6px; line-height: 1.2; margin-top: 2px; }
.page-head p { margin: 4px 0 0; color: var(--text-2); max-width: 70ch; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Header band with a faint pattern, for a record's own page (DS2 "request detail"). */
.band {
  position: relative; overflow: hidden; border-radius: var(--radius-xl);
  background: var(--primary-soft); border: 1px solid var(--border);
  padding: 20px 24px; margin-bottom: 18px;
}
.band::before {
  content: ""; position: absolute; inset: 0; opacity: .14; pointer-events: none;
  background-image: radial-gradient(currentColor 1px, transparent 1.2px);
  background-size: 14px 14px; color: var(--primary);
}
.band::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
.band > * { position: relative; }
.band .ref { font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.band h1 { font-size: 22px; font-weight: 800; letter-spacing: -.4px; margin: 4px 0 6px; }
.band .facts { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--text-2); }
.band .facts b { color: var(--text); font-weight: 600; }

/* ---------------------------------------------------------------- cards -- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-sm);
  padding: 22px 24px; margin-bottom: 18px;
}
.card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-title h2 { font-size: 16px; font-weight: 700; letter-spacing: -.2px; flex: 1; }
.card-title .num {                 /* numbered sections, as in the DS2 request detail */
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: var(--primary-soft); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
  font: 800 12.5px var(--font-mono);
}
.card-title .hint { font-size: 12.5px; color: var(--text-3); }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-title { padding: 18px 22px 0; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Case on the left, a sticky rail with the decision on the right. */
/* Two columns down to 980px, so on an ordinary laptop the decision stays beside the case
   rather than below all of it (the approver must not scroll to act). */
.detail-cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.detail-cols .side { position: sticky; top: 84px; }
@media (max-width: 1280px) { .detail-cols { grid-template-columns: minmax(0, 1fr) 300px; } }
@media (max-width: 980px) { .detail-cols { grid-template-columns: 1fr; } .detail-cols .side { position: static; } }

/* ---------------------------------------------------------- key facts -- */
.meta-list { display: grid; gap: 0; }
.meta-list .row { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1.5px dotted var(--border-strong); font-size: 13.5px; }
.meta-list .row:last-child { border-bottom: none; }
.meta-list .k { flex: 0 0 42%; color: var(--text-2); }
.meta-list .v { flex: 1; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.facts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px 20px; }
.facts-grid .k { font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--text-3); }
.facts-grid .v { font-size: 14px; font-weight: 600; margin-top: 2px; overflow-wrap: anywhere; }
.prose { white-space: pre-wrap; font-size: 14px; line-height: 1.65; }

/* ---------------------------------------------------------------- forms -- */
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.field-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-grid .full { grid-column: 1 / -1; }
@media (max-width: 760px) { .field-grid, .field-grid.three { grid-template-columns: 1fr; } }
/* The field's OWN label only (direct child). A bare ".field label" also caught the label
   PrimeFaces puts inside every dropdown (the selected value) and every radio option. */
.field > label, .field > .lbl { display: block; font: 700 12.5px var(--font-sans); color: var(--text); margin-bottom: 7px; }
.field > label .req, .field > .lbl .req { color: var(--danger); margin-left: 2px; }
.field .hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.field .ui-inputfield, .field .ui-inputtext { width: 100%; }
/* Wrappers PrimeFaces renders as inline spans: without display:block the input inside
   shrinks to its own size instead of filling the field. */
.field .ui-inputnumber, .field .ui-autocomplete, .field .ui-password { display: block; width: 100%; }
.field .ui-inputnumber input, .field .ui-autocomplete input { width: 100%; }
/* PrimeFaces' script writes a pixel width onto a dropdown (autoWidth), which beats a class rule. */
.field .ui-selectonemenu, .lines .ui-selectonemenu, .field .ui-selectcheckboxmenu { width: 100% !important; min-width: 0; box-sizing: border-box; }
.field .ui-calendar { display: flex; gap: 6px; width: 100%; }
.field .ui-calendar input { flex: 1; min-width: 0; width: auto; }
/* One control height on a form row: text inputs rendered ~36px beside ~41px dropdowns. */
.ws-content input.ui-inputtext, .ws-content .ui-selectonemenu, .ws-content .ui-selectcheckboxmenu { min-height: 42px; box-sizing: border-box; }
/* PrimeFaces makes the arrow icon position:absolute and stretches it to the trigger's full
   height, then draws the glyph at the top of that box - so the arrow sat at the top edge
   whatever the trigger's centring said. Measured, 2026-09-30. */
.ui-selectonemenu .ui-selectonemenu-trigger .ui-icon { position: static; height: auto !important; }
.ws-content .ui-selectonemenu .ui-selectonemenu-label { line-height: 20px; }
a.ui-button, a.ui-button:hover { text-decoration: none; }
a.ui-button.ui-state-default:hover { color: var(--on-primary); }
a.ui-button.ie-secondary:hover { color: var(--text); }
.form-foot { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--border); }

/* Line items: a PrimeFaces table used as an editable grid. */
.lines .ui-datatable-data > tr > td { vertical-align: top; }
.lines .ui-inputfield { width: 100%; }
.lines-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 0 0; }
.total-box { text-align: right; }
.total-box .k { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.total-box .v { font: 700 22px var(--font-mono); letter-spacing: -.5px; }

/* ---------------------------------------------------------------- badges -- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font: 700 12px var(--font-sans); padding: 4px 10px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-2);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger  { background: var(--danger-soft);  color: var(--danger); }
.badge.info    { background: var(--info-soft);    color: var(--info); }
.badge.primary { background: var(--primary-soft); color: var(--primary); }
.badge.neutral { background: var(--surface-3); color: var(--text-2); }

/* ------------------------------------------------------------ stat tiles -- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-tile {
  position: relative; overflow: hidden; display: block; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 18px 20px; box-shadow: var(--shadow-sm);
  transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s;
}
a.stat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: var(--text); }
.stat-tile .k { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.stat-tile .n { font: 700 34px/1 var(--font-mono); letter-spacing: -1px; margin-top: 10px; }
.stat-tile .d { font-size: 12.5px; color: var(--text-2); margin-top: 6px; }
.stat-tile.lead {
  background: linear-gradient(135deg, #F0A722 0%, #E58E0A 45%, #D22A20 120%);
  border-color: transparent; color: #231800;
}
.stat-tile.lead .k, .stat-tile.lead .d { color: #231800; opacity: .8; }
.stat-tile.danger { background: var(--danger-soft); border-color: transparent; }
.stat-tile.danger .n { color: var(--danger); }

/* ------------------------------------------------------ approval route -- */
/* DS2: completed stages fill, the current one is ringed, upcoming stay muted;
   vertical with dotted connectors in a side panel. */
.route { list-style: none; margin: 0; padding: 0; }
.route li { position: relative; display: flex; gap: 12px; padding-bottom: 16px; }
.route li:last-child { padding-bottom: 0; }
.route li::before {
  content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px;
  border-left: 2px dotted var(--border-strong);
}
.route li:last-child::before { display: none; }
.route .dot {
  width: 28px; height: 28px; border-radius: 50%; flex: none; z-index: 1;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
  background: var(--surface-3); color: var(--text-3); border: 2px solid var(--border-strong);
}
.route .done .dot { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.route .done::before { border-left-style: solid; border-left-color: var(--primary); }
.route .current .dot { background: var(--surface); border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }
.route .refused .dot { background: var(--danger); border-color: var(--danger); color: #fff; }
.route .body { min-width: 0; padding-top: 3px; }
.route .t { font-size: 13.5px; font-weight: 700; }
.route .w { font-size: 12px; color: var(--text-3); }
.route .note { margin-top: 6px; font-size: 13px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; white-space: pre-wrap; }

/* --------------------------------------------------------- decide bar -- */
/* Stays on screen while its card does, so an approver never scrolls to act.
   Must be the LAST child of its card: its negative margins reach the card edges. */
.decide-bar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin: 18px -24px -22px; padding: 14px 24px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}
.decide-bar .grow { flex: 1; }
.side .decide-bar { position: static; }
.decide-bar .ui-button { flex: 1 1 auto; }

/* ------------------------------------------------------- empty, callout -- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-2); }
.empty-state i { font-size: 28px; color: var(--text-3); display: block; margin-bottom: 10px; }
.empty-state b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.callout {
  display: flex; gap: 12px; align-items: flex-start;
  border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 18px;
  background: var(--info-soft); color: var(--text); border: 1px solid transparent;
  font-size: 13.5px;
}
.callout > i { color: var(--info); font-size: 16px; margin-top: 2px; }
.callout.warning { background: var(--warning-soft); } .callout.warning > i { color: var(--warning); }
.callout.danger  { background: var(--danger-soft); }  .callout.danger > i  { color: var(--danger); }
.callout.success { background: var(--success-soft); } .callout.success > i { color: var(--success); }
.callout b { display: block; margin-bottom: 2px; }

/* ------------------------------------------------------ module cards ---- */
.module-list { display: grid; gap: 12px; }
.module-row {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.module-row .ic {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.module-row.off .ic, .module-row.unbuilt .ic { background: var(--surface-3); color: var(--text-3); }
.module-row .txt { flex: 1; min-width: 220px; }
.module-row .txt b { font-size: 14.5px; }
.module-row .txt p { margin: 2px 0 0; font-size: 13px; color: var(--text-2); }
.module-row .txt .src { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.module-row .state { display: flex; align-items: center; gap: 12px; }

/* Home tiles: one per live module. */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.doc-card {
  display: flex; flex-direction: column; gap: 8px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: 20px; box-shadow: var(--shadow-sm);
  transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s, border-color .22s;
}
.doc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary); color: var(--text); }
.doc-card .ic { width: 40px; height: 40px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 17px; }
.doc-card b { font-size: 15px; }
.doc-card p { margin: 0; font-size: 13px; color: var(--text-2); flex: 1; }
.doc-card .go { font-size: 13px; font-weight: 700; color: var(--primary); }

/* ---------------------------------------------------------- hero (home) -- */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius-xl);
  min-height: 170px; margin-bottom: 18px; padding: 30px;
  background: #2A2520 center / cover no-repeat;
  color: #fff;
}
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,15,5,.30), rgba(20,15,5,.72)); }
.hero > * { position: relative; }
.hero .chip { display: inline-flex; align-items: center; gap: 8px; background: rgba(0,0,0,.3); font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 6px 12px; border-radius: 999px; }
.hero h1 { color: #fff; font-size: 28px; font-weight: 800; letter-spacing: -.8px; margin-top: 12px; }
.hero p { margin: 6px 0 0; color: rgba(255,255,255,.88); font-size: 14.5px; }
/* The tiles sit BELOW the photo. The design system's pull-up over the photo's edge read as
   things stacked on each other, so nothing overlaps here. (The gold tile is .stat-tile.lead;
   it was once .hero, which is this banner's class, and it inherited the banner's height.) */
.over-hero { position: relative; }

/* ------------------------------------------------------------- sign-in -- */
.auth { position: relative; display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
/* A grid column will not shrink below its content's natural width unless told to; on a phone the
   password field's intrinsic width pushed the form (and the theme button) past the screen edge. */
.auth > * { min-width: 0; }
.auth-card input { max-width: 100%; }
.auth-brand {
  position: relative; overflow: hidden; color: #fff; padding: 44px 48px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: #1A1512 center / cover no-repeat;
}
.auth-brand::before { content: ""; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(26,21,18,.55), rgba(26,21,18,.9)); }
.auth-brand::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.auth-brand > * { position: relative; }
.auth-brand .logo { display: flex; align-items: center; gap: 12px; }
.auth-brand .logo .mark { width: 44px; height: 44px; border-radius: 12px; background: #fff; padding: 6px; display: flex; align-items: center; justify-content: center; }
.auth-brand .logo .mark img { height: 100%; }
.auth-brand .logo b { font-size: 18px; font-weight: 800; }
.auth-brand .logo small { display: block; font-size: 10px; letter-spacing: .08em; color: rgba(255,255,255,.55); font-weight: 700; }
.auth-brand h1 { color: #fff; font-size: 36px; font-weight: 800; letter-spacing: -1.2px; line-height: 1.1; max-width: 14ch; }
.auth-brand p { color: rgba(255,255,255,.8); max-width: 46ch; font-size: 15px; }
.auth-form { position: relative; display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--canvas); }
/* Level with the logo across the page: its centre sits 66px down (44px padding + half its 44px
   mark); the button is 34px tall. Inset 48px like the brand panel. */
.auth-form > .theme-btn { position: absolute; top: 49px; right: 48px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.auth-card .sub { color: var(--text-2); margin: 4px 0 24px; }
.auth-card .field { margin-bottom: 16px; }
.auth-card .ui-button { width: 100%; justify-content: center; }
.auth-card .foot { font-size: 12.5px; color: var(--text-3); margin-top: 20px; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { min-height: 200px; padding: 28px 24px; }
  .auth-brand h1 { font-size: 26px; }
  .auth-brand p { display: none; }
  /* Stacked: the button sits on the photo, level with the logo (28px padding + 22px = 50px centre). */
  .auth-form { position: static; }
  .auth-form > .theme-btn { top: 33px; right: 24px; z-index: 2; }
}

/* ------------------------------------------------------------------------
   PrimeFaces widgets that ie-primefaces.css does not theme. With THEME=none
   each of these rendered as bare browser controls.
   ------------------------------------------------------------------------ */

/* Radio groups and checkbox labels: option text beside its box, not below it. */
.ui-selectoneradio td, .ui-selectmanycheckbox td { padding: 5px 16px 5px 0; vertical-align: middle; }
.ui-selectoneradio label, .ui-selectmanycheckbox label, .ui-chkbox-label {
  display: inline; font: 400 14px var(--font-sans); color: var(--text); margin: 0 0 0 8px; cursor: pointer;
}
.ui-radiobutton, .ui-chkbox { vertical-align: middle; }

/* File upload (advanced mode, auto upload): one tidy "Choose file" button. */
.ui-fileupload { border: 0; background: none; }
.ui-fileupload-buttonbar { border: 0; background: none; padding: 0; display: flex; gap: 8px; }
.ui-fileupload-buttonbar .ui-fileupload-upload, .ui-fileupload-buttonbar .ui-fileupload-cancel { display: none; }
.ui-fileupload-choose.ui-button {
  background: var(--surface); color: var(--text); border: 1px dashed var(--border-strong);
  box-shadow: none; position: relative; overflow: hidden;
}
.ui-fileupload-choose.ui-button:hover, .ui-fileupload-choose.ui-button.ui-state-hover {
  border-color: var(--primary); color: var(--primary); background: var(--primary-soft);
}
.ui-fileupload-choose input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ui-fileupload-content { border: 0; background: none; padding: 6px 0 0; }
.ui-fileupload-content .ui-messages { margin: 6px 0 0; }
.ui-fileupload-files { width: 100%; font-size: 12.5px; color: var(--text-2); }
.ui-fileupload-files td { padding: 4px 6px 4px 0; }
.ui-fileupload-files .ui-progressbar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.ui-fileupload-files .ui-progressbar-value { background: var(--primary); height: 100%; }

/* People picker (autocomplete) panel. */
.ui-autocomplete-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 4px; margin-top: 4px; z-index: 1100;
}
.ui-autocomplete-items { list-style: none; margin: 0; padding: 0; }
.ui-autocomplete-item { padding: 8px 10px; border-radius: 8px; font-size: 13.5px; color: var(--text); cursor: pointer; }
.ui-autocomplete-item.ui-state-highlight { background: var(--primary-soft); color: var(--text); }
.ui-autocomplete-query { font-weight: 700; color: var(--primary); }

/* Calendar trigger and popup. */
.ui-calendar .ui-datepicker-trigger.ui-button { flex: none; width: 42px; padding: 0; justify-content: center; }
/* Its icon is a jQuery UI sprite that THEME=none never ships: an empty amber square. Draw the
   PrimeIcons calendar in its place. */
.ui-datepicker-trigger .ui-icon { background: none !important; text-indent: 0 !important; width: auto !important;
  height: auto !important; position: static !important; margin: 0 !important; font-family: 'primeicons'; font-style: normal; line-height: 1; }
.ui-datepicker-trigger .ui-icon::before { content: "\e927"; font-size: 15px; }
.ui-datepicker-trigger .ui-button-text { display: none; }
.ui-datepicker {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 10px; z-index: 1100 !important; font: 13px var(--font-sans); color: var(--text);
}
.ui-datepicker-header { position: relative; display: flex; align-items: center; justify-content: center;
  padding: 4px 32px 10px; background: none; border: 0; }
.ui-datepicker-prev, .ui-datepicker-next { position: absolute; top: 2px; width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-2); }
.ui-datepicker-prev { left: 0; } .ui-datepicker-next { right: 0; }
.ui-datepicker-prev:hover, .ui-datepicker-next:hover { background: var(--surface-3); }
.ui-datepicker-prev span, .ui-datepicker-next span { display: none; }
.ui-datepicker-prev::before { content: "\2039"; font-size: 20px; }
.ui-datepicker-next::before { content: "\203A"; font-size: 20px; }
.ui-datepicker-title { display: flex; gap: 6px; font-weight: 700; }
.ui-datepicker-title select { font: 600 13px var(--font-sans); border: 1px solid var(--border-strong); border-radius: 6px;
  background: var(--surface-2); color: var(--text); padding: 3px 6px; }
.ui-datepicker-calendar { border-collapse: collapse; }
.ui-datepicker-calendar th { font-size: 11px; font-weight: 700; color: var(--text-3); padding: 4px; }
.ui-datepicker-calendar td { padding: 1px; text-align: center; }
.ui-datepicker-calendar td a, .ui-datepicker-calendar td span {
  display: block; width: 32px; height: 32px; line-height: 32px; border-radius: 8px; color: var(--text); text-decoration: none;
}
.ui-datepicker-calendar td a:hover { background: var(--surface-3); color: var(--text); }
.ui-datepicker-calendar td a.ui-state-highlight { box-shadow: inset 0 0 0 1px var(--primary); }
.ui-datepicker-calendar td a.ui-state-active { background: var(--primary); color: var(--on-primary); }
.ui-datepicker-other-month a { color: var(--text-3); }

/* Checkbox menu (Routing: categories that skip the specialty department). */
.ui-selectcheckboxmenu {
  position: relative; display: inline-flex; align-items: center; min-height: 42px;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-md); cursor: pointer;
}
.ui-selectcheckboxmenu-label-container { flex: 1; min-width: 0; }
.ui-selectcheckboxmenu-label { display: block; padding: 10px 14px; font: 14px var(--font-sans); color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-selectcheckboxmenu-trigger { width: 36px; display: flex; align-items: center; justify-content: center; color: var(--text-3); }
.ui-selectcheckboxmenu-trigger .ui-icon::before { content: "\25BE"; font-size: 13px; }
.ui-selectcheckboxmenu-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 6px; z-index: 1100; }
.ui-selectcheckboxmenu-header { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.ui-selectcheckboxmenu-close { margin-left: auto; color: var(--text-3); }
.ui-selectcheckboxmenu-items { list-style: none; margin: 0; padding: 4px 0 0; max-height: 260px; overflow-y: auto; }
.ui-selectcheckboxmenu-item { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; font-size: 13.5px; }
.ui-selectcheckboxmenu-item label { font-weight: 400; margin: 0; }
.ui-selectcheckboxmenu-item:hover { background: var(--surface-3); }

/* Confirm dialog: the warning icon beside the message, buttons at the right. */
.ui-confirm-dialog .ui-dialog-content { display: flex; gap: 12px; align-items: flex-start; }
.ui-confirm-dialog-severity { flex: none; font-size: 20px; color: var(--warning); margin-top: 2px; }
.ui-confirm-dialog-message { font-size: 14px; line-height: 1.55; color: var(--text); }
.ui-confirm-dialog .ui-dialog-buttonpane { display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 20px 18px; border-top: 1px solid var(--border); }

/* Plain HTML switch (Administration > Modules): a button styled as a toggle. */
.switch {
  position: relative; width: 46px; height: 26px; border-radius: 999px; border: none; cursor: pointer; flex: none;
  background: var(--border-strong); transition: background .12s;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm); transition: transform .12s;
}
.switch.on { background: var(--success); }
.switch.on::after { transform: translateX(20px); }

/* ------------------------------------------------ incident photographs and video -- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.media-item { margin: 0; border: 1px solid var(--border, #e2e5ea); border-radius: 10px; overflow: hidden; background: var(--surface-2, transparent); }
.media-item img, .media-item video { display: block; width: 100%; max-height: 240px; object-fit: cover; background: #000; }
.media-item figcaption { padding: 8px 10px; font-size: 12.5px; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ trackers -- */
/* One red ramp, ordered by severity. Validated (dataviz validate_palette --ordinal):
   light #EFA39C / #DB362C / #8E1F18 against #FFFFFF; dark #8A362E / #D0483E / #F7968D
   against #1D1B18. Red/amber/green was rejected: red and amber fail colour-blind separation. */
:root, [data-theme="light"] { --trk-1:#EFA39C; --trk-2:#DB362C; --trk-3:#8E1F18; }
[data-theme="dark"]         { --trk-1:#8A362E; --trk-2:#D0483E; --trk-3:#F7968D; }
.trk-s1 { background: var(--trk-1); }
.trk-s2 { background: var(--trk-2); }
.trk-s3 { background: var(--trk-3); }

.trk-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; margin: 0 0 12px; padding: 0;
              font-size: 12.5px; color: var(--text-2); }
.trk-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.trk-plot { display: flex; gap: 8px; align-items: stretch; }
.trk-axis { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px;
            color: var(--text-3); padding-bottom: 22px; min-width: 18px; text-align: right; }
.trk-cols { flex: 1; display: flex; gap: 4px; align-items: stretch; min-width: 0;
            border-bottom: 1px solid var(--border); }
.trk-col { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; outline: none; }
.trk-stack { height: 160px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; }
.trk-seg { width: 100%; max-width: 28px; min-height: 3px; }
.trk-stack > .trk-seg:first-child { border-radius: 4px 4px 0 0; }
.trk-x { height: 22px; line-height: 22px; font-size: 11px; color: var(--text-3); text-align: center;
         white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trk-col:hover .trk-stack, .trk-col:focus .trk-stack { background: var(--surface-3); border-radius: 6px 6px 0 0; }

.trk-tip { display: none; position: absolute; bottom: calc(100% - 40px); left: 50%; transform: translateX(-50%);
           z-index: 5; min-width: 170px; padding: 8px 10px; border-radius: 8px; font-size: 12px;
           background: var(--surface); color: var(--text); border: 1px solid var(--border-strong);
           box-shadow: 0 6px 18px rgba(0,0,0,.14); pointer-events: none; }
.trk-col:hover .trk-tip, .trk-col:focus .trk-tip { display: block; }
.trk-col:first-child .trk-tip { left: 0; transform: none; }
.trk-col:last-child .trk-tip  { left: auto; right: 0; transform: none; }
.trk-tip b { display: block; margin-bottom: 4px; }
.trk-tip .trk-n { float: right; margin-left: 12px; font-variant-numeric: tabular-nums; }
.trk-total { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border); color: var(--text-2); }

.trk-table { margin-top: 12px; font-size: 12.5px; }
.trk-table summary { cursor: pointer; color: var(--text-2); }
.trk-table table { border-collapse: collapse; margin-top: 8px; width: 100%; }
.trk-table th, .trk-table td { padding: 4px 8px; border-bottom: 1px solid var(--border); text-align: right;
                               font-variant-numeric: tabular-nums; }
.trk-table th:first-child { text-align: left; font-weight: 600; }

/* Narrow screens: smaller axis labels, never an ellipsis; the tooltip names each column in full. */
@media (max-width: 640px) {
  .trk-cols { gap: 2px; }
  .trk-x { font-size: 10px; text-overflow: clip; }
}

/* The stat markup the pages actually use (stat-row / stat / stat-num / stat-label).
   Only stat-grid and stat-tile .k/.n/.d were styled, so these rendered as bare text. */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-row > .stat, .stat-row > .stat-tile {
  display: block; padding: 16px 18px; border-radius: var(--radius-lg, 14px); background: var(--surface);
  border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.stat-num { font: 700 30px/1 var(--font-mono, monospace); letter-spacing: -1px; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12.5px; color: var(--text-2); }
.stat.danger  .stat-num, .stat-tile.danger  .stat-num { color: var(--danger); }
.stat.warning .stat-num, .stat-tile.warning .stat-num { color: var(--warning); }
.stat.success .stat-num, .stat-tile.success .stat-num { color: var(--success); }

/* Phone width: a wide data table scrolls inside its card instead of widening the whole
   page, which pushed the header button, the tiles and the trackers off the screen. */
.ws-content { min-width: 0; }
.ws-content .card { min-width: 0; }
.ui-datatable-tablewrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 640px) {
  .ws-content { padding: 16px 16px 48px; }
  .page-head { flex-wrap: wrap; gap: 12px; }
}

/* P-SOC console sound switch (resources/js/alarm.js). */
.alarm-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px;
                font-weight: 700; cursor: pointer; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.alarm-toggle[aria-pressed="true"] { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
