/* ============================================================================
   CFlo Engineering Studio — visual system
   Dark-first. Glass and glow live on the chrome; data surfaces stay solid and
   high-contrast, because this is a dense table application first and a
   showpiece second.
   ========================================================================== */

/* ---------------------------------------------------------------- tokens
   Default theme is Space Grey: graphite aluminium, not black. Surfaces step up
   in luminance rather than down, so panels read as machined layers. */
:root {
  color-scheme: dark;

  --base:        #3a3d42;   /* window graphite */
  --base-2:      #43464c;   /* modals, raised sheets */
  --panel:       rgba(255, 255, 255, 0.055);
  --panel-2:     rgba(255, 255, 255, 0.03);
  --panel-hi:    rgba(255, 255, 255, 0.11);
  --solid:       #45484e;   /* inputs, table heads — no blur behind text */
  --solid-2:     #4c5057;
  --hairline:    rgba(255, 255, 255, 0.10);
  --hairline-2:  rgba(255, 255, 255, 0.18);

  --ink:         #f3f5f7;
  --ink-2:       rgba(243, 245, 247, 0.70);
  --ink-3:       rgba(243, 245, 247, 0.48);
  --ink-4:       rgba(243, 245, 247, 0.30);

  --accent:      #34d98a;   /* CFlo green, pitched to sit on graphite */
  --accent-2:    #4ac9f5;
  --accent-deep: #17945b;
  --accent-ink:  #04170d;
  --accent-glow: rgba(52, 217, 138, 0.34);
  --accent-tint: rgba(52, 217, 138, 0.14);

  --red:         #ff7a6f;
  --red-tint:    rgba(255, 122, 111, 0.16);
  --amber:       #ffc061;
  --amber-tint:  rgba(255, 192, 97, 0.16);
  --blue:        #6cc9f7;
  --blue-tint:   rgba(108, 201, 247, 0.16);
  --violet:      #b49dff;
  --violet-tint: rgba(180, 157, 255, 0.16);

  --r-lg: 24px;
  --r:    18px;
  --r-ctl: 13px;
  --r-sm: 10px;

  /* Layered depth: ambient shadow + a lit top edge. */
  --lift:   0 1px 0 var(--panel-hi) inset, 0 10px 26px -14px rgba(0, 0, 0, 0.5);
  --lift-2: 0 1px 0 var(--panel-hi) inset, 0 26px 60px -26px rgba(0, 0, 0, 0.62);
  --blur: saturate(170%) blur(26px);

  --font: -apple-system, "SF Pro Text", "SF Pro Display", BlinkMacSystemFont,
          "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, "JetBrains Mono", monospace;
  --spring: cubic-bezier(0.22, 1, 0.36, 1);
  --sidebar: 244px;
}

[data-theme="light"] {
  color-scheme: light;
  --base:        #f4f6f9;
  --base-2:      #ffffff;
  --panel:       rgba(255, 255, 255, 0.86);
  --panel-2:     rgba(255, 255, 255, 0.62);
  --panel-hi:    #ffffff;
  --solid:       #ffffff;
  --solid-2:     #f7f9fb;
  --hairline:    rgba(9, 22, 34, 0.09);
  --hairline-2:  rgba(9, 22, 34, 0.16);
  --ink:         #0b1620;
  --ink-2:       rgba(11, 22, 32, 0.68);
  --ink-3:       rgba(11, 22, 32, 0.46);
  --ink-4:       rgba(11, 22, 32, 0.26);
  --accent:      #00934f;
  --accent-2:    #0086c9;
  --accent-deep: #00703c;
  --accent-ink:  #ffffff;
  --accent-glow: rgba(0, 147, 79, 0.28);
  --accent-tint: rgba(0, 147, 79, 0.09);
  --red:         #cc352c;  --red-tint:    rgba(204, 53, 44, 0.09);
  --amber:       #9a6200;  --amber-tint:  rgba(154, 98, 0, 0.10);
  --blue:        #0a6bb0;  --blue-tint:   rgba(10, 107, 176, 0.09);
  --violet:      #6440bf;  --violet-tint: rgba(100, 64, 191, 0.09);
  /* Crisper, tighter shadows — light UI reads by edge, not by glow. */
  --lift:   0 0 0 1px rgba(9, 22, 34, 0.045), 0 1px 2px rgba(9, 22, 34, 0.05), 0 8px 20px -14px rgba(9, 22, 34, 0.30);
  --lift-2: 0 0 0 1px rgba(9, 22, 34, 0.06), 0 2px 5px rgba(9, 22, 34, 0.06), 0 26px 55px -28px rgba(9, 22, 34, 0.34);
  --blur: saturate(140%) blur(20px);
}

/* The ambient field is a whisper in light mode — enough for depth, not a tint. */
[data-theme="light"] body::before {
  background:
    radial-gradient(46% 40% at 14% 4%,  rgba(0, 147, 79, 0.055), transparent 70%),
    radial-gradient(40% 36% at 92% 10%, rgba(0, 134, 201, 0.045), transparent 70%),
    radial-gradient(48% 42% at 78% 96%, rgba(100, 64, 191, 0.035), transparent 72%);
  opacity: 1;
}
/* No coloured corner glow behind KPI figures on white — it reads as a smudge. */
[data-theme="light"] .kpi.good::before,
[data-theme="light"] .kpi.warn::before,
[data-theme="light"] .kpi.bad::before { display: none; }
[data-theme="light"] .kpi::after { display: none; }
[data-theme="light"] .sidebar { background: rgba(255, 255, 255, 0.80); }
[data-theme="light"] table.tbl tbody tr:hover { background: #f6f8fa; }
[data-theme="light"] .bar-fill { box-shadow: none; }
[data-theme="light"] .progress > i { box-shadow: none; }
[data-theme="light"] .nav a.active { box-shadow: inset 0 0 0 1px rgba(0, 147, 79, 0.16); }
[data-theme="light"] .heat th.nm, [data-theme="light"] .heat td.nm { background: var(--base); }

/* ---------------------------------------------------------------- reset */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--base);
  color: var(--ink);
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Ambient depth field. Static gradients, one very slow drift — cheap to paint. */
body::before {
  content: '';
  position: fixed; inset: -25%;
  z-index: -1;
  background:
    radial-gradient(44% 40% at 16% 4%,  rgba(52, 217, 138, 0.10), transparent 70%),
    radial-gradient(40% 36% at 90% 10%, rgba(74, 201, 245, 0.075), transparent 70%),
    radial-gradient(48% 42% at 76% 96%, rgba(180, 157, 255, 0.06), transparent 72%),
    radial-gradient(40% 36% at 6% 92%,  rgba(52, 217, 138, 0.05), transparent 72%);
  animation: drift 44s var(--spring) infinite alternate;
  pointer-events: none;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(2%, -2%, 0) scale(1.08); }
}

