/* IBS Project Tracker: Procore-style app shell and widget dashboard in IBS colours.
   Brand colours sampled from inovus/IBS site: indigo #3A4386, ring teal #1AB8B3, ring green #7FDF9A. */

@font-face {
  font-family: "Raleway";
  src: url("fonts/raleway-latin-var.e401cae7a129.woff2") format("woff2");
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}

/* The INOVUS website colours, light (spec 2026-10-20 section 8.8; sample approved by the owner 2026-10-20). Token names
   are kept from the earlier themes, so every rule keeps working: --ibs-indigo is the website's indigo, --ibs-teal the
   primary action (now indigo too), --ibs-green the green of "on track" and done. Text colours meet WCAG AA on every
   surface they sit on (tests/test_colours.py). */
:root {
  /* brand */
  --ibs-indigo: #364191;
  --ibs-indigo-ink: #30397b;
  --ibs-indigo-soft: #eaedff; /* the website's tint: selected rows, the active menu entry */
  --ibs-indigo-line: #c9cef2;
  --ibs-indigo-brand: #364191;
  --ibs-blue: #4fa6d5; /* the website's blue: fills and the map's highlight; text uses --link */
  --ibs-teal: #364191; /* primary buttons */
  --ibs-teal-hover: #30397b;
  --ibs-green: #6ec083; /* fills: bars, done; text uses --ok */
  --on-teal: #ffffff;
  --link: #236d94;
  --link-hover: #1c5573;
  --focus: #236d94;
  --focus-on-bar: #ffffff;
  --ok: #2e6b3e; --ok-bg: #e3f8ea; --ok-line: #b5e6c4;

  /* shell: the indigo band of the website */
  --side-bg: #364191;
  --side-ink: #eaedff;
  --side-ink-strong: #ffffff;
  --side-hover: rgba(255, 255, 255, 0.12);
  --side-active: #eaedff;
  --side-active-ink: #364191;
  --side-line: rgba(255, 255, 255, 0.14);

  /* surfaces and ink */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f7fb; /* panels */
  --ink: #444444;
  --ink-strong: #1c2025;
  --ink-2: #5a5f69;
  --ink-3: #62676e;
  --ink-quiet: #868b95; /* a zero, a step not built yet: steps back (clean look, 2026-11-08) */
  --line: #e4e7ef;
  --line-2: #cdd2e0;
  --line-field: #7c8297; /* input borders: 3:1 on white */
  --row-hover: #f0f2f9;

  /* attention tiers (status palette: fixed, always paired with a label); text uses the darker tones */
  --tier-act: #d03b3b;
  --tier-check: #b87a00;
  --tier-unreported: #7c8297;
  --tier-clear: #6ec083;
  --tier-clear-ring: #3e8e57;
  --act: #b4382a; --act-bg: #fdebe8; --act-line: #f3b9b1;
  --check: #7a4f00; --check-bg: #fff4d6; --check-line: #f2d38a;

  /* activity statuses on a light page */
  --act-done: #364191;
  --act-in_progress: #4fa6d5;
  --act-upcoming: #cdd2e0;
  --act-hold: #d97f72;
  --act-delayed: #d03b3b;
  --act-other: #e4e7ef;

  /* map */
  --map-sea: #f6f7fb;
  --map-land: #e4e8f4;
  --map-coast: #b9c0e0;
  --prov: #9aa3d6;
  --prov-hi: #4fa6d5;

  --radius: 10px;
  --shadow: none; /* one look (the owner, 2026-11-05): boxes at rest carry a hairline only; shadows are for what floats */
  --shadow-pop: 0 12px 32px rgba(28, 32, 37, 0.14), 0 2px 6px rgba(28, 32, 37, 0.08);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-brand: "Raleway", var(--font);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 var(--font); /* 15 px on both halves of the site (one look, the owner, 2026-11-05) */
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--ibs-teal); color: var(--on-teal); }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.topbar :focus-visible { outline-color: var(--focus-on-bar); }
code { font: 0.92em ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 0.05em 0.35em; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }

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

body.has-shell { min-height: 100vh; background: var(--bg); }

.topbar {
  position: sticky; top: 0; z-index: 700;
  display: flex; align-items: center; gap: 8px;
  height: 60px; padding: 0 24px;
  background: var(--side-bg); color: var(--side-ink);
  border-bottom: 1px solid var(--side-line);
}
.brand { display: flex; flex: none; align-items: baseline; gap: 8px; padding: 0 20px 0 0; color: var(--side-ink-strong); text-decoration: none; }
.brand:hover { color: var(--side-ink-strong); }
.brand-mark { font-family: var(--font-brand); font-weight: 700; font-size: 22px; letter-spacing: 0.01em; }
.brand-name { font-family: var(--font-brand); font-weight: 600; font-size: 14px; color: var(--side-ink); }

/* The tabs never push the bar past the screen (the owner, 2026-11-01: "fix the ui bug in phone"): the brand and the
   buttons stay put, and tabs that do not fit scroll sideways. */
