/* ---- cards ------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding: 16px 20px 12px; }
h1, h2, .brand-mark, .brand-name, .signin-brand { font-variant-numeric: lining-nums; }
h2 { margin: 0; font-family: var(--font-brand); font-size: 16px; font-weight: 700; letter-spacing: 0; color: var(--ink-strong); }
.card-link { font-size: 13px; font-weight: 550; text-decoration: none; }
.card-link:hover { text-decoration: underline; }
.card-flag { font-size: 12.5px; color: var(--ink-3); }
.card-empty { margin: 0; padding: 4px 20px 20px; color: var(--ink-3); }
.card-foot { margin: 0; padding: 12px 20px 16px; color: var(--ink-3); font-size: 13px; border-top: 1px solid var(--line); }

/* ---- the spine and the counts: a proportional bar per attention tier, the count in Raleway.
   Tier words always sit beside the colour (Spoken Status Rule). */

.spine { position: relative; display: flex; gap: 3px; height: 10px; margin-bottom: 22px; overflow: hidden; border-radius: 5px; }
.spine-seg { flex: var(--n) 1 0; min-width: 6px; border-radius: 5px; transform-origin: left center; }
.spine-seg[data-tier="act"] { background: var(--tier-act); }
.spine-seg[data-tier="check"] { background: var(--tier-check); }
.spine-seg[data-tier="unreported"] { background: var(--tier-unreported); }
.spine-seg[data-tier="clear"] { background: var(--tier-clear); }
.lane-count { font-family: var(--font-brand); font-weight: 700; font-size: 56px; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: lining-nums proportional-nums; }
.tier-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.tier-dot.tier-act { background: var(--tier-act); }
.tier-dot.tier-check { background: var(--tier-check); }
.tier-dot.tier-unreported { background: var(--tier-unreported); }
.tier-dot.tier-clear { background: var(--tier-clear); box-shadow: inset 0 0 0 1px var(--tier-clear-ring); }

/* ---- dashboard: the map is the stage, panels float on it ---------------------------------- */