::selection { background: var(--accent-tint); color: var(--ink); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; opacity: 0.82; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.022em; }
h1 { font-size: 26px; letter-spacing: -0.032em; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0 0 10px; }

.icon { flex: none; }

/* Scrollbars, quietened. */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--hairline-2); border-radius: 8px;
  border: 3px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); background-clip: content-box; }

/* ---------------------------------------------------------------- boot */
.boot { display: grid; place-items: center; min-height: 240px; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--hairline-2); border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
  filter: drop-shadow(0 0 8px var(--accent-glow));
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- login
   A standalone surface with its own fixed palette — it is the front door of
   CFlo Engineering Studio, so it does not follow the app's dark/light setting. */
.login-split {
  position: fixed; inset: 0; z-index: 300;
  display: grid; grid-template-columns: 1fr 1fr;
  background: #fff; color: #0d1512;
  font-family: var(--font);
}

/* -- left: brand panel -- */
.login-brand {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 46px 52px 40px;
  color: #fff;
  background:
    radial-gradient(120% 90% at 88% 78%, #3fb64f 0%, transparent 58%),
    linear-gradient(158deg, #05230f 0%, #0d5a26 42%, #2aa544 100%);
}
/* Oversized watermark glyph, cropped by the panel. */
.login-brand .glyph {
  position: absolute; right: -14%; bottom: -12%;
  transform: rotate(-18deg);
  color: rgba(255, 255, 255, 0.11);
  pointer-events: none; user-select: none; line-height: 0;
}
.login-lockup { position: relative; display: flex; align-items: flex-start; gap: 18px; }
.login-lockup .tag {
  font-size: 7px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: lowercase; opacity: 0.8; margin-top: 5px; line-height: 1.3;
}
.login-lockup .studio { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; align-self: center; }

.login-hero { position: relative; }
.login-hero h1 {
  font-size: clamp(40px, 6.4vw, 74px); font-weight: 800;
  letter-spacing: -0.045em; line-height: 0.94; margin-bottom: 22px;
}
.login-hero .sub { font-size: 15.5px; font-weight: 400; opacity: 0.92; margin-bottom: 26px; }
.login-hero .machine {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.62);
}
.login-hero .machine i {
  display: inline-block; width: 7px; height: 13px; margin-left: 5px;
  background: #7ff0a8; vertical-align: -2px; border-radius: 1px;
  animation: caret 1.15s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }
.login-brand .foot {
  position: relative; font-size: 12px; color: rgba(255, 255, 255, 0.55);
}

/* -- right: form panel -- */
.login-form-wrap {
  display: grid; place-items: center; padding: 40px 44px;
  background: #fff; overflow-y: auto;
}
.login-form { width: 100%; max-width: 402px; }
.login-form h2 {
  font-size: 30px; font-weight: 700; letter-spacing: -0.035em; margin-bottom: 10px;
  color: #0d1512;
}
.login-form .lede { font-size: 14px; color: #5b6b64; line-height: 1.5; margin-bottom: 26px; }
.login-form label {
  display: block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.13em;
  text-transform: uppercase; color: #63736c; margin-bottom: 7px;
}
.login-form .fld { margin-bottom: 18px; position: relative; }
.login-form input {
  width: 100%; padding: 14px 16px;
  font: inherit; font-size: 14.5px; color: #0d1512;
  background: #eef2fb;
  border: 1px solid transparent; border-radius: 12px;
  outline: none; transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.login-form input::placeholder { color: #97a5a0; }
.login-form input:focus {
  background: #fff; border-color: #1eaa4b;
  box-shadow: 0 0 0 3.5px rgba(30, 170, 75, 0.16);
}
.login-form .eye {
  position: absolute; right: 6px; bottom: 5px;
  width: 40px; height: 40px; padding: 0;
  display: grid; place-items: center;
  background: none; border: 0; border-radius: 9px;
  color: #7c8b84; cursor: pointer;
}
.login-form .eye:hover { color: #0d1512; background: rgba(13, 21, 18, 0.05); }
.login-form .go {
  width: 100%; padding: 15px; margin-top: 4px;
  font: inherit; font-size: 15px; font-weight: 700; letter-spacing: -0.01em;
  color: #fff; background: #22b04c;
  border: 0; border-radius: 12px; cursor: pointer;
  box-shadow: 0 8px 22px -10px rgba(34, 176, 76, 0.7);
  transition: filter 0.18s, transform 0.24s var(--spring);
}
.login-form .go:hover { filter: brightness(1.06); }
.login-form .go:active { transform: scale(0.985); }
.login-form .go:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.login-form .note { font-size: 13px; color: #78877f; margin-top: 14px; }
.login-form .alt {
  display: block; width: 100%; margin-top: 16px; padding: 0;
  background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: #0f8a3d; text-align: left;
}
.login-form .alt:hover { text-decoration: underline; }
.login-form .lerr {
  background: #fdecea; color: #b8322b; padding: 11px 14px;
  border-radius: 12px; font-size: 13px; margin-bottom: 18px;
}
.login-form .lnote {
  background: #e8f6ec; color: #1c6b36; padding: 11px 14px;
  border-radius: 12px; font-size: 13px; margin-bottom: 18px;
}
.login-form .go.secondary {
  color: #0f8a3d; background: #eaf6ee; box-shadow: none; margin-top: 10px;
}
/* Six digits, spaced out, so a code read off a phone is easy to check. */
.login-form input.otp {
  font-size: 26px; font-weight: 700; letter-spacing: 0.34em;
  text-align: center; padding-right: 14px;
}
.login-form .login-links {
  display: flex; gap: 18px; flex-wrap: wrap; margin-top: 16px;
}
.login-form .login-links button {
  padding: 0; background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: #0f8a3d;
}
.login-form .login-links button:hover { text-decoration: underline; }
.login-form .login-links button:last-child:not(:only-child) { color: #8a9691; }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 900px) {
  .login-split { grid-template-columns: 1fr; overflow-y: auto; }
  .login-brand { padding: 30px 26px 26px; min-height: 46vh; }
  .login-brand .glyph { font-size: 34vh; bottom: -16%; }
  .login-hero h1 { font-size: clamp(34px, 11vw, 54px); }
  .login-hero .sub { margin-bottom: 18px; font-size: 14.5px; }
  .login-form-wrap { padding: 32px 24px 48px; }
}

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 16px 12px 12px;
  background: var(--panel-2);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-right: 1px solid var(--hairline);
}
.brand { padding: 6px 12px 20px; }
.brand .cflo-wordmark { color: var(--accent); margin-bottom: 12px; }
.brand .mark {
  display: block; font-size: 17px; font-weight: 600; letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--ink) 25%, var(--accent) 135%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand .sub {
  font-size: 9px; letter-spacing: 0.19em; text-transform: uppercase;
  color: var(--ink-4); margin-top: 3px; font-weight: 500;
}

.nav { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.nav-group {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.16em;
  color: var(--ink-4); padding: 16px 12px 7px; font-weight: 600;
}
.nav a {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; margin-bottom: 2px;
  border-radius: var(--r-ctl);
  color: var(--ink-2); font-size: 13.5px; font-weight: 450;
  transition: color 0.18s, background 0.18s;
}
.nav a:hover { background: var(--panel); color: var(--ink); }
.nav a .icon { color: var(--ink-3); transition: color 0.18s; }
.nav a:hover .icon { color: var(--ink-2); }
.nav a.active {
  color: var(--ink); font-weight: 550;
  background: linear-gradient(100deg, var(--accent-tint), transparent 92%);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.nav a.active .icon { color: var(--accent); }
.nav a.active::before {
  content: ''; position: absolute; left: 0; top: 50%;
  width: 2.5px; height: 17px; margin-top: -8.5px;
  border-radius: 3px; background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.nav a .pill {
  margin-left: auto;
  background: var(--red-tint); color: var(--red);
  font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums;
  padding: 1px 7px; border-radius: 20px;
  box-shadow: inset 0 0 0 1px rgba(255, 122, 111, 0.3);
}

.side-foot { border-top: 1px solid var(--hairline); padding: 13px 8px 4px; margin-top: 8px; }
.who { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 33px; height: 33px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--accent-ink);
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 14px -4px var(--accent-glow);
}
.who .nm { font-size: 12.5px; font-weight: 550; line-height: 1.25; }
.who .rl { font-size: 11px; color: var(--ink-3); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 18px 28px;
  background: color-mix(in srgb, var(--base) 72%, transparent);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--hairline);
}
.topbar .crumb { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.topbar .grow { flex: 1; }
.content { padding: 24px 28px 72px; max-width: 1560px; width: 100%; }
.burger { display: none; }

/* ---------------------------------------------------------------- surfaces */
.card {
  background: var(--panel);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--lift);
  padding: 20px 22px;
  margin-bottom: 18px;
  animation: rise-in 0.55s var(--spring) both;
}
.card.tight { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-head h2 { flex: 1; }
.card-head .hint { color: var(--ink-3); font-size: 11.5px; font-weight: 400; }

.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: 1.9fr 1fr; }
.grid > .card { margin-bottom: 0; }

/* ---------------------------------------------------------------- KPI */
.kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(186px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.kpi {
  position: relative; overflow: hidden;
  background: var(--panel);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--hairline);
  border-radius: var(--r);
  box-shadow: var(--lift);
  padding: 17px 18px;
  transition: transform 0.4s var(--spring), border-color 0.3s;
  animation: rise-in 0.55s var(--spring) both;
}
.kpi:hover { transform: translateY(-2px); border-color: var(--hairline-2); }
.kpi::after {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--hairline-2) 45%, transparent);
}
.kpi .lb {
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.15em;
  color: var(--ink-3); font-weight: 600;
}
.kpi .vl {
  font-size: 33px; font-weight: 600; letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums; line-height: 1.05; margin-top: 9px;
}
.kpi .sb { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }
.kpi.good .vl { color: var(--accent); }
.kpi.warn .vl { color: var(--amber); }
.kpi.bad  .vl { color: var(--red); }
/* State reads from the figure's colour and a hairline at the top edge.
   A coloured corner bloom smudged the tile on both grey and white, so it is out. */
.kpi.good { box-shadow: var(--lift), inset 0 2px 0 -1px var(--accent); }
.kpi.warn { box-shadow: var(--lift), inset 0 2px 0 -1px var(--amber); }
.kpi.bad  { box-shadow: var(--lift), inset 0 2px 0 -1px var(--red); }

/* ---------------------------------------------------------------- tables */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  position: sticky; top: 0; z-index: 2;
  text-align: left; white-space: nowrap;
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-3); font-weight: 600;
  padding: 12px 14px;
  background: var(--solid);
  border-bottom: 1px solid var(--hairline);
}
table.tbl td {
  padding: 12px 14px; vertical-align: middle;
  border-bottom: 1px solid var(--hairline);
}
table.tbl tbody tr { transition: background 0.15s; }
table.tbl tbody tr:hover { background: var(--panel); }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl .clickable { cursor: pointer; }
.card.tight table.tbl th { background: var(--solid); }

.mono { font-family: var(--mono); font-size: 12px; letter-spacing: -0.01em; }
.muted { color: var(--ink-3); }
.strong { font-weight: 550; }
.nowrap { white-space: nowrap; }
.truncate { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- badges */
.b {
  display: inline-block; padding: 2.5px 9px; border-radius: 20px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.015em;
  white-space: nowrap; line-height: 1.55;
}
.b-green { background: var(--accent-tint); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-tint); }
.b-red   { background: var(--red-tint);    color: var(--red); }
.b-amber { background: var(--amber-tint);  color: var(--amber); }
.b-blue  { background: var(--blue-tint);   color: var(--blue); }
.b-grey  { background: var(--panel-hi);    color: var(--ink-2); }
.b-violet{ background: var(--violet-tint); color: var(--violet); }

.dot {
  width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 7px;
  vertical-align: 1px;
}
.dot.GREEN { background: var(--accent); box-shadow: 0 0 9px var(--accent-glow); }
.dot.AMBER { background: var(--amber);  box-shadow: 0 0 9px rgba(255, 192, 97, 0.4); }
.dot.RED   { background: var(--red);    box-shadow: 0 0 9px rgba(255, 122, 111, 0.45); }
.dot.DONE  { background: var(--ink-4); }
.dot.NO_BASELINE { background: var(--violet); box-shadow: 0 0 9px rgba(180, 157, 255, 0.4); }

/* ---------------------------------------------------------------- forms */
label.f { display: block; margin-bottom: 14px; }
label.f > span {
  display: block; font-size: 11.5px; font-weight: 550; color: var(--ink-2);
  margin-bottom: 6px; letter-spacing: -0.005em;
}
label.f > span .req { color: var(--accent); }

input, select, textarea {
  width: 100%; padding: 10px 13px;
  font: inherit; font-size: 13.5px;
  color: var(--ink);
  background: var(--solid);
  border: 1px solid var(--hairline);
  border-radius: var(--r-ctl);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  appearance: none; -webkit-appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--ink-4); }
input:hover, select:hover, textarea:hover { border-color: var(--hairline-2); }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px var(--accent-tint);
  background: var(--solid-2);
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
                    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}