.nav { display: flex; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav > * { flex: none; }
.nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--side-ink);
  text-decoration: none;
  font-weight: 500;
  transition: background-color 120ms, color 120ms;
}
.nav a:hover { background: var(--side-hover); color: var(--side-ink-strong); }
.nav a[aria-current="page"] { background: var(--side-active); color: var(--side-active-ink); }
.nav a[aria-current="page"] .icon { color: var(--side-active-ink); }
/* An entry's sections (Admin's and Management's Purchasing; the owner, 2026-10-31): a tinted bar joined under the top
   bar. Procurement's Purchasing pages keep it open (frontend/src/app/TopBar.tsx); here it slides down while the pointer
   or keyboard focus is on the entry, and the entry joins it like a tab. */
.topbar { --bar-h: 60px; }
.nav { align-self: stretch; align-items: center; }
.nav-group { align-self: stretch; display: flex; align-items: center; }
.nav-group > a { position: relative; }
.nav-group > a::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: calc((var(--bar-h) - 100%) / 2); }
.nav-group:hover > a, .nav-group:focus-within > a { background: var(--side-active); color: var(--side-active-ink); border-radius: 8px 8px 0 0; }
.nav-group:hover > a .icon, .nav-group:focus-within > a .icon { color: var(--side-active-ink); }
.nav-group:hover > a::after, .nav-group:focus-within > a::after { background: var(--side-active); }
.subnav {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 1;
  display: flex; align-items: center; gap: 4px; height: 44px; padding: 0 24px; overflow-x: auto;
  background: var(--side-active); box-shadow: 0 12px 24px rgba(28, 32, 37, 0.12);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 150ms ease-in 120ms, transform 150ms ease-in 120ms, visibility 0s linear 270ms;
}
.nav-group:hover > .subnav, .nav-group:focus-within > .subnav {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity 220ms ease-out, transform 220ms ease-out, visibility 0s;
}
.nav .subnav a { flex: none; gap: 6px; padding: 6px 12px; border-radius: 6px; color: var(--ink-2); font-size: 14px; white-space: nowrap; }
.nav .subnav a:hover { background: rgba(255, 255, 255, 0.75); color: var(--ink-strong); }
.subnav-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--side-bg); color: var(--side-ink-strong); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
@media (prefers-reduced-motion: reduce) { .subnav { transform: none; transition: none; } }
@media (max-width: 900px) { .topbar { --bar-h: 56px; } .subnav { padding: 0 12px; } }
@media (max-width: 767px) { .subnav { display: none; } }
/* The current tab's sub-tabs, docked under the top bar on the tracker's pages as on procurement's (the owner,
   2026-11-01: tabs by department, the Dashboard a sub-tab of Projects). */
.subbar {
  position: sticky; top: var(--bar-h, 60px); z-index: 690;
  display: flex; align-items: center; gap: 4px; height: 44px; padding: 0 24px; overflow-x: auto;
  background: #fff; border-bottom: 1px solid var(--side-line);
}
.subbar a { flex: none; display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 6px; color: var(--ink-2);
  font-size: 14px; font-weight: 500; white-space: nowrap; text-decoration: none; transition: background-color 120ms, color 120ms; }
.subbar a:hover { background: var(--side-active); color: var(--ink-strong); }
/* The page's own sub-tab: an indigo underline on a white bar (clean look, the owner, 2026-11-08: "Keep navy, calmer"). */
.subbar a[aria-current="page"] { color: var(--side-active-ink); font-weight: 600; border-radius: 0; box-shadow: inset 0 -2px 0 var(--ibs-indigo); }
/* A step not built yet: greyed, not a link (the owner, 2026-11-08: "Keep, but greyed"). */
.subbar .soon, .subnav .soon { flex: none; display: flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: 14px;
  color: var(--ink-quiet); white-space: nowrap; cursor: not-allowed; }
.subbar .soon em, .subnav .soon em { font-style: normal; font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 0 5px; border: 1px solid var(--side-line); border-radius: 5px; }
@media (max-width: 900px) { .subbar { top: 56px; padding: 0 12px; } }