.stage {
  position: relative; height: clamp(500px, calc(100vh - 340px), 720px);
  border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--map-sea);
}
.stage .map { position: absolute; inset: 0; border: 0; border-radius: 0; }
.float { position: absolute; z-index: 500; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); }
.f-title { left: 16px; top: 16px; padding: 12px 18px; }
.f-title h1 { font-size: 24px; color: var(--ink); }
.f-title .meta { margin: 2px 0 0; color: var(--ink-3); font-size: 12.5px; }
.f-title .pm-howto { max-width: 320px; line-height: 1.45; }
.f-key { left: 16px; bottom: 16px; margin: 0; padding: 8px 12px; }
.stage .leaflet-top.leaflet-left { top: 196px; margin-left: 4px; }
.stage .leaflet-top.leaflet-right { right: 436px; }
.content:has(.room) { padding: 0; }
.stage.room { height: calc(100vh - 60px); min-height: 560px; border: 0; border-radius: 0; }
.f-title { display: grid; gap: 10px; min-width: 320px; }
.f-title .meta { margin-top: -6px; }
.r-counts { display: grid; grid-template-columns: repeat(4, auto); gap: 2px 14px; }
.r-count { display: grid; padding: 4px 6px 2px; margin: -4px -6px -2px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.r-count:hover { background: var(--row-hover); color: var(--ink); }
.r-count[aria-pressed="true"] { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--ibs-teal); }
.r-word { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.r-count .lane-count { font-size: 34px; line-height: 1.05; }
.r-act .lane-count { color: var(--act); }
.lane-total { font-size: 12px; color: var(--ink-3); }
.f-title .spine { height: 6px; margin: 0; border-radius: 3px; }
.f-title .filterbar { margin: 0; padding: 6px 8px; }
.f-rail { right: 20px; top: 20px; bottom: 20px; width: 400px; display: flex; flex-direction: column; overflow: hidden; }
.rail-head { padding: 12px; border-bottom: 1px solid var(--line); }
.rail-head .teamchips { display: flex; flex-wrap: nowrap; gap: 2px; margin: 0; padding: 3px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.rail-head .teamchips[hidden] { display: none; }
.rail-head .team-chip { flex: 1; min-height: 34px; border: 0; border-radius: 7px; white-space: nowrap; }
.rail-head .team-chip[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.rail-head .team-chip .n { color: var(--ink-3); font-weight: 500; }
.stage.room .f-title { left: 20px; top: 20px; }
.stage.room .f-key { left: 20px; bottom: 20px; }

/* ---- job drawer ------------------------------------------------------------------------------------ */
[hidden] { display: none !important; }
.drawer {
  position: fixed; top: 60px; right: 0; bottom: 0; z-index: 1500; width: 400px; max-width: 100vw;
  display: flex; flex-direction: column; overflow-y: auto;
  background: var(--surface); border-left: 1px solid var(--line-2); box-shadow: var(--shadow-pop);
  transform: translateX(100%); transition: transform 320ms var(--ease-out);
}
.drawer.is-open { transform: none; }
.drawer-close { position: sticky; top: 10px; align-self: flex-end; flex: none; margin: 10px 10px -46px 0; z-index: 2; background: var(--surface); width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--ink-2); cursor: pointer; }
.drawer-close:hover { background: var(--row-hover); color: var(--ink); }
.drawer-body { padding: 20px 20px 28px; }
.drawer-skel, .drawer-msg { margin: 0 0 8px; color: var(--ink-2); font-weight: 600; }
.panel-head { padding-right: 36px; }
.panel-code { margin: 0 0 2px; color: var(--ink-2); font-weight: 650; font-size: 12.5px; }
.drawer-title { font-size: 20px; line-height: 1.25; color: var(--ink); }
.drawer-title:focus-visible { outline: 2px solid var(--ibs-indigo); outline-offset: 4px; }
.panel-tier { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; font-weight: 600; color: var(--ink-2); }
.panel-chips { margin: 8px 0 0; }
.panel-facts { display: grid; gap: 12px; margin: 18px 0 0; }
.panel-facts div { display: grid; gap: 2px; }
.panel-facts dt { color: var(--ink-3); font-size: 12px; font-weight: 600; }
.panel-facts dd { margin: 0; color: var(--ink); display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-variant-numeric: tabular-nums; }
.panel-facts .rel { color: var(--ink-3); font-size: 12.5px; }
.panel-report { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.panel-report h3 { margin: 0 0 6px; font: 700 13.5px var(--font-brand); color: var(--ibs-indigo); }
.panel-report-meta, .panel-report-people { margin: 0 0 4px; color: var(--ink-2); font-size: 13px; }
.panel-report-people { color: var(--ink); font-weight: 600; }
.panel-lines { margin: 8px 0 4px; padding-left: 16px; list-style: disc; color: var(--ink); overflow-wrap: anywhere; }
.panel-lines li { margin: 0 0 4px; }
.panel-photos { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; list-style: none; padding: 0; }
.panel-photos img { display: block; width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); }
.panel-open { margin: 22px 0 0; }
.chip-fresh { background: transparent; border-color: var(--ibs-teal); color: var(--ibs-teal); }
.job-pin.is-selected .dot { transform: scale(1.5); }
@media (max-width: 1240px) {
  .drawer { top: auto; left: 0; width: auto; max-height: 85vh; border-left: 0; border-top: 1px solid var(--line-2); border-radius: 14px 14px 0 0; transform: translateY(100%); }
  .drawer.is-open { transform: none; }
}
@media (prefers-reduced-motion: reduce) { .drawer { transition: none; } }

/* ---- filters ---------------------------------------------------------------------------------------- */
.teamchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.team-chip { font: 600 12.5px var(--font); min-height: 32px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 999px; background: transparent; color: var(--ink-2); cursor: pointer; transition: background-color 140ms, color 140ms, border-color 140ms; }
.team-chip:hover { border-color: var(--ibs-indigo); color: var(--ibs-indigo-ink); }
.team-chip[aria-pressed="true"] { background: var(--ibs-teal); border-color: var(--ibs-teal); color: var(--on-teal); }
.filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 16px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.fchip { font: 600 12.5px var(--font); min-height: 30px; padding: 0 10px; border: 1px solid var(--ibs-indigo-line); border-radius: 999px; background: var(--ibs-indigo-soft); color: var(--ibs-indigo-ink); cursor: pointer; }
.fchip:hover { border-color: var(--ibs-indigo); }
.fnote { color: var(--ink-3); font-size: 12.5px; }
.fclear { margin-left: auto; font: 600 12.5px var(--font); min-height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: var(--ibs-indigo); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.job-pin.is-dim { opacity: 0.28; }
.job-pin.is-dim.is-linked, .job-pin.is-dim.is-selected { opacity: 1; }
.filter-empty { padding-top: 12px; }

/* ---- pins: size wrapper, spark, Manpower mode ------------------------------------------------------------ */
.job-pin .sz { position: absolute; inset: 0; transform: scale(var(--pin-scale, 1)); transition: transform 240ms var(--ease-out), opacity 200ms; }
.job-pin .spark { position: absolute; right: -1px; top: -1px; width: 9px; height: 9px; border-radius: 50%; background: var(--ibs-teal); border: 1.5px solid var(--bg); }
.motion-ready .job-pin .spark { animation: spark-in 700ms var(--ease-out) both; animation-delay: calc(var(--pin-base, 0ms) + var(--d, 0ms) + 200ms); }
@keyframes spark-in { from { transform: scale(0); } 60% { transform: scale(1.7); } to { transform: scale(1); } }
.pins-manpower .job-pin:not(.is-fresh) .sz { transform: scale(0.55); opacity: 0.5; }
.map-tip-fresh { color: var(--ibs-teal); font-weight: 600; }
.map-pinmode { display: flex; gap: 2px; margin-left: 6px; padding-left: 6px; border-left: 1px solid var(--line); }
.map-pinmode button { font: 600 12px var(--font); padding: 6px 10px; border: 0; border-radius: 6px; background: none; color: var(--ink-2); cursor: pointer; }
.map-pinmode button[aria-pressed="true"] { background: var(--ibs-teal); color: var(--on-teal); }
@media (prefers-reduced-motion: reduce) { .job-pin .sz { transition: none; } .motion-ready .job-pin .spark { animation: none; } }

/* the job list beside the map: every job, grouped by tier, urgent first */
.rail-list { flex: 1; list-style: none; margin: 0; padding: 0 0 6px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.rail-list .grp-h { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 8px 18px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 650; letter-spacing: 0.02em; border-top: 1px solid var(--line); }
.rail-list .grp-h:first-child { border-top: 0; }
.rail-list .grp-h .n { margin-left: auto; color: var(--ink-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.rail-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "job pct" "chips chips"; align-items: center; gap: 4px 12px; padding: 11px 18px; border-top: 1px solid var(--line); transition: background-color 160ms; }
.grp-h + .rail-row { border-top: 0; }
.rail-row.is-linked, .rail-row.is-selected { background: var(--ibs-indigo-soft); }
.rail-row.is-selected .code { color: var(--ibs-teal); }
.action-job { grid-area: job; display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; min-width: 0; }
.action-job .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.action-job:hover .name, .rail-row.is-linked .action-job .name { color: var(--ibs-indigo); }
.action-job:hover .name { text-decoration: underline; }
.action-chips { grid-area: chips; display: flex; flex-wrap: wrap; align-items: center; min-width: 0; padding-left: 18px; }
.chip-more { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.action-pct { grid-area: pct; display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 13px; font-weight: 550; white-space: nowrap; font-variant-numeric: tabular-nums; }
.meter { display: inline-block; width: 56px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 3px; background: var(--act-done); }


/* map */
.map.leaflet-container, .leaflet-container { font: 13px/1.4 var(--font); background: var(--map-sea); }
.map.map-failed { display: grid; place-items: center; color: var(--ink-3); }
.map-key { list-style: none; display: grid; gap: 4px; color: var(--ink-2); font-size: 12px; }
.map-key li { display: flex; align-items: center; gap: 8px; }
.pin-key { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); }
.pin-key.pin-act { background: var(--tier-act); } .pin-key.pin-check { background: var(--tier-check); }
.pin-key.pin-unreported { background: var(--tier-unreported); } .pin-key.pin-clear { background: var(--tier-clear); }
.pin-key.pin-hollow { background: var(--surface); border: 2.5px solid var(--ink-3); box-shadow: none; }
.pin-key.pin-shade { border-radius: 3px; background: color-mix(in srgb, var(--tier-act) 45%, transparent); border: 1px solid var(--prov); box-shadow: none; }
.leaflet-container .leaflet-control-attribution { font-size: 11.5px; background: transparent !important; color: var(--ink-3); }
.leaflet-container .leaflet-control-attribution a { color: var(--ink-3); }
.leaflet-bar { border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); }
.leaflet-bar a, .leaflet-bar a:hover { background: var(--surface); color: var(--ink); border-bottom-color: var(--line); }
.leaflet-bar a:hover { background: var(--row-hover); }
.leaflet-bar a.leaflet-disabled { background: var(--surface); color: var(--ink-3); }
.leaflet-tooltip.map-tip { padding: 8px 10px; border: 0; border-radius: 8px; box-shadow: var(--shadow-pop); background: var(--surface); color: var(--ink); }
.map-tip::before { display: none; }
.map-tip div { display: grid; gap: 2px; max-width: 260px; white-space: normal; }
.map-tip span { color: var(--ink-2); }
.map-tip .map-tip-place { color: var(--ink-3); font-size: 12px; }
.map-views { display: flex; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-pop); }
.map-views button { font: 600 12px var(--font); padding: 6px 10px; border: 0; border-radius: 6px; background: none; color: var(--ink-2); cursor: pointer; }
.map-views button:hover { background: var(--ibs-indigo-soft); color: var(--ibs-indigo-ink); }

/* provinces (border territories): thin lines, a wash of the most urgent tier inside, lit on hover or link */
.prov { cursor: default; transition: fill-opacity 200ms, stroke 200ms, stroke-width 200ms; }
.motion-first .prov-fade { animation: prov-in 900ms var(--ease-out) both 700ms; }
@keyframes prov-in { from { opacity: 0; } to { opacity: 1; } }

/* pins (Leaflet divIcons) */
.job-pin { background: none; border: 0; }
.job-pin .dot {
  position: absolute; inset: 3px; border-radius: 50%;
  background: var(--pin); border: 2px solid var(--bg);
  box-shadow: 0 1px 3px rgba(28, 32, 37, 0.35);
  transition: transform 180ms var(--ease-out);
}
.job-pin.is-unconfirmed .dot { background: var(--surface); border: 3px solid var(--pin); }
.job-pin.tier-act { --pin: var(--tier-act); } .job-pin.tier-check { --pin: var(--tier-check); }
.job-pin.tier-unreported { --pin: var(--tier-unreported); } .job-pin.tier-clear { --pin: var(--tier-clear); }
.job-pin .ring { position: absolute; inset: 3px; border-radius: 50%; border: 2px solid var(--pin); opacity: 0; pointer-events: none; }
.map.is-linking .job-pin:not(.is-linked) { opacity: 0.28; }
.job-pin { transition: opacity 180ms; }
.job-pin.is-linked { z-index: 1000 !important; }
.job-pin.is-linked .dot { transform: scale(1.5); }


/* table twins (accessibility view of each chart) */
.twin { margin: 14px 20px 16px; }
.twin summary { cursor: pointer; color: var(--ibs-indigo); font-size: 13px; font-weight: 550; width: max-content; list-style: none; display: inline-flex; align-items: center; gap: 8px; }
.twin summary::-webkit-details-marker { display: none; }
.twin summary::before { content: ""; width: 6px; height: 6px; border-right: 1.75px solid currentColor; border-bottom: 1.75px solid currentColor; transform: rotate(-45deg); transition: transform 160ms var(--ease-out); }
.twin[open] summary::before { transform: rotate(45deg) translate(-1px, -1px); }
.twin-table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.twin-table th, .twin-table td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--line); font-weight: 400; }
.twin-table thead th { color: var(--ink-3); font-weight: 600; font-size: 12px; }
.twin-table tbody th { font-weight: 600; }

/* chart tooltip */
.tip {
  position: fixed; left: 0; top: 0; z-index: 50;
  display: grid; gap: 1px;
  padding: 8px 10px;
  background: var(--ibs-indigo-ink);
  color: #fff;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  box-shadow: var(--shadow-pop);
  pointer-events: none;
  font-size: 12.5px;
  max-width: 280px;
}
.tip[hidden] { display: none; }
.tip-value { font-weight: 650; font-size: 13.5px; }
.tip-label { color: rgba(255, 255, 255, 0.78); }

/* ---- tabs with counts (reports inbox) ------------------------------------ */

.tabs { display: flex; gap: 4px; margin: 0 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 12px 11px; margin-bottom: -1px;
  color: var(--ink-2); text-decoration: none; font-weight: 500; white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 120ms, border-color 120ms;
}
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--ibs-indigo); border-bottom-color: var(--ibs-indigo); }
.count { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: 12px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }

.seg.seg-done { background: var(--act-done); }
.seg.seg-in_progress { background: var(--act-in_progress); }
.seg.seg-upcoming { background: var(--act-upcoming); }
.seg.seg-hold { background: var(--act-hold); }
.seg.seg-delayed { background: var(--act-delayed); }
.seg.seg-other { background: var(--act-other); }

.code { font-weight: 650; font-size: 13px; letter-spacing: 0.01em; color: var(--ink); white-space: nowrap; }
.action-job .code { flex: none; }
.name { font-weight: 500; }
.sub { display: block; margin-top: 2px; color: var(--ink-3); font-size: 12.5px; }

/* One soft status label on both halves (the owner, 2026-11-05): a dot and the word on a soft fill, no border. */
.chip { display: inline-flex; align-items: center; gap: 6px; margin: 2px 4px 2px 0; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 18px; white-space: nowrap; border: 0; background: var(--ibs-indigo-soft); color: var(--ibs-indigo); }
.chip::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-late, .chip-hold, .chip-delayed { background: var(--act-bg); border-color: var(--act-line); color: var(--act); }
.chip-conflict, .chip-completed_open, .chip-no_report, .chip-delivery_late { background: var(--check-bg); border-color: var(--check-line); color: var(--check); }
.chip-unreported { background: var(--surface-2); border-color: var(--line-2); color: var(--ink-2); }
.chips { margin: 10px 0 0; }
.nil { color: var(--ink-3); }
.stack { display: flex; width: min(132px, 100%); height: 8px; margin-bottom: 4px; border-radius: 2px; overflow: hidden; background: var(--line); gap: 1px; }
.seg { display: block; height: 100%; min-width: 2px; }