input[type=checkbox] {
  width: 17px; height: 17px; border-radius: 5px; padding: 0;
  display: grid; place-content: center; cursor: pointer;
}
input[type=checkbox]:checked {
  background: linear-gradient(140deg, var(--accent), var(--accent-deep));
  border-color: transparent;
}
input[type=checkbox]:checked::after {
  content: ''; width: 9px; height: 5px;
  border: 2px solid var(--accent-ink); border-top: 0; border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px);
}
input[type=date] { min-height: 39px; }
textarea { min-height: 84px; resize: vertical; line-height: 1.55; }

.row { display: grid; gap: 14px; }
.row.c2 { grid-template-columns: 1fr 1fr; }
.row.c3 { grid-template-columns: repeat(3, 1fr); }

.err, .ok-msg {
  padding: 11px 14px; border-radius: var(--r-ctl); font-size: 13px; margin-bottom: 14px;
}
.err    { background: var(--red-tint);    color: var(--red);    box-shadow: inset 0 0 0 1px rgba(255, 122, 111, 0.26); }
.ok-msg { background: var(--accent-tint); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-tint); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 17px;
  font: inherit; font-size: 13px; font-weight: 550; letter-spacing: -0.005em;
  color: var(--accent-ink);
  background: linear-gradient(140deg, var(--accent), var(--accent-deep));
  border: 0; border-radius: var(--r-ctl);
  cursor: pointer; white-space: nowrap;
  box-shadow: 0 5px 18px -8px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform 0.28s var(--spring), box-shadow 0.28s, filter 0.2s;
}
.btn:hover { filter: brightness(1.09); box-shadow: 0 8px 26px -8px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.28); }
.btn:active { transform: scale(0.975); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; box-shadow: none; filter: none; }
.btn.wide { width: 100%; padding: 12px; font-size: 14px; }