.top-end { margin-left: auto; flex: none; display: flex; align-items: center; gap: 18px; }
/* Raise a PR: the bar's one filled button, for everyone who makes PRs (the owner, 2026-10-30). */
.raise-pr-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 9px; border-radius: 8px;
  font-weight: 600; font-size: 13.5px; white-space: nowrap; text-decoration: none;
  color: var(--side-active-ink); background: var(--side-active); transition: background-color 120ms;
}
.raise-pr-btn .icon { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.25; fill: none; }
.raise-pr-btn:hover { background: #ffffff; }
.raise-pr-btn:focus-visible { outline: 2px solid var(--focus-on-bar); outline-offset: 2px; }
.top-end .chat-btn { margin-right: 6px; }
/* My asks beside + Ask Logistics: a quiet outlined twin, white on the bar (UI walk, 1 Dec 2026). */
.top-end .my-asks-btn { margin-left: -10px; color: var(--side-ink-strong); background: transparent; box-shadow: inset 0 0 0 1px var(--side-line); }
.top-end .my-asks-btn:hover { background: var(--side-hover); }
.top-data { margin: 0; display: grid; font-size: 12px; line-height: 1.3; }
.top-label { color: var(--side-ink); }
.top-data time { color: var(--side-ink-strong); font-weight: 600; font-variant-numeric: tabular-nums; }
.top-user { display: flex; align-items: center; gap: 10px; }
.top-user form { margin: 0; }
.top-name { color: var(--side-ink-strong); font-weight: 500; max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  display: grid; place-items: center; width: 30px; height: 30px; flex: none;
  border-radius: 50%; background: var(--ibs-green); color: var(--ink-strong); font-weight: 700; font-size: 13px;
}
.icon-btn {
  display: grid; place-items: center; width: 34px; height: 34px;
  border: 0; border-radius: 8px; background: none; color: var(--side-ink); cursor: pointer;
}
.icon-btn:hover { background: var(--side-hover); color: var(--side-ink-strong); }
/* The name menu (base.html): the setup pages and Sign out under the person's name. */
.user-menu { position: relative; }
.user-menu > summary {
  display: flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 8px;
  color: var(--side-ink); cursor: pointer; list-style: none;
}
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover { background: var(--side-hover); }
.user-menu-caret { width: 16px; height: 16px; }
.user-menu-list {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 200px; padding: 6px;
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 8px 24px rgba(20, 24, 60, 0.16);
}
.user-menu-list form { margin: 0; }
.user-menu-list a, .user-menu-list button {
  display: block; width: 100%; padding: 9px 12px; border: 0; border-radius: 8px; background: none;
  color: var(--ink-strong); font: inherit; font-weight: 500; text-align: left; text-decoration: none; cursor: pointer;
}
.user-menu-list a:hover, .user-menu-list button:hover { background: var(--ibs-indigo-soft); }

.main { min-width: 0; display: flex; flex-direction: column; }
.pagehead {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px;
  padding: 28px 32px 20px;
  background: var(--surface); /* no band or rule under the title: it sits on the page, as on procurement's pages */
}
h1 {
  margin: 0;
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink-strong);
  text-wrap: balance;
}
h1 .code { font-family: var(--font); font-size: 0.62em; font-weight: 650; color: var(--ink-2); vertical-align: 0.18em; margin-right: 6px; }
.pagehead-sub { margin: 4px 0 0; color: var(--ink-2); font-size: 14.5px; max-width: 72ch; }
.pagehead-meta { margin: 0; color: var(--ink-3); font-size: 13px; }
.pagehead-meta time { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.pagehead-actions { margin: 10px 0 0; }
.pagehead-actions .btn { margin: 0; }
.pagehead-form { display: inline; margin: 0; }
.crumb { margin: 0 0 6px; font-size: 13px; color: var(--ink-3); }

.content { padding: 24px 32px 8px; max-width: 1480px; width: 100%; margin: 0 auto; }
.content:has(.stage) { max-width: none; }
.foot { padding: 8px 32px 28px; color: var(--ink-3); font-size: 12.5px; max-width: 1480px; margin: 0 auto; width: 100%; }

.banner { margin: 0 0 16px; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); }
.banner-warn { background: var(--check-bg); border-color: var(--check-line); color: var(--check); }


/* How a page works, behind a ? (clean look, the owner, 2026-11-08): the tracker's twin of procurement's HelpTip. */
.help-tip { position: relative; display: inline-block; vertical-align: middle; font: 400 13.5px/1.5 var(--font-body, system-ui, sans-serif); letter-spacing: 0; }
.help-tip > summary { list-style: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  color: var(--ink-2); cursor: pointer; }
.help-tip > summary::-webkit-details-marker { display: none; }
.help-tip > summary:hover { background: var(--side-active); color: var(--ink-strong); }
.help-tip > summary:focus-visible { outline: 2px solid var(--ibs-indigo); outline-offset: 2px; }
.help-tip-panel { position: absolute; left: 0; top: 32px; z-index: 30; width: min(380px, 80vw); padding: 12px 14px; border: 1px solid var(--side-line);
  border-radius: 10px; background: #fff; color: var(--ink-strong); box-shadow: 0 12px 40px rgba(28, 32, 37, 0.14); white-space: normal; }

/* Your move (clean look, the owner, 2026-11-08): the account's own count first, in the indigo; a 0 steps back. */
.fig { display: grid; gap: 2px; margin: 10px 0 12px; }
.fig-label { font-size: 13px; color: var(--ink-2); }
.fig-mine .fig-label { color: var(--ibs-indigo); font-weight: 600; }
.fig-value { font: 700 30px/1.15 var(--font-brand, Raleway, system-ui, sans-serif); font-variant-numeric: tabular-nums; color: var(--ink-strong); }
.fig-mine .fig-value { color: var(--ibs-indigo); }
.fig-value.is-zero { color: var(--ink-quiet); }
.fig-sub { font-size: 13px; color: var(--ink-2); }
.job-tile-mine .job-tile-label { color: var(--ibs-indigo); font-weight: 600; }
.job-tile-mine .job-tile-figure { color: var(--ibs-indigo); }
