/* ==========================================================================
   InfraDesk — signed-in views
   --------------------------------------------------------------------------
   Apple's product pages and Health app: a #f5f5f7 ground, white tiles with
   generous corners and no borders, a small bold title per tile, one large
   figure, a labelled breakdown, and a plain line of insight. Status colour is
   data only: open blue, under review amber, closed green, high priority red.
   ========================================================================== */

:root {
  --tile: #ffffff;
  --r-tile: 22px;
  --fill: #f5f5f7;          /* inset surfaces inside a tile */
  --track: #ececf0;         /* empty part of a bar or ring */
  --med: #8e8e93;           /* medium priority */
  --low: #c7c7cc;           /* low priority */
}

/* Apple's system colours inside the app: vivid for marks, deeper for text.
   (The landing page keeps its own palette.) */
body.app-open {
  /* Black and blue, in the McKinsey manner: deep navy, electric blue, cyan,
     cool greys; red only where something is late or high priority. */
  --navy: #051c2c;
  --navy-2: #0b2a40;
  --c-open: #c8102e;  --t-open: #b00d27;
  --c-review: #00a9f4; --t-review: #0077b0;
  --c-closed: #2251ff; --t-closed: #1f45e0;
  --c-red: #7a0c1e;   --t-red: #7a0c1e;
  --c-grey: #c6ccd5;  --c-grey-2: #8b95a3;
  --blue: #2251ff; --blue-h: #1b44e0; --blue-t: rgba(34, 81, 255, .1);
  --st-open: var(--c-open);
  --st-review: var(--c-review);
  --st-closed: var(--c-closed);
}

/* --- ground, rail and top bar ------------------------------------------- */

.app { background: var(--g); }
.page { background: var(--g); }
.rail { background: var(--w); border-right-color: var(--line-2); }
@media (min-width: 761px) { .rail-panel { background: var(--w); border-right-color: var(--line-2); } }
.rail-link.is-active { background: var(--g); box-shadow: none; }

.top {
  background: rgba(245, 245, 247, .86);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: transparent;
}
.top .scope { gap: 0; }
.top .scope .pill,
.top .scope .pill-tint {
  height: auto;
  padding: 0 10px;
  border-radius: 0;
  background: none;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 400;
}
.top .scope .pill + .pill { border-left: 1px solid var(--line); }
.top .scope .pill svg { display: none; }
.top .scope .pill:first-child { padding-left: 4px; }
.page:has(> .view-home:not([style*="none"])) .top-title { visibility: hidden; }

/* --- the dashboard: overview, then the work, then a short side column ---- */

.view-home { display: flex; flex: 1; min-height: 0; }

.dash2 {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 4px 40px 28px;
  gap: 16px;
}

/* Overview: sentence, split bar, figures */
.ov {
  flex: none;
  padding: 26px 30px 22px;
  border-radius: var(--r-tile);
  background: var(--tile);
}
.ov-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
.d-hello { margin-bottom: 4px; font-size: 15px; font-weight: 500; color: var(--ink-2); letter-spacing: -.012em; }
.d-sum { max-width: 36em; font-size: 28px; line-height: 1.18; font-weight: 600; letter-spacing: -.024em; text-wrap: pretty; }
.d-sum b { font-weight: 600; color: var(--ink); }
.d-sum span { color: var(--ink-3); }
.dash2.is-loading .d-sum span { color: var(--line); }

.d-cta {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  height: 40px; padding: 0 20px 0 16px; border: 0; border-radius: var(--r-cap);
  background: var(--blue); color: #fff; font-size: 15px; font-weight: 500; letter-spacing: -.012em;
  transition: background .18s var(--ease), transform .18s var(--ease);
}
.d-cta svg { width: 15px; height: 15px; }
.d-cta:hover { background: var(--blue-h); }
.d-cta:active { transform: scale(.97); }

.ov-bar { display: flex; gap: 2px; height: 6px; margin: 22px 0 18px; border-radius: 3px; overflow: hidden; }
.ov-bar i { display: block; min-width: 3px; }
.ov-bar .is-open { background: var(--c-open); }
.ov-bar .is-review { background: var(--c-review); }
.ov-bar .is-closed { background: var(--c-closed); }
.ov-bar .is-empty { background: var(--track); }