.btn.ghost {
  color: var(--ink-2);
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--hairline);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.btn.ghost:hover { color: var(--ink); background: var(--panel-hi); box-shadow: inset 0 0 0 1px var(--hairline-2); filter: none; }
.btn.ghost .icon { color: var(--ink-3); }
.btn.danger { background: linear-gradient(140deg, var(--red), #b8352d); color: #fff; box-shadow: 0 5px 18px -8px rgba(255, 122, 111, 0.4); }
.btn.sm { padding: 7px 12px; font-size: 12px; border-radius: var(--r-sm); gap: 5px; }
.btn.icon-only { padding: 8px; }
.btn-row { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

.seg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--panel); border-radius: var(--r-ctl);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.seg button {
  padding: 6px 13px; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 550; color: var(--ink-3);
  border-radius: var(--r-sm); transition: color 0.18s, background 0.18s;
}
.seg button:hover { color: var(--ink-2); }
.seg button.on {
  color: var(--ink); background: var(--panel-hi);
  box-shadow: 0 2px 8px -4px rgba(0, 0, 0, 0.5), inset 0 0 0 1px var(--hairline);
}

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filters input, .filters select { width: auto; min-width: 148px; padding: 8px 12px; font-size: 12.5px; }
.filters select { padding-right: 30px; }
.filters .grow { flex: 1; min-width: 180px; }
.filters .grow input { width: 100%; }

/* ---------------------------------------------------------------- charts */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row {
  display: grid; grid-template-columns: 158px 1fr 58px;
  align-items: center; gap: 12px; font-size: 12.5px;
}
.bar-track {
  height: 22px; border-radius: 7px; overflow: hidden;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--hairline);
}
.bar-fill {
  height: 100%; border-radius: 7px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  box-shadow: 0 0 16px -3px var(--accent-glow);
  transform-origin: left;
  animation: grow 0.75s var(--spring) both;
}
.bar-fill.red   { background: linear-gradient(90deg, #b8352d, var(--red));   box-shadow: 0 0 16px -3px rgba(255, 122, 111, 0.45); }
.bar-fill.amber { background: linear-gradient(90deg, #a8760f, var(--amber)); box-shadow: 0 0 16px -3px rgba(255, 192, 97, 0.4); }
.bar-fill.blue  { background: linear-gradient(90deg, #24729c, var(--blue));  box-shadow: 0 0 16px -3px rgba(79, 195, 255, 0.4); }
.bar-fill.grey  { background: linear-gradient(90deg, var(--ink-4), var(--ink-3)); box-shadow: none; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.stack {
  display: flex; height: 24px; border-radius: 7px; overflow: hidden;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--hairline);
}
.stack > div { height: 100%; transition: filter 0.2s; }
.stack > div:hover { filter: brightness(1.2); }
.legend {
  display: flex; gap: 16px; flex-wrap: wrap; margin-top: 13px;
  font-size: 11.5px; color: var(--ink-2);
}
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 6px; }

.progress {
  height: 5px; min-width: 62px; border-radius: 4px; overflow: hidden;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--hairline);
}
.progress > i {
  display: block; height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  box-shadow: 0 0 10px -2px var(--accent-glow);
}

/* heatmap */
.heat { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.heat table { border-collapse: separate; border-spacing: 3px; font-size: 11px; }
.heat th {
  font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-4); font-weight: 600; padding: 4px 5px; white-space: nowrap;
}
.heat th.nm, .heat td.nm {
  position: sticky; left: 0; z-index: 2; text-align: left;
  background: var(--base); padding-right: 12px; white-space: nowrap;
}
.heat th.nm { min-width: 158px; }
.heat td.nm { font-weight: 550; font-size: 12px; }
.heat td.cell {
  width: 48px; height: 33px; text-align: center; border-radius: 8px;
  font-variant-numeric: tabular-nums; font-weight: 600; font-size: 11.5px;
  transition: transform 0.25s var(--spring);
}
.heat td.cell:hover { transform: scale(1.1); }
.h0 { background: var(--panel-2); color: var(--ink-4); box-shadow: inset 0 0 0 1px var(--hairline); }
.h1 { background: rgba(52, 217, 138, 0.16); color: #9ff0c6; }
.h2 { background: rgba(52, 217, 138, 0.34); color: #dcfff0; }
.h3 { background: rgba(255, 192, 97, 0.32); color: #ffeccb; }
.h4 { background: rgba(255, 122, 111, 0.32); color: #ffd8d4; }
.h5 { background: linear-gradient(140deg, #f4645a, #b8352d); color: #fff;
      box-shadow: 0 0 16px -4px rgba(255, 122, 111, 0.5); }
[data-theme="light"] .h2 { color: #054d31; }
[data-theme="light"] .h3 { color: #6b4400; }
[data-theme="light"] .h4 { color: #7d211c; }

/* ---------------------------------------------------------------- project cards */
.board {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
}
.pcard {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--lift);
  cursor: pointer;
  transition: transform 0.42s var(--spring), box-shadow 0.42s, border-color 0.3s;
  animation: rise-in 0.5s var(--spring) both;
}
.pcard:hover {
  transform: translateY(-4px);
  border-color: var(--hairline-2);
  box-shadow: var(--lift-2);
}
.pcard .shot {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background:
    linear-gradient(150deg, rgba(47, 224, 141, 0.10), rgba(56, 208, 255, 0.06) 55%, transparent),
    var(--solid);
  display: grid; place-items: center;
}
.pcard .shot img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.6s var(--spring);
}
.pcard:hover .shot img { transform: scale(1.045); }
.pcard .shot .none { color: var(--ink-4); display: grid; justify-items: center; gap: 7px; font-size: 11px; }
.pcard .shot::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 58%;
  background: linear-gradient(to top, rgba(30, 32, 36, 0.88), transparent);
  pointer-events: none;
}
[data-theme="light"] .pcard .shot::after {
  background: linear-gradient(to top, rgba(255, 255, 255, 0.94), transparent);
}
.pcard .shot .tags {
  position: absolute; left: 12px; top: 12px; z-index: 2; display: flex; gap: 6px; flex-wrap: wrap;
}
.pcard .shot .code {
  position: absolute; left: 14px; bottom: 11px; z-index: 2;
  font-size: 17px; font-weight: 650; letter-spacing: -0.03em;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}
[data-theme="light"] .pcard .shot .code { text-shadow: none; }
.pcard .card-tools {
  position: absolute; right: 11px; bottom: 11px; z-index: 3;
  display: flex; gap: 6px;
}
.pcard .shot .cam {
  width: 32px; height: 32px; padding: 0;
  display: grid; place-items: center;
  background: rgba(28, 31, 35, 0.6); color: #fff;
  border: 0; border-radius: 10px; cursor: pointer;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; transition: opacity 0.24s, background 0.2s;
}
.pcard:hover .cam, .pcard .cam:focus-visible { opacity: 1; }
.pcard .card-tools .cam:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pcard .cam:hover { background: rgba(28, 31, 35, 0.85); }

.pcard .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 11px; flex: 1; }
.pcard .nm {
  font-size: 13.5px; font-weight: 550; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pcard .meta { font-size: 11.5px; color: var(--ink-3); }
.pcard .stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  padding-top: 11px; border-top: 1px solid var(--hairline); margin-top: auto;
}
.pcard .stat .k {
  font-size: 9px; text-transform: uppercase; letter-spacing: 0.13em;
  color: var(--ink-4); font-weight: 600;
}
.pcard .stat .v {
  font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 3px;
}
.pcard .gatebar { display: flex; gap: 2.5px; }
.pcard .gatebar i {
  flex: 1; height: 4px; border-radius: 3px; background: var(--panel-hi);
}
.pcard .gatebar i.on { background: linear-gradient(90deg, var(--accent-deep), var(--accent)); }
.pcard .gatebar i.na { background: var(--hairline); }

/* stacked team avatars */
.faces { display: flex; align-items: center; }
.faces .face {
  width: 25px; height: 25px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-size: 9.5px; font-weight: 650; letter-spacing: -0.01em;
  color: var(--ink); background: var(--solid-2);
  box-shadow: 0 0 0 2px var(--base), inset 0 0 0 1px var(--hairline-2);
  margin-left: -7px;
}
.faces .face:first-child { margin-left: 0; }
.faces .face.lead {
  color: var(--accent-ink);
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 2px var(--base), 0 3px 10px -3px var(--accent-glow);
}
.faces .face.more { color: var(--ink-3); font-size: 9px; }
.pcard .faces .face { box-shadow: 0 0 0 2px var(--solid), inset 0 0 0 1px var(--hairline-2); }

.member-row {
  display: flex; align-items: center; gap: 11px; padding: 9px 0;
  border-bottom: 1px solid var(--hairline);
}
.member-row:last-child { border-bottom: 0; }
.member-row .mn { flex: 1; min-width: 0; }
.member-row .mn .n { font-size: 13px; font-weight: 550; }
.member-row .mn .d { font-size: 11px; color: var(--ink-3); }

/* gallery on the project detail page */
.gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; }
.gal figure {
  position: relative; margin: 0; aspect-ratio: 4 / 3; overflow: hidden;
  border-radius: 14px; background: var(--solid);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.gal img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal .acts {
  position: absolute; inset: auto 0 0 0; display: flex; gap: 6px; justify-content: flex-end;
  padding: 8px; opacity: 0; transition: opacity 0.22s;
  background: linear-gradient(to top, rgba(30, 32, 36, 0.85), transparent);
}
.gal figure:hover .acts { opacity: 1; }
.gal .acts button {
  width: 28px; height: 28px; padding: 0; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.14); color: #fff; border: 0; border-radius: 8px; cursor: pointer;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.gal .acts button:hover { background: rgba(255, 255, 255, 0.28); }
.gal .acts button.on { background: var(--accent); color: var(--accent-ink); }
.gal .badge-cover {
  position: absolute; left: 8px; top: 8px; z-index: 2;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 20px;
  background: var(--accent); color: var(--accent-ink);
}
.drop {
  display: grid; place-items: center; gap: 8px; padding: 26px;
  border-radius: 14px; cursor: pointer; text-align: center;
  color: var(--ink-3); font-size: 12.5px;
  border: 1.5px dashed var(--hairline-2);
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-tint); color: var(--accent); }

/* ---------------------------------------------------------------- stage gates */
.gates { display: flex; gap: 6px; flex-wrap: wrap; }
.gate {
  /* Grow to fill, but never stretch a short final row across the whole strip. */
  flex: 1 1 84px; min-width: 84px; max-width: 170px;
  padding: 11px 9px;
  border-radius: 14px; text-align: center;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--hairline);
  transition: transform 0.3s var(--spring);
}
.gate:hover { transform: translateY(-2px); }
.gate .gn {
  font-size: 10.5px; font-weight: 600; line-height: 1.3; margin-bottom: 5px;
  color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.gate .gd { font-size: 10px; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.gate.DONE {
  background: var(--accent-tint);
  box-shadow: inset 0 0 0 1px rgba(52, 217, 138, 0.26);
}
.gate.DONE .gn { color: var(--accent); }
.gate.IN_PROGRESS {
  background: var(--blue-tint);
  box-shadow: inset 0 0 0 1px rgba(108, 201, 247, 0.26);
}
.gate.IN_PROGRESS .gn { color: var(--blue); }
.gate.BLOCKED { background: var(--red-tint); box-shadow: inset 0 0 0 1px rgba(255, 122, 111, 0.3); }
.gate.BLOCKED .gn { color: var(--red); }
.gate.NA { opacity: 0.4; }
.gate.late { box-shadow: inset 0 0 0 1px rgba(255, 122, 111, 0.34), inset 0 -3px 0 var(--red); }

/* ---------------------------------------------------------------- modal */
.modal-back {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 20px; overflow-y: auto;
  background: rgba(24, 26, 29, 0.55);
  backdrop-filter: blur(10px) saturate(140%); -webkit-backdrop-filter: blur(10px) saturate(140%);
  animation: fade 0.25s ease both;
}
[data-theme="light"] .modal-back { background: rgba(20, 32, 44, 0.34); }
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%; max-width: 580px; max-height: 92vh;
  display: flex; flex-direction: column;
  background: var(--base-2);
  border: 1px solid var(--hairline-2);
  border-radius: var(--r-lg);
  box-shadow: var(--lift-2);
  animation: pop 0.4s var(--spring) both;
}
.modal.wide { max-width: 940px; }
@keyframes pop {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
.modal-head {
  display: flex; align-items: center; gap: 12px;
  padding: 19px 22px; border-bottom: 1px solid var(--hairline);
}
.modal-head h2 { flex: 1; font-size: 17px; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 16px 22px; border-top: 1px solid var(--hairline);
}
.x {
  width: 30px; height: 30px; padding: 0; flex: none;
  display: grid; place-items: center;
  background: var(--panel); border: 0; border-radius: 9px;
  color: var(--ink-3); cursor: pointer; transition: color 0.18s, background 0.18s;
}
.x:hover { color: var(--ink); background: var(--panel-hi); }

/* ---------------------------------------------------------------- toast */
#toast-root {
  position: fixed; bottom: 22px; right: 22px; z-index: 200;
  display: flex; flex-direction: column; gap: 9px;
}
.toast {
  padding: 12px 17px; max-width: 400px; font-size: 13px; font-weight: 500;
  color: var(--ink);
  background: var(--base-2);
  border: 1px solid var(--hairline-2);
  border-radius: var(--r-ctl);
  box-shadow: var(--lift-2);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  animation: toast-in 0.4s var(--spring) both;
}
.toast.ok  { border-left: 2.5px solid var(--accent); }
.toast.err { border-left: 2.5px solid var(--red); }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- misc */
.empty { text-align: center; padding: 48px 20px; color: var(--ink-3); }
.empty .big {
  width: 46px; height: 46px; margin: 0 auto 14px;
  display: grid; place-items: center; border-radius: 14px;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--hairline);
  font-size: 20px; color: var(--ink-4);
}

.tabs {
  display: flex; gap: 4px; margin-bottom: 20px; padding: 4px;
  background: var(--panel-2); border-radius: var(--r-ctl);
  box-shadow: inset 0 0 0 1px var(--hairline);
  overflow-x: auto; width: fit-content; max-width: 100%;
}
.tabs button {
  width: auto; padding: 8px 16px; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 550; color: var(--ink-3);
  border-radius: var(--r-sm); white-space: nowrap;
  transition: color 0.18s, background 0.18s;
}
.tabs button:hover { color: var(--ink-2); }
.tabs button.on {
  color: var(--ink); background: var(--panel-hi);
  box-shadow: 0 2px 10px -5px rgba(0, 0, 0, 0.55), inset 0 0 0 1px var(--hairline);
}

.thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.thumbs a {
  display: block; width: 96px; height: 96px; border-radius: 14px; overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--hairline); background: var(--panel-2);
  transition: transform 0.3s var(--spring);
}
.thumbs a:hover { transform: scale(1.05); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }

.kv { display: grid; grid-template-columns: 148px 1fr; gap: 9px 16px; font-size: 13px; }
.kv dt { color: var(--ink-3); font-weight: 500; }
.kv dd { margin: 0; }

.callout {
  padding: 13px 16px; border-radius: var(--r); font-size: 12.5px;
  margin-bottom: 16px; line-height: 1.55;
  background: var(--amber-tint); color: var(--amber);
  box-shadow: inset 0 0 0 1px rgba(255, 192, 97, 0.22);
}
.callout strong { color: inherit; font-weight: 600; }
.callout.info   { background: var(--blue-tint);   color: var(--blue);   box-shadow: inset 0 0 0 1px rgba(108, 201, 247, 0.22); }
.callout.danger { background: var(--red-tint);    color: var(--red);    box-shadow: inset 0 0 0 1px rgba(255, 122, 111, 0.26); }
.callout.good   { background: var(--accent-tint); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(52, 217, 138, 0.24); }

/* A single hero figure, for the resource-gap verdict. */
.verdict { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.verdict .fig {
  font-size: 54px; font-weight: 600; letter-spacing: -0.05em; line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(140deg, var(--ink) 15%, var(--accent) 120%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* A dash means "not measurable yet" — render it flat, not as a hero figure. */
.verdict .fig.na {
  background: none; -webkit-text-fill-color: var(--ink-4); color: var(--ink-4);
  font-size: 34px;
}
.verdict.short .fig { background: linear-gradient(140deg, #ffd9d6 5%, var(--red) 105%);
  -webkit-background-clip: text; background-clip: text; }
.verdict .cap { font-size: 13px; color: var(--ink-2); max-width: 420px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3, .g-2-1 { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 272px; z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.34s var(--spring);
    background: var(--base-2); box-shadow: var(--lift-2);
  }
  .shell.open .sidebar { transform: none; }
  .shell.open::after {
    content: ''; position: fixed; inset: 0; z-index: 50;
    background: rgba(24, 26, 29, 0.5); backdrop-filter: blur(6px);
  }
  .burger {
    display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
    background: var(--panel); border: 0; border-radius: 11px;
    color: var(--ink-2); cursor: pointer;
    box-shadow: inset 0 0 0 1px var(--hairline);
  }
  .topbar { padding: 14px 16px; }
  .content { padding: 16px 15px 72px; }
  h1 { font-size: 21px; }
  .g2, .row.c2, .row.c3 { grid-template-columns: 1fr; }
  .kpi .vl { font-size: 27px; }
  .kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 11px; }
  .bar-row { grid-template-columns: 106px 1fr 48px; }
  .kv { grid-template-columns: 116px 1fr; }
  .verdict .fig { font-size: 42px; }
  table.tbl th, table.tbl td { padding: 10px 11px; }
  .modal { max-height: 94vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  body::before { animation: none; }
}

@media print {
  body::before, .sidebar, .topbar, .btn, .filters, .tabs { display: none !important; }
  body { background: #fff; color: #000; }
  .shell { grid-template-columns: 1fr; }
  .card, .kpi { box-shadow: none; border: 1px solid #ccc; background: #fff;
    backdrop-filter: none; break-inside: avoid; animation: none; }
}

/* ---------------------------------------------------------------- timesheet day */
.day-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px;
}
.day-date { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; min-width: 168px; }
.day-date .sub { font-size: 11.5px; color: var(--ink-3); font-weight: 400; margin-top: 1px; }
.day-meter { margin-left: auto; min-width: 190px; }
.day-meter .row { display: flex; justify-content: space-between; font-size: 11.5px; margin-bottom: 5px; }
.day-meter .row .n { font-variant-numeric: tabular-nums; font-weight: 600; }

.act {
  display: flex; align-items: center; gap: 14px; padding: 13px 16px;
  border-bottom: 1px solid var(--hairline);
}
.act:last-child { border-bottom: 0; }
.act .hrs {
  min-width: 62px; text-align: center; flex: none;
  font-size: 19px; font-weight: 600; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.act .meat { flex: 1; min-width: 0; }
.act .meat .t { font-size: 13.5px; font-weight: 550; }
.act .meat .s { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.act .meat .note { font-size: 12px; color: var(--ink-2); margin-top: 4px; font-style: italic; }
.act .tools { display: flex; gap: 6px; opacity: 0; transition: opacity 0.2s; }
.act:hover .tools { opacity: 1; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border: 0; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 550; color: var(--ink-2);
  background: var(--panel); border-radius: 20px;
  box-shadow: inset 0 0 0 1px var(--hairline);
  transition: color 0.18s, background 0.18s, transform 0.24s var(--spring);
}
.chip:hover { color: var(--ink); background: var(--panel-hi); transform: translateY(-1px); }
.chip .c { font-family: var(--mono); font-size: 11px; color: var(--accent); }

.quick {
  display: grid; gap: 12px;
  grid-template-columns: 1.7fr 1.7fr 1.1fr 86px auto;
  align-items: end;
}
.quick optgroup { font-weight: 700; color: var(--ink-3); font-size: 11px; }
.quick optgroup option { font-weight: 400; color: var(--ink); }
.quick select:disabled { opacity: 0.55; cursor: not-allowed; }
.quick label.f { margin-bottom: 0; }
@media (max-width: 900px) {
  .quick { grid-template-columns: 1fr 1fr; }
  .quick > *:last-child { grid-column: 1 / -1; }
  .day-meter { margin-left: 0; width: 100%; }
}

/* ---------------------------------------------------------------- snag trail */
.trail { position: relative; padding-left: 4px; }
.trail-row {
  position: relative; display: flex; gap: 14px;
  padding: 0 0 16px 16px; border-left: 1px solid var(--hairline);
}
.trail-row:last-child { border-left-color: transparent; padding-bottom: 0; }
.trail-dot {
  position: absolute; left: -5px; top: 4px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 3px var(--base), 0 0 10px var(--accent-glow);
}
.trail-top { font-size: 13px; }

/* faces carry photographs when there is one */
.faces .face { overflow: hidden; }
.faces .face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.member-row .face { border-radius: 12px; }


/* The CFLO wordmark, real vector, masked so it takes the colour it sits on. */
.cflo-wordmark {
  display: block;
  background-color: currentColor;
  -webkit-mask: url("../img/cflo-logo.svg") no-repeat center / contain;
  mask: url("../img/cflo-logo.svg") no-repeat center / contain;
}

/* The CFlo mark, masked so it can take any colour it is placed on. */
.cflo-mark {
  display: block;
  background-color: currentColor;
  -webkit-mask: url("../img/cflo-c.svg") no-repeat center / contain;
  mask: url("../img/cflo-c.svg") no-repeat center / contain;
  pointer-events: none;
}

/* ---------------------------------------------------------------- hero band
   The same surface as the login panel: CFlo green, one big line, the C cropped
   by the edge. Numbers live in the cards below, not here. */
.hero {
  position: relative; overflow: hidden;
  min-height: 262px;
  padding: 34px 38px 32px;
  margin-bottom: 20px;
  border-radius: var(--r-lg);
  color: #fff;
  background:
    radial-gradient(120% 150% at 92% 88%, #3fb64f 0%, transparent 58%),
    linear-gradient(152deg, #06280f 0%, #0d5a26 44%, #29a343 100%);
  box-shadow: var(--lift);
  animation: rise-in 0.6s var(--spring) both;
  display: flex; flex-direction: column; justify-content: center;
}
.hero .glyph {
  /* Set on the diagonal and oversized, bleeding past three edges. The panel's
     own overflow does the cropping, so it reads as a deliberate treatment. */
  position: absolute; right: -54px; top: -88px;
  transform: rotate(-18deg);
  transform-origin: 60% 50%;
  color: rgba(255, 255, 255, 0.13);
  pointer-events: none; user-select: none; line-height: 0;
}
.hero .when {
  position: relative;
  font-family: var(--mono); font-size: 12px; letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.6);
}
.hero .greet {
  position: relative;
  font-size: clamp(34px, 4.6vw, 58px); font-weight: 800;
  letter-spacing: -0.045em; line-height: 0.98;
  margin: 14px 0 0; color: #fff;
  background: none; -webkit-background-clip: initial; background-clip: initial;
}
.hero .creed {
  position: relative; margin-top: 16px; padding: 0; border: 0;
  font-size: 16px; font-style: normal; font-weight: 400;
  color: rgba(255, 255, 255, 0.9); max-width: 620px;
}
@media (max-width: 780px) {
  .hero { min-height: 0; padding: 26px 22px 24px; }
  .hero .glyph { right: -40px; top: -48px; }
  .hero .glyph .cflo-mark { width: 220px !important; height: 257px !important; }
  .hero .creed { font-size: 14.5px; }
}

/* ---------------------------------------------------------------- form sections */
.fset { margin-bottom: 26px; }
.fset:last-child { margin-bottom: 0; }
.fset > legend, .fset > .lg {
  display: block; width: 100%;
  font-size: 10.5px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 700;
  padding: 0 0 10px; margin-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
}
.fset > .lg .sub {
  display: block; margin-top: 6px;
  font-size: 11.5px; letter-spacing: 0; text-transform: none;
  color: var(--ink-4); font-weight: 400;
}

/* one committed date per key milestone */
.mdates { display: grid; gap: 10px; }
.mrow {
  display: grid; grid-template-columns: 1fr 218px; gap: 12px; align-items: center;
  padding: 9px 12px; border-radius: var(--r-ctl);
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--hairline);
}
.mrow .mn { font-size: 13px; font-weight: 550; }
.mrow .ms { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.mrow input, .mrow select { padding: 8px 11px; font-size: 13px; }
.mrow > div { display: flex; gap: 8px; }

/* budget, kept loud on purpose */
.budget-band {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 13px 16px; border-radius: var(--r);
  background: var(--accent-tint);
  box-shadow: inset 0 0 0 1px rgba(52, 217, 138, 0.24);
}
.budget-band .k {
  font-size: 10px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--accent); font-weight: 700;
}
.budget-band .v {
  font-size: 22px; font-weight: 650; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.budget-band .n { font-size: 12px; color: var(--ink-3); }
.pcard .budget { font-size: 11.5px; color: var(--accent); font-weight: 600; margin-top: 2px; }
@media (max-width: 780px) { .mrow { grid-template-columns: 1fr; } }

/* drag to reorder milestones */
tr.draggable-row { cursor: grab; }
tr.draggable-row.dragging { opacity: 0.4; cursor: grabbing; }
tr.draggable-row.drop-into { box-shadow: inset 0 2px 0 var(--accent); }
.pcard.dragging { opacity: 0.45; }
.pcard.drop-into { box-shadow: inset 3px 0 0 var(--accent), var(--lift); }
tr[data-project].dragging { opacity: 0.4; }
tr[data-project].drop-into { box-shadow: inset 0 2px 0 var(--accent); }

/* ---------------------------------------------------------------- picker */
/* Drops down, always. See picker() in ui.js for why this is not a <select>. */
.pk { position: relative; display: inline-block; width: 100%; }
.pk-btn {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 10px 13px;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink);
  background: var(--solid); border: 1px solid var(--hairline);
  border-radius: var(--r-ctl); cursor: pointer; text-align: left;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.pk-btn:hover { border-color: var(--hairline-2); }
.pk.on .pk-btn {
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px var(--accent-tint);
  background: var(--solid-2);
}
.pk-btn svg { flex: none; margin-left: auto; color: var(--ink-3); transition: transform 0.2s var(--spring); }
.pk.on .pk-btn svg { transform: rotate(180deg); }
.pk-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-menu {
  display: none; position: absolute; z-index: 60;
  top: calc(100% + 7px); left: 0; min-width: 100%;
  padding: 6px; border-radius: var(--r);
  background: var(--solid); border: 1px solid var(--hairline-2);
  box-shadow: 0 26px 54px -20px rgba(0, 0, 0, 0.7);
  animation: pk-in 0.17s var(--spring);
}
.pk.on .pk-menu { display: block; }
.pk-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 12px 9px 8px; border: 0; border-radius: var(--r-sm);
  font: inherit; font-size: 13.5px; color: var(--ink);
  background: none; cursor: pointer; text-align: left; white-space: nowrap;
}
.pk-item:hover { background: var(--panel-hi); }
.pk-item.on { font-weight: 700; }
.pk-tick { width: 16px; flex: none; display: inline-flex; color: var(--accent); }
@keyframes pk-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