.ov-stats { display: flex; gap: 0; }
.ov-group { display: flex; flex: 3; }
.ov-group.is-more { flex: 4; padding-left: 26px; margin-left: 26px; border-left: 1px solid var(--line-2); }
.is-emp .ov-group.is-more { flex: 2; }
.st { display: flex; flex-direction: column; flex: 1; min-width: 0; padding-right: 16px; }
.st.is-link { cursor: pointer; border-radius: 10px; }
.st.is-link:hover .st-k { color: var(--ink); }
.st-k { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.st-k.is-open::before, .st-k.is-review::before, .st-k.is-closed::before, .st-k.is-high::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none;
}
.st-k.is-open::before { background: var(--c-open); }
.st-k.is-review::before { background: var(--c-review); }
.st-k.is-closed::before { background: var(--c-closed); }
.st-k.is-high::before { background: var(--c-red); }
.st-v { margin-top: 4px; font-size: 34px; line-height: 1.05; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.st-v em { margin-left: 2px; font-style: normal; font-size: 17px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; }
.st-s { margin-top: 4px; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-s.is-late { color: var(--t-red); }
.st-s.is-check { color: var(--t-closed); }

/* The working row */
.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  flex: 1;
  min-height: 0;
}
.is-ops .t-queue { grid-column: span 6; }
.is-ops .t-sites { grid-column: span 3; }
.is-ops .side { grid-column: span 3; }
.is-emp .t-list { grid-column: span 8; }
.is-emp .side { grid-column: span 4; }
.side { display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.side .t-act { flex: 1; }

.is-loading .ov { height: 210px; }
.is-loading .bento .tile { grid-column: span 6; }

/* --- tiles -------------------------------------------------------------- */

.tile {
  display: flex; flex-direction: column; gap: 12px;
  min-width: 0; min-height: 0;
  padding: 20px 22px 16px;
  border-radius: var(--r-tile);
  background: var(--tile);
}
.tile.is-ghost { background: rgba(255, 255, 255, .6); }
.tl-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; min-height: 28px; }
.tl-title { font-size: 17px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; }
.tl-aside { min-width: 0; font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-foot { margin-top: auto; flex: none; padding-top: 2px; }
.tl-note { font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.tl-empty { padding: 18px 0; font-size: 14px; color: var(--ink-2); }
.tl-link { display: inline-flex; align-items: center; gap: 2px; padding: 0; border: 0; background: none; color: var(--blue); font-size: 14px; }
.tl-link svg { width: 12px; height: 12px; }
.tl-link:hover { text-decoration: underline; }
.tl-calm { display: flex; align-items: center; gap: 12px; padding: 20px 2px; font-size: 15px; color: var(--ink-2); }
.calm-mark { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: rgba(52, 199, 89, .14); color: var(--t-closed); }
.calm-mark svg { width: 16px; height: 16px; }
.mk { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: none; }
.mk.is-open { background: var(--c-open); }
.mk.is-review { background: var(--c-review); }
.mk.is-closed { background: var(--c-closed); }
.mk.is-late { background: var(--c-red); }

/* Segmented control */
.seg-wrap { display: inline-flex; flex-wrap: nowrap; padding: 2px; border-radius: 9px; background: #eeeef0; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px;
  border: 0; border-radius: 7px; background: transparent; color: var(--ink);
  font-size: 12.5px; font-weight: 500; white-space: nowrap;
  transition: background .16s var(--ease), box-shadow .16s var(--ease);
}
.seg.is-active { background: var(--w); box-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 0 0 .5px rgba(0, 0, 0, .05); }
.seg-n { font-size: 11.5px; font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.seg-n.is-late { color: var(--t-red); font-weight: 600; }

/* Lists: title over one line of details */
.r-list, .sw, .act { list-style: none; margin: 0 -10px; padding: 0; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.r {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 172px 100px;
  align-items: center;
  column-gap: 20px;
  padding: 12px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .14s var(--ease);
}
.r + .r { border-top: 1px solid var(--line-2); }
.r:hover { background: var(--fill); }
.r:hover, .r:hover + .r { border-top-color: transparent; }
.r:focus-visible { outline-offset: -3px; }
.r-go, .r-cta { justify-self: end; }
.r-title { font-size: 15px; font-weight: 500; letter-spacing: -.014em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-meta { display: flex; flex-wrap: wrap; align-items: center; column-gap: 14px; row-gap: 2px; margin-top: 3px; font-size: 12.5px; color: var(--ink-3); }
.r-meta .pr { font-weight: 500; color: var(--ink-2); }
.r-meta .pr.is-high { color: var(--t-red); font-weight: 600; }
.fl { font-weight: 600; }
.fl.is-late { color: var(--t-red); }
.fl.is-review { color: var(--t-review); }
.r-state { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.r-state .jt { width: 100%; }
.r-go { color: var(--line); }
.r-go svg { width: 14px; height: 14px; }
.r:hover .r-go { color: var(--ink-3); }
.r-cta { height: 30px; padding: 0 14px; font-size: 13px; }

/* Being worked on */
.mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mini li { display: grid; grid-template-columns: 7px minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.mini b { font-size: 17px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.crew { list-style: none; margin: 4px 0 0; padding: 12px 0 0; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line-2); }
.crew li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.av { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--fill); font-size: 10.5px; font-weight: 600; color: var(--ink-2); }
.crew-n { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crew-c { font-size: 12.5px; color: var(--ink-3); }

/* Escalations */
.escs { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.esc-b { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 2px 12px 2px 0; border: 0; background: none; text-align: left; border-radius: 8px; }
.esc-b + .esc-b { padding-left: 16px; border-left: 1px solid var(--line-2); }
.esc-b:hover .esc-k { color: var(--ink); }
.esc-k { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); }
.esc-b b { font-size: 30px; line-height: 1.05; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.esc-b small { font-size: 12px; color: var(--ink-3); }

/* Site workload */
.sw li + li .sw-row { border-top: 1px solid var(--line-2); }
.sw-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; column-gap: 10px;
  width: 100%; padding: 10px 10px; border: 0; border-radius: 10px; background: none; text-align: left;
  transition: background .14s var(--ease);
}
.sw-row:hover { background: var(--fill); }
.sw-name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-n { font-size: 13px; font-weight: 500; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sw-n small { margin-left: 4px; font-size: 12px; font-weight: 400; color: var(--ink-3); }
.sw-n em { font-style: normal; color: var(--t-red); }
.sw-bar { grid-column: 1 / -1; display: flex; gap: 2px; height: 4px; border-radius: 2px; background: var(--track); overflow: hidden; }
.sw-bar i { display: block; height: 100%; }
.sw-bar .is-open { background: var(--c-open); }
.sw-bar .is-rest { background: #d1d1d6; }
.sw-row.is-quiet .sw-name, .sw-row.is-quiet .sw-n { color: var(--ink-3); font-weight: 400; }

/* Recent activity */
.act-row { display: grid; grid-template-columns: 7px minmax(0, 1fr) auto; align-items: start; column-gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer; transition: background .14s var(--ease); }
.act-row + .act-row { border-top: 1px solid var(--line-2); }
.act-row:hover { background: var(--fill); }
.act-dot { width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--c-open); }
.act-dot.is-review { background: var(--c-review); }
.act-dot.is-closed { background: var(--c-closed); }
.act-top { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.act-top b { font-weight: 600; color: var(--ink); }
.act-top span { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.act-msg { margin-top: 1px; font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-when { font-size: 12px; color: var(--ink-3); white-space: nowrap; padding-top: 1px; }

.btn-blue {
  display: inline-flex; align-items: center; height: 36px; padding: 0 18px; border: 0; border-radius: var(--r-cap);
  background: var(--blue); color: #fff; font-size: 15px; font-weight: 500; white-space: nowrap;
  transition: background .18s var(--ease);
}
.btn-blue:hover { background: var(--blue-h); }

/* --- the tracker: Open, Under review, Closed ------------------------------ */

.jt { --c: var(--c-open, var(--st-open)); display: flex; align-items: center; width: 184px; flex: none; }
.jt.is-review { --c: var(--c-review, var(--st-review)); }
.jt.is-check, .jt.is-closed { --c: var(--c-closed, var(--st-closed)); }
.jt b { flex: 1; height: 1.5px; margin: 0 2px; border-radius: 1px; background: #e3e3e8; }
.jt[data-step="2"] b:first-of-type, .jt[data-step="3"] b { background: var(--c); }
.jt-n { width: 6px; height: 6px; flex: none; border-radius: 50%; background: #d1d1d6; }
.jt-n.is-done { background: var(--c); }
.jt-n.is-now { width: 10px; height: 10px; background: #fff; box-shadow: inset 0 0 0 2px var(--c); }
.tk-line { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-line.is-late { color: var(--t-red, var(--red)); font-weight: 500; }
.tk-line.is-soon { color: var(--ink); font-weight: 500; }
.tk-line.is-review { color: var(--t-review, var(--st-review)); }
.tk-line.is-check { color: var(--t-closed, var(--st-closed)); font-weight: 500; }
.tk-line.is-closed { color: var(--ink-3); }

/* ==========================================================================
   Tickets board — the toolbar on the ground, the list in one white tile
   ========================================================================== */

.board { max-width: 1480px; width: 100%; margin: 0 auto; padding: 0 40px 28px; }
.board-bar { gap: 14px; padding: 18px 0 16px; }
.board-bar .tabs { background: #e8e8ed; }
.board-tools { gap: 10px; }
.board-tools .pill-search { width: 280px; background: var(--w); }
.board-tools .pill-search input { width: 100%; }
.zt-cards { display: none !important; }

.filters-wrap { position: relative; }
.filters-btn {
  gap: 7px;
  height: 36px;
  padding: 0 14px 0 12px;
  border: 0;
  background: var(--w);
  color: var(--ink);
  font-size: 14px;
  transition: background .16s var(--ease);
}
.filters-btn svg { width: 15px; height: 15px; }
.filters-btn:hover, .filters-btn.is-open { background: var(--g2); }
.filters-btn.is-on { background: var(--blue-t); color: var(--blue); }
.filters-n {
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}
.filters-n[hidden] { display: none; }
.filters {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 360px;
  padding: 12px;
  border-radius: 18px;
  background: var(--w);
  box-shadow: var(--shadow-sheet);
}
.filters[hidden] { display: none; }
.filters-row { display: grid; grid-template-columns: 84px minmax(0, 1fr); align-items: center; gap: 10px; padding: 4px; }
.filters-row:has(> .is-hidden) { display: none; }
.filters-k { font-size: 13px; color: var(--ink-2); }
.filters .pill-select, .filters .tabs-days { width: 100%; max-width: none; background: var(--g); }
.filters .dd-trigger { width: 100%; }
.filters .dd-trigger .chev { margin-left: auto; }
.filters .tabs-days .days-title { display: none; }
.filters .tabs-days .days-slider { flex: 1; }
.filters-clear { align-self: flex-end; margin-top: 4px; padding: 6px 8px; border: 0; background: none; color: var(--blue); font-size: 14px; }
.filters-clear[hidden] { display: none; }
.filters-clear:hover { text-decoration: underline; }

.tk-head,
.tk-row { grid-template-columns: 64px minmax(0, 1fr) 86px 200px 16px; column-gap: 20px; }
.tk-head {
  padding: 16px 20px 10px;
  border-radius: var(--r-tile) var(--r-tile) 0 0;
  border-bottom: 1px solid var(--line-2);
  background: var(--tile);
}
.tk-head-trk { display: flex; justify-content: space-between; width: 184px; }
.tk-list { padding: 4px 10px 10px; border-radius: 0 0 var(--r-tile) var(--r-tile); background: var(--tile); }
.tk-row { padding: 12px 10px; border-radius: 14px; border-bottom: 0; cursor: pointer; }
.tk-row + .tk-row { box-shadow: inset 0 1px 0 var(--line-2); }
.tk-row:hover { background: var(--g); box-shadow: none; }
.tk-row:hover + .tk-row { box-shadow: none; }
.tk-thumb { width: 64px; height: 52px; }
.tk-title { font-size: 15px; }
.tk-snippet { margin-top: 1px; font-size: 13px; }
.tk-meta { gap: 14px; margin-top: 4px; font-size: 12.5px; color: var(--ink-2); }
.tk-meta span { padding-left: 0; border-left: 0; }
.tk-meta .tk-id { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tk-trk { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tk-act { color: var(--ink-3); }
.tk-act svg { width: 15px; height: 15px; }
.tk-row .prio { justify-self: start; }
.tk-empty { background: var(--tile); }

/* ==========================================================================
   Ticket sheets — the story on the left, the facts on the right
   ========================================================================== */

.proof-trk { display: flex; flex-direction: column; gap: 8px; padding: 16px 16px 14px; border-radius: 14px; background: var(--g); }
.proof-trk .jt { width: 100%; }
.proof-trk-key { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); }
.proof-trk .tk-line { font-size: 14px; white-space: normal; }

#proof-modal .modal-card { width: min(1080px, calc(100vw - 48px)); }
.proof-body { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 22px; align-items: start; }
.proof-media { position: sticky; top: 0; }
.proof-media .split { border-radius: 16px; }
.proof-side, .detail-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.proof-side .proof-trk { order: -2; }
.proof-side #reporter-verification-box { order: -1; }

.proof-side .meta, .detail-side .meta { display: flex; flex-direction: column; gap: 0; padding: 0; border: 0; border-radius: 0; background: none; }
.proof-side .meta-cell, .detail-side .meta-cell {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  column-gap: 12px;
  padding: 9px 2px;
  border: 0;
  border-bottom: 1px solid var(--line-2);
  background: none;
}
.proof-side .meta-cell:last-child, .detail-side .meta-cell:last-child { border-bottom: 0; }
.proof-side .meta-k, .detail-side .meta-k { grid-row: span 2; margin: 0; font-size: 13px; color: var(--ink-2); }
.proof-side .meta-v, .detail-side .meta-v { font-size: 14px; white-space: normal; overflow-wrap: anywhere; }
.detail-side .meta-s { grid-column: 2; font-size: 12px; color: var(--ink-3); }

#reporter-verification-box { margin: 0; padding: 16px; border-radius: 14px; }
#reporter-verification-box .panel-heading { font-size: 17px; font-weight: 600; }
#reporter-verification-box .panel-text { font-size: 14px; line-height: 1.42; }
#reporter-verification-box .row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
#btn-confirm-fix { background: var(--blue); color: #fff; }

.detail-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.detail-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.detail-main .panel { margin: 0; }
.detail-side { position: sticky; top: 0; }

/* ==========================================================================
   Estate — headline, four figure tiles, then the panels, all white on grey
   ========================================================================== */

.view-estate { max-width: 1480px; width: 100%; margin: 0 auto; padding: 18px 40px 28px; gap: 16px; }
.est-sum { flex: none; max-width: 36em; font-size: 30px; }
.est-sum:empty { display: none; }
.est-kpis { gap: 16px; }
.est-kpi { padding: 18px 22px 18px; border-radius: var(--r-tile); background: var(--tile); }
.est-kpi.is-lead { background: var(--tile); }
.est-k { font-size: 15px; font-weight: 600; color: var(--ink); }
.est-v { font-size: 40px; }
.est-v small { font-size: 17px; }
.est-s { font-size: 13px; color: var(--ink-2); }
.est-bar { height: 6px; border-radius: 3px; background: var(--track); }
.est-grid { gap: 16px; }
.est-panel { padding: 20px 22px; border: 0; border-radius: var(--r-tile); background: var(--tile); }
.est-panel-head h2 { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }

/* ==========================================================================
   Section pages (Sites, People, Escalations, HRBP admins, uploads, settings)
   ========================================================================== */

.modal-overlay.modal-page.is-open { padding: 18px 40px 28px; }
.modal-page .modal-card {
  max-width: 1400px;
  margin: 0 auto;
  border: 0;
  border-radius: var(--r-tile);
  background: var(--tile);
}
.modal-page .modal-header { border-bottom-color: var(--line-2); }
.modal-page .modal-title { font-size: 24px; letter-spacing: -.022em; }

/* ==========================================================================
   Smaller screens
   ========================================================================== */

@media (max-width: 1280px) {
  .dash2, .board, .view-estate { padding-left: 28px; padding-right: 28px; }
  .d-sum { font-size: 25px; }
  .ov { padding: 22px 24px 20px; }
  .st-v { font-size: 30px; }
  .ov-group.is-more { padding-left: 18px; margin-left: 18px; }
  .st { padding-right: 10px; }
  .r { grid-template-columns: minmax(0, 1fr) 150px 96px; column-gap: 14px; }
}

/* Tablets: the overview wraps its figures and the page scrolls */
@media (max-width: 1100px) and (min-width: 761px) {
  .dash2 { overflow-y: auto; }
  .bento { flex: none; }
  .ov-stats { flex-direction: column; gap: 18px; }
  .ov-group.is-more { padding: 18px 0 0; margin: 0; border-left: 0; border-top: 1px solid var(--line-2); }
  .is-ops .t-queue, .is-emp .t-list { grid-column: span 12; }
  .is-ops .t-sites, .is-ops .side, .is-emp .side { grid-column: span 6; }
  .r-list, .sw, .act { max-height: 440px; }
}

@media (min-width: 761px) and (max-height: 820px) {
  .dash2 { gap: 12px; }
  .ov { padding: 18px 24px 16px; }
  .d-sum { font-size: 24px; }
  .ov-bar { margin: 16px 0 14px; }
  .st-v { font-size: 28px; }
  .tile { padding: 16px 18px 14px; gap: 10px; }
}

@media (max-width: 760px) {
  .dash2 { padding: 12px 12px 104px; gap: 12px; }
  .ov { padding: 20px 18px 18px; border-radius: 20px; }
  .ov-top { flex-direction: column; align-items: stretch; gap: 16px; }
  .d-sum { font-size: 23px; }
  .d-cta { justify-content: center; height: 46px; font-size: 16px; }
  .ov-bar { margin: 18px 0 14px; }
  .ov-stats { flex-direction: column; gap: 14px; }
  .ov-group { flex-wrap: wrap; row-gap: 14px; }
  .ov-group .st { flex: 0 0 50%; }
  .ov-group.is-more { padding: 14px 0 0; margin: 0; border-left: 0; border-top: 1px solid var(--line-2); }
  .st-v { font-size: 28px; }

  .bento { display: flex; flex-direction: column; gap: 12px; }
  .tile { padding: 18px 16px 14px; border-radius: 20px; }
  .side { gap: 12px; }
  .r-list, .act { max-height: none; overflow: visible; }
  .sw { max-height: 300px; }
  .t-queue .tl-head, .t-list .tl-head { flex-direction: column; align-items: stretch; }
  .seg-wrap { align-self: stretch; }
  .seg { flex: 1; justify-content: center; padding: 0 8px; }
  .r { grid-template-columns: minmax(0, 1fr); row-gap: 8px; }
  .r-cta { justify-self: stretch; }
  .r-title { white-space: normal; }
  .r-state { flex-direction: row; align-items: center; gap: 10px; }
  .r-state .jt { width: 96px; }
  .r-go { display: none; }
  .r-cta { justify-content: center; height: 38px; }
  .is-emp .r-list li:nth-child(n+7) { display: none; }
  .act li:nth-child(n+6) { display: none; }

  .board { padding: 0 12px 96px; }
  .board-bar { padding: 14px 4px 10px; }
  .board-tools { flex-wrap: nowrap; }
  .board-tools .pill-search { flex: 1; width: auto; }
  .filters { position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: auto; padding: 16px 16px calc(84px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; }
  .tk-head { display: none; }
  .tk-list { border-radius: var(--r-tile); padding: 6px; }
  .tk-row { grid-template-columns: 56px minmax(0, 1fr); row-gap: 8px; column-gap: 12px; padding: 12px 8px; }
  .tk-thumb { width: 56px; height: 56px; grid-row: span 3; }
  .tk-row .prio { grid-column: 2; }
  .tk-trk { grid-column: 2; flex-direction: row; align-items: center; gap: 10px; }
  .tk-trk .jt { width: 96px; }
  .tk-trk .tk-line { flex: 1; min-width: 0; }
  .tk-snippet, .tk-act, .tk-meta .tk-id { display: none; }

  .view-estate { padding: 16px 16px 100px; }
  .est-sum { font-size: 22px; }
  .modal-overlay.modal-page.is-open { padding: 12px 12px 88px; }
}

@media (max-width: 900px) {
  .proof-body, .detail-body { display: flex; flex-direction: column; gap: 16px; }
  .proof-media, .detail-side { position: static; }
  .detail-side { order: -1; }
}

/* Priority chips: red is reserved for High; amber belongs to "Under review" */
.prio.is-medium { background: var(--fill); color: var(--ink-2); }
.prio.is-low { background: none; color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line-2); }
body.app-open .prio.is-high { background: rgba(255, 59, 48, .1); color: var(--t-red); }
body.app-open .status.is-open { color: var(--t-open); }
body.app-open .status.is-review { color: var(--t-review); }
body.app-open .status.is-closed { color: var(--t-closed); }
.est-bar i, .meter i { background: var(--c-closed); }

/* Legacy tab groups take the same segmented control */
.segmented-tabs { display: inline-flex; gap: 0; padding: 3px !important; border-radius: 10px; background: var(--fill); border: 0; }
.segmented-tab { height: 28px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; font-size: 13px; font-weight: 500; white-space: nowrap; color: var(--ink); box-shadow: none; }
.segmented-tab.is-active { background: var(--w); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); }

/* Estate headline matches the dashboards */
.est-sum { font-size: 28px; line-height: 1.18; letter-spacing: -.024em; }
.est-sum b { font-weight: 600; color: var(--ink); }
.est-sum span { color: var(--ink-3); }
.est-v { font-size: 34px; }


/* ==========================================================================
   Insights — chart cards below the work area (dashboards and Estate)
   ========================================================================== */

.dash2 { overflow-y: auto; scrollbar-width: thin; }
.dash2 > .bento { flex: none; height: max(420px, calc(100dvh - 430px)); }
.view-estate { overflow-y: auto; scrollbar-width: thin; }
.view-estate > .est-grid { flex: none; height: max(520px, calc(100dvh - 330px)); }

.ins { display: grid; gap: 16px; flex: none; }
.ins-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ins-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ic {
  display: flex; flex-direction: column; min-width: 0;
  padding: 20px 22px 16px; border-radius: var(--r-tile); background: var(--tile);
}
.ic-t { font-size: 16px; line-height: 1.3; font-weight: 600; letter-spacing: -.018em; color: var(--ink); }
.ic-s { margin-top: 3px; font-size: 12.5px; color: var(--ink-3); }
.ic-body { flex: 1; margin: 18px 0 14px; min-height: 150px; display: flex; flex-direction: column; justify-content: flex-end; }
.ic-src { padding-top: 10px; border-top: 1px solid var(--line-2); font-size: 11.5px; color: var(--ink-3); }
.ic-key { display: flex; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.ic-key span { display: inline-flex; align-items: center; gap: 6px; }
.ic-key span::before { content: ""; width: 10px; height: 3px; border-radius: 2px; }
.k-new::before { background: var(--c-grey); }
.k-done::before { background: var(--c-open); }

/* Weekly flow: paired columns, values on top */
.flow { display: flex; align-items: stretch; gap: 6px; height: 150px; }
.flow-w { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.flow-bars { display: flex; align-items: flex-end; justify-content: center; gap: 2px; flex: 1; border-bottom: 1px solid var(--line); }
.fb { position: relative; width: 42%; max-width: 14px; min-height: 1px; border-radius: 2px 2px 0 0; }
.fb.is-new { background: var(--c-grey); }
.fb.is-done { background: var(--c-open); }
.fb em { position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%); font-style: normal; font-size: 10px; font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.fb.is-done em { color: var(--c-open); font-weight: 600; }
.flow-x { margin-top: 5px; font-size: 10px; color: var(--ink-3); text-align: center; white-space: nowrap; }
.flow-w.is-now .flow-x { color: var(--ink); font-weight: 600; }

/* Horizontal bars (ageing, categories) */
.hb { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.hb li { display: grid; grid-template-columns: 82px minmax(0, 1fr) 30px; align-items: center; gap: 10px; }
.hb.is-cat li { grid-template-columns: 112px minmax(0, 1fr) 74px; }
.hb-k { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-bar { height: 14px; }
.hb-bar i { display: block; height: 100%; min-width: 2px; border-radius: 2px; background: var(--c-grey); }
.hb li.is-hot .hb-bar i { background: var(--c-red); }
.hb li.is-hot .hb-k, .hb li.is-hot .hb-v { color: var(--t-red); }
.hb li.is-top .hb-bar i { background: var(--c-open); }
.hb li.is-top .hb-k { color: var(--ink); }
.hb-v { font-size: 13px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.hb-v em { margin-left: 6px; font-style: normal; font-weight: 400; font-size: 11.5px; color: var(--ink-3); }

/* Time to close: one stacked bar, then the breakdown */
.stk { display: flex; gap: 2px; height: 22px; border-radius: 4px; overflow: hidden; }
.stk i { display: block; }
.s0 { background: var(--c-closed); }
.s1 { background: #6fa98b; }
.s2 { background: var(--c-grey); }
.s3 { background: var(--c-red); }
.s-empty { background: var(--track); }
.stk-k { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.stk-k li { display: grid; grid-template-columns: 10px minmax(0, 1fr) 30px 38px; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.stk-k b { font-weight: 600; color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.stk-k em { font-style: normal; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.kw { width: 10px; height: 10px; border-radius: 2px; }
.stk-k li:nth-child(2) { padding-bottom: 7px; border-bottom: 1px dashed var(--line); }

/* Overview text on one line where it fits */
.d-sum { font-size: 26px; max-width: none; }
.est-sum { font-size: 26px; max-width: none; }

@media (max-width: 1280px) {
  .ins-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .d-sum, .est-sum { font-size: 23px; }
}
@media (max-width: 1100px) and (min-width: 761px) {
  .dash2 > .bento, .view-estate > .est-grid { height: auto; }
}
@media (max-width: 760px) {
  .dash2 > .bento, .view-estate > .est-grid { height: auto; }
  .ins-4, .ins-3 { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .ic { padding: 18px 16px 14px; border-radius: 20px; }
  .d-sum, .est-sum { font-size: 22px; }
}


/* ==========================================================================
   Black and blue — overview panels are navy tiles, as apple.com sets its
   product tiles on black; everything else is white on the grey ground.
   ========================================================================== */

.ov, .est-kpis {
  --c-closed: #dfe6ef;
  background: var(--navy);
  color: #fff;
}
.ov .d-hello { color: rgba(255, 255, 255, .62); }
.ov .d-sum b, .est-kpis .est-sum b { color: #fff; }
.ov .d-sum span, .est-kpis .est-sum span { color: rgba(255, 255, 255, .5); }
.ov .ov-bar .is-empty { background: rgba(255, 255, 255, .14); }
.ov .ov-group.is-more { border-left-color: rgba(255, 255, 255, .14); }
.ov .st-k { color: rgba(255, 255, 255, .66); }
.ov .st.is-link:hover .st-k { color: #fff; }
.ov .st-v { color: #fff; }
.ov .st-v em { color: rgba(255, 255, 255, .55); }
.ov .st-s { color: rgba(255, 255, 255, .5); }
.ov .st-s.is-late { color: #ff8a8c; }
.ov .st-s.is-check { color: #7fd4ff; }
.ov .st-k.is-high::before { background: #ff6b6e; }
.ov .d-cta { background: var(--c-open); }
.ov .d-cta:hover { background: #3a64ff; }

.st-viz { display: block; margin-top: 8px; height: 26px; }
.spark { width: 100%; max-width: 132px; height: 26px; overflow: visible; }
.spark path { fill: none; stroke: #7fa2ff; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark circle { fill: #fff; }
.mbar { display: flex; gap: 2px; width: 100%; max-width: 132px; height: 5px; margin-top: 10px; border-radius: 3px; overflow: hidden; }
.mbar i { display: block; height: 100%; }
.mbar .is-hi { background: #ff6b6e; }
.mbar .is-med { background: rgba(255, 255, 255, .55); }
.mbar .is-lo { background: rgba(255, 255, 255, .25); }
.mbar .is-none { background: rgba(255, 255, 255, .14); }
.mbar.is-track { background: rgba(255, 255, 255, .14); }
.mbar .is-fill { background: var(--c-open); border-radius: 3px; }
.ov .mbar .is-fill { background: #7fa2ff; }
.bullet { position: relative; display: block; width: 100%; max-width: 132px; height: 5px; margin-top: 10px; border-radius: 3px; background: rgba(255, 255, 255, .14); }
.bullet i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: #7fa2ff; }
.bullet.is-over i { background: #ff6b6e; }
.bullet b { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: #fff; border-radius: 1px; }

/* Estate's figures sit in the same navy panel, headline included */
.est-kpis { padding: 26px 30px 24px; border-radius: var(--r-tile); gap: 0; row-gap: 22px; }
.est-kpis .est-sum { grid-column: 1 / -1; margin: 0; font-size: 26px; }
.est-kpis .est-kpi { padding: 0 22px; border-radius: 0; background: none; border-left: 1px solid rgba(255, 255, 255, .14); }
.est-kpis .est-kpi:nth-child(2) { padding-left: 0; border-left: 0; }
.est-kpis .est-k { color: rgba(255, 255, 255, .66); font-weight: 500; font-size: 13px; }
.est-kpis .est-v { color: #fff; }
.est-kpis .est-v small { color: rgba(255, 255, 255, .55); }
.est-kpis .est-s { color: rgba(255, 255, 255, .5); }
.est-kpis .est-bar { background: rgba(255, 255, 255, .14); }
.est-kpis .est-bar i { background: #7fa2ff; }

/* Light tiles: closed reads as navy, the context greys stay cool */
.segbar { display: flex; gap: 3px; height: 8px; }
.segbar i { flex: 1; border-radius: 2px; }
.segbar .is-open { background: var(--c-open); }
.segbar .is-review { background: var(--c-review); }
.segbar .is-check { background: var(--navy); }
.mini .mk.is-closed, .act-dot.is-closed, .kv-k.is-closed::before { background: var(--navy); }
.esc-b { gap: 4px; }
.esc-b .mbar { max-width: none; margin-top: 4px; background: var(--track); }
.esc-b .mbar .is-fill { background: var(--c-open); }
.esc-b.is-hot .mbar .is-fill { background: var(--c-red); }
.esc-k { font-weight: 500; }
.sw-bar .is-rest { background: #dde2e9; }
.fb.is-new, .hb-bar i, .k-new::before { background: var(--c-grey); }
.s0 { background: var(--navy); }
.s1 { background: var(--c-open); }
.s2 { background: var(--c-grey); }
.s3 { background: var(--c-red); }

/* ==========================================================================
   Every page: an Apple page heading on the ground, content in white tiles
   ========================================================================== */

.page:has(.modal-page.is-open) .top-title { visibility: hidden; }
.modal-overlay.modal-page.is-open { padding: 4px 40px 32px; }
.modal-page .modal-card { max-width: 1400px; width: 100%; margin: 0 auto; background: none; border-radius: 0; overflow: visible; }
.modal-page .modal-header { padding: 0 2px 20px; border: 0; background: none; }
.modal-page .modal-title { font-size: 34px; line-height: 1.12; font-weight: 600; letter-spacing: -.028em; }
.modal-page .modal-sub { margin-top: 6px; font-size: 17px; color: var(--ink-2); max-width: 60ch; }
.modal-page .modal-body {
  padding: 22px 24px 24px;
  border-radius: var(--r-tile);
  background: var(--tile);
  overflow: visible;
}
.modal-page .modal-footer { padding: 16px 2px 0; border: 0; background: none; }

/* Tables read as lists */
body.app-open .dt-wrap { border: 0; border-radius: 0; max-height: 62dvh; }
body.app-open .dt { font-size: 14px; }
body.app-open .dt thead th { background: var(--tile); color: var(--ink-3); font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; border-bottom: 1px solid var(--line); padding: 10px 14px; position: sticky; top: 0; z-index: 1; }
body.app-open .dt tbody td { padding: 13px 14px; border-bottom: 1px solid var(--line-2); }
body.app-open .dt tbody tr:hover { background: #f7f8fa; }

/* Apple's buttons: filled blue for the main action, outlined for the rest */
body.app-open .btn-ink, body.app-open .soft-btn-primary, body.app-open .btn-blue { background: var(--blue); color: #fff; }
body.app-open .btn-ink:hover, body.app-open .soft-btn-primary:hover, body.app-open .btn-blue:hover { background: var(--blue-h); }
body.app-open .btn:not(.btn-ink):not(.btn-danger):not(.btn-ghost):not(.btn-ok),
body.app-open .soft-btn {
  background: transparent;
  color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}
body.app-open .btn:not(.btn-ink):not(.btn-danger):not(.btn-ghost):not(.btn-ok):hover,
body.app-open .soft-btn:hover { background: var(--blue-t); }
body.app-open .btn-danger { background: transparent; color: var(--t-red); box-shadow: inset 0 0 0 1px var(--t-red); }

/* Inputs */
body.app-open .input, body.app-open .select, body.app-open .textarea, body.app-open .cdd-trigger.select { border-radius: 12px; border-color: var(--line); background-color: var(--tile); }
body.app-open .input:focus, body.app-open .select:focus, body.app-open .textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-t); }

/* Chips */
body.app-open .tag, body.app-open .badge, body.app-open .dash-badge { border-radius: var(--r-cap); }
body.app-open .panel { border-radius: 16px; }
body.app-open .panel-tint { background: rgba(34, 81, 255, .06); }

/* Sheets */
body.app-open .modal-overlay:not(.modal-page) .modal-card { border-radius: 24px; }
body.app-open .modal-overlay:not(.modal-page) .modal-header { border-bottom-color: var(--line-2); }
body.app-open .modal-overlay:not(.modal-page) .modal-title { font-size: 22px; letter-spacing: -.022em; }

/* Tickets board gets a page heading too */
.board-title { flex: none; padding: 6px 2px 0; }
.board-title h2 { font-size: 34px; line-height: 1.12; font-weight: 600; letter-spacing: -.028em; }
.board-title p { margin-top: 6px; font-size: 17px; color: var(--ink-2); }
.page:has(> .view-tickets:not([hidden])) .top-title h1 { visibility: hidden; }

@media (max-width: 1280px) {
  .modal-overlay.modal-page.is-open { padding: 4px 28px 28px; }
}
@media (max-width: 760px) {
  .modal-overlay.modal-page.is-open { padding: 4px 12px 96px; }
  .modal-page .modal-title, .board-title h2 { font-size: 28px; }
  .modal-page .modal-sub, .board-title p { font-size: 15px; }
  .modal-page .modal-body { padding: 16px; border-radius: 20px; }
  .est-kpis { grid-template-columns: 1fr 1fr; padding: 20px 18px; }
  .est-kpis .est-kpi:nth-child(2n) { padding-left: 0; border-left: 0; }
  .est-kpis .est-kpi:nth-child(2n+1) { padding-left: 16px; }
}


/* Two statuses: the tracker runs Open to Closed */
.jt-n.is-next { width: 10px; height: 10px; background: #fff; box-shadow: inset 0 0 0 2px #c6ccd5; }
.jt[data-step="2"] b { background: var(--c); }
.jt[data-step="1"] b { background: #e3e3e8; }
.jt.is-open .jt-n.is-done { width: 10px; height: 10px; background: var(--c-open); box-shadow: 0 0 0 3px rgba(34, 81, 255, .16); }
.segbar .is-late, .mk.is-late { background: var(--c-red); }
.tk-head-trk, .proof-trk-key { justify-content: space-between; }


/* ==========================================================================
   Open is orange; overdue a deeper red; blue stays the action colour
   ========================================================================== */

.ov .d-cta { background: var(--blue); }
.ov .d-cta:hover { background: var(--blue-h); }
.jt.is-open .jt-n.is-done { box-shadow: 0 0 0 3px rgba(242, 113, 28, .18); }
.ov .st-s.is-late { color: #ff8f8f; }
.mbar .is-hi { background: #ff5a6e; }
.spark path { stroke: #9db4ff; }
body.app-open .status.is-open { color: var(--t-open); background: rgba(242, 113, 28, .1); }
.fb.is-done, .k-done::before, .hb li.is-top .hb-bar i { background: var(--blue); }
.fb.is-done em { color: var(--blue); }

/* Ops dashboard: two panels under the overview */
.is-ops .t-queue { grid-column: span 7; }
.is-ops .t-sites { grid-column: span 5; }
.st[data-esc] { cursor: pointer; }

/* Site workload: one aligned stacked bar per site */
.swc-key { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); margin-top: -4px; }
.swc-key span { display: inline-flex; align-items: center; gap: 6px; }
.swc-key .k-o::before, .swc-key .k-c::before { content: ""; width: 10px; height: 10px; border-radius: 2px; }
.swc-key .k-o::before { background: var(--c-open); }
.swc-key .k-c::before { background: #b8c2cf; }
.swc-key .k-n { margin-left: auto; color: var(--ink-3); }
.swc { list-style: none; margin: 0 -10px; padding: 0; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.swc-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  text-align: left;
  transition: background .14s var(--ease);
}
.swc-row:hover { background: var(--fill); }
.swc-name { display: flex; flex-direction: column; min-width: 0; font-size: 13.5px; font-weight: 500; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.swc-name em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--t-red); }
.swc-bar { display: flex; align-items: stretch; gap: 2px; height: 18px; }
.swc-bar i { position: relative; display: flex; align-items: center; min-width: 0; border-radius: 3px; }
.swc-bar .is-open { background: var(--c-open); }
.swc-bar .is-closed { background: #b8c2cf; }
.swc-bar b { padding-left: 6px; font-size: 11px; font-weight: 600; color: #fff; }
.swc-n { font-size: 12.5px; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.swc-n b { font-size: 14px; color: var(--ink); }
.swc-row.is-quiet .swc-name { color: var(--ink-3); font-weight: 400; }
.swc-row.is-quiet .swc-n b { color: var(--ink-3); font-weight: 500; }

/* Insights: folded away behind one quiet button */
.more { display: flex; flex-direction: column; gap: 16px; flex: none; }
.more-btn {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 18px 0 20px;
  border: 0;
  border-radius: var(--r-cap);
  background: var(--tile);
  color: var(--blue);
  font-size: 15px;
  font-weight: 500;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background .16s var(--ease);
}
.more-btn:hover { background: var(--blue-t); }
.more-btn svg { width: 14px; height: 14px; transition: transform .2s var(--ease); }
.more.is-open .more-btn svg { transform: rotate(180deg); }
.more-body { display: flex; flex-direction: column; gap: 16px; }
.more-body[hidden] { display: none; }
.ins-extra .tile { max-height: 420px; }
.dash2 > .bento { height: max(400px, calc(100dvh - 470px)); }

@media (max-width: 1100px) and (min-width: 761px) {
  .is-ops .t-queue, .is-ops .t-sites { grid-column: span 12; }
  .swc { max-height: 440px; }
}
@media (max-width: 760px) {
  .swc-row { grid-template-columns: 110px minmax(0, 1fr) 44px; }
  .swc { max-height: 340px; }
  .more-btn { align-self: stretch; justify-content: center; }
}
.is-emp > .bento { height: max(420px, calc(100dvh - 400px)); }
.s1 { background: var(--blue); }
@media (max-width: 1100px) { .is-emp > .bento { height: auto; } }


/* Site workload as a dot chart: one dot per ticket */
.swc-key .k-l::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c-red); }
.swc-key .k-o::before, .swc-key .k-c::before { border-radius: 50%; }
.dots { list-style: none; margin: 0 -10px; padding: 0; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.dots li + li .dot-row { border-top: 1px solid var(--line-2); }
.dot-row {
  display: grid; grid-template-columns: 140px minmax(0, 1fr) 48px; align-items: center; gap: 12px;
  width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: none; text-align: left;
  transition: background .14s var(--ease);
}
.dot-row:hover { background: var(--fill); border-top-color: transparent; }
.dot-name { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot-set { display: flex; flex-wrap: wrap; gap: 4px; }
.dot-set i { width: 11px; height: 11px; border-radius: 50%; }
.dot-set .d-open { background: var(--c-open); }
.dot-set .d-late { background: var(--c-red); }
.dot-set .d-closed { background: #d3d9e1; }
.dot-row.is-quiet .dot-name { color: var(--ink-3); font-weight: 400; }
.dot-row.is-quiet .swc-n b { color: var(--ink-3); font-weight: 500; }
.more-btn { display: none; }
.is-ops > .bento { height: max(420px, calc(100dvh - 400px)); }
@media (max-width: 760px) { .dot-row { grid-template-columns: 110px minmax(0, 1fr) 40px; } }

/* Queue, site workload and recent activity side by side */
.is-ops .t-queue { grid-column: span 6; }
.is-ops .t-sites { grid-column: span 3; }
.is-ops .side { grid-column: span 3; }
.is-ops .dot-row { grid-template-columns: minmax(0, 1fr) auto 40px; }
.is-ops .dot-set { max-width: 96px; justify-content: flex-end; }
@media (max-width: 1100px) and (min-width: 761px) {
  .is-ops .t-queue { grid-column: span 12; }
  .is-ops .t-sites, .is-ops .side { grid-column: span 6; }
}


/* Open shares High priority's red; overdue is a deeper maroon */
.jt.is-open .jt-n.is-done { box-shadow: 0 0 0 3px rgba(200, 16, 46, .16); }
body.app-open .status.is-open { color: var(--t-open); background: rgba(200, 16, 46, .08); }
body.app-open .prio.is-high { background: rgba(200, 16, 46, .08); color: #b00d27; }
.r-meta .pr.is-high, .prio-txt.is-high { color: #b00d27; }
.ov .st-k.is-high::before, .mbar .is-hi { background: #ff4d63; }
.ov .st-k.is-open::before { background: #ff4d63; }
.ov-bar .is-open { background: #ff4d63; }
.ov .st-s.is-late { color: #ffb1bb; }
.st-k.is-high::before { background: var(--c-open); }
.tk-line.is-late, .swc-name em, .seg-n.is-late, .fl.is-late { color: var(--t-red); }

/* Site workload lollipops */
.swc-key .k-t::before { content: ""; width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 0 0 2px #9aa4b2; }
.swc-key .k-o::before { background: var(--c-open); }
.swc-key .k-l::before { background: var(--c-red); }
.pops { list-style: none; margin: 0 -10px; padding: 0; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.pops li + li .pop-row { border-top: 1px solid var(--line-2); }
.pop-row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(70px, 1.1fr) 40px; align-items: center; gap: 12px;
  width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: none; text-align: left;
  transition: background .14s var(--ease);
}
.pop-row:hover { background: var(--fill); }
.pop { position: relative; height: 14px; margin: 0 6px; background: linear-gradient(var(--line-2), var(--line-2)) left center / 100% 1px no-repeat; }
.pop-line { position: absolute; left: 0; top: 50%; height: 2px; margin-top: -1px; background: var(--c-open); border-radius: 1px; }
.pop-total { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--tile); box-shadow: inset 0 0 0 2px #9aa4b2; }
.pop-dot { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--c-open); box-shadow: 0 0 0 2px var(--tile); }
.pop-dot.is-late { background: var(--c-red); }
.pop-row.is-quiet .dot-name { color: var(--ink-3); font-weight: 400; }
.pop-row.is-quiet .swc-n b { color: var(--ink-3); font-weight: 500; }
.pop-axisrow { margin: 0 -10px; padding-top: 6px; border-top: 1px solid var(--line); cursor: default; }
.pop-axisrow:hover { background: none; }
.pop-axis { display: grid; grid-template-columns: 1fr auto 1fr; margin: 0 6px; font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pop-axis span:nth-child(2) { text-align: center; }
.pop-axis span:last-child { text-align: right; }


/* Site workload: an arc for the zone, capsule bars for each site */
.gauge { display: grid; grid-template-columns: 124px minmax(0, 1fr); align-items: center; column-gap: 16px; flex: none; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.gauge svg { grid-row: 1 / span 2; width: 124px; height: 70px; overflow: visible; }
.g-track, .g-open, .g-late { fill: none; stroke-width: 11; stroke-linecap: round; }
.g-track { stroke: #e6e9ee; }
.g-open { stroke: url(#none); stroke: var(--c-open); }
.g-late { stroke: var(--c-red); }
.g-mid { grid-column: 1; grid-row: 1 / span 2; align-self: end; justify-self: center; text-align: center; margin-bottom: -2px; line-height: 1.1; pointer-events: none; }
.gauge svg, .g-mid { grid-column: 1; grid-row: 1; }
.g-mid b { display: block; font-size: 24px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.g-mid span { font-size: 10.5px; color: var(--ink-3); }
.g-key { grid-column: 2; grid-row: 1; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.g-key li { display: flex; align-items: center; gap: 8px; }
.g-key i { width: 9px; height: 9px; border-radius: 3px; }
.g-key .is-late { background: var(--c-red); }
.g-key .is-open { background: var(--c-open); }
.g-key .is-rest { background: #e6e9ee; }

.caps { list-style: none; margin: 0 -10px; padding: 0; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.cap-row { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: none; text-align: left; transition: background .14s var(--ease); }
.cap-row:hover { background: var(--fill); }
.cap-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; }
.cap-top .swc-n { font-size: 12px; }
.cap-top .swc-n em { font-style: normal; font-weight: 600; color: var(--t-red); margin-left: 4px; }
.cap { position: relative; display: block; height: 10px; border-radius: 5px; background: #eceff3; overflow: hidden; }
.cap-fill { position: absolute; left: 0; top: 0; bottom: 0; display: block; border-radius: 5px; background: linear-gradient(90deg, #e0283f, var(--c-open)); }
.cap-late { position: absolute; left: 0; top: 0; bottom: 0; display: block; background: var(--c-red); border-radius: 5px 0 0 5px; }
.cap-row.is-quiet .dot-name { color: var(--ink-3); font-weight: 400; }
.cap-row.is-quiet .swc-n b { color: var(--ink-3); }
.cap-row.is-quiet .cap { background: #f0f2f5; }


/* Site workload: an arc gauge per site */
.swc-key .k-t::before { box-shadow: none; background: #e3e7ec; border-radius: 50%; }
.arcs { list-style: none; margin: 0 -4px; padding: 2px 0 0; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; align-content: start; }
.arc-tile {
  display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%;
  padding: 12px 6px 10px; border: 0; border-radius: 14px; background: var(--fill); text-align: center;
  transition: background .14s var(--ease), transform .14s var(--ease);
}
.arc-tile:hover { background: #eceef2; }
.arc-tile:active { transform: scale(.98); }
.arc-g { position: relative; display: block; width: 72px; height: 42px; }
.arc-g svg { width: 72px; height: 42px; overflow: visible; }
.a-track, .a-open, .a-late { fill: none; stroke-width: 7; stroke-linecap: round; }
.a-track { stroke: #e3e7ec; }
.a-open { stroke: var(--c-open); }
.a-late { stroke: var(--c-red); }
.arc-n { position: absolute; left: 0; right: 0; bottom: -2px; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.arc-n b { font-size: 17px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.arc-n small { margin-top: 2px; font-size: 10px; color: var(--ink-3); }
.arc-name { max-width: 100%; margin-top: 4px; font-size: 12px; font-weight: 500; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arc-late { font-size: 10.5px; font-weight: 600; color: var(--t-red); }
.arc-tile.is-quiet { background: #fafbfc; }
.arc-tile.is-quiet .arc-name, .arc-tile.is-quiet .arc-n b { color: var(--ink-3); font-weight: 400; }


/* Closed is always blue */
.ov, .est-kpis { --c-closed: #7fa2ff; }
.ov-bar .is-closed, .ov .st-k.is-closed::before { background: #7fa2ff; }
.mini .mk.is-closed, .act-dot.is-closed, .kv-k.is-closed::before, .segbar .is-check { background: var(--c-closed); }
.swc-key .k-c::before { background: var(--c-closed); border-radius: 3px; }
.swc-key .k-o::before, .swc-key .k-l::before { border-radius: 3px; }
.jt.is-closed .jt-n, .jt.is-closed b { background: var(--c-closed); }
body.app-open .status.is-closed { color: var(--t-closed); background: rgba(34, 81, 255, .08); }

/* Site workload capsules: overdue, open, closed */
.cap { display: flex; gap: 2px; height: 12px; border-radius: 6px; background: none; overflow: hidden; }
.cap i { display: block; height: 100%; }
.cap .c-late { background: var(--c-red); }
.cap .c-open { background: linear-gradient(90deg, #d9203c, var(--c-open)); }
.cap .c-closed { background: linear-gradient(90deg, #4a6dff, var(--c-closed)); }
.cap i:first-child { border-radius: 6px 0 0 6px; }
.cap i:last-child { border-radius: 0 6px 6px 0; }
.cap i:only-child { border-radius: 6px; }
.cap-row.is-quiet .cap { opacity: .55; background: none; }


/* Site workload: one site at a time, inside the same card */
.back-btn { display: inline-flex; align-items: center; gap: 2px; padding: 0; border: 0; background: none; color: var(--blue); font-size: 14px; }
.back-btn svg { width: 13px; height: 13px; }
.back-btn:hover { text-decoration: underline; }
.t-sites.is-site .tl-title { overflow: hidden; text-overflow: ellipsis; }
.site-sum { display: flex; flex-direction: column; gap: 8px; flex: none; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.site-sum .swc-n { font-size: 13px; text-align: left; }
.site-sum .swc-n b { font-size: 22px; letter-spacing: -.02em; }
.site-sum .swc-n em { font-style: normal; font-weight: 600; color: var(--t-red); margin-left: 4px; }
.site-sum .cap { width: 100% !important; }
.site-list { list-style: none; margin: 0 -10px; padding: 0; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.sl { display: grid; grid-template-columns: 8px minmax(0, 1fr); column-gap: 10px; row-gap: 2px; padding: 9px 10px; border-radius: 10px; cursor: pointer; transition: background .14s var(--ease); }
.sl + .sl { border-top: 1px solid var(--line-2); }
.sl:hover { background: var(--fill); }
.sl-mk { grid-row: span 2; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; }
.sl-mk.is-open { background: var(--c-open); }
.sl-mk.is-late { background: var(--c-red); }
.sl-mk.is-closed { background: var(--c-closed); }
.sl-main { display: flex; flex-direction: column; min-width: 0; }
.sl-t { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-m { font-size: 12px; color: var(--ink-3); }
.sl .tk-line { grid-column: 2; font-size: 12px; }

/* Ops: queue and site workload share the row */
.is-ops .t-queue { grid-column: span 7; }
.is-ops .t-sites { grid-column: span 5; }
@media (max-width: 1100px) and (min-width: 761px) {
  .is-ops .t-queue, .is-ops .t-sites { grid-column: span 12; }
}

/* ==========================================================================
   Monochrome: black, grey and blue — nothing else.
   Open is black (overdue is black, the rest of open grey), closed is blue,
   emphasis comes from weight, not from colour.
   ========================================================================== */

body.app-open {
  --navy: #1d1d1f;
  --ink-strong: #1d1d1f;
  --grey-open: #a1a1a6;
  --c-open: #1d1d1f;  --t-open: #1d1d1f;
  --c-red: #1d1d1f;   --t-red: #1d1d1f;
  --c-review: #a1a1a6; --t-review: #6e6e73;
  --c-closed: #2251ff; --t-closed: #2251ff;
  --red: #1d1d1f; --red-t: rgba(0, 0, 0, .06);
  --st-open: var(--c-open);
  --st-review: var(--c-review);
  --st-closed: var(--c-closed);
}

/* The overview panel: Apple black, with white, grey and blue */
.ov, .est-kpis { background: #1d1d1f; --c-closed: #6f8dff; }
.ov-bar .is-open, .ov .st-k.is-open::before, .ov .st-k.is-high::before { background: #fff; }
.ov-bar .is-closed, .ov .st-k.is-closed::before { background: #6f8dff; }
.ov .st-s.is-late { color: #fff; font-weight: 600; }
.ov .mbar .is-hi { background: #fff; }
.ov .mbar .is-med { background: rgba(255, 255, 255, .45); }
.ov .mbar .is-lo { background: rgba(255, 255, 255, .2); }
.ov .mbar .is-fill, .est-kpis .est-bar i, .ov .bullet i { background: #6f8dff; }
.ov .bullet.is-over i { background: #fff; }
.spark path { stroke: #6f8dff; }

/* Text emphasis by weight */
.tk-line.is-late, .swc-n em, .cap-top .swc-n em, .site-sum .swc-n em, .seg-n.is-late, .fl.is-late, .sw-n em, .arc-late { color: var(--ink); font-weight: 600; }
.fl.is-review { color: var(--ink-2); font-weight: 500; }
.r-meta .pr.is-high, .prio-txt.is-high { color: var(--ink); font-weight: 600; }
body.app-open .prio.is-high { background: #1d1d1f; color: #fff; }
body.app-open .prio.is-medium { background: var(--fill); color: var(--ink); }
body.app-open .status.is-open { color: var(--ink); background: rgba(0, 0, 0, .06); }
body.app-open .status.is-closed { color: var(--blue); background: var(--blue-t); }
.jt.is-open .jt-n.is-done { background: #1d1d1f; box-shadow: 0 0 0 3px rgba(0, 0, 0, .1); }

/* Site workload capsules: overdue black, open grey, closed blue */
.cap .c-late { background: #1d1d1f; }
.cap .c-open { background: var(--grey-open); }
.cap .c-closed { background: var(--blue); }
.swc-key .k-l::before { background: #1d1d1f; }
.swc-key .k-o::before { background: var(--grey-open); }
.swc-key .k-c::before { background: var(--blue); }
.sl-mk.is-late { background: #1d1d1f; }
.sl-mk.is-open { background: var(--grey-open); }
.segbar .is-late, .mk.is-late { background: #1d1d1f; }
.segbar .is-open, .mini .mk.is-open { background: var(--grey-open); }

/* Insight cards: grey context, blue for the point, black for the bad */
.hb li.is-hot .hb-bar i { background: #1d1d1f; }
.hb li.is-hot .hb-k, .hb li.is-hot .hb-v { color: var(--ink); font-weight: 600; }
.s0 { background: #1a3fd6; }
.s1 { background: #8fa8ff; }
.s2 { background: #c7c7cc; }
.s3 { background: #1d1d1f; }
.act-dot, .act-dot.is-review { background: #a1a1a6; }
.act-dot.is-closed { background: var(--blue); }

/* Overview zone bars: open black, closed blue */
.est-legend .is-open::before { background: #1d1d1f; }

/* The insights button: a blue circle in the top bar */
.insights-btn {
  display: grid; place-items: center; width: 36px; height: 36px; margin-right: 4px;
  border: 0; border-radius: 50%; background: var(--blue); color: #fff;
  transition: background .16s var(--ease), transform .16s var(--ease);
}
.insights-btn[hidden] { display: none; }
.insights-btn svg { width: 18px; height: 18px; }
.insights-btn:hover { background: var(--blue-h); }
.insights-btn:active { transform: scale(.94); }

/* The insights sheet */
.insights-card { width: min(1240px, calc(100vw - 48px)); background: var(--g); }
.insights-card .modal-header { background: var(--w); }
.insights-card .modal-body { padding: 20px; }
.insights-card .ins { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.insights-card .ic { box-shadow: none; }
@media (max-width: 760px) {
  .insights-card { width: 100%; }
  .insights-card .ins { grid-template-columns: minmax(0, 1fr); }
  .insights-card .modal-body { padding: 12px; }
}

/* Site workload treemap: area is tickets, shade is state */
.swc-key .k-c::before { background: #dbe3ff; }
.swc-key .k-o::before { background: #a1a1a6; }
.swc-key .k-l::before { background: #1d1d1f; }
.tmap { position: relative; flex: 1; min-height: 260px; margin-top: 2px; }
.tm {
  position: absolute;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  padding: 8px 9px; border: 2px solid var(--tile); border-radius: 10px;
  text-align: left; overflow: hidden; cursor: pointer;
  transition: filter .14s var(--ease), transform .14s var(--ease);
}
.tm:hover { filter: brightness(1.08); }
.tm:active { transform: scale(.985); }
.tm.is-late { background: #1d1d1f; color: #fff; }
.tm.is-open { background: #a1a1a6; color: #fff; }
.tm.is-clear { background: #dbe3ff; color: #1f45e0; }
.tm-name { max-width: 100%; font-size: 12.5px; font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tm-n { font-size: 11px; opacity: .8; font-variant-numeric: tabular-nums; }
.tm-n b { font-size: 15px; opacity: 1; font-weight: 600; }
.tm.is-small { padding: 4px 5px; }
.tm.is-small .tm-name { font-size: 10px; -webkit-line-clamp: 1; }
.tm.is-small .tm-n { display: none; }
@media (max-width: 760px) { .tmap { min-height: 300px; } }


/* Site workload: a ranked list with an eight-week sparkline per site */
.rk-head { display: grid; grid-template-columns: 22px minmax(0, 1fr) 100px 44px; gap: 10px; padding: 0 0 6px; border-bottom: 1px solid var(--line-2); font-size: 11.5px; color: var(--ink-3); }
.rk-head span:first-child { grid-column: 1 / span 2; }
.rk-head span:last-child { text-align: right; }
.rk { list-style: none; margin: 0 -10px; padding: 0; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.rk li + li .rk-row { border-top: 1px solid var(--line-2); }
.rk-row {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) 100px 44px; align-items: center; gap: 10px;
  width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: none; text-align: left;
  transition: background .14s var(--ease);
}
.rk-row:hover { background: var(--fill); border-top-color: transparent; }
.rk-i { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rk-main { display: flex; flex-direction: column; min-width: 0; }
.rk-name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-sub { display: flex; gap: 8px; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.rk-sub em { font-style: normal; font-weight: 600; color: var(--ink); }
.spk { width: 100px; height: 26px; overflow: visible; }
.spk-l { fill: none; stroke: var(--blue); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.spk-a { fill: rgba(34, 81, 255, .08); stroke: none; }
.spk circle { fill: var(--blue); }
.rk-n { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; font-variant-numeric: tabular-nums; }
.rk-n b { font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.rk-n small { font-size: 11px; color: var(--ink-3); }
.rk-row.is-quiet .rk-name, .rk-row.is-quiet .rk-n b { color: var(--ink-3); font-weight: 400; }
.rk-row.is-quiet .spk-l { stroke: #c7c7cc; }
.rk-row.is-quiet .spk-a { fill: rgba(0, 0, 0, .03); }
.rk-row.is-quiet .spk circle { fill: #c7c7cc; }

/* The site the dashboard is scoped to, in the overview panel */
.scope-chip {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  height: 34px; padding: 0 12px 0 16px; border: 0; border-radius: var(--r-cap);
  background: rgba(255, 255, 255, .12); color: #fff; font-size: 14px; font-weight: 500;
  transition: background .16s var(--ease);
}
.scope-chip:hover { background: rgba(255, 255, 255, .2); }
.scope-chip svg { width: 13px; height: 13px; opacity: .8; }

/* Site workload leads on the left at the wider width; the queue sits right */
.is-ops .t-sites { grid-column: span 7; }
.is-ops .t-queue { grid-column: span 5; }
.is-ops .t-queue .tl-head { flex-wrap: wrap; row-gap: 10px; }
.is-ops .t-queue .r { grid-template-columns: minmax(0, 1fr) 132px 14px; column-gap: 14px; }
.is-ops .t-queue .r-state .jt { width: 100%; }
@media (max-width: 1100px) and (min-width: 761px) {
  .is-ops .t-sites, .is-ops .t-queue { grid-column: span 12; }
}
.is-ops .rk-head, .is-ops .rk-row { grid-template-columns: 22px minmax(0, 1fr) minmax(100px, 1.3fr) 48px; column-gap: 16px; }
.is-ops .spk { width: 100%; }
.spk-l { vector-effect: non-scaling-stroke; }


/* Needs attention: one line per ticket, the lateness on the right */
.na { list-style: none; margin: 0 -10px; padding: 0; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.na-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 11px 10px; border-radius: 10px; cursor: pointer; transition: background .14s var(--ease); }
.na-row + .na-row { border-top: 1px solid var(--line-2); }
.na-row:hover { background: var(--fill); }
.na-row:focus-visible { outline-offset: -3px; }
.na-main { display: flex; flex-direction: column; min-width: 0; }
.na-t { font-size: 14.5px; font-weight: 500; letter-spacing: -.012em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.na-s { display: flex; align-items: center; gap: 8px; margin-top: 2px; font-size: 12.5px; color: var(--ink-3); }
.na-tag { padding: 1px 7px; border-radius: var(--r-cap); background: var(--fill); color: var(--ink-2); font-size: 11px; font-weight: 600; }
.na-tag.is-strong { background: #1d1d1f; color: #fff; }
.na-d { font-size: 12px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.na-d b { margin-right: 1px; font-size: 20px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); }
.na-ok { font-size: 12px; color: var(--ink-3); }


/* Timeline bar: raised to due. Grey while on time, black past due, blue once closed. */
.tb { position: relative; display: block; width: 100%; height: 6px; border-radius: 3px; background: #ececf0; }
.tb-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: #a1a1a6; }
.tb.is-late .tb-fill { border-radius: 3px 0 0 3px; }
.tb-over { position: absolute; top: -1px; bottom: -1px; border-radius: 0 4px 4px 0; background: #1d1d1f; }
.tb-due { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; border-radius: 1px; background: #1d1d1f; }
.tb.is-late .tb-due { background: #fff; box-shadow: 0 0 0 1px #1d1d1f; }
.tb.is-closed .tb-fill { background: var(--blue); }
.r-state .tb, .tk-trk .tb, .mt-trk .tb { margin: 4px 0 2px; }
.proof-trk .tb { margin: 4px 0; }
.tk-trk .tb { width: 184px; }
@media (max-width: 760px) { .r-state .tb, .tk-trk .tb { width: 96px; flex: none; } }


/* Employees see a plain status: Open or Closed */
.stp { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; height: 22px; padding: 0 10px; border-radius: var(--r-cap); font-size: 12px; font-weight: 600; }
.stp::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.stp.is-open { background: rgba(0, 0, 0, .06); color: var(--ink); }
.stp.is-closed { background: var(--blue-t); color: var(--blue); }
.r-state:has(.stp), .tk-trk:has(.stp), .proof-trk:has(.stp) { flex-direction: row; align-items: center; gap: 8px; }
.tk-line.is-plain { color: var(--ink-3); }
.proof-trk:has(.stp) .proof-trk-key { display: none; }

/* Being worked on: people with your open tickets */
.who-list { list-style: none; margin: 4px 0 0; padding: 12px 0 0; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line-2); overflow-y: auto; min-height: 0; }
.who-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr) 28px; align-items: center; gap: 10px; }
.who-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.who-bar { display: block; height: 4px; border-radius: 2px; background: #ececf0; }
.who-bar i { display: block; height: 100%; border-radius: 2px; background: #1d1d1f; }
.who-c { font-size: 15px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.who-more .crew-c { font-size: 12.5px; }
.t-work .big { display: flex; align-items: baseline; gap: 8px; }
.t-work .big b { font-size: 40px; line-height: 1; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.t-work .big span { font-size: 15px; font-weight: 500; color: var(--ink-2); }


/* Being worked on (employee): a segment per open ticket */
.t-work .segbar .is-open, .t-work .mini .mk.is-open { background: #1d1d1f; }

/* ==========================================================================
   Responsive pass — phones (≤760px) and tablets (761–1100px)
   ========================================================================== */

/* The More sheet (mobile.js): sections that don't fit the tab bar */
.rail-more { display: none; }
.more-sheet { position: fixed; inset: 0; z-index: 1300; }
.more-sheet[hidden] { display: none; }
.more-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .32); animation: more-fade .2s var(--ease); }
.more-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 80dvh; overflow-y: auto;
  padding: 8px 12px calc(14px + env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0;
  background: var(--w);
  box-shadow: var(--shadow-sheet);
  animation: more-up .3s var(--ease);
}
.more-grab { width: 36px; height: 5px; margin: 0 auto 6px; border-radius: 3px; background: var(--g2); }
.more-list { list-style: none; margin: 0; padding: 0; }
.more-list li + li { box-shadow: inset 0 1px 0 var(--line-2); }
.more-item {
  display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 52px; padding: 0 8px;
  border: 0; border-radius: 12px; background: none;
  color: var(--ink); font-size: 17px; letter-spacing: -.02em; text-align: left;
}
.more-item:active { background: var(--g); }
.more-item.is-active, .more-item.is-active .more-ic { color: var(--blue); }
.more-ic { display: grid; place-items: center; flex: none; width: 28px; height: 28px; color: var(--ink-2); }
.more-ic svg { width: 21px; height: 21px; }
@keyframes more-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes more-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .more-panel, .more-scrim { animation: none; } }

/* Below desktop the dashboard row sizes to its tiles (the desktop rules fix
   its height so the page fits one screen; stacked tiles would be clipped). */
@media (max-width: 1100px) {
  .dash2 > .bento, .is-ops > .bento, .is-emp > .bento { height: auto; }
}

/* Tablets */
@media (min-width: 761px) and (max-width: 1100px) {
  /* Tickets board: four columns that line up with their headings */
  .tk-head, .tk-row { grid-template-columns: 56px minmax(0, 1fr) 76px 152px; grid-template-rows: auto; column-gap: 14px; }
  .tk-head > span:nth-child(3) { display: block; }
  .tk-head > span:nth-child(5), .tk-act { display: none; }
  .tk-head-trk { width: auto; }
  .tk-thumb { width: 56px; height: 48px; }
  .tk-thumb, .tk-main { grid-row: auto; }
  .tk-row .prio, .tk-row .status { grid-column: auto; justify-self: start; }
  .tk-trk .jt, .tk-trk .tb { width: 100%; }

  /* Overview: one column, the list first, as on phones; the chart keeps a
     fixed height so its bars aren't stretched out of view */
  .view-estate { overflow-y: auto; }
  .view-estate > .est-grid { display: flex; flex-direction: column; gap: 14px; height: auto; }
  .est-sites { order: 1; }
  .est-zones { order: 2; }
  .est-trend { order: 3; }
  .est-chart { flex: none; height: 200px; min-height: 0; }
  .est-sites .est-list { max-height: 56dvh; overflow-y: auto; overscroll-behavior: contain; }
}

/* Phones */
@media (max-width: 760px) {
  /* Tab bar: four sections, Report and More, in that order */
  .rail-nav > .rail-link { order: var(--tab-order, 40); }
  .rail-nav > .rail-cta { order: 50; }
  .rail-nav > .rail-more { order: 60; }
  .rail-more:not([hidden]) { display: flex; }
  .rail-link.is-tucked { display: none !important; }
  body.has-more .rail-foot { display: none; }
  .rail-link .rail-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

  /* Dashboard tiles size to their content; the page scrolls, not the tile */
  .bento, .bento > .tile, .bento > .side { flex: none; height: auto; max-height: none; }
  .na { flex: none; max-height: none; overflow: visible; }
  .na-row { gap: 10px; padding: 11px 8px; }
  .na-t { white-space: normal; }

  /* Site workload: a narrower sparkline so the name and its notes fit */
  .t-sites .rk { flex: none; max-height: 420px; }
  .rk-head, .rk-row { grid-template-columns: 16px minmax(0, 1fr) 64px 40px; gap: 8px; }
  .rk-name { white-space: normal; line-height: 1.25; }
  .rk-sub { flex-wrap: wrap; column-gap: 6px; white-space: normal; }
  .spk { width: 64px; }

  /* Overview: the ranked site list scrolls in place, so the zones and the
     trend below it can still be reached */
  .est-sites .est-list { max-height: 62dvh; overflow-y: auto; overscroll-behavior: contain; }

  /* Data tables become stacked cards; mobile.js labels each cell */
  body.app-open .dt-wrap { max-height: 70dvh; }
  /* short tables (some carry an inline cap) grow with the page instead of
     scrolling inside it */
  body.app-open .dt-wrap-sm, .dt-wrap-compact { max-height: none !important; overflow-y: visible !important; }
  body.app-open .dt thead { display: none; }
  body.app-open .dt, body.app-open .dt tbody, body.app-open .dt tr { display: block; width: 100%; }
  body.app-open .dt tbody tr { padding: 12px 2px; border-bottom: 1px solid var(--line-2); }
  body.app-open .dt tbody tr:last-child { border-bottom: 0; }
  body.app-open .dt tbody tr:hover { background: none; }
  body.app-open .dt tbody td {
    display: block; position: relative;
    min-height: 26px; padding: 3px 0 3px 106px; border: 0; background: none;
    white-space: normal; overflow-wrap: anywhere; text-align: left;
  }
  body.app-open .dt tbody td::before {
    content: attr(data-label);
    position: absolute; left: 0; top: 5px; width: 96px;
    font-size: 12px; font-weight: 400; line-height: 1.3; color: var(--ink-3);
  }
  body.app-open .dt tbody td:not([data-label]),
  body.app-open .dt tbody td[data-label=""] { padding-left: 0; }
  body.app-open .dt tbody td:not([data-label])::before,
  body.app-open .dt tbody td[data-label=""]::before { display: none; }
  body.app-open .dt tbody td * { white-space: normal; text-overflow: clip; }
  body.app-open .dt tbody td:first-child { font-weight: 600; }
  body.app-open .dt tbody td .cdd-trigger, body.app-open .dt tbody td .select { min-width: 0; width: 100%; }
  body.app-open .dt .dt-empty { display: block; }

  /* Sheets: full width, and the admin sheet's actions stack cleanly */
  #proof-modal .modal-card { width: 100%; }
  #admin-detail-modal .modal-footer-split { flex-direction: column-reverse; align-items: stretch; gap: 8px; }
  #admin-detail-modal .modal-footer-stack { align-items: stretch; gap: 8px; }
  #admin-detail-modal .modal-footer-group { display: flex; gap: 8px; }
  #admin-detail-modal .modal-footer-group > * { flex: 1; }
  #admin-detail-modal .modal-footer-group .footer-note { flex: none; align-self: center; font-size: 12px; }
  #admin-detail-modal .modal-footer-group:has(> .footer-note) { flex-wrap: wrap; }
  #admin-detail-modal .modal-footer-group:has(> .footer-note) .footer-note { flex-basis: 100%; text-align: center; }
  #admin-detail-modal .modal-footer-split > .soft-btn { border: 0; }
}
