/* =========================================================================
   Falxon Labs · Construction ERP · Liquid Glass Design System
   ========================================================================= */

:root {
  /* Type */
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, sans-serif;
  --font-text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  --font-mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, monospace;

  /* Brand */
  --brand-h: 250;
  --brand-c: 0.22;
  --brand-blue: oklch(0.62 var(--brand-c) var(--brand-h));
  --brand-blue-soft: oklch(0.62 var(--brand-c) var(--brand-h) / 0.18);
  --brand-blue-deep: oklch(0.48 var(--brand-c) calc(var(--brand-h) + 4));
  --accent-amber: oklch(0.78 0.16 65);
  --accent-amber-soft: oklch(0.78 0.16 65 / 0.20);

  --status-green: oklch(0.74 0.16 152);
  --status-red: oklch(0.66 0.20 25);

  /* Density (overridden by [data-density]) */
  --gap-xs: 6px;
  --gap-s: 10px;
  --gap-m: 16px;
  --gap-l: 24px;
  --gap-xl: 36px;
  --gap-xxl: 56px;

  --pad-card: 22px;
  --pad-card-l: 28px;
  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 22px;
  --radius-xl: 28px;
  --radius-pill: 999px;
}

[data-density="balanced"] {
  --gap-xl: 28px;
  --gap-xxl: 40px;
  --pad-card: 18px;
  --pad-card-l: 22px;
}
[data-density="dense"] {
  --gap-m: 12px;
  --gap-l: 18px;
  --gap-xl: 22px;
  --gap-xxl: 32px;
  --pad-card: 14px;
  --pad-card-l: 18px;
}

/* ── Theme: Light ───────────────────────────────────────────────────────── */
:root, [data-theme="light"] {
  --bg-base: oklch(0.98 0.005 250);
  --fg: #000000;
  --fg-mute: oklch(0.50 0.012 260);
  --fg-faint: oklch(0.62 0.012 260);
  --hairline: oklch(0.18 0.02 260 / 0.10);
  --hairline-soft: oklch(0.18 0.02 260 / 0.06);

  /* Glass */
  --glass-tint: 255, 255, 255;
  --glass-fill: rgba(255, 255, 255, 0.42);
  --glass-fill-strong: rgba(255, 255, 255, 0.62);
  --glass-fill-faint: rgba(255, 255, 255, 0.22);
  --glass-rim-top: rgba(255, 255, 255, 0.85);
  --glass-rim-bot: rgba(0, 0, 0, 0.04);
  --glass-edge: rgba(255, 255, 255, 0.6);
  --glass-shadow: 0 1px 2px rgba(15, 23, 42, 0.04),
                  0 8px 24px rgba(15, 23, 42, 0.08),
                  0 28px 80px rgba(15, 23, 42, 0.10);
  --glass-shadow-lg: 0 1px 2px rgba(15, 23, 42, 0.04),
                     0 18px 48px rgba(15, 23, 42, 0.12),
                     0 60px 160px rgba(15, 23, 42, 0.14);

  /* Backdrop blueprint colors */
  --bp-line: oklch(0.62 var(--brand-c) var(--brand-h) / 0.18);
  --bp-line-strong: oklch(0.62 var(--brand-c) var(--brand-h) / 0.30);
  --bp-bg-1: oklch(0.94 0.04 var(--brand-h));
  --bp-bg-2: oklch(0.96 0.02 80);
  --bp-bg-3: oklch(0.92 0.06 200);
  --bp-bg-4: oklch(0.88 0.08 65);

  /* Component tokens */
  --card-bg: rgba(255, 255, 255, 0.80);
  --surface: rgba(255, 255, 255, 0.65);
  --border-subtle: rgba(0, 0, 0, 0.08);
  --red: #dc2626;
}

/* ── Theme: Dark ────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg-base: oklch(0.16 0.02 260);
  --fg: #ffffff;
  --fg-mute: oklch(0.75 0.012 260);
  --fg-faint: oklch(0.58 0.015 260);
  --hairline: oklch(0.96 0.005 260 / 0.12);
  --hairline-soft: oklch(0.96 0.005 260 / 0.06);

  --glass-tint: 20, 24, 40;
  --glass-fill: rgba(28, 32, 50, 0.42);
  --glass-fill-strong: rgba(40, 46, 70, 0.65);
  --glass-fill-faint: rgba(20, 24, 40, 0.22);
  --glass-rim-top: rgba(255, 255, 255, 0.16);
  --glass-rim-bot: rgba(0, 0, 0, 0.30);
  --glass-edge: rgba(255, 255, 255, 0.10);
  --glass-shadow: 0 1px 2px rgba(0, 0, 0, 0.40),
                  0 8px 24px rgba(0, 0, 0, 0.40),
                  0 28px 80px rgba(0, 0, 0, 0.50);
  --glass-shadow-lg: 0 1px 2px rgba(0, 0, 0, 0.40),
                     0 18px 48px rgba(0, 0, 0, 0.50),
                     0 60px 160px rgba(0, 0, 0, 0.60);

  --bp-line: oklch(0.78 var(--brand-c) var(--brand-h) / 0.22);
  --bp-line-strong: oklch(0.78 var(--brand-c) var(--brand-h) / 0.40);
  --bp-bg-1: oklch(0.20 0.06 var(--brand-h));
  --bp-bg-2: oklch(0.22 0.05 25);
  --bp-bg-3: oklch(0.18 0.07 200);
  --bp-bg-4: oklch(0.20 0.06 290);

  /* Component tokens */
  --card-bg: rgba(18, 18, 31, 0.85);
  --surface: rgba(255, 255, 255, 0.06);
  --border-subtle: rgba(255, 255, 255, 0.09);
  --red: #f87171;
}

/* ── Glass intensity ────────────────────────────────────────────────────── */
[data-glass="subtle"] {
  --glass-blur: 18px;
  --glass-saturate: 130%;
}
[data-glass="balanced"] {
  --glass-blur: 28px;
  --glass-saturate: 160%;
}
[data-glass="heavy"] {
  --glass-blur: 44px;
  --glass-saturate: 200%;
}

/* =========================================================================
   Base
   ========================================================================= */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-text);
  color: var(--fg);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  letter-spacing: -0.005em;
}
button { font-family: inherit; }
::selection { background: var(--brand-blue-soft); }

/* =========================================================================
   Backdrops — these live behind the glass
   ========================================================================= */

.app-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  isolation: isolate;
}

/* Color-mesh layer */
.bd-mesh {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(40% 40% at 12% 18%, var(--bp-bg-1) 0%, transparent 60%),
    radial-gradient(30% 35% at 88% 12%, var(--bp-bg-4) 0%, transparent 65%),
    radial-gradient(45% 45% at 78% 88%, var(--bp-bg-3) 0%, transparent 60%),
    radial-gradient(35% 30% at 18% 92%, var(--bp-bg-2) 0%, transparent 60%),
    var(--bg-base);
  filter: saturate(1.05);
  transition: opacity 0.4s ease;
}

/* Blueprint line layer */
.bd-blueprint {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--bp-line-strong) 0.5px, transparent 0.5px),
    linear-gradient(90deg, var(--bp-line-strong) 0.5px, transparent 0.5px),
    linear-gradient(var(--bp-line) 0.5px, transparent 0.5px),
    linear-gradient(90deg, var(--bp-line) 0.5px, transparent 0.5px);
  background-size: 240px 240px, 240px 240px, 40px 40px, 40px 40px;
  background-position: -1px -1px, -1px -1px, -1px -1px, -1px -1px;
  opacity: 0.7;
  mask-image: radial-gradient(120% 80% at 50% 50%, black 30%, transparent 80%);
}

.bd-floorplan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
}

.bd-photo {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, var(--bp-bg-1), var(--bp-bg-3) 50%, var(--bp-bg-4));
  opacity: 0.9;
}

/* =========================================================================
   Glass primitive
   ========================================================================= */

.glass {
  position: relative;
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border-radius: var(--radius-l);
  box-shadow:
    inset 0 1.5px 0 var(--glass-rim-top),
    inset 0 -1.5px 0 var(--glass-rim-bot),
    inset 0 0 0 0.5px var(--glass-edge),
    0 1px 0 rgba(255,255,255,0.45),
    0 2px 0 rgba(15,23,42,0.04),
    0 4px 0 rgba(15,23,42,0.03),
    var(--glass-shadow);
  isolation: isolate;
}
[data-theme="dark"] .glass {
  box-shadow:
    inset 0 1.5px 0 var(--glass-rim-top),
    inset 0 -1.5px 0 var(--glass-rim-bot),
    inset 0 0 0 0.5px var(--glass-edge),
    0 1px 0 rgba(255,255,255,0.10),
    0 2px 0 rgba(0,0,0,0.18),
    0 4px 0 rgba(0,0,0,0.14),
    var(--glass-shadow);
}

.glass::before {
  /* Top specular highlight */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(255, 255, 255, 0.04) 8%,
    transparent 22%
  );
  mix-blend-mode: overlay;
}
[data-theme="dark"] .glass::before {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.10) 0%,
    rgba(255, 255, 255, 0.02) 12%,
    transparent 28%
  );
}

.glass-strong {
  background: var(--glass-fill-strong);
}

.glass-faint {
  background: var(--glass-fill-faint);
}

.glass-lg-shadow {
  box-shadow:
    inset 0 1px 0 var(--glass-rim-top),
    inset 0 -1px 0 var(--glass-rim-bot),
    inset 0 0 0 0.5px var(--glass-edge),
    var(--glass-shadow-lg);
}

/* =========================================================================
   Layout
   ========================================================================= */

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 248px 1fr;
  gap: 20px;
  height: 100vh;
  padding: 16px 18px 18px;
  transition: grid-template-columns 0.32s cubic-bezier(0.4, 0.0, 0.2, 1);
}
.app.collapsed { grid-template-columns: 76px 1fr; }

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  border-radius: var(--radius-xl);
  min-height: 0;
  position: relative;
  overflow: hidden;
  transition: padding 0.32s cubic-bezier(0.4, 0.0, 0.2, 1);
}
.app.collapsed .sidebar { padding: 18px 10px 14px; }

.sb-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 0 -6px;
  padding: 0 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--glass-fill-strong) transparent;
}
.sb-scroll::-webkit-scrollbar { width: 6px; }
.sb-scroll::-webkit-scrollbar-track { background: transparent; }
.sb-scroll::-webkit-scrollbar-thumb {
  background: var(--glass-fill-strong);
  border-radius: 999px;
}
.sb-scroll::-webkit-scrollbar-thumb:hover { background: var(--fg-mute); }

/* Collapse button */
.sb-collapse {
  position: absolute;
  top: 14px;
  right: 12px;
  width: 26px; height: 26px;
  border-radius: 8px;
  border: 0;
  background: var(--glass-fill-faint);
  color: var(--fg-mute);
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 5;
  transition: all 0.2s;
}
.sb-collapse:hover {
  background: var(--glass-fill-strong);
  color: var(--fg);
}
.sb-collapse svg { transition: transform 0.32s cubic-bezier(0.4, 0.0, 0.2, 1); }
.app.collapsed .sb-collapse svg { transform: rotate(180deg); }
.app.collapsed .sb-collapse {
  position: static;
  margin: 0 auto 8px;
}

/* Hide labels when collapsed */
.app.collapsed .brand > div:not(.brand-mark),
.app.collapsed .nav-section,
.app.collapsed .nav-item > span:not(.nav-icon),
.app.collapsed .nav-item .nav-badge,
.app.collapsed .nav-item .nav-chev,
.app.collapsed .user-pill > div:not(.avatar):not(:last-child),
.app.collapsed .user-pill > span:last-child {
  display: none;
}
.app.collapsed .brand {
  justify-content: center;
  padding: 6px 0 14px;
}
.app.collapsed .nav-list { align-items: center; }
.app.collapsed .nav-item {
  justify-content: center;
  padding: 9px;
  width: 40px;
}
.app.collapsed .user-pill { justify-content: center; padding: 6px; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 14px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-deep));
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 4px 12px oklch(0.62 var(--brand-c) var(--brand-h) / 0.4);
}
.brand-mark-img {
  background: transparent;
  box-shadow: none;
  padding: 0;
}
.brand-mark-img img,
.brand-mark-img svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 4px oklch(0.62 var(--brand-c) var(--brand-h) / 0.25));
}
.brand-mark-img svg { color: var(--fg); }

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.brand-sub {
  font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-section {
  margin-top: 10px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-faint);
  opacity: 0.7;
}

.nav-section-btn {
  appearance: none;
  border: 0;
  background: transparent;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 6px;
  margin-top: 8px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-faint);
  opacity: 0.75;
  transition: background 0.15s, opacity 0.15s;
}
.nav-section-btn:hover { opacity: 1; background: var(--glass-fill-faint); }
.nav-section-chev {
  flex-shrink: 0;
  transition: transform 0.18s ease;
  opacity: 0.7;
}
.nav-section-btn.collapsed .nav-section-chev { transform: rotate(-90deg); }
.app.collapsed .nav-section-btn { display: none; }

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 6px;
  padding: 0;
  list-style: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 450;
  color: var(--fg-mute);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  user-select: none;
}
.nav-item:hover {
  background: rgba(var(--glass-tint), 0.4);
  color: var(--fg);
}
.nav-item.active {
  background: var(--glass-fill-strong);
  color: var(--fg);
  font-weight: 500;
  box-shadow:
    inset 0 1px 0 var(--glass-rim-top),
    inset 0 0 0 0.5px var(--glass-edge),
    0 1px 2px rgba(0, 0, 0, 0.04);
}
.nav-item.active .nav-icon { color: var(--brand-blue); }
.nav-item .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--fg-faint);
  display: grid;
  place-items: center;
}
.nav-item .nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
}
.nav-item .nav-chev {
  margin-left: auto;
  opacity: 0.4;
  font-size: 10px;
}

/* Locked (pre-launch) modules — still clickable, they land on Coming Soon. */
.nav-item.locked {
  color: var(--fg-faint);
}
.nav-item.locked .nav-icon {
  opacity: 0.55;
}
.nav-item.locked:hover {
  color: var(--fg-mute);
}
.nav-item.locked.active {
  color: var(--fg-mute);
}
.nav-item .nav-lock {
  margin-left: auto;
  display: grid;
  place-items: center;
  color: var(--fg-faint);
  opacity: 0.7;
  flex-shrink: 0;
}
.nav-item .nav-lock svg {
  width: 13px;
  height: 13px;
}
.app.collapsed .nav-item .nav-lock { display: none; }

.sidebar-bottom {
  margin-top: auto;
  padding-top: 12px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--glass-fill-faint);
  cursor: pointer;
  transition: background 0.15s;
}
.user-pill:hover { background: var(--glass-fill); }
.avatar {
  width: 32px; height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-amber), var(--brand-blue));
  display: grid; place-items: center;
  color: #fff; font-weight: 600; font-size: 11.5px;
  flex-shrink: 0;
}
.user-name { font-size: 12.5px; font-weight: 500; color: var(--fg); line-height: 1.25; }
.user-role { font-size: 10.5px; color: var(--fg-faint); line-height: 1.35; margin-top: 2px; }
.user-pill.active { background: var(--glass-fill); }

/* User popup menu */
.user-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  padding: 8px;
  border-radius: 16px;
  z-index: 30;
  animation: userMenuIn 0.16s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  backdrop-filter: blur(28px) saturate(1.8);
}
@keyframes userMenuIn {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.user-menu-section {
  font-size: 10px;
  font-weight: 600;
  color: var(--fg-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 10px 8px;
}
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: 0;
  border-radius: 10px;
  font: 500 13px var(--font-text);
  color: var(--fg);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}
.user-menu-item:hover { background: var(--glass-fill-strong); }
.user-menu-icon {
  width: 22px;
  display: grid;
  place-items: center;
  color: var(--fg-mute);
}
.user-menu-icon svg { width: 16px; height: 16px; }
.user-menu-tag {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--brand-blue);
  font-variant-numeric: tabular-nums;
}
.user-menu-divider {
  height: 0.5px;
  background: var(--hairline);
  margin: 6px 4px;
}
.user-menu-danger {
  color: var(--status-red);
}
.user-menu-danger .user-menu-icon { color: var(--status-red); }
.app.collapsed .user-menu { left: 100%; bottom: 0; right: auto; width: 220px; margin-left: 8px; }

/* Main column */
.main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  gap: 14px;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 16px;
  border-radius: var(--radius-pill);
  height: 52px;
  flex-shrink: 0;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-mute);
}
.crumbs strong { color: var(--fg); font-weight: 500; }
.crumb-sep { opacity: 0.4; }

.search-pill {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--glass-fill-faint);
  border-radius: 999px;
  font-size: 13px;
  color: var(--fg-mute);
  max-width: 480px;
  margin-left: auto;
  cursor: text;
  transition: background 0.15s;
}
.search-pill:hover { background: var(--glass-fill); }
.search-kbd {
  margin-left: auto;
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(var(--glass-tint), 0.6);
  border: 0.5px solid var(--hairline);
  color: var(--fg-faint);
  font-family: var(--font-mono);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  appearance: none;
  border: 0;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: transparent;
  color: var(--fg-mute);
  cursor: pointer;
  transition: all 0.15s;
}
.icon-btn:hover {
  background: var(--glass-fill);
  color: var(--fg);
}
.icon-btn .badge-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 7px; height: 7px;
  border-radius: 999px;
  background: var(--accent-amber);
  border: 1.5px solid var(--bg-base);
}

.btn {
  appearance: none;
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  height: 36px;
  white-space: nowrap;
}
.btn-primary {
  appearance: none;
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  height: 36px;
  white-space: nowrap;
  background: linear-gradient(180deg, var(--brand-blue) 0%, var(--brand-blue-deep) 100%);
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1),
    0 4px 12px oklch(0.62 var(--brand-c) var(--brand-h) / 0.3);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-glass {
  appearance: none;
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  height: 36px;
  white-space: nowrap;
  background: var(--glass-fill);
  color: var(--fg);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.30), 0 1px 2px rgba(15,23,42,0.06);
}
.btn-glass:hover { background: var(--glass-fill-strong); }
.btn-ghost {
  background: var(--glass-fill-faint);
  color: var(--fg);
}
.btn-ghost:hover { background: var(--glass-fill); }

/* Content */
.content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 6px 80px;
  margin: 0 -6px;
  scrollbar-width: thin;
  scrollbar-color: var(--hairline) transparent;
}
.content::-webkit-scrollbar { width: 8px; }
.content::-webkit-scrollbar-thumb {
  background: var(--hairline);
  border-radius: 999px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 16px 4px 22px;
  gap: 24px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0 0 4px;
  color: var(--fg);
}
.page-sub {
  font-size: 14px;
  color: var(--fg-mute);
  margin: 0;
}

/* ── Coming Soon (pre-launch gate) ─────────────────────────────────────── */

/* The gate is one centred card, not a document that scrolls. .content carries
   80px of bottom padding so real pages clear the AI orb; leaving it here
   centres the card inside a box 80px taller than the viewport, so it sits
   visibly high and the page grows a scrollbar with nothing to scroll. */
.content:has(> .coming-soon) { padding-bottom: 6px; }

.coming-soon {
  display: grid;
  place-items: center;
  /* Fallback for engines without :has() — the padding above still applies, so
     stay off 100% there and centre in a viewport-sized box instead. */
  min-height: min(70vh, 620px);
  padding: 16px 4px 24px;
}
@supports selector(:has(*)) {
  .coming-soon { min-height: 100%; }
}

.coming-soon-card {
  position: relative;
  overflow: hidden;
  width: min(100%, 640px);
  padding: 46px 44px 34px;
  border-radius: var(--radius-xl);
  text-align: center;
  animation: cs-rise 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
/* Brand wash over a faint blueprint grid, masked out before it reaches the
   buttons — the screen reads as part of the product, not a dead end.
   .glass sets isolation:isolate, so z-index:-1 lands above the card's own
   fill and below its content. */
.coming-soon-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(125% 95% at 50% -25%,
      oklch(0.62 var(--brand-c) var(--brand-h) / 0.18) 0%,
      transparent 60%),
    repeating-linear-gradient(0deg,
      oklch(0.62 var(--brand-c) var(--brand-h) / 0.07) 0 1px, transparent 1px 30px),
    repeating-linear-gradient(90deg,
      oklch(0.62 var(--brand-c) var(--brand-h) / 0.07) 0 1px, transparent 1px 30px);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,0.4) 46%, transparent 76%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,0.4) 46%, transparent 76%);
}
[data-theme="dark"] .coming-soon-card::after {
  background:
    radial-gradient(125% 95% at 50% -25%,
      oklch(0.70 var(--brand-c) var(--brand-h) / 0.22) 0%,
      transparent 60%),
    repeating-linear-gradient(0deg,
      oklch(0.80 var(--brand-c) var(--brand-h) / 0.08) 0 1px, transparent 1px 30px),
    repeating-linear-gradient(90deg,
      oklch(0.80 var(--brand-c) var(--brand-h) / 0.08) 0 1px, transparent 1px 30px);
}

.coming-soon-icon {
  position: relative;
  width: 62px;
  height: 62px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
  border-radius: 19px;
  color: #fff;
  background: linear-gradient(180deg,
    oklch(0.70 var(--brand-c) var(--brand-h)) 0%,
    var(--brand-blue-deep) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 6px 20px oklch(0.62 var(--brand-c) var(--brand-h) / 0.35);
}
.coming-soon-icon svg { width: 26px; height: 26px; }
/* A slow halo: this is a waiting state, so it breathes instead of sitting. */
.coming-soon-icon::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 26px;
  border: 1.5px solid oklch(0.62 var(--brand-c) var(--brand-h) / 0.40);
  animation: cs-halo 3.4s ease-out infinite;
}

.coming-soon-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-blue);
  background: var(--brand-blue-soft);
  border: 0.5px solid oklch(0.62 var(--brand-c) var(--brand-h) / 0.28);
  padding: 5px 12px 5px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 15px;
}
[data-theme="dark"] .coming-soon-tag { color: oklch(0.82 var(--brand-c) var(--brand-h)); }
.coming-soon-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: currentColor;
  animation: cs-blink 2.4s ease-out infinite;
}

.coming-soon-title {
  font-family: var(--font-display);
  font-size: 31px;
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1.14;
  margin: 0 0 12px;
  color: var(--fg);
}
.coming-soon-sub {
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--fg-mute);
  margin: 0 auto;
  max-width: 42ch;
  text-wrap: balance;
}

/* "Available now" hairline — separates the dead end from the way out. */
.coming-soon-rule {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 18px;
  color: var(--fg-faint);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.coming-soon-rule::before,
.coming-soon-rule::after {
  content: "";
  flex: 1;
  height: 1px;
}
.coming-soon-rule::before { background: linear-gradient(90deg, transparent, var(--hairline)); }
.coming-soon-rule::after  { background: linear-gradient(90deg, var(--hairline), transparent); }

.coming-soon-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.coming-soon-actions .btn { height: 38px; padding: 0 18px; }
.coming-soon-actions .btn:hover { transform: translateY(-1px); }
.coming-soon-actions .btn-icon {
  display: grid;
  place-items: center;
}
.coming-soon-actions .btn-icon svg { width: 16px; height: 16px; }

.coming-soon-back {
  margin-top: 22px;
  background: none;
  border: 0;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: 12.5px;
  color: var(--fg-faint);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.coming-soon-back:hover { color: var(--fg); background: var(--glass-fill-faint); }

@keyframes cs-rise {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to   { opacity: 1; transform: none; }
}
@keyframes cs-halo {
  0%   { transform: scale(0.94); opacity: 0.85; }
  70%  { transform: scale(1.16); opacity: 0; }
  100% { transform: scale(1.16); opacity: 0; }
}
@keyframes cs-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.25; }
}

@media (max-width: 620px) {
  .coming-soon-card { padding: 36px 22px 26px; }
  .coming-soon-title { font-size: 26px; }
  .coming-soon-actions { flex-direction: column; align-items: stretch; }
  .coming-soon-actions .btn { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .coming-soon-card,
  .coming-soon-icon::after,
  .coming-soon-dot { animation: none; }
  .coming-soon-actions .btn:hover { transform: none; }
}

.page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* =========================================================================
   Cards & content blocks
   ========================================================================= */

.card {
  padding: var(--pad-card-l);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--fg);
}
.card-sub {
  font-size: 12px;
  color: var(--fg-faint);
  margin: 2px 0 0;
}
.card-link {
  font-size: 12.5px;
  color: var(--brand-blue);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

/* KPI tiles */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap-m);
  margin-bottom: var(--gap-l);
}

.kpi {
  padding: 18px 20px;
  border-radius: var(--radius-m);
  position: relative;
  overflow: hidden;
}
.kpi-clickable {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.kpi-clickable:hover {
  transform: translateY(-2px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.55) inset,
    0 -1px 0 rgba(15,23,42,0.06) inset,
    0 14px 32px rgba(15,23,42,0.12);
}
.kpi-clickable:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}
[data-theme="dark"] .kpi-clickable:hover {
  box-shadow:
    0 1px 0 rgba(255,255,255,0.10) inset,
    0 14px 32px rgba(0,0,0,0.45);
}
.kpi-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--fg-mute);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.kpi-icon {
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border-radius: 5px;
  background: var(--glass-fill);
}
.kpi-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--fg);
}
.kpi-unit { font-size: 14px; font-weight: 500; color: var(--fg-faint); }
.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 8px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--status-green);
  padding: 2px 7px;
  border-radius: 999px;
  background: oklch(0.74 0.16 152 / 0.15);
}
.kpi-delta.negative {
  color: var(--status-red);
  background: oklch(0.66 0.20 25 / 0.15);
}
.kpi-spark {
  position: absolute;
  right: 12px; bottom: 12px;
  width: 80px; height: 28px;
  opacity: 0.85;
}

/* Completion KPI — actual vs expected dual-bar */
.kpi-completion .kpi-completion-rows {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kpi-comp-row {
  display: grid;
  grid-template-columns: 56px 1fr 38px;
  align-items: center;
  gap: 8px;
}
.kpi-comp-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.kpi-comp-tag-expected { color: var(--fg-faint); }
.kpi-comp-track {
  position: relative;
  height: 10px;
  border-radius: 5px;
  background: var(--glass-fill);
  border: 0.5px solid var(--hairline);
  overflow: visible;
}
.kpi-comp-bar {
  height: 100%;
  border-radius: 5px;
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.kpi-comp-bar-actual {
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-blue-deep, var(--brand-blue)));
  box-shadow: 0 0 12px color-mix(in oklch, var(--brand-blue) 40%, transparent);
}
.kpi-comp-bar-expected {
  background: repeating-linear-gradient(
    -45deg,
    var(--fg-faint) 0,
    var(--fg-faint) 4px,
    transparent 4px,
    transparent 8px);
  opacity: 0.6;
}
.kpi-comp-track-expected {
  background: transparent;
  border-color: color-mix(in oklch, var(--fg-faint) 30%, transparent);
}
.kpi-comp-marker {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: var(--accent-amber, #f59e0b);
  border-radius: 1px;
  transform: translateX(-1px);
  box-shadow: 0 0 6px color-mix(in oklch, var(--accent-amber, #f59e0b) 60%, transparent);
}
.kpi-comp-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.kpi-comp-num-expected { color: var(--fg-mute); font-weight: 600; }

/* Two-column layout in dashboard */
.dash-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: var(--gap-m);
  align-items: start;
}

/* Project list */
.proj-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.proj-row {
  display: grid;
  grid-template-columns: 36px 1.6fr 1fr 90px 110px 24px;
  align-items: center;
  gap: 14px;
  padding: 12px 4px;
  border-bottom: 0.5px solid var(--hairline-soft);
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s;
}
.proj-row:hover { background: rgba(var(--glass-tint), 0.4); }
.proj-row:last-child { border-bottom: 0; }
.proj-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--glass-fill);
  font-size: 16px;
}
.proj-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fg);
}
.proj-meta {
  font-size: 11.5px;
  color: var(--fg-faint);
  margin-top: 2px;
}
.proj-cell {
  font-size: 12.5px;
  color: var(--fg-mute);
  font-variant-numeric: tabular-nums;
}
.proj-cell strong {
  color: var(--fg);
  font-weight: 500;
}

/* Progress bar */
.progress {
  height: 5px;
  background: rgba(var(--glass-tint), 0.5);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 0 0.5px var(--hairline-soft);
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-blue-deep));
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}
.progress-fill.amber {
  background: linear-gradient(90deg, var(--accent-amber), oklch(0.72 0.18 50));
}
.progress-fill.green {
  background: linear-gradient(90deg, oklch(0.78 0.16 152), oklch(0.62 0.18 158));
}

/* Status pill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.pill-blue { background: var(--brand-blue-soft); color: var(--brand-blue); }
.pill-violet { background: oklch(0.72 0.16 295 / 0.18); color: oklch(0.46 0.18 295); }
[data-theme="dark"] .pill-violet { color: oklch(0.82 0.16 295); }
.pill-amber { background: var(--accent-amber-soft); color: oklch(0.55 0.16 55); }
[data-theme="dark"] .pill-amber { color: oklch(0.85 0.16 70); }
.pill-green { background: oklch(0.74 0.16 152 / 0.18); color: oklch(0.42 0.14 158); }
[data-theme="dark"] .pill-green { color: oklch(0.82 0.16 152); }
.pill-red { background: oklch(0.66 0.20 25 / 0.16); color: oklch(0.50 0.18 25); }
[data-theme="dark"] .pill-red { color: oklch(0.78 0.18 25); }
.pill-gray { background: rgba(var(--glass-tint), 0.5); color: var(--fg-mute); }
.pill-dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }

/* =========================================================================
   Recommendations / Activity feed
   ========================================================================= */

.rec-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rec-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 14px;
  background: var(--glass-fill-faint);
  cursor: pointer;
  transition: background 0.15s;
}
.rec-item:hover { background: var(--glass-fill); }
.rec-icon {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand-blue-soft), var(--accent-amber-soft));
  color: var(--brand-blue);
}
.rec-title {
  font-size: 13px;
  font-weight: 500;
  margin: 0 0 2px;
  color: var(--fg);
}
.rec-desc {
  font-size: 12px;
  color: var(--fg-mute);
  margin: 0;
  line-height: 1.4;
}
.rec-cta {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--brand-blue);
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(var(--glass-tint), 0.6);
  white-space: nowrap;
  cursor: pointer;
  border: 0;
  font-family: inherit;
}

/* Activity */
.activity {
  display: flex;
  flex-direction: column;
}
.activity-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 0.5px solid var(--hairline-soft);
  align-items: flex-start;
}
.activity-item:last-child { border-bottom: 0; }
.activity-avatar {
  width: 28px; height: 28px;
  border-radius: 999px;
  display: grid; place-items: center;
  font-size: 10.5px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-deep));
}
.activity-text {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--fg);
}
.activity-text strong { font-weight: 500; }
.activity-meta { font-size: 11px; color: var(--fg-faint); margin-top: 2px; }
.activity-time {
  font-size: 11px;
  color: var(--fg-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* =========================================================================
   QTO upload zone
   ========================================================================= */

.qto-zone {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  border-radius: var(--radius-l);
}

.qto-drop {
  border: 1.5px dashed var(--brand-blue);
  border-radius: var(--radius-m);
  padding: 28px 20px;
  text-align: center;
  background: var(--brand-blue-soft);
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
  cursor: pointer;
}
.qto-drop:hover {
  background: oklch(0.62 var(--brand-c) var(--brand-h) / 0.24);
  transform: translateY(-1px);
}
.qto-drop.dragging {
  background: oklch(0.62 var(--brand-c) var(--brand-h) / 0.3);
  border-style: solid;
  transform: scale(1.01);
}
.qto-drop-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-deep));
  color: #fff;
  box-shadow: 0 8px 24px oklch(0.62 var(--brand-c) var(--brand-h) / 0.4);
}
.qto-drop-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--fg);
}
.qto-drop-sub {
  font-size: 12.5px;
  color: var(--fg-mute);
  margin: 0;
}

.qto-files {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qto-file {
  display: grid;
  grid-template-columns: 36px 1fr 100px 70px 24px;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--glass-fill-faint);
  position: relative;
  overflow: hidden;
}
.qto-file-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--glass-fill);
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-blue);
  letter-spacing: 0.02em;
}
.qto-file-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
}
.qto-file-meta {
  font-size: 11px;
  color: var(--fg-faint);
  margin-top: 1px;
}
.qto-file-size {
  font-size: 11.5px;
  color: var(--fg-mute);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* QTO summary tiles */
.qto-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 14px;
  border-radius: 14px;
  background: var(--glass-fill-faint);
}
.qto-stat {
  text-align: center;
  padding: 4px;
}
.qto-stat-label {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 4px;
}
.qto-stat-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}

/* =========================================================================
   AI Orb
   ========================================================================= */

.ai-orb-wrap {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.ai-orb {
  width: 60px;
  height: 60px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.55), transparent 45%),
    radial-gradient(circle at 70% 75%, var(--accent-amber) 0%, transparent 40%),
    linear-gradient(135deg, var(--brand-blue) 0%, var(--brand-blue-deep) 70%, var(--brand-blue) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2),
    0 8px 24px oklch(0.62 var(--brand-c) var(--brand-h) / 0.45),
    0 24px 60px rgba(15, 23, 42, 0.18);
  border: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #fff;
  position: relative;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: orb-pulse 4s ease-in-out infinite;
}
.ai-orb:hover { transform: scale(1.06); }
.ai-orb:active { transform: scale(0.96); }

.ai-orb::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  background: radial-gradient(circle, oklch(0.62 var(--brand-c) var(--brand-h) / 0.25), transparent 60%);
  z-index: -1;
  animation: orb-halo 3s ease-in-out infinite;
}

@keyframes orb-pulse {
  0%, 100% { box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2),
    0 8px 24px oklch(0.62 var(--brand-c) var(--brand-h) / 0.45),
    0 24px 60px rgba(15, 23, 42, 0.18); }
  50% { box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2),
    0 12px 32px oklch(0.62 var(--brand-c) var(--brand-h) / 0.65),
    0 30px 80px rgba(15, 23, 42, 0.22); }
}

@keyframes orb-halo {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.15); opacity: 0.9; }
}

.ai-panel {
  width: 360px;
  border-radius: var(--radius-l);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transform-origin: bottom right;
  animation: ai-pop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes ai-pop {
  from { opacity: 0; transform: scale(0.85) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.ai-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ai-mark {
  width: 28px; height: 28px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.55), transparent 45%),
    linear-gradient(135deg, var(--brand-blue), var(--brand-blue-deep));
  display: grid; place-items: center;
  color: #fff;
}
.ai-title {
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}
.ai-status {
  font-size: 11px;
  color: var(--fg-faint);
  display: flex; align-items: center; gap: 5px;
}
.ai-status::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--status-green);
  box-shadow: 0 0 0 3px oklch(0.74 0.16 152 / 0.18);
}
.ai-x {
  margin-left: auto;
  appearance: none;
  border: 0;
  background: transparent;
  width: 28px; height: 28px;
  border-radius: 999px;
  color: var(--fg-faint);
  cursor: pointer;
  display: grid; place-items: center;
}
.ai-x:hover { background: var(--glass-fill); color: var(--fg); }

.ai-greet {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--fg);
  margin: 0;
}
.ai-greet b { color: var(--brand-blue); font-weight: 500; }

.ai-suggest {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ai-chip {
  appearance: none;
  border: 0.5px solid var(--hairline);
  background: var(--glass-fill-faint);
  padding: 9px 12px;
  border-radius: 12px;
  text-align: left;
  font-size: 12.5px;
  font-family: inherit;
  color: var(--fg);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
}
.ai-chip:hover {
  background: var(--glass-fill);
  border-color: var(--brand-blue);
}
.ai-chip-arrow {
  margin-left: auto;
  color: var(--fg-faint);
  transition: transform 0.15s;
}
.ai-chip:hover .ai-chip-arrow {
  color: var(--brand-blue);
  transform: translateX(2px);
}

.ai-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 14px;
  border-radius: 999px;
  background: var(--glass-fill-faint);
  border: 0.5px solid var(--hairline);
}
.ai-input input {
  flex: 1;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: inherit;
  outline: 0;
}
.ai-input input::placeholder { color: var(--fg-faint); }
.ai-input-send {
  appearance: none;
  border: 0;
  width: 30px; height: 30px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-deep));
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* =========================================================================
   Schedule timeline
   ========================================================================= */

.timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tl-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
  align-items: center;
}
.tl-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg);
}
.tl-meta {
  font-size: 11px;
  color: var(--fg-faint);
  margin-top: 2px;
}
.tl-track {
  position: relative;
  height: 14px;
  background: rgba(var(--glass-tint), 0.4);
  border-radius: 999px;
  box-shadow: inset 0 0 0 0.5px var(--hairline-soft);
}
.tl-bar {
  position: absolute;
  top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-blue-deep));
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.tl-bar.amber { background: linear-gradient(90deg, var(--accent-amber), oklch(0.7 0.18 50)); }
.tl-bar.green { background: linear-gradient(90deg, oklch(0.78 0.16 152), oklch(0.62 0.18 158)); }
.tl-today {
  position: absolute;
  top: -6px; bottom: -6px;
  width: 1.5px;
  background: var(--accent-amber);
  box-shadow: 0 0 8px var(--accent-amber);
}
/* ============================================================
   STAGE PIPELINE — BOQ → Procurement → Delivery → On site
   Volumes are visual; click jumps to that tab.
   ============================================================ */
.stage-pipeline {
  display: grid;
  grid-template-columns: 1fr 40px 1fr 40px 1fr 40px 1fr;
  align-items: end;
  gap: 4px;
  padding: 18px 18px 16px;
  margin: 8px 0 22px;
  border-radius: 14px;
  border: 0.5px solid var(--hairline);
  background: var(--glass-fill-faint, rgba(255,255,255,0.04));
}
.stage-pipe-node {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.15s;
}
.stage-pipe-node:hover { background: var(--glass-fill, rgba(0,0,0,0.04)); }
.stage-pipe-bar {
  position: relative;
  width: 100%;
  max-width: 96px;
  height: 92px;
  border-radius: 8px 8px 4px 4px;
  background: color-mix(in oklch, var(--stage-color) 8%, transparent);
  border: 0.5px solid color-mix(in oklch, var(--stage-color) 22%, transparent);
  overflow: hidden;
}
.stage-pipe-bar-fill {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg,
    color-mix(in oklch, var(--stage-color) 78%, transparent),
    color-mix(in oklch, var(--stage-color) 50%, transparent));
  border-radius: 8px 8px 4px 4px;
  transition: height 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
}
.stage-pipe-node.active .stage-pipe-bar {
  border-color: color-mix(in oklch, var(--stage-color) 60%, transparent);
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--stage-color) 22%, transparent);
}
.stage-pipe-node.active .stage-pipe-bar-fill {
  background: linear-gradient(180deg,
    var(--stage-color),
    color-mix(in oklch, var(--stage-color) 70%, black 6%));
}
.stage-pipe-meta {
  text-align: center;
  width: 100%;
}
.stage-pipe-count {
  font-size: 18px;
  font-weight: 700;
  color: var(--fg);
  line-height: 1;
}
.stage-pipe-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--fg-mute);
  letter-spacing: 0.02em;
}
.stage-pipe-icon { display: inline-grid; place-items: center; }
.stage-pipe-icon svg { width: 12px; height: 12px; }
.stage-pipe-node.active .stage-pipe-label,
.stage-pipe-node.active .stage-pipe-count { color: var(--fg); }
.stage-pipe-pct {
  font-size: 10px;
  color: var(--fg-faint);
  margin-top: 2px;
  letter-spacing: 0.02em;
}
.stage-pipe-flow {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 92px;
  pointer-events: none;
}
.stage-pipe-flow svg {
  width: 100%;
  height: 56px;
  align-self: center;
  margin-bottom: 18px;
}
.tl-bar-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.95);
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.18);
  pointer-events: none;
}
.tl-row-ticks {
  margin-bottom: 2px;
}
.tl-ticks-track {
  background: transparent;
  box-shadow: none;
  height: 16px;
  border-radius: 0;
}
.tl-tick-label {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-mute);
  white-space: nowrap;
}
.tl-tick-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--hairline-soft, rgba(0,0,0,0.08));
}
.tl-tick-line-faint {
  top: 2px;
  bottom: 2px;
  opacity: 0.5;
}
.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  padding: 0 5px;
  margin-left: 6px;
  height: 16px;
  border-radius: 999px;
  background: var(--glass-fill, rgba(0,0,0,0.06));
  color: var(--fg-mute);
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.tab.active .tab-count {
  background: var(--fg);
  color: var(--bg-base);
}

/* =========================================================================
   Misc utilities
   ========================================================================= */

.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 4px; }
.spacer { flex: 1; }
.muted { color: var(--fg-mute); }
.faint { color: var(--fg-faint); }
.tabular { font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }

.divider-v {
  width: 1px;
  align-self: stretch;
  background: var(--hairline);
}

/* Theme switch in topbar */
.theme-switch {
  display: flex;
  align-items: center;
  padding: 3px;
  background: var(--glass-fill-faint);
  border-radius: 999px;
}
.theme-switch button {
  appearance: none;
  border: 0;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: transparent;
  color: var(--fg-faint);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.2s;
}
.theme-switch button.active {
  background: var(--glass-fill-strong);
  color: var(--fg);
  box-shadow:
    inset 0 1px 0 var(--glass-rim-top),
    inset 0 0 0 0.5px var(--glass-edge),
    0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Token pill */
.token-pill {
  appearance: none;
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 3px 14px 3px 4px;
  border-radius: 999px;
  background: var(--glass-fill-faint);
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: inset 0 0 0 0.5px var(--hairline);
}
.token-pill:hover {
  background: var(--glass-fill);
  box-shadow: inset 0 0 0 0.5px var(--brand-blue-soft),
              0 4px 16px oklch(0.62 var(--brand-c) var(--brand-h) / 0.18);
}
.token-orb {
  width: 28px; height: 28px;
  border-radius: 999px;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.55), transparent 45%),
    linear-gradient(135deg, var(--brand-blue), var(--brand-blue-deep));
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 6px oklch(0.62 var(--brand-c) var(--brand-h) / 0.4);
}
.token-orb svg { width: 14px; height: 14px; }
.token-val {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.token-label {
  font-size: 11.5px;
  color: var(--fg-faint);
  font-weight: 500;
}

/* Tab bar inside content */
.tabs {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 999px;
  background: var(--glass-fill-faint);
  gap: 2px;
  flex-wrap: wrap;
  max-width: 100%;
}
.tab-sep {
  display: inline-block;
  width: 1px;
  height: 14px;
  background: var(--hairline);
  margin: 0 6px;
}
.tab {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg-mute);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.tab.active {
  background: var(--glass-fill-strong);
  color: var(--fg);
  box-shadow:
    inset 0 1px 0 var(--glass-rim-top),
    inset 0 0 0 0.5px var(--glass-edge);
}

/* =========================================================================
   BOQ Automation page
   ========================================================================= */

.boq-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap-m);
  margin-bottom: var(--gap-l);
}
@media (max-width: 1100px) {
  .boq-stats { grid-template-columns: repeat(2, 1fr); }
}

/* QTO uses 8 KPIs — keep a clean 4×2 on wide screens */
.boq-stats.qto-stats { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1400px) {
  .boq-stats.qto-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1100px) {
  .boq-stats.qto-stats { grid-template-columns: repeat(2, 1fr); }
}

/* Toggle on a KPI card (e.g. "this month / total") */
.kpi-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  padding: 2px;
  border-radius: 999px;
  background: var(--glass-fill-faint);
  border: 0.5px solid var(--hairline-soft);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1;
}
.kpi-toggle button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--fg-mute);
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  letter-spacing: 0.01em;
  transition: color 120ms ease, background 120ms ease;
}
.kpi-toggle button:hover { color: var(--fg); }
.kpi-toggle button.active {
  background: var(--fg);
  color: var(--bg-base);
}
.kpi.has-toggle { position: relative; }
.kpi.has-toggle .kpi-label { padding-right: 96px; }

.boq-drop {
  border: 1.5px dashed var(--brand-blue);
  border-radius: var(--radius-l);
  padding: 36px 24px;
  text-align: center;
  background:
    radial-gradient(60% 60% at 50% 30%, oklch(0.62 var(--brand-c) var(--brand-h) / 0.18), transparent 70%),
    var(--brand-blue-soft);
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
  cursor: pointer;
}
.boq-drop:hover {
  background:
    radial-gradient(60% 60% at 50% 30%, oklch(0.62 var(--brand-c) var(--brand-h) / 0.28), transparent 70%),
    oklch(0.62 var(--brand-c) var(--brand-h) / 0.22);
}
.boq-drop.dragging {
  border-style: solid;
  background:
    radial-gradient(60% 60% at 50% 30%, oklch(0.62 var(--brand-c) var(--brand-h) / 0.34), transparent 70%),
    oklch(0.62 var(--brand-c) var(--brand-h) / 0.28);
  transform: scale(1.005);
}
.boq-drop-icon {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 18px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-deep));
  color: #fff;
  box-shadow: 0 12px 32px oklch(0.62 var(--brand-c) var(--brand-h) / 0.45);
}
.boq-drop-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 4px;
}
.boq-drop-sub {
  font-size: 12.5px;
  color: var(--fg-mute);
  margin: 0 0 16px;
}
.boq-drop-types {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.boq-file-pill {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  height: 26px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(var(--glass-tint), 0.7);
  border: 0.5px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: currentColor;
}
.boq-file-pill-ext { line-height: 1; }

.boq-staged {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius-m);
  background: var(--glass-fill-faint);
}
.boq-staged-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg-mute);
}
.boq-staged-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.boq-staged-item {
  display: grid;
  grid-template-columns: 48px 1fr 28px;
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(var(--glass-tint), 0.5);
}
.boq-staged-name { font-size: 12.5px; font-weight: 500; }
.boq-staged-meta { font-size: 11px; color: var(--fg-faint); margin-top: 1px; }

/* In-progress card */
.boq-inprog {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.boq-inprog-row {
  display: grid;
  grid-template-columns: 36px 1fr 80px;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--glass-fill-faint);
}
.boq-inprog-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--glass-fill);
  display: grid; place-items: center;
}
.boq-spinner {
  width: 18px; height: 18px;
  border-radius: 999px;
  border: 2px solid oklch(0.62 var(--brand-c) var(--brand-h) / 0.25);
  border-top-color: var(--brand-blue);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.boq-inprog-name { font-size: 13px; font-weight: 500; }
.boq-inprog-stage { font-size: 11.5px; color: var(--fg-mute); margin-top: 2px; }
.boq-inprog-pct {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--brand-blue);
}
.boq-inprog-eta { font-size: 11px; color: var(--fg-faint); margin-top: 2px; }

/* Processed table */
.boq-table {
  display: flex;
  flex-direction: column;
}
.boq-thead, .boq-trow {
  display: grid;
  grid-template-columns: 2fr 1fr 80px 70px 100px 100px 110px 70px;
  gap: 14px;
  align-items: center;
}
.boq-thead {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg-faint);
  padding: 0 4px 10px;
  border-bottom: 0.5px solid var(--hairline);
}
.boq-trow {
  padding: 12px 4px;
  border-bottom: 0.5px solid var(--hairline-soft);
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s;
}
.boq-trow:hover { background: rgba(var(--glass-tint), 0.4); }
.boq-trow:last-child { border-bottom: 0; }
.boq-tcell-name {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: center;
  min-width: 0;
}
.boq-tcell-icon {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--glass-fill);
  color: var(--brand-blue);
  display: grid; place-items: center;
}
.boq-tname {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.boq-tmeta { font-size: 11px; color: var(--fg-faint); margin-top: 1px; }
.boq-tcell-proj { font-size: 11.5px; }
.boq-tcell-num {
  font-size: 13px;
  color: var(--fg-mute);
  text-align: right;
}
.boq-tcell-num strong { color: var(--fg); font-weight: 500; }
.boq-tcell-date {
  font-size: 12px;
  color: var(--fg-faint);
  white-space: nowrap;
}

/* =========================================================================
   Project board tiles
   ========================================================================= */

.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--gap-m);
}
.proj-empty {
  grid-column: 1 / -1;
  padding: 48px 24px;
  text-align: center;
  border: 0.5px dashed var(--hairline);
  border-radius: var(--radius-l);
  background: var(--glass-fill-faint);
}
.proj-empty-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--fg);
  margin-bottom: 4px;
}
.proj-empty-sub {
  font-size: 13px;
  color: var(--fg-mute);
}

.proj-tile {
  border-radius: var(--radius-l);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  isolation: isolate;
  /* Light 3D thickness — soft top rim, dark drop, plus an extruded z-shadow */
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.85),
    inset 0 -1.5px 0 rgba(0,0,0,0.10),
    inset 0 0 0 0.5px var(--glass-edge),
    0 1px 0 rgba(255,255,255,0.6),
    0 2px 0 rgba(15,23,42,0.05),
    0 4px 0 rgba(15,23,42,0.04),
    0 10px 24px rgba(15,23,42,0.14),
    0 24px 60px rgba(15,23,42,0.10);
}
[data-theme="dark"] .proj-tile {
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.20),
    inset 0 -1.5px 0 rgba(0,0,0,0.40),
    inset 0 0 0 0.5px rgba(255,255,255,0.12),
    0 1px 0 rgba(255,255,255,0.10),
    0 2px 0 rgba(0,0,0,0.20),
    0 4px 0 rgba(0,0,0,0.18),
    0 10px 24px rgba(0,0,0,0.40),
    0 24px 60px rgba(0,0,0,0.30);
}
.proj-tile:hover {
  transform: translateY(-3px);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.85),
    inset 0 -1.5px 0 rgba(0,0,0,0.10),
    inset 0 0 0 0.5px var(--glass-edge),
    0 1px 0 rgba(255,255,255,0.6),
    0 2px 0 rgba(15,23,42,0.05),
    0 4px 0 rgba(15,23,42,0.04),
    0 16px 36px rgba(15,23,42,0.18),
    0 36px 80px rgba(15,23,42,0.14);
}
[data-theme="dark"] .proj-tile:hover {
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.20),
    inset 0 -1.5px 0 rgba(0,0,0,0.40),
    inset 0 0 0 0.5px rgba(255,255,255,0.12),
    0 1px 0 rgba(255,255,255,0.10),
    0 2px 0 rgba(0,0,0,0.20),
    0 4px 0 rgba(0,0,0,0.18),
    0 16px 36px rgba(0,0,0,0.50),
    0 36px 80px rgba(0,0,0,0.40);
}

.proj-tile-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.proj-tile-bg svg {
  display: block;
  width: 100%;
  height: 100%;
}

.proj-tile-spacer {
  height: 175px;
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}

.proj-tile-stage {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
}
.proj-tile-stage .pill {
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  padding: 5px 11px;
  font-size: 10.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.9),
    inset 0 -1px 0 rgba(0,0,0,0.04),
    0 4px 12px rgba(15,23,42,0.10);
}
.proj-tile-stage .pill svg {
  width: 11px;
  height: 11px;
}
[data-theme="dark"] .proj-tile-stage .pill {
  background: rgba(20, 24, 40, 0.88);
  color: #ffffff;
  border-color: rgba(255,255,255,0.14);
}

.proj-tile-more {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
}
.proj-tile-more-btn {
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.5) !important;
  color: var(--fg) !important;
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.7),
    inset 0 0 0 0.5px rgba(255,255,255,0.6),
    0 2px 8px rgba(15,23,42,0.10);
}
[data-theme="dark"] .proj-tile-more-btn {
  background: rgba(20, 24, 40, 0.5) !important;
  color: var(--fg) !important;
}

/* Kebab dropdown menu */
.proj-tile-menu {
  position: absolute;
  top: 38px;
  right: 0;
  min-width: 200px;
  padding: 6px;
  background: var(--surface, #fff);
  border: 0.5px solid var(--hairline);
  border-radius: 12px;
  box-shadow:
    0 12px 32px rgba(15, 23, 42, 0.18),
    0 2px 8px rgba(15, 23, 42, 0.08);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
[data-theme="dark"] .proj-tile-menu {
  background: #1a1f2e;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}
.proj-tile-menu-item {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.proj-tile-menu-item:hover {
  background: var(--glass-fill-faint);
}
.proj-tile-menu-icon {
  display: inline-grid;
  place-items: center;
  color: var(--fg-mute);
  width: 16px;
  height: 16px;
}
.proj-tile-menu-item-danger { color: oklch(0.55 0.18 25); }
.proj-tile-menu-item-danger .proj-tile-menu-icon { color: inherit; }
[data-theme="dark"] .proj-tile-menu-item-danger { color: oklch(0.78 0.18 25); }
.proj-tile-menu-sep {
  height: 1px;
  background: var(--hairline);
  margin: 4px 2px;
}

/* Flagged pill sits next to the stage pill */
.proj-tile-flag-pill {
  margin-left: 6px;
}

/* The glass module that floats over the illustration */
.proj-tile-body {
  position: relative;
  z-index: 2;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 0 0 0.5px rgba(255,255,255,0.35);
}
[data-theme="dark"] .proj-tile-body {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 0 0 0.5px rgba(255,255,255,0.10);
}

/* heavy frosted-glass refraction layer — the body's own backdrop */
.proj-tile-body::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  -webkit-backdrop-filter: blur(28px) saturate(2.0) brightness(1.05);
  backdrop-filter: blur(28px) saturate(2.0) brightness(1.05);
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.55) 0%,
    rgba(255,255,255,0.42) 50%,
    rgba(255,255,255,0.50) 100%
  );
}
[data-theme="dark"] .proj-tile-body::before {
  background: linear-gradient(
    180deg,
    rgba(18,22,38,0.78) 0%,
    rgba(18,22,38,0.72) 50%,
    rgba(18,22,38,0.78) 100%
  );
}

/* specular highlight curve along the top of the glass */
.proj-tile-body::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 60%;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(120% 60% at 30% 0%, rgba(255,255,255,0.55), rgba(255,255,255,0) 60%),
    linear-gradient(180deg, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0) 70%);
  mix-blend-mode: overlay;
}

.proj-tile-body-content {
  position: relative;
  z-index: 3;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.proj-tile-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--fg);
}

.proj-tile-meta {
  font-size: 11.5px;
  color: var(--fg-mute);
  margin-top: 2px;
  font-weight: 500;
}

.proj-tile-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.proj-tile-prog-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--fg-mute);
  font-weight: 500;
}
.proj-tile-prog-meta strong { color: var(--fg); font-weight: 600; }
.proj-tile-prog-meta .faint { color: var(--fg-faint); }

.proj-tile-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 0.5px solid rgba(10, 14, 26, 0.12);
}
[data-theme="dark"] .proj-tile-foot { border-top-color: rgba(10, 14, 26, 0.15); }

.proj-avatars {
  display: flex;
}
.proj-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 10px;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.7), 0 1px 3px rgba(0,0,0,0.10);
  margin-right: -8px;
  position: relative;
}
[data-theme="dark"] .proj-avatar {
  box-shadow: 0 0 0 2px rgba(28,32,50,0.7), 0 1px 3px rgba(0,0,0,0.30);
}
.proj-avatar:last-child { margin-right: 0; }
.proj-avatar-more {
  background: rgba(255,255,255,0.6);
  color: var(--fg-mute);
}
[data-theme="dark"] .proj-avatar-more { background: rgba(40,46,70,0.7); }

.proj-tile-time {
  font-size: 10.5px;
  color: var(--fg-mute);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
[data-theme="dark"] .proj-tile-time { color: rgba(255, 255, 255, 0.72); }

/* =========================================================================
   Analytics charts
   ========================================================================= */
.chart-svg {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 10px;
}
.chart-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 92px;
}
.chart-stat-label {
  font-size: 11px;
  color: var(--fg-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.chart-stat-val {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--fg);
  margin-top: 2px;
}
.chart-legend {
  display: flex;
  gap: 18px;
  margin-top: 14px;
  padding: 12px 4px 0;
  border-top: 0.5px solid var(--hairline-soft);
}
.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--fg-mute);
  font-weight: 500;
}
.chart-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}
.chart-swatch-dash {
  height: 2px;
  border-radius: 1px;
}


/* =========================================================================
 * PROJECT PEEK — Notion-style center peek modal
 * ========================================================================= */

.peek-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8, 12, 28, 0.42);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: start center;
  padding: 32px 24px;
  overflow: auto;
  animation: peekFadeIn 0.18s ease-out;
}
[data-theme="dark"] .peek-backdrop { background: rgba(0, 4, 16, 0.62); }
@keyframes peekFadeIn { from { opacity: 0; } to { opacity: 1; } }

.peek-shell {
  width: min(960px, 100%);
  max-width: 960px;
  margin: 0 auto;
  background: var(--glass-fill-strong);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
  backdrop-filter: blur(40px) saturate(1.8);
  border-radius: 22px;
  box-shadow:
    0 1px 0 var(--glass-rim-top) inset,
    0 -1px 0 var(--glass-rim-bot) inset,
    0 0 0 0.5px var(--hairline),
    0 60px 120px -20px rgba(0, 0, 0, 0.45),
    0 24px 48px -12px rgba(0, 0, 0, 0.30);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 64px);
  animation: peekIn 0.24s cubic-bezier(0.2, 0.9, 0.3, 1.05);
}
@keyframes peekIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.peek-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 0.5px solid var(--hairline-soft);
  flex-shrink: 0;
  background: var(--glass-fill-faint);
}
.peek-bar-left, .peek-bar-right { display: flex; align-items: center; gap: 6px; }
.peek-crumb {
  font-size: 12.5px;
  color: var(--fg);
  margin-left: 6px;
}
.peek-crumb strong { font-weight: 500; }
.peek-btn {
  appearance: none;
  border: 0;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: transparent;
  color: var(--fg-faint);
  cursor: pointer;
  display: grid; place-items: center;
  transition: background 0.12s, color 0.12s;
}
.peek-btn:hover { background: var(--glass-fill); color: var(--fg); }
.peek-btn svg { width: 16px; height: 16px; }

.peek-scroll {
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--hairline) transparent;
}
.peek-scroll::-webkit-scrollbar { width: 8px; }
.peek-scroll::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 999px; }

/* Cover */
.peek-cover {
  position: relative;
  height: 220px;
  overflow: hidden;
}
.peek-cover > div:first-child,
.peek-cover > svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.peek-cover-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, transparent 55%, rgba(0,0,0,0.18) 100%);
  pointer-events: none;
}
.peek-cover-stage {
  position: absolute;
  bottom: 16px;
  left: 24px;
  z-index: 2;
}

.peek-body {
  padding: 28px 40px 40px;
  max-width: 820px;
  margin: 0 auto;
}

.peek-title-block { padding-bottom: 28px; border-bottom: 0.5px solid var(--hairline-soft); margin-bottom: 32px; }
.peek-eyebrow {
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-faint);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.peek-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  line-height: 1.05;
  color: var(--fg);
}
.peek-desc {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--fg-mute);
  margin: 0 0 16px;
  text-wrap: pretty;
  max-width: 640px;
}
.peek-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.peek-pills .pill svg { width: 12px; height: 12px; }
.peek-team {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 6px;
}
.peek-team .proj-avatar {
  margin-left: -6px;
  border: 2px solid rgba(var(--glass-tint), 0.95);
  width: 30px; height: 30px;
  font-size: 10.5px;
}
.peek-team .proj-avatar:first-child { margin-left: 0; }

/* Section */
.pf-section { margin-bottom: 36px; }
.pf-section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 4px;
  border-bottom: 0.5px solid var(--hairline);
}
.pf-section-head-btn {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 0.5px solid var(--hairline);
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: inherit;
  padding-left: 0;
  padding-right: 0;
  transition: border-color 0.15s;
}
.pf-section-head-btn:hover { border-bottom-color: var(--fg-mute); }
.pf-section-head-btn:hover .pf-section-caret { color: var(--fg); }
.pf-section-caret {
  margin-left: auto;
  font-size: 11px;
  color: var(--fg-faint);
  transition: color 0.15s;
  align-self: center;
}
.pf-section.is-collapsed { margin-bottom: 12px; }
.pf-section.is-collapsed .pf-section-head-btn { margin-bottom: 0; }
.pf-section-num {
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-faint);
  background: var(--glass-fill-faint);
  border-radius: 5px;
  padding: 2px 7px;
  min-width: 22px;
  text-align: center;
}
.pf-section-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  text-transform: uppercase;
  font-variant: small-caps;
  color: var(--fg);
}
.pf-rows { display: flex; flex-direction: column; }

.pf-subhead {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--fg-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 14px 0 6px;
  margin-top: 4px;
}

.pf-row {
  display: grid;
  grid-template-columns: 36px 1fr 110px minmax(180px, 1.4fr);
  gap: 16px;
  align-items: start;
  padding: 10px 4px;
  border-bottom: 0.5px solid var(--hairline-soft);
  font-size: 13px;
  transition: background 0.1s;
  border-radius: 6px;
}
.pf-row:hover { background: var(--glass-fill-faint); }
.pf-num {
  font-size: 11px;
  color: var(--fg-faint);
  font-weight: 500;
  padding-top: 2px;
}
.pf-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--fg);
  font-weight: 500;
}
.pf-status { display: inline-flex; gap: 4px; align-items: center; }
.pf-dot {
  width: 7px; height: 7px;
  border-radius: 999px;
  display: inline-block;
}
.pf-dot-req { background: var(--fg-mute); }
.pf-dot-opt {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--fg-faint);
}
.pf-flag { font-size: 9px; opacity: 0.6; }
.pf-type {
  font-size: 11.5px;
  color: var(--fg-faint);
  font-family: var(--font-mono);
  padding-top: 2px;
}
.pf-value {
  color: var(--fg);
  line-height: 1.5;
  word-break: break-word;
}
.pf-empty { color: var(--fg-faint); font-style: italic; }
.pf-enum {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
  font-size: 11.5px;
  font-weight: 500;
}
.pf-enum-amber {
  background: var(--accent-amber-soft);
  color: oklch(0.55 0.16 55);
}
[data-theme="dark"] .pf-enum-amber { color: oklch(0.85 0.16 70); }
.pf-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--glass-fill);
  font-size: 11.5px;
  color: var(--fg-mute);
  border: 0.5px solid var(--hairline-soft);
}
.pf-chip svg { width: 11px; height: 11px; }

/* ─── Generic stub for new project peek tabs ─────────────────────────── */
.pf-stub {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.pf-stub-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.pf-stub-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--glass-fill-faint);
  border: 0.5px solid var(--hairline-soft);
  color: var(--brand-blue);
  flex: 0 0 auto;
}
.pf-stub-icon svg { width: 22px; height: 22px; }
.pf-stub-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.pf-stub-sub {
  font-size: 13px;
  color: var(--fg-mute);
  margin-top: 2px;
  max-width: 60ch;
}
.pf-stub-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.pf-stub-stat {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--glass-fill-faint);
  border: 0.5px solid var(--hairline-soft);
}
.pf-stub-stat-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-faint);
  font-weight: 500;
}
.pf-stub-stat-value {
  font-size: 22px;
  font-weight: 600;
  color: var(--fg);
  margin-top: 4px;
  letter-spacing: -0.015em;
}
.pf-stub-stat-sub {
  font-size: 12px;
  color: var(--fg-mute);
  margin-top: 2px;
}
.pf-stub-list {
  border-radius: 12px;
  border: 0.5px solid var(--hairline-soft);
  overflow: hidden;
  background: var(--surface, #fff);
}
[data-theme="dark"] .pf-stub-list {
  background: rgba(255,255,255,0.02);
}
.pf-stub-list-head {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-faint);
  background: var(--glass-fill-faint);
  border-bottom: 0.5px solid var(--hairline-soft);
  font-weight: 600;
}
.pf-stub-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-top: 0.5px solid var(--hairline-soft);
}
.pf-stub-row:first-child { border-top: 0; }
.pf-stub-row-main { flex: 1; min-width: 0; }
.pf-stub-row-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fg);
}
.pf-stub-row-meta {
  font-size: 12px;
  color: var(--fg-mute);
  margin-top: 1px;
}
.pf-stub-foot {
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--glass-fill-faint);
  border: 0.5px dashed var(--hairline);
  font-size: 12.5px;
  color: var(--fg-mute);
}
.pf-list {
  margin: 0;
  padding-left: 16px;
  font-size: 12.5px;
  color: var(--fg-mute);
  line-height: 1.6;
}
.pf-list li { margin: 2px 0; }

/* =========================================================================
 * BOQ — package list + line-item detail
 * ========================================================================= */
.boq-pkg-list { overflow: hidden; }
.boq-pkg-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  border-top: 0.5px solid var(--hairline-soft);
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: background 120ms ease;
}
.boq-pkg-row:first-of-type { border-top: 0; }
.boq-pkg-row:hover { background: var(--glass-fill-faint); }
.boq-pkg-icon {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--glass-fill-faint);
  flex-shrink: 0;
}
.boq-pkg-arrow {
  font-size: 22px;
  color: var(--fg-mute);
  margin-left: 4px;
  font-weight: 300;
  line-height: 1;
}

/* Status breakdown column */
.boq-pkg-status {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 240px;
  flex-shrink: 0;
}
.boq-pkg-bar {
  display: flex;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--glass-fill-faint);
  box-shadow: inset 0 0 0 0.5px var(--hairline-soft);
}
.boq-pkg-bar-seg { height: 100%; min-width: 2px; }
.boq-pkg-bar-seg + .boq-pkg-bar-seg {
  box-shadow: inset 1px 0 0 var(--surface-1, #fff);
}
.boq-pkg-bar-green { background: oklch(0.62 0.15 152); }
.boq-pkg-bar-amber { background: oklch(0.72 0.16 70); }
.boq-pkg-bar-blue  { background: var(--brand-blue, oklch(0.55 0.16 245)); }
.boq-pkg-bar-gray  { background: oklch(0.72 0.01 250); }
[data-theme="dark"] .boq-pkg-bar-green { background: oklch(0.68 0.15 152); }
[data-theme="dark"] .boq-pkg-bar-amber { background: oklch(0.78 0.16 70); }
[data-theme="dark"] .boq-pkg-bar-gray  { background: oklch(0.55 0.01 250); }

.boq-pkg-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 11px;
  color: var(--fg-mute);
  line-height: 1.2;
}
.boq-pkg-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.boq-pkg-legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  flex-shrink: 0;
}
.boq-pkg-legend-count {
  color: var(--fg);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.boq-pkg-legend-label { color: var(--fg-mute); }

.boq-detail {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.boq-detail-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.boq-back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 6px;
  border: 0.5px solid var(--hairline-soft);
  border-radius: 999px;
  background: var(--glass-fill-faint);
  color: var(--fg);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.boq-back:hover { background: var(--glass-fill); }
.boq-back-arrow { font-size: 14px; line-height: 1; }
.boq-detail-title-wrap { display: flex; gap: 12px; align-items: flex-start; }
.boq-detail-icon {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--glass-fill-faint);
  flex-shrink: 0;
}
.boq-detail-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.boq-detail-sub {
  font-size: 13px;
  color: var(--fg-mute);
  margin-top: 2px;
  max-width: 60ch;
}
.boq-detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.boq-detail-stat {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--glass-fill-faint);
  border: 0.5px solid var(--hairline-soft);
}
.boq-detail-stat-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-mute);
  font-weight: 500;
}
.boq-detail-stat-value {
  font-size: 20px;
  font-weight: 600;
  margin-top: 4px;
  letter-spacing: -0.015em;
}

.boq-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  margin-bottom: 16px;
  background: transparent;
}
.boq-search {
  position: relative;
  flex: 1 1 220px;
  min-width: 200px;
  max-width: 360px;
  display: flex;
  align-items: center;
}
.boq-search-icon {
  position: absolute;
  left: 10px;
  color: var(--fg-mute);
  display: grid; place-items: center;
  pointer-events: none;
}
.boq-search input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border-radius: 8px;
  border: 0.5px solid var(--hairline-soft);
  background: var(--glass-fill-faint);
  color: var(--fg);
  font: inherit;
  font-size: 13px;
}
.boq-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.boq-filter {
  padding: 6px 12px;
  border-radius: 999px;
  border: 0.5px solid var(--hairline-soft);
  background: transparent;
  color: var(--fg-mute);
  font: inherit;
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
  line-height: 1;
  min-height: 28px;
}
.boq-filter:hover { color: var(--fg); background: var(--glass-fill-faint); }
.boq-filter.active {
  background: var(--fg);
  color: var(--bg-base);
  border-color: var(--fg);
}
.boq-filter-count {
  display: inline-block;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(var(--glass-tint), 0.6);
  color: var(--fg-mute);
  font-size: 11px;
  line-height: 16px;
  min-width: 16px;
  text-align: center;
}
.boq-filter.active .boq-filter-count {
  background: rgba(255,255,255,0.18);
  color: var(--bg-base);
}

.boq-li-wrap {
  border-radius: 12px;
  border: 0.5px solid var(--hairline-soft);
  background: var(--surface, #fff);
  overflow: visible;
}
[data-theme="dark"] .boq-li-wrap { background: rgba(255,255,255,0.02); }

.boq-li-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  table-layout: fixed;
}
.boq-li-table .boq-col-no     { width: 120px; }
.boq-li-table .boq-col-desc   { width: auto;  }
.boq-li-table .boq-col-unit   { width: 64px;  }
.boq-li-table .boq-col-qty    { width: 70px;  }
.boq-li-table .boq-col-rate   { width: 90px;  }
.boq-li-table .boq-col-amt    { width: 110px; }
.boq-li-table .boq-col-status { width: 110px; }

.boq-li-table thead th {
  position: sticky;
  top: 0;
  background: var(--glass-fill-strong, rgba(255,255,255,0.92));
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 0.5px solid var(--hairline);
  padding: 10px 12px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-mute);
  text-align: left;
  white-space: nowrap;
  z-index: 4;
}
[data-theme="dark"] .boq-li-table thead th { background: rgba(20,20,22,0.92); }
.boq-li-table .boq-th-num { text-align: right; }
.boq-li-table .boq-th-no  { text-align: left; }

.boq-li-table tbody td {
  padding: 8px 12px;
  border-top: 0.5px solid var(--hairline-soft);
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}
.boq-li-table tbody tr:hover td { background: var(--glass-fill-faint); }
.boq-li-table tbody tr.boq-section-row:hover td,
.boq-li-table tbody tr.boq-subtotal-row:hover td,
.boq-li-table tbody tr.boq-grandtotal-row:hover td { background: inherit; }

.boq-li-table .boq-no {
  color: var(--fg-mute);
  white-space: nowrap;
  font-size: 11.5px;
}
.boq-li-table .boq-desc {
  color: var(--fg);
  white-space: normal;
  overflow-wrap: anywhere;
}
.boq-li-table .boq-cell-num { text-align: right; white-space: nowrap; }
.boq-li-table .boq-amount { font-weight: 600; }

/* Status cell dropdown */
.boq-status-cell { position: relative; }
.boq-status-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  font: inherit;
  padding: 3px 8px 3px 10px;
}
.boq-status-trigger:hover { filter: brightness(0.96); }
.boq-status-caret { font-size: 9px; opacity: 0.7; margin-left: 2px; }
.boq-status-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 20;
  min-width: 140px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface, #fff);
  border: 0.5px solid var(--hairline);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.06);
}
[data-theme="dark"] .boq-status-menu { background: var(--bg-elev, #1a1a1a); }
.boq-status-option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: transparent;
  border: none;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
}
.boq-status-option:hover { background: rgba(var(--glass-tint), 0.6); }
.boq-status-option.is-current { background: rgba(var(--glass-tint), 0.4); }

/* Variation (forked) rows */
.boq-row-variation { background: oklch(0.96 0.04 250 / 0.4); }
[data-theme="dark"] .boq-row-variation { background: oklch(0.30 0.06 250 / 0.3); }
.boq-row-variation .boq-no { color: var(--brand-blue); font-weight: 600; }
.boq-vo-tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--brand-blue);
  color: #fff;
  vertical-align: middle;
}
.boq-fork-arrow { color: var(--brand-blue); font-weight: 600; margin-right: 4px; }

/* Toast */
.boq-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: oklch(0.20 0.02 270);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  animation: boqToastIn 0.18s ease-out;
}
@keyframes boqToastIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* BOQ → Procurement confirm modal */
.boq-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 18, 24, 0.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: boqOverlayIn 0.16s ease-out;
}
@keyframes boqOverlayIn { from { opacity: 0; } to { opacity: 1; } }
.boq-confirm {
  width: min(440px, 92vw);
  background: var(--surface, #fff);
  border: 0.5px solid var(--hairline);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.24), 0 4px 12px rgba(0,0,0,0.08);
  animation: boqConfirmIn 0.18s ease-out;
}
[data-theme="dark"] .boq-confirm { background: var(--bg-elev, #1a1a1a); }
@keyframes boqConfirmIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.boq-confirm-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: oklch(0.72 0.16 295 / 0.18);
  color: oklch(0.46 0.18 295);
  margin-bottom: 14px;
}
.boq-confirm-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}
.boq-confirm-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(var(--glass-tint), 0.5);
  border-radius: 8px;
  margin-bottom: 10px;
}
.boq-confirm-no { font-size: 11px; font-weight: 600; color: var(--fg-faint); }
.boq-confirm-name { font-size: 13px; font-weight: 500; }
.boq-confirm-text {
  font-size: 13px;
  color: var(--fg-mute);
  line-height: 1.5;
  margin: 0 0 12px;
}
.boq-confirm-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  padding: 10px 12px;
  background: rgba(var(--glass-tint), 0.3);
  border-radius: 8px;
  margin-bottom: 18px;
}
.boq-confirm-meta-label {
  color: var(--fg-faint);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 4px;
}
.boq-confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.boq-confirm-btn {
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 0.5px solid var(--hairline);
  background: transparent;
  color: inherit;
}
.boq-confirm-cancel:hover { background: rgba(var(--glass-tint), 0.6); }
.boq-confirm-go {
  background: oklch(0.46 0.18 295);
  color: #fff;
  border-color: oklch(0.46 0.18 295);
}
.boq-confirm-go:hover { background: oklch(0.40 0.18 295); }

/* Procurement tab */
.proc-detail { padding: 8px 0 32px; }
.proc-empty {
  padding: 64px 24px;
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}
.proc-empty-icon {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(var(--glass-tint), 0.5);
  color: var(--fg-mute);
  font-size: 22px;
}
.proc-empty-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}
.proc-empty-text {
  font-size: 13px;
  color: var(--fg-mute);
  line-height: 1.55;
  margin: 0;
}
.proc-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.proc-stat {
  padding: 12px 14px;
  border-radius: 10px;
  border: 0.5px solid var(--hairline-soft);
  background: var(--surface, #fff);
}
[data-theme="dark"] .proc-stat { background: rgba(255,255,255,0.02); }
.proc-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-faint);
  margin-bottom: 6px;
}
.proc-stat-value { font-size: 18px; font-weight: 600; }

.proc-pipeline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  margin-bottom: 20px;
  border-radius: 10px;
  border: 0.5px solid var(--hairline-soft);
  background: var(--surface, #fff);
  overflow-x: auto;
}
[data-theme="dark"] .proc-pipeline { background: rgba(255,255,255,0.02); }
.proc-pipe-step { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.proc-pipe-dot {
  width: 28px; height: 28px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
  font-size: 12px;
}
.proc-pipe-label { font-size: 12px; font-weight: 500; }
.proc-pipe-line {
  width: 28px;
  height: 1px;
  background: var(--hairline);
  margin: 0 4px;
}

.proc-pkg-count { color: var(--fg-faint); margin-left: 8px; font-weight: 400; }

/* Procurement stage sub-tabs */
.proc-stage-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  border: 0.5px solid var(--hairline-soft);
  border-radius: 12px;
  background: var(--surface, #fff);
  overflow-x: auto;
}
[data-theme="dark"] .proc-stage-tabs { background: rgba(255,255,255,0.02); }
.proc-stage-tab {
  flex: 1;
  min-width: 120px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  font: inherit;
  color: var(--fg-mute);
  transition: background 0.12s, color 0.12s;
}
.proc-stage-tab:hover { background: rgba(var(--glass-tint), 0.5); color: var(--fg); }
.proc-stage-tab.active {
  background: rgba(var(--glass-tint), 0.85);
  color: var(--fg);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04), inset 0 0 0 0.5px var(--hairline);
}
[data-theme="dark"] .proc-stage-tab.active { background: rgba(255,255,255,0.06); }
.proc-stage-tab-dot {
  width: 8px; height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
}
.proc-stage-tab-label {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.proc-stage-tab-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(var(--glass-tint), 0.7);
  color: var(--fg-mute);
  min-width: 22px;
  text-align: center;
}
.proc-stage-tab.active .proc-stage-tab-count {
  background: var(--fg);
  color: var(--bg-base);
}

/* Stage-change confirm flow visual */
.proc-stage-flow {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  padding: 12px;
  background: rgba(var(--glass-tint), 0.4);
  border-radius: 8px;
  margin-bottom: 18px;
}
.proc-stage-flow-arrow { font-size: 14px; color: var(--fg-mute); }

/* Section header row */
.boq-li-table .boq-section-row td {
  background: color-mix(in oklch, var(--fg) 5%, transparent);
  padding: 12px !important;
  border-top: 0.5px solid var(--hairline) !important;
}
.boq-li-table .boq-section-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.boq-li-table .boq-section-num {
  display: inline-grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg-base);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0;
}

/* Collapsible section header — chevron + clickability */
.boq-li-table .boq-section-row { cursor: pointer; }
.boq-li-table .boq-section-row:hover td {
  background: color-mix(in oklch, var(--fg) 8%, transparent) !important;
}
.boq-li-table .boq-section-row:focus-visible {
  outline: 2px solid var(--brand-blue, oklch(0.55 0.16 245));
  outline-offset: -2px;
}
.boq-li-table .boq-section-chevron {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  font-size: 18px;
  font-weight: 400;
  color: var(--fg-mute);
  line-height: 1;
  transform: rotate(90deg);
  transform-origin: center;
  transition: transform 160ms ease;
}
.boq-li-table .boq-section-row.is-collapsed .boq-section-chevron {
  transform: rotate(0deg);
}
.boq-li-table .boq-section-count {
  margin-left: 6px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--fg-mute);
  text-transform: none;
}
.boq-li-table .boq-section-amount {
  font-weight: 600;
  font-size: 12px;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

/* Subtotal row at end of each section */
.boq-li-table .boq-subtotal-row td {
  background: color-mix(in oklch, var(--fg) 3%, transparent);
  border-top: 0.5px solid var(--hairline) !important;
  padding: 9px 12px !important;
}
.boq-li-table .boq-subtotal-label {
  font-weight: 600;
  font-size: 12px;
  color: var(--fg);
  text-align: right;
}
.boq-li-table .boq-subtotal-count {
  color: var(--fg-mute);
  font-weight: 400;
  margin-left: 4px;
}
.boq-li-table .boq-subtotal-value {
  font-weight: 700;
  font-size: 13px;
  color: var(--fg);
}

/* Grand total row at end of package */
.boq-li-table .boq-grandtotal-row td {
  background: var(--fg);
  color: var(--bg-base);
  padding: 14px 12px !important;
  border-top: 0.5px solid var(--fg) !important;
}
.boq-li-table .boq-grandtotal-label {
  font-weight: 700;
  font-size: 13px;
  color: var(--bg-base);
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.boq-li-table .boq-grandtotal-count {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.75;
}
.boq-li-table .boq-grandtotal-value {
  font-weight: 700;
  font-size: 15px;
  color: var(--bg-base);
  letter-spacing: -0.01em;
}

/* Round bottom corners on the last visible row inside the wrapper */
.boq-li-table tbody tr:last-child td:first-child { border-bottom-left-radius: 12px; }
.boq-li-table tbody tr:last-child td:last-child  { border-bottom-right-radius: 12px; }
.boq-li-table .boq-grandtotal-row td:first-child { border-bottom-left-radius: 12px; }
.boq-li-table .boq-grandtotal-row td:last-child  { border-bottom-right-radius: 12px; }

.boq-empty {
  padding: 32px;
  text-align: center;
  color: var(--fg-mute);
  font-size: 13px;
}

/* Smaller screens */
@media (max-width: 720px) {
  .peek-shell { width: 100%; border-radius: 16px; }
  .peek-body { padding: 20px 20px 32px; }
  .peek-title { font-size: 28px; }
  .pf-row { grid-template-columns: 28px 1fr; gap: 8px; }
  .pf-type, .pf-value { grid-column: 2; }
  .pf-type { padding-top: 0; opacity: 0.7; }
}


/* =========================================================================
 * PEEK TABS (Cover / Docs / Live)
 * ========================================================================= */
.peek-tabs {
  display: flex;
  gap: 4px;
  margin-top: 18px;
  padding: 4px;
  background: var(--glass-fill-faint);
  border-radius: 12px;
  width: fit-content;
  border: 0.5px solid var(--hairline-soft);
}
.peek-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--fg-mute);
  font: 500 13px var(--font-text);
  padding: 7px 14px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.peek-tab svg { width: 14px; height: 14px; }
.peek-tab:hover { color: var(--fg); }
.peek-tab.active {
  background: rgba(var(--glass-tint), 0.95);
  color: var(--fg);
  box-shadow: 0 1px 0 var(--glass-rim-top) inset, 0 1px 2px rgba(0,0,0,0.08);
}
.peek-tab.active svg { color: var(--brand-blue); }
.peek-tab-count {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--glass-fill);
  color: var(--fg-faint);
  margin-left: 2px;
}
.peek-tab-live {
  color: var(--status-red, #ef4444);
  font-size: 8px;
  margin-left: 2px;
  animation: peekLivePulse 1.6s ease-in-out infinite;
}
@keyframes peekLivePulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* Tabs floating on the cover image */
.peek-tabs-cover {
  position: absolute;
  top: 16px;
  right: 16px;
  left: 16px;
  width: auto;
  margin-top: 0;
  z-index: 3;
  background: rgba(20, 24, 40, 0.42);
  border-color: rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  backdrop-filter: blur(28px) saturate(1.6);
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 8px 24px -8px rgba(0,0,0,0.45);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.3) transparent;
}
.peek-tabs-cover::-webkit-scrollbar { height: 6px; }
.peek-tabs-cover::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 999px; }
.peek-tabs-cover .peek-tab { white-space: nowrap; flex: 0 0 auto; }
.peek-tabs-cover .peek-tab { color: rgba(255,255,255,0.78); }
.peek-tabs-cover .peek-tab:hover { color: #fff; }
.peek-tabs-cover .peek-tab.active {
  background: rgba(255,255,255,0.95);
  color: var(--fg);
  box-shadow: 0 1px 0 rgba(255,255,255,1) inset, 0 1px 4px rgba(0,0,0,0.18);
}
.peek-tabs-cover .peek-tab.active svg { color: var(--brand-blue); }
.peek-tabs-cover .peek-tab svg { color: rgba(255,255,255,0.78); }
.peek-tabs-cover .peek-tab-count {
  background: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.85);
}
.peek-tabs-cover .peek-tab.active .peek-tab-count {
  background: var(--glass-fill);
  color: var(--fg-faint);
}

/* =========================================================================
 * EXPANDED MODE — peek occupies the full content frame
 * ========================================================================= */
.peek-backdrop.peek-expanded {
  /* Inset from the left so the sidebar stays visible & reachable */
  inset: 16px 18px 18px calc(248px + 18px + 20px);  /* sidebar + app padding-left + gap */
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  padding: 0;
  align-items: stretch;
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: left 0.32s cubic-bezier(0.4, 0.0, 0.2, 1);
}
.app.collapsed .peek-backdrop.peek-expanded {
  left: calc(76px + 18px + 20px);
}
.peek-backdrop.peek-expanded .peek-shell {
  width: 100%;
  max-width: none;
  max-height: 100%;
  height: 100%;
  border-radius: var(--radius-xl);
  box-shadow:
    0 30px 60px rgba(15, 23, 42, 0.20),
    0 0 0 0.5px rgba(255,255,255,0.6);
  animation: none;
  background: var(--bg-base);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
[data-theme="dark"] .peek-backdrop.peek-expanded .peek-shell {
  box-shadow:
    0 30px 60px rgba(0,0,0,0.50),
    0 0 0 0.5px rgba(255,255,255,0.10);
}
.peek-backdrop.peek-expanded .peek-bar {
  background: var(--glass-fill-strong);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  backdrop-filter: blur(28px) saturate(1.6);
}

/* =========================================================================
 * DOCS TAB
 * ========================================================================= */
.pd-wrap { padding-top: 4px; }
.pd-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
  align-items: center;
}
.pd-search {
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--glass-fill-faint);
  border-radius: 10px;
  font-size: 13px;
  color: var(--fg-faint);
  border: 0.5px solid var(--hairline-soft);
}

.pd-folders {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}
.pd-folder {
  appearance: none;
  border: 0;
  text-align: left;
  display: flex;
  gap: 14px;
  padding: 16px;
  border-radius: 14px;
  background: var(--glass-fill-faint);
  border: 0.5px solid var(--hairline-soft);
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.pd-folder:hover { background: var(--glass-fill); transform: translateY(-1px); }
.pd-folder-icon {
  width: 44px; height: 44px;
  border-radius: 11px;
  display: grid; place-items: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, 0 4px 10px rgba(0,0,0,0.10);
}
.pd-folder-icon svg { width: 20px; height: 20px; }
.pd-folder-body { min-width: 0; flex: 1; }
.pd-folder-name { font-weight: 500; font-size: 13.5px; color: var(--fg); margin-bottom: 2px; }
.pd-folder-meta { font-size: 11.5px; color: var(--fg-faint); margin-bottom: 6px; }
.pd-folder-recent {
  font-size: 11.5px;
  color: var(--fg-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pd-section-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin: 0 0 12px;
}

.pd-list {
  background: var(--glass-fill-faint);
  border-radius: 14px;
  border: 0.5px solid var(--hairline-soft);
  overflow: hidden;
}
.pd-row {
  display: grid;
  grid-template-columns: 56px 1fr 110px 80px 80px 30px;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 0.5px solid var(--hairline-soft);
  font-size: 12.5px;
}
.pd-row:last-child { border-bottom: 0; }
.pd-row:hover { background: var(--glass-fill); }
.pd-kind {
  display: inline-grid;
  place-items: center;
  height: 26px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--brand-blue);
}
.pd-kind-pdf { background: #ef4444; }
.pd-kind-xlsx { background: #10b981; }
.pd-kind-dwg { background: #8b5cf6; }
.pd-kind-docx { background: #3b82f6; }
.pd-name { font-weight: 500; color: var(--fg); }
.pd-who, .pd-when, .pd-size { color: var(--fg-faint); }

/* =========================================================================
 * LIVE TAB
 * ========================================================================= */
.pl-wrap { padding-top: 4px; }
.pl-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(239,68,68,0.15), rgba(239,68,68,0.05));
  border: 0.5px solid rgba(239,68,68,0.30);
  margin-bottom: 22px;
}
.pl-pulse {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: #ef4444;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(239,68,68, 0.7);
  animation: pl-pulse 1.6s ease-out infinite;
}
@keyframes pl-pulse {
  0% { box-shadow: 0 0 0 0 rgba(239,68,68, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(239,68,68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68, 0); }
}
.pl-banner-title { font-weight: 500; font-size: 13.5px; color: var(--fg); }
.pl-banner-sub { font-size: 11.5px; color: var(--fg-faint); margin-top: 1px; }

.pl-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 32px;
}
.pl-kpi {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--glass-fill-faint);
  border: 0.5px solid var(--hairline-soft);
}
.pl-kpi-label {
  font-size: 11px;
  color: var(--fg-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.pl-kpi-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.pl-kpi-delta { font-size: 11px; color: var(--fg-mute); }
.pl-kpi-amber .pl-kpi-value { color: oklch(0.65 0.16 65); }

.pl-cams {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}
.pl-cam {
  border-radius: 14px;
  overflow: hidden;
  border: 0.5px solid var(--hairline-soft);
  background: var(--glass-fill-faint);
}
.pl-cam-art {
  position: relative;
  aspect-ratio: 16/9;
  background: #0a0f1f;
  overflow: hidden;
}
.pl-cam-art svg { display: block; width: 100%; height: 100%; }
.pl-cam.offline .pl-cam-art { filter: saturate(0) brightness(0.55); }
.pl-cam-badge {
  position: absolute;
  top: 8px; left: 8px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px;
  border-radius: 5px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.pl-cam-badge.offline { background: rgba(0,0,0,0.85); color: #f87171; }
.pl-cam-ts {
  position: absolute;
  bottom: 8px; right: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 10px;
  font-family: var(--font-mono);
}
.pl-cam-label {
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg);
}

.pl-stream {
  background: var(--glass-fill-faint);
  border-radius: 14px;
  border: 0.5px solid var(--hairline-soft);
  padding: 4px 14px;
}
.pl-stream-row {
  display: grid;
  grid-template-columns: 50px 14px 1fr 90px;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 0.5px solid var(--hairline-soft);
  font-size: 12.5px;
}
.pl-stream-row:last-child { border-bottom: 0; }
.pl-stream-time { color: var(--fg-faint); font-size: 11.5px; }
.pl-stream-dot {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--brand-blue);
  display: inline-block;
  justify-self: center;
}
.pl-stream-delivery { background: #10b981; }
.pl-stream-milestone { background: var(--brand-blue); }
.pl-stream-alert    { background: #ef4444; }
.pl-stream-rfi      { background: #f59e0b; }
.pl-stream-msg { color: var(--fg); }
.pl-stream-who { color: var(--fg-faint); font-size: 11.5px; text-align: right; }

@media (max-width: 720px) {
  .pd-folders, .pl-cams { grid-template-columns: 1fr; }
  .pl-kpis { grid-template-columns: repeat(2, 1fr); }
  .pd-row { grid-template-columns: 56px 1fr; }
  .pd-row > :nth-child(n+3) { display: none; }
}


/* =========================================================================
 * TEAM TILES — built on top of .proj-tile / .proj-tile-body
 * ========================================================================= */
.team-tile {
  border-radius: var(--radius-l);
  overflow: hidden;
  position: relative;
  background: var(--surface);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 360px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.45),
    inset 0 -1px 0 rgba(15,23,42,0.04),
    0 1px 3px rgba(15,23,42,0.06),
    0 12px 32px -8px rgba(15,23,42,0.12),
    0 24px 60px rgba(15,23,42,0.10);
}
[data-theme="dark"] .team-tile {
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.20),
    inset 0 -1px 0 rgba(0,0,0,0.30),
    0 12px 32px -8px rgba(0,0,0,0.40),
    0 24px 60px rgba(0,0,0,0.30);
}
.team-tile:hover {
  transform: translateY(-3px);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.50),
    inset 0 -1px 0 rgba(15,23,42,0.04),
    0 1px 3px rgba(15,23,42,0.06),
    0 18px 40px -8px rgba(15,23,42,0.16),
    0 36px 80px rgba(15,23,42,0.14);
}

.team-tile-bg { position: absolute; inset: 0; z-index: 0; }
.team-tile-bg svg { display: block; width: 100%; height: 100%; }

.team-tile-spacer { height: 175px; flex: 0 0 auto; pointer-events: none; }

.team-tile-pulse {
  position: absolute;
  top: 14px; left: 14px; z-index: 3;
}
.team-tile-pulse .pill {
  background: rgba(255,255,255,0.85);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  border: 0.5px solid rgba(255,255,255,0.6);
  color: var(--fg);
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset, 0 4px 12px rgba(15,23,42,0.10);
  display: inline-flex; align-items: center; gap: 6px;
}
.team-pulse-dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: currentColor;
  display: inline-block;
}
[data-theme="dark"] .team-tile-pulse .pill {
  background: rgba(20,24,40,0.88);
  color: #ffffff;
  border-color: rgba(255,255,255,0.14);
}

.team-tile-more {
  position: absolute;
  top: 10px; right: 10px; z-index: 3;
}

/* Circular leader avatar overlapping the cover/body junction */
.team-tile-leader {
  position: absolute;
  top: 122px;
  left: 18px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
}
.team-leader-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0.02em;
  border: 3px solid rgba(255,255,255,0.95);
  box-shadow:
    0 4px 12px rgba(15,23,42,0.20),
    0 0 0 0.5px rgba(15,23,42,0.10);
  flex-shrink: 0;
}
[data-theme="dark"] .team-leader-avatar {
  border-color: rgba(28, 32, 50, 0.95);
  box-shadow: 0 4px 12px rgba(0,0,0,0.40);
}
.team-leader-text {
  background: rgba(255,255,255,0.85);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  padding: 6px 10px;
  border-radius: 9px;
  border: 0.5px solid rgba(255,255,255,0.6);
  box-shadow: 0 1px 0 rgba(255,255,255,0.5) inset, 0 4px 10px rgba(15,23,42,0.10);
  margin-bottom: 2px;
}
[data-theme="dark"] .team-leader-text {
  background: rgba(20,24,40,0.88);
  border-color: rgba(255,255,255,0.14);
  box-shadow: 0 1px 0 rgba(255,255,255,0.12) inset, 0 4px 10px rgba(0,0,0,0.35);
}
.team-leader-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.team-leader-role {
  font-size: 10.5px;
  color: var(--fg-mute);
  font-weight: 500;
  margin-top: 1px;
  white-space: nowrap;
}

/* The body uses .proj-tile-body for the glass; we just add stats */
.team-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px 0 4px;
  border-top: 0.5px solid rgba(10, 14, 26, 0.10);
  border-bottom: 0.5px solid rgba(10, 14, 26, 0.10);
  margin: 6px 0 4px;
}
[data-theme="dark"] .team-stats {
  border-top-color: rgba(255,255,255,0.10);
  border-bottom-color: rgba(255,255,255,0.10);
}
.team-stat-num {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.team-stat-label {
  font-size: 10px;
  color: var(--fg-faint);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 1px;
}

/* Reuse .proj-tile-body styles (glass etc) — clone .team-tile rules onto .proj-tile-body */
.team-tile .proj-tile-body { z-index: 2; flex: 1 1 auto; display: flex; flex-direction: column; }




/* =========================================================================
 * COLOR-CODED ENUM DROPDOWNS
 * Each enum value gets a color tone. The dropdown becomes a colored pill
 * with a status dot, matching the iOS 26 control-surface vibe.
 * ========================================================================= */
.pf-enum-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  border: 0.5px solid;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.005em;
  position: relative;
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
}
.pf-enum-dot {
  width: 7px; height: 7px;
  border-radius: 999px;
  background: currentColor;
  flex: 0 0 auto;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.5);
}
.pf-select-enum {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  font: inherit;
  color: inherit;
  font-weight: 600;
  padding: 0 18px 0 0;
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0 center;
  background-size: 10px 10px;
}
.pf-select-enum option {
  background: var(--bg-base);
  color: var(--fg);
  font-weight: 500;
}

/* Color tones — light mode + dark mode tweaks */
.pf-enum-blue   { background: oklch(0.62 var(--brand-c) var(--brand-h) / 0.14); border-color: oklch(0.62 var(--brand-c) var(--brand-h) / 0.32); color: oklch(0.42 0.20 var(--brand-h)); }
.pf-enum-green  { background: oklch(0.74 0.16 152 / 0.16); border-color: oklch(0.74 0.16 152 / 0.32); color: oklch(0.40 0.16 152); }
.pf-enum-amber  { background: oklch(0.84 0.14 75  / 0.20); border-color: oklch(0.84 0.14 75  / 0.34); color: oklch(0.46 0.16 60); }
.pf-enum-red    { background: oklch(0.66 0.20 25  / 0.16); border-color: oklch(0.66 0.20 25  / 0.32); color: oklch(0.42 0.20 25); }
.pf-enum-violet { background: oklch(0.62 0.22 295 / 0.16); border-color: oklch(0.62 0.22 295 / 0.32); color: oklch(0.42 0.22 295); }
.pf-enum-cyan   { background: oklch(0.78 0.13 220 / 0.18); border-color: oklch(0.78 0.13 220 / 0.34); color: oklch(0.40 0.16 220); }
.pf-enum-pink   { background: oklch(0.74 0.18 350 / 0.16); border-color: oklch(0.74 0.18 350 / 0.32); color: oklch(0.45 0.20 350); }
.pf-enum-slate  { background: oklch(0.55 0.04 260 / 0.14); border-color: oklch(0.55 0.04 260 / 0.30); color: oklch(0.32 0.04 260); }
.pf-enum-lime   { background: oklch(0.84 0.18 130 / 0.18); border-color: oklch(0.84 0.18 130 / 0.34); color: oklch(0.40 0.18 130); }
.pf-enum-gray   { background: oklch(0.65 0.01 260 / 0.14); border-color: oklch(0.65 0.01 260 / 0.28); color: oklch(0.32 0.01 260); }

/* Dark mode: brighter text, slightly brighter chips */
[data-theme="dark"] .pf-enum-blue   { background: oklch(0.62 var(--brand-c) var(--brand-h) / 0.22); color: oklch(0.85 0.16 var(--brand-h)); }
[data-theme="dark"] .pf-enum-green  { background: oklch(0.74 0.16 152 / 0.22); color: oklch(0.88 0.18 152); }
[data-theme="dark"] .pf-enum-amber  { background: oklch(0.84 0.14 75  / 0.26); color: oklch(0.90 0.18 75); }
[data-theme="dark"] .pf-enum-red    { background: oklch(0.66 0.20 25  / 0.24); color: oklch(0.85 0.20 25); }
[data-theme="dark"] .pf-enum-violet { background: oklch(0.62 0.22 295 / 0.24); color: oklch(0.85 0.20 295); }
[data-theme="dark"] .pf-enum-cyan   { background: oklch(0.78 0.13 220 / 0.24); color: oklch(0.88 0.16 220); }
[data-theme="dark"] .pf-enum-pink   { background: oklch(0.74 0.18 350 / 0.24); color: oklch(0.88 0.20 350); }
[data-theme="dark"] .pf-enum-slate  { background: oklch(0.55 0.04 260 / 0.22); color: oklch(0.85 0.04 260); }
[data-theme="dark"] .pf-enum-lime   { background: oklch(0.84 0.18 130 / 0.22); color: oklch(0.92 0.20 130); }
[data-theme="dark"] .pf-enum-gray   { background: oklch(0.65 0.01 260 / 0.22); color: oklch(0.85 0.01 260); }

[data-theme="dark"] .pf-enum-dot {
  box-shadow: 0 0 0 2px rgba(20,24,40,0.5);
}


/* =========================================================================
 * DOC FOLDER SUB-PEEK — center-peek for clicking a doc category from Docs tab
 * ========================================================================= */
.peek-backdrop.peek-sub {
  z-index: 220;
  background: rgba(8,12,28,0.32);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
[data-theme="dark"] .peek-backdrop.peek-sub { background: rgba(0,4,16,0.45); }

.peek-backdrop.peek-sub.peek-expanded {
  /* Promote sub-peek to fullscreen-within-content (still keeps sidebar visible) */
  z-index: 230;
  left: calc(248px + 18px + 20px);
  top: 16px;
  right: 18px;
  bottom: 18px;
  inset: auto;
}
.app.collapsed .peek-backdrop.peek-sub.peek-expanded {
  left: calc(76px + 18px + 20px);
}

.peek-crumb-active { font-weight: 600; color: var(--fg); }
.peek-crumb-sep { color: var(--fg-faint); margin: 0 4px; }

/* HERO */
.dfp-hero {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border-radius: 18px;
  border: 0.5px solid var(--hairline-soft);
  margin-bottom: 18px;
}
.dfp-hero-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: grid; place-items: center;
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.3) inset, 0 6px 16px rgba(0,0,0,0.14);
}
.dfp-hero-icon svg { width: 28px; height: 28px; }
.dfp-hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--fg);
}
.dfp-hero-meta {
  font-size: 12.5px;
  color: var(--fg-mute);
  margin-top: 2px;
}
.dfp-hero-actions { display: flex; gap: 8px; }

/* STATS */
.dfp-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}
.dfp-stat {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--glass-fill-faint);
  border: 0.5px solid var(--hairline-soft);
}
.dfp-stat-num {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--fg);
}
.dfp-stat-label {
  font-size: 11px;
  color: var(--fg-mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

/* TOOLBAR */
.dfp-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  align-items: center;
}

/* LIST */
.dfp-list {
  border-radius: 14px;
  background: var(--glass-fill-faint);
  border: 0.5px solid var(--hairline-soft);
  overflow: hidden;
}
.dfp-list-head {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 0.8fr 1.1fr 32px;
  gap: 12px;
  padding: 10px 16px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-faint);
  background: var(--glass-fill-faint);
  border-bottom: 0.5px solid var(--hairline-soft);
}
.dfp-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 0.8fr 1.1fr 32px;
  gap: 12px;
  align-items: center;
  padding: 10px 16px;
  font-size: 12.5px;
  color: var(--fg);
  border-bottom: 0.5px solid var(--hairline-soft);
  transition: background 0.15s;
}
.dfp-row:last-child { border-bottom: 0; }
.dfp-row:hover { background: var(--glass-fill); }
.dfp-row-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dfp-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--fg);
}
.dfp-cell { color: var(--fg-mute); }


/* =========================================================================
   PENDING TASKS PAGE
   ========================================================================= */

.ptask-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  margin-bottom: 28px;
  width: fit-content;
  max-width: 100%;
}
.ptask-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: none;
  background: transparent;
  font-family: var(--font-text);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-mute);
  cursor: pointer;
  transition: all 0.18s ease;
}
.ptask-filter:hover {
  color: var(--fg);
  background: var(--glass-fill);
}
.ptask-filter.active {
  background: var(--brand-blue);
  color: #fff;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.3) inset,
    0 6px 16px rgba(48, 110, 240, 0.35);
}
.ptask-filter-count {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(15,23,42,0.08);
  color: inherit;
  opacity: 0.75;
}
.ptask-filter.active .ptask-filter-count {
  background: rgba(255,255,255,0.22);
  opacity: 1;
}
[data-theme="dark"] .ptask-filter-count {
  background: rgba(255,255,255,0.10);
}

/* "Goals" filter pill — set apart from the standard quick-filters */
.ptask-filter-goals {
  background: linear-gradient(135deg,
    color-mix(in oklch, var(--accent-amber, #f59e0b) 18%, transparent),
    color-mix(in oklch, var(--accent-violet, #8b5cf6) 16%, transparent));
  border-color: color-mix(in oklch, var(--accent-amber, #f59e0b) 35%, var(--hairline));
  color: var(--fg);
}
.ptask-filter-goals::before {
  content: "◆";
  font-size: 10px;
  margin-right: 4px;
  color: var(--accent-amber, #f59e0b);
}
.ptask-filter-goals.active {
  background: linear-gradient(135deg, var(--accent-amber, #f59e0b), var(--accent-violet, #8b5cf6));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 18px color-mix(in oklch, var(--accent-amber, #f59e0b) 35%, transparent);
}
.ptask-filter-goals.active::before { color: #fff; }

/* Completed rows — subdued & struck-through */
.ptask-row-done { opacity: 0.78; }
.ptask-check-done {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: oklch(0.72 0.18 145 / 0.18);
  color: oklch(0.72 0.18 145);
  border: 1px solid oklch(0.72 0.18 145 / 0.4);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.ptask-title-done {
  text-decoration: line-through;
  text-decoration-color: var(--fg-faint);
  color: var(--fg-mute);
}
.ptask-pill-done {
  align-self: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: oklch(0.72 0.18 145 / 0.15);
  color: oklch(0.72 0.18 145);
}

/* Goals view — distinct color contrast (amber/violet) vs the blue task surfaces */
.goals-wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  border-radius: var(--radius-l, 18px);
  background:
    radial-gradient(900px 240px at 0% 0%, color-mix(in oklch, var(--accent-amber, #f59e0b) 10%, transparent), transparent 60%),
    radial-gradient(700px 200px at 100% 100%, color-mix(in oklch, var(--accent-violet, #8b5cf6) 10%, transparent), transparent 60%),
    var(--surface, var(--glass-fill));
  border: 0.5px solid color-mix(in oklch, var(--accent-amber, #f59e0b) 25%, var(--hairline));
}
.goals-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.goals-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}
.goals-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--fg-mute);
}
.goals-tabs {
  display: inline-flex;
  background: var(--glass-fill);
  border: 0.5px solid var(--hairline);
  padding: 3px;
  border-radius: 999px;
  gap: 2px;
}
.goals-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--fg-mute);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}
.goals-tab:hover { color: var(--fg); }
.goals-tab.active {
  background: linear-gradient(135deg, var(--accent-amber, #f59e0b), var(--accent-violet, #8b5cf6));
  color: #fff;
  box-shadow: 0 4px 12px color-mix(in oklch, var(--accent-amber, #f59e0b) 30%, transparent);
}
.goals-overview {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-m, 12px);
  background: color-mix(in oklch, var(--accent-amber, #f59e0b) 8%, var(--bg, #fff));
  border: 0.5px solid color-mix(in oklch, var(--accent-amber, #f59e0b) 30%, var(--hairline));
}
.goals-overview-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.goals-overview-label {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
}
.goals-overview-window {
  font-size: 12px;
  color: var(--fg-mute);
}
.goals-overview-pct {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-amber, #f59e0b);
  font-variant-numeric: tabular-nums;
}
.goals-overview-track {
  height: 6px;
  border-radius: 3px;
  background: color-mix(in oklch, var(--accent-amber, #f59e0b) 12%, transparent);
  overflow: hidden;
}
.goals-overview-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-amber, #f59e0b), var(--accent-violet, #8b5cf6));
  border-radius: 3px;
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

/* Lens grouping — Delivery / Commercial / Stewardship.
   Each lens has its own hue via --lens-hue (set inline). */
.goals-lenses {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.goals-lens {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-m, 12px);
  background: color-mix(in oklch, var(--lens-hue) 5%, var(--surface, #fff));
  border: 0.5px solid color-mix(in oklch, var(--lens-hue) 28%, var(--hairline));
  position: relative;
}
.goals-lens::before {
  content: "";
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 3px;
  background: var(--lens-hue);
  border-radius: 0 2px 2px 0;
}
.goals-lens-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 8px;
}
.goals-lens-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: color-mix(in oklch, var(--lens-hue) 18%, transparent);
  color: var(--lens-hue);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.goals-lens-text { flex: 1; min-width: 0; }
.goals-lens-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--fg);
  letter-spacing: -0.005em;
}
.goals-lens-sub {
  margin: 1px 0 0;
  font-size: 11px;
  color: var(--fg-mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.goals-lens-count {
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--lens-hue);
  background: color-mix(in oklch, var(--lens-hue) 14%, transparent);
  padding: 3px 9px;
  border-radius: 999px;
}
.goals-lens-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

/* KRA chip + hygiene de-emphasis + focus highlight */
.goal-card-kra {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: color-mix(in oklch, var(--fg) 8%, transparent);
  color: var(--fg-mute);
  margin-right: 6px;
}
.goal-card-dot { color: var(--fg-faint); margin-right: 6px; }

.goal-card-focus {
  box-shadow:
    0 0 0 1px color-mix(in oklch, var(--lens-hue, var(--brand-blue)) 35%, transparent),
    0 8px 22px color-mix(in oklch, var(--lens-hue, var(--brand-blue)) 12%, transparent);
}
.goal-card-focus .goal-card-title::before {
  content: "★";
  font-size: 10px;
  color: var(--lens-hue, var(--accent-amber, #f59e0b));
  margin-right: 6px;
  vertical-align: 1px;
}

.goal-card-hygiene {
  opacity: 0.78;
  background: color-mix(in oklch, var(--fg-faint) 4%, var(--surface, #fff));
}
.goal-card-hygiene .goal-card-title { color: var(--fg-mute); font-weight: 500; }
.goal-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-m, 12px);
  background: var(--surface, #fff);
  border: 0.5px solid var(--hairline);
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s;
}
.goal-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.08);
}
.goal-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.goal-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.3;
}
.goal-card-pct {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--fg-mute);
}
.goal-card-track {
  height: 5px;
  border-radius: 3px;
  background: color-mix(in oklch, var(--fg-faint) 18%, transparent);
  overflow: hidden;
}
.goal-card-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.goal-card-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--fg-mute);
}
.goal-card-metric {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.goal-card-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
}
.goal-card-unit { color: var(--fg-mute); font-weight: 500; }
.goal-card-sep  { color: var(--fg-faint); }

.goal-card-done {
  border-color: color-mix(in oklch, oklch(0.72 0.18 145) 40%, var(--hairline));
  background: color-mix(in oklch, oklch(0.72 0.18 145) 6%, var(--surface, #fff));
}
.goal-card-done .goal-card-bar { background: linear-gradient(90deg, oklch(0.72 0.18 145), oklch(0.78 0.16 165)); }
.goal-card-done .goal-card-pct { color: oklch(0.62 0.18 145); }

.goal-card-ok {
  border-color: color-mix(in oklch, var(--accent-amber, #f59e0b) 30%, var(--hairline));
}
.goal-card-ok .goal-card-bar { background: linear-gradient(90deg, var(--accent-amber, #f59e0b), oklch(0.78 0.16 60)); }
.goal-card-ok .goal-card-pct { color: var(--accent-amber, #f59e0b); }

.goal-card-risk {
  border-color: color-mix(in oklch, var(--status-red, #dc2626) 35%, var(--hairline));
  background: color-mix(in oklch, var(--status-red, #dc2626) 5%, var(--surface, #fff));
}
.goal-card-risk .goal-card-bar { background: linear-gradient(90deg, var(--status-red, #dc2626), oklch(0.68 0.20 30)); }
.goal-card-risk .goal-card-pct { color: var(--status-red, #dc2626); }

.ptask-groups {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.ptask-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 0 4px;
}
.ptask-group-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.ptask-group-label {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--fg);
}
.ptask-group-count {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--glass-fill);
  color: var(--fg-mute);
}

.ptask-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ptask-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ptask-row:hover {
  transform: translateX(2px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.55) inset,
    0 8px 22px rgba(15,23,42,0.10);
}
[data-theme="dark"] .ptask-row:hover {
  box-shadow:
    0 1px 0 rgba(255,255,255,0.10) inset,
    0 8px 22px rgba(0,0,0,0.40);
}

.ptask-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--fg-mute);
  background: transparent;
  cursor: pointer;
  display: grid; place-items: center;
  transition: all 0.18s ease;
  flex-shrink: 0;
}
.ptask-check:hover {
  border-color: var(--brand-blue);
  background: oklch(0.62 var(--brand-c) var(--brand-h) / 0.08);
}
.ptask-check-inner {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: transparent;
  transition: all 0.18s ease;
}
.ptask-check:hover .ptask-check-inner {
  background: var(--brand-blue);
}

.ptask-body {
  min-width: 0;
}
.ptask-title {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.005em;
  line-height: 1.35;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ptask-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--fg-mute);
  flex-wrap: wrap;
}
.ptask-dot { opacity: 0.5; }
.ptask-tag {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--fg-faint);
}

.ptask-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.ptask-priority {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}
.ptask-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, oklch(0.65 0.16 var(--brand-h)), oklch(0.55 0.18 calc(var(--brand-h) + 20)));
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 2px var(--bg-base);
}
.ptask-time {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-mute);
  font-variant-numeric: tabular-nums;
  min-width: 50px;
  text-align: right;
}


/* ===== Pending Tasks · row clickability + inline milestone progress ===== */
.ptask-row[role="button"] {
  cursor: pointer;
  user-select: none;
}
.ptask-row[role="button"]:focus-visible {
  outline: 2px solid oklch(0.62 var(--brand-c) var(--brand-h) / 0.55);
  outline-offset: 2px;
}

/* Mini milestone progress bar — sits left of the priority pill */
.ptask-mini-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  cursor: default;
}
.ptask-mini-progress-track {
  display: flex;
  width: 88px;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.08);
  gap: 1.5px;
  padding: 0;
}
[data-theme="dark"] .ptask-mini-progress-track {
  background: rgba(255, 255, 255, 0.07);
}
.ptask-mini-progress-seg {
  display: block;
  height: 100%;
  background: rgba(15, 23, 42, 0.10);
  transition: background 0.18s ease;
}
[data-theme="dark"] .ptask-mini-progress-seg {
  background: rgba(255, 255, 255, 0.10);
}
.ptask-mini-progress-seg.done {
  background: linear-gradient(135deg, #4ade80, #059669);
}
.ptask-mini-progress-label {
  font-size: 11px;
  color: var(--fg-mute);
  font-weight: 500;
  min-width: 26px;
  text-align: right;
}

/* ===== Pending Tasks · sub-view styles ===== */

.approval-type-pill {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.approval-action {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: none;
  background: var(--glass-fill);
  cursor: pointer;
  display: grid; place-items: center;
  color: var(--fg-mute);
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.approval-action:hover { background: var(--glass-fill-strong); color: var(--fg); }
.approval-action.approve:hover { color: oklch(0.55 0.18 145); background: oklch(0.55 0.18 145 / 0.12); }
.approval-action.reject:hover  { color: oklch(0.62 0.21 28);  background: oklch(0.62 0.21 28 / 0.12); }

/* ===== PING ===== */
.ping-wrap { display: flex; flex-direction: column; gap: 28px; }
.ping-section { display: flex; flex-direction: column; gap: 12px; }

.ping-contacts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.ping-contact {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 12px 16px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ping-contact:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.55) inset, 0 10px 24px rgba(15,23,42,0.10);
}
[data-theme="dark"] .ping-contact:hover {
  box-shadow: 0 1px 0 rgba(255,255,255,0.10) inset, 0 10px 24px rgba(0,0,0,0.40);
}
.ping-avatar-wrap {
  position: relative;
  margin-bottom: 4px;
}
.ping-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, oklch(0.65 0.16 var(--brand-h)), oklch(0.55 0.18 calc(var(--brand-h) + 20)));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  display: grid; place-items: center;
}
.ping-status-dot {
  position: absolute;
  bottom: 0; right: 0;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg-base);
}
.ping-contact-name {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.005em;
  text-align: center;
}
.ping-contact-role {
  font-size: 11.5px;
  color: var(--fg-mute);
  text-align: center;
}
.ping-unread {
  position: absolute;
  top: 12px; right: 12px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: oklch(0.62 0.21 28);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--bg-base);
}

.ping-conv-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: oklch(0.62 0.16 240 / 0.15);
  color: oklch(0.55 0.18 245);
  display: grid; place-items: center;
  flex-shrink: 0;
}
[data-theme="dark"] .ping-conv-icon {
  background: oklch(0.62 0.16 240 / 0.22);
  color: oklch(0.78 0.14 245);
}
.ping-conv-project {
  font-weight: 600;
  color: var(--fg);
}

/* ===== RFI ===== */
.rfi-wrap { display: flex; flex-direction: column; }
.rfi-project-group { margin-bottom: 18px; }
.rfi-project-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: 0.01em;
  margin: 14px 4px 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
  color: var(--fg-mute);
}
.rfi-ref {
  font-family: var(--font-mono, ui-monospace, "SF Mono", monospace);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 6px 10px;
  border-radius: 7px;
  background: oklch(0.62 0.16 240 / 0.14);
  color: oklch(0.45 0.18 245);
  white-space: nowrap;
  flex-shrink: 0;
}
[data-theme="dark"] .rfi-ref {
  background: oklch(0.62 0.16 240 / 0.22);
  color: oklch(0.82 0.13 240);
}


/* ===== SCHEDULE / GANTT ===== */
.sched-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 16px;
  margin-bottom: 16px;
  align-items: center;
}
.sched-filter-mini {
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  border: none;
  background: var(--glass-fill);
  color: var(--fg-mute);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sched-filter-mini:hover { color: var(--fg); background: var(--glass-fill-strong); }
.sched-filter-divider {
  width: 1px; height: 22px;
  background: var(--glass-edge);
  margin: 0 4px;
}
.sched-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  background: var(--glass-fill);
  color: var(--fg-mute);
  font-family: var(--font-text);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
}
.sched-filter:hover { color: var(--fg); }
.sched-filter.on { font-weight: 600; }
.sched-filter-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sched-filter-count {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(15,23,42,0.06);
  color: inherit;
  opacity: 0.7;
}
[data-theme="dark"] .sched-filter-count { background: rgba(255,255,255,0.10); }

.sched-gantt {
  border-radius: 18px;
  overflow: auto;
  max-height: calc(100vh - 280px);
  padding: 0;
}
.sched-gantt-inner { display: flex; flex-direction: column; }

.sched-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--glass-edge);
  min-height: 40px;
  position: relative;
}
.sched-row-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--glass-fill-strong);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  backdrop-filter: blur(28px) saturate(1.6);
  min-height: 44px;
  font-weight: 600;
}
.sched-row-label {
  width: 220px;
  flex-shrink: 0;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--fg);
  border-right: 1px solid var(--glass-edge);
  background: var(--glass-fill);
  position: sticky;
  left: 0;
  z-index: 4;
}
.sched-row-head .sched-row-label {
  background: var(--glass-fill-strong);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-mute);
}

.sched-row-project { background: color-mix(in oklch, var(--bg-base), transparent 40%); min-height: 36px; }
.sched-row-project-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.005em;
}
.sched-row-count {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--glass-fill);
  color: var(--fg-mute);
  margin-left: auto;
}

.sched-row-task-label {
  flex-direction: column;
  align-items: flex-start !important;
  gap: 2px;
  padding: 8px 14px 8px 28px;
}
.sched-row-task-name {
  font-size: 12.5px;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.sched-row-task-meta {
  font-size: 10.5px;
  color: var(--fg-mute);
  letter-spacing: 0.02em;
}

.sched-timeline {
  position: relative;
  flex: 0 0 auto;
  background-image: linear-gradient(90deg, var(--glass-edge) 1px, transparent 1px);
  background-size: 14px 100%;
  background-position: 0 0;
}
.sched-row-head .sched-timeline { background: transparent; }
.sched-tick {
  position: absolute;
  top: 0; bottom: 0;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-mute);
  letter-spacing: 0.01em;
}
.sched-today {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: oklch(0.62 0.21 28);
  z-index: 3;
}
.sched-today span {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 10px;
  font-weight: 700;
  color: oklch(0.62 0.21 28);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.sched-today-line {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: oklch(0.62 0.21 28 / 0.35);
  z-index: 1;
  pointer-events: none;
}

.sched-bar {
  position: absolute;
  top: 8px;
  height: 24px;
  border-radius: 7px;
  cursor: grab;
  display: flex;
  align-items: center;
  padding: 0 10px;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.25) inset,
    0 4px 12px rgba(15,23,42,0.18);
  transition: filter 0.15s ease, transform 0.15s ease;
  user-select: none;
  z-index: 2;
}
.sched-bar:hover { filter: brightness(1.06); transform: translateY(-1px); }
.sched-bar:active { cursor: grabbing; }
.sched-bar-progress {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.20);
  pointer-events: none;
}
.sched-bar-label {
  position: relative;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
  z-index: 2;
}
.sched-bar-resize {
  position: absolute;
  top: 0; bottom: 0;
  width: 6px;
  cursor: ew-resize;
  z-index: 3;
}
.sched-bar-resize-l { left: 0; }
.sched-bar-resize-r { right: 0; }
.sched-bar-resize:hover { background: rgba(255,255,255,0.30); }

.sched-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--fg-mute);
  font-size: 13px;
}

/* Modal */
.sched-modal-bg {
  position: fixed; inset: 0;
  background: rgba(8, 12, 24, 0.45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: grid; place-items: center;
  z-index: 200;
}
.sched-modal {
  width: 480px;
  max-width: calc(100vw - 32px);
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
}
.sched-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--glass-edge);
}
.sched-modal-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}
.sched-modal-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sched-modal-foot {
  padding: 14px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--glass-edge);
}
.sched-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.sched-field span {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--fg-mute);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sched-field input[type="text"], .sched-field select {
  height: 36px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--glass-edge);
  background: var(--glass-fill);
  color: var(--fg);
  font-size: 13px;
  font-family: var(--font-text);
}
.sched-field input[type="text"]:focus, .sched-field select:focus {
  outline: 2px solid var(--brand-blue);
  outline-offset: 1px;
}
.sched-field-row { display: flex; gap: 14px; }


/* ===== CREDITS & USAGE ===== */
.credits-balance {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  margin-bottom: 32px;
}
.credits-balance-card {
  padding: 26px 28px;
  border-radius: 22px;
  position: relative;
  overflow: hidden;
}
.credits-balance-card::before {
  content: "";
  position: absolute;
  top: -40px; right: -40px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, oklch(0.62 var(--brand-c) var(--brand-h) / 0.18), transparent 70%);
  pointer-events: none;
}
.credits-balance-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: 10px;
}
.credits-balance-val {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--fg);
  margin-bottom: 4px;
}
.credits-balance-unit {
  font-size: 22px;
  font-weight: 500;
  color: oklch(0.62 0.21 28);
  letter-spacing: 0;
}
.credits-balance-meta {
  font-size: 13px;
  color: var(--fg-mute);
  margin-bottom: 18px;
}
.credits-balance-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--glass-edge);
  overflow: hidden;
  margin-bottom: 8px;
}
.credits-balance-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, oklch(0.62 0.18 var(--brand-h)), oklch(0.55 0.20 270));
  border-radius: 999px;
}
.credits-balance-foot {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--fg-mute);
}

.credits-quick-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.credits-stat {
  padding: 16px 18px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.credits-stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.credits-stat-val {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
  line-height: 1.1;
}
.credits-stat-meta {
  font-size: 11.5px;
  color: var(--fg-mute);
}

.credits-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin: 14px 4px 14px;
}
.credits-section-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
  margin: 0 0 4px;
}
.credits-section-sub {
  font-size: 13px;
  color: var(--fg-mute);
  margin: 0;
}

/* Pack cards */
.pack-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
@media (max-width: 1100px) {
  .pack-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .pack-grid { grid-template-columns: repeat(2, 1fr); }
}

.pack-card {
  position: relative;
  padding: 22px 20px 20px;
  border-radius: 18px;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1.5px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  font-family: var(--font-text);
}
.pack-card:hover {
  transform: translateY(-2px);
}
.pack-card.pack-selected {
  border-color: oklch(0.62 var(--brand-c) var(--brand-h));
  box-shadow:
    0 0 0 4px oklch(0.62 var(--brand-c) var(--brand-h) / 0.12),
    0 1px 0 rgba(255,255,255,0.55) inset,
    0 12px 32px rgba(15,23,42,0.14);
}
.pack-card.pack-popular {
  background: oklch(0.18 0.02 260);
  color: #fff;
  border-color: oklch(0.18 0.02 260);
}
[data-theme="dark"] .pack-card.pack-popular {
  background: #000;
  border-color: oklch(0.30 0.04 260);
}
.pack-card.pack-popular.pack-selected {
  border-color: oklch(0.62 var(--brand-c) var(--brand-h));
  box-shadow:
    0 0 0 4px oklch(0.62 var(--brand-c) var(--brand-h) / 0.20),
    0 12px 32px rgba(0,0,0,0.45);
}

.pack-popular-badge {
  position: absolute;
  top: 14px; right: 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: oklch(0.62 var(--brand-c) var(--brand-h));
  color: #fff;
}
.pack-check {
  position: absolute;
  top: 14px; left: 14px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: oklch(0.62 var(--brand-c) var(--brand-h));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
}
.pack-card.pack-popular .pack-check { background: oklch(0.62 var(--brand-c) var(--brand-h)); }

.pack-amt {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--font-display);
}
.pack-amt-num {
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: inherit;
}
.pack-amt-unit {
  font-size: 16px;
  font-weight: 500;
  color: oklch(0.62 0.21 28);
}
.pack-card.pack-popular .pack-amt-unit { color: oklch(0.72 0.22 32); }

.pack-price {
  font-size: 16px;
  font-weight: 500;
  color: inherit;
  opacity: 0.92;
}
.pack-card.pack-popular .pack-price { opacity: 0.82; }

.pack-divider {
  height: 1px;
  background: var(--glass-edge);
  margin: 4px 0;
}
.pack-card.pack-popular .pack-divider { background: rgba(255,255,255,0.12); }

.pack-meta {
  font-size: 13px;
  color: var(--fg-mute);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pack-card.pack-popular .pack-meta { color: rgba(255,255,255,0.78); }

/* Finalize bar */
.pack-finalize {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  border-radius: 16px;
  margin-bottom: 18px;
}
.pack-finalize-info { display: flex; flex-direction: column; gap: 4px; }
.pack-finalize-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.pack-finalize-val {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.005em;
  display: flex;
  gap: 6px;
  align-items: baseline;
  flex-wrap: wrap;
}
.pack-finalize-gst {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-mute);
  margin-left: 4px;
}
.pack-finalize-btn {
  height: 44px;
  padding: 0 22px;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Usage history */
.credits-history {
  border-radius: 16px;
  overflow: hidden;
}
.credits-history-head {
  display: grid;
  grid-template-columns: 140px 1fr 100px 120px;
  padding: 12px 18px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-mute);
  border-bottom: 1px solid var(--glass-edge);
  background: var(--glass-fill);
}
.credits-history-row {
  display: grid;
  grid-template-columns: 140px 1fr 100px 120px;
  padding: 14px 18px;
  font-size: 13px;
  border-bottom: 1px solid var(--glass-edge);
  align-items: center;
}
.credits-history-row:last-child { border-bottom: none; }
.credits-history-date {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  color: var(--fg-mute);
}
.credits-history-item { color: var(--fg); }
.credits-history-amt.pos { color: oklch(0.55 0.18 145); font-weight: 600; }
.credits-history-amt.neg { color: var(--fg); }

/* CHECKOUT MODAL */
.checkout-bg {
  position: fixed; inset: 0;
  background: rgba(8, 12, 24, 0.55);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  display: grid; place-items: center;
  z-index: 300;
  animation: peekFadeIn 0.18s ease;
}
.checkout-shell {
  width: 540px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 60px);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.checkout-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--glass-edge);
}
.checkout-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: oklch(0.62 var(--brand-c) var(--brand-h));
  margin-bottom: 4px;
}
.checkout-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}
.checkout-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.checkout-summary {
  background: var(--glass-fill);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 22px;
}
.checkout-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 6px 0;
  font-size: 13.5px;
  color: var(--fg);
}
.checkout-line.muted { color: var(--fg-mute); }
.checkout-line-label { font-weight: 600; }
.checkout-line-meta {
  font-size: 11.5px;
  color: var(--fg-mute);
  margin-top: 2px;
}
.checkout-divider {
  height: 1px;
  background: var(--glass-edge);
  margin: 8px 0;
}
.checkout-total {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}

.checkout-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin: 0 0 10px;
}
.checkout-methods {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.checkout-method {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--glass-edge);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-text);
  transition: all 0.15s ease;
}
.checkout-method:hover { background: var(--glass-fill); }
.checkout-method.on {
  border-color: oklch(0.62 var(--brand-c) var(--brand-h));
  background: oklch(0.62 var(--brand-c) var(--brand-h) / 0.08);
}
.checkout-method-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--glass-fill);
  color: var(--fg);
  display: grid; place-items: center;
}
.checkout-method.on .checkout-method-icon {
  background: oklch(0.62 var(--brand-c) var(--brand-h) / 0.16);
  color: oklch(0.55 0.20 var(--brand-h));
}
.checkout-method-text { flex: 1; }
.checkout-method-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg);
}
.checkout-method-sub {
  font-size: 11.5px;
  color: var(--fg-mute);
  margin-top: 1px;
}
.checkout-method-radio {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--glass-edge);
  position: relative;
}
.checkout-method-radio.on {
  border-color: oklch(0.62 var(--brand-c) var(--brand-h));
}
.checkout-method-radio.on::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: oklch(0.62 var(--brand-c) var(--brand-h));
}

.checkout-card-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 0 4px;
  border-top: 1px solid var(--glass-edge);
  margin-bottom: 18px;
}

.checkout-secure {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--glass-fill);
  border-radius: 10px;
  font-size: 11.5px;
  color: var(--fg-mute);
}
.checkout-lock {
  color: oklch(0.55 0.18 145);
  display: inline-flex;
}

.checkout-foot {
  padding: 16px 24px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--glass-edge);
  background: var(--glass-fill);
}
.checkout-pay {
  height: 44px;
  padding: 0 22px;
  font-size: 14px;
  font-weight: 600;
}

.checkout-state {
  padding: 50px 30px 40px;
  text-align: center;
}
.checkout-state h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin: 14px 0 6px;
}
.checkout-state p {
  font-size: 13.5px;
  color: var(--fg-mute);
  margin: 0 0 20px;
}
.checkout-spinner {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 3px solid var(--glass-edge);
  border-top-color: oklch(0.62 var(--brand-c) var(--brand-h));
  margin: 0 auto;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.checkout-success {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: oklch(0.55 0.18 145 / 0.16);
  color: oklch(0.50 0.18 145);
  margin: 0 auto;
  display: grid;
  place-items: center;
  font-size: 28px;
}

@media (max-width: 900px) {
  .credits-balance { grid-template-columns: 1fr; }
}


/* =========================================================================
   PROFILE / SETTINGS PAGE
   ========================================================================= */

.prof-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 80px;
  max-width: 1080px;
  margin: 0 auto;
  width: 100%;
}

.prof-section {
  padding: 26px 28px;
  border-radius: var(--radius-l);
}
.prof-section-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 0.5px solid var(--hairline-soft);
}
.prof-section-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--fg);
}
.prof-section-sub {
  font-size: 13px;
  color: var(--fg-mute);
  margin: 4px 0 0;
  line-height: 1.5;
  text-wrap: pretty;
  max-width: 720px;
}
.prof-section-body {
  display: flex;
  flex-direction: column;
}

/* Row */
.prof-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 1.4fr);
  gap: 32px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 0.5px solid var(--hairline-soft);
}
.prof-row:last-child { border-bottom: 0; }
.prof-row-label { padding-top: 6px; }
.prof-row-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 4px;
}
.prof-row-hint {
  font-size: 12px;
  color: var(--fg-mute);
  line-height: 1.45;
  text-wrap: pretty;
}
.prof-row-control {
  display: flex;
  align-items: center;
  min-width: 0;
}

/* Inputs */
.prof-input {
  width: 100%;
  background: var(--glass-fill-faint);
  border: 0.5px solid var(--hairline);
  color: var(--fg);
  font: 500 13.5px var(--font-text);
  padding: 10px 14px;
  border-radius: 12px;
  outline: 0;
  transition: border-color 0.15s, background 0.15s;
}
.prof-input:focus {
  border-color: var(--brand-blue);
  background: var(--glass-fill);
  box-shadow: 0 0 0 4px oklch(0.62 var(--brand-c) var(--brand-h) / 0.12);
}
select.prof-input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--fg-mute) 50%),
                    linear-gradient(135deg, var(--fg-mute) 50%, transparent 50%);
  background-position: calc(100% - 16px) center, calc(100% - 11px) center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.prof-pwd-row {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
}
.prof-pwd-row .prof-input { flex: 1; font-family: var(--font-mono); letter-spacing: 0.06em; }

/* Avatar */
.prof-avatar-row {
  display: flex;
  gap: 16px;
  align-items: center;
}
.prof-avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.55), transparent 45%),
    linear-gradient(135deg, var(--accent-amber), var(--brand-blue));
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(15,23,42,0.18);
}
.prof-avatar-actions {
  display: flex;
  gap: 8px;
}

/* Switch */
.prof-switch {
  appearance: none;
  border: 0;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: var(--glass-fill-faint);
  border: 0.5px solid var(--hairline);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.prof-switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.20), 0 1px 0 rgba(0,0,0,0.08);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
[data-theme="dark"] .prof-switch-knob { background: oklch(0.92 0.005 260); }
.prof-switch.on {
  background: linear-gradient(180deg, var(--brand-blue), var(--brand-blue-deep));
  border-color: transparent;
}
.prof-switch.on .prof-switch-knob { transform: translateX(18px); }

.prof-toggle-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  font-size: 13.5px;
  color: var(--fg);
}

/* Segmented */
.prof-seg {
  display: inline-flex;
  background: var(--glass-fill-faint);
  border: 0.5px solid var(--hairline);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.prof-seg-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--fg-mute);
  font: 500 12.5px var(--font-text);
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.prof-seg-btn:hover { color: var(--fg); }
.prof-seg-btn.active {
  background: var(--glass-fill-strong);
  color: var(--fg);
  box-shadow:
    inset 0 1px 0 var(--glass-rim-top),
    0 1px 2px rgba(15,23,42,0.06);
}

/* Theme swatches */
.prof-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 4px 0;
}
.prof-swatch {
  appearance: none;
  border: 0.5px solid var(--hairline);
  background: var(--glass-fill-faint);
  border-radius: 14px;
  padding: 10px 14px 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s;
  font: 500 12.5px var(--font-text);
  color: var(--fg);
}
.prof-swatch:hover { background: var(--glass-fill); }
.prof-swatch.active {
  border-color: var(--brand-blue);
  background: var(--glass-fill);
  box-shadow: 0 0 0 3px oklch(0.62 var(--brand-c) var(--brand-h) / 0.18);
}
.prof-swatch-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.4),
    0 1px 3px rgba(0,0,0,0.15);
}

/* Buttons specific to profile */
.btn-ghost-line {
  appearance: none;
  border: 0.5px solid var(--hairline);
  background: transparent;
  color: var(--fg-mute);
  font: 500 13px var(--font-text);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  height: 36px;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s;
}
.btn-ghost-line:hover { color: var(--fg); border-color: var(--fg-mute); }

.btn-danger {
  appearance: none;
  border: 0;
  background: oklch(0.55 0.20 25);
  color: #fff;
  font: 500 13px var(--font-text);
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  height: 36px;
  display: inline-flex;
  align-items: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.20),
    0 4px 10px oklch(0.55 0.20 25 / 0.30);
  transition: filter 0.15s;
}
.btn-danger:hover { filter: brightness(1.08); }
.btn-danger-ghost {
  appearance: none;
  border: 0.5px solid oklch(0.55 0.20 25 / 0.40);
  background: oklch(0.55 0.20 25 / 0.08);
  color: oklch(0.55 0.20 25);
  font: 500 13px var(--font-text);
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  height: 36px;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s;
}
[data-theme="dark"] .btn-danger-ghost { color: oklch(0.78 0.18 25); border-color: oklch(0.55 0.20 25 / 0.55); }
.btn-danger-ghost:hover { background: oklch(0.55 0.20 25 / 0.15); }

/* Save bar */
.prof-save-bar {
  position: sticky;
  bottom: 16px;
  margin-top: 12px;
  padding: 14px 22px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 5;
}
.prof-save-status {
  font-size: 12.5px;
  color: var(--fg-mute);
}
.prof-save-actions {
  display: flex;
  gap: 10px;
}

@media (max-width: 760px) {
  .prof-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .prof-section { padding: 22px 20px; }
}


/* =========================================================================
 * TEAM PEEK — tabs (Tasks · Timeline · Workload · Box · Activity)
 * ========================================================================= */
.tp-cover { background-size: cover; }
.tp-body .peek-eyebrow { letter-spacing: 0.08em; }

.tp-tab {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.tp-eyebrow { display: flex; flex-direction: column; gap: 4px; }
.tp-tab-title {
  margin: 0;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.tp-tab-sub {
  margin: 0;
  font-size: 13.5px;
  color: var(--fg-mute);
  max-width: 70ch;
  text-wrap: pretty;
}

.tp-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tp-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 0.5px solid var(--hairline);
  background: var(--glass-fill-faint);
  font-size: 13px;
  color: var(--fg-mute);
  flex: 1 1 220px;
  max-width: 320px;
}
.tp-chip {
  appearance: none;
  border: 0.5px solid var(--hairline);
  background: var(--glass-fill-faint);
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--fg-mute);
  cursor: pointer;
}
.tp-chip.active {
  background: var(--brand-blue, #3b82f6);
  color: white;
  border-color: transparent;
}

/* Tasks table */
.tp-table {
  border: 0.5px solid var(--hairline);
  border-radius: 14px;
  overflow: hidden;
  background: var(--glass-fill-faint);
}
.tp-thead, .tp-trow {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  font-size: 12.5px;
}
.tp-thead {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-mute);
  background: rgba(0,0,0,0.02);
  border-bottom: 0.5px solid var(--hairline);
}
[data-theme="dark"] .tp-thead { background: rgba(255,255,255,0.03); }
.tp-trow + .tp-trow { border-top: 0.5px solid var(--hairline-soft); }
.tp-trow:hover { background: rgba(0,0,0,0.025); }
[data-theme="dark"] .tp-trow:hover { background: rgba(255,255,255,0.04); }
.tp-trow.tp-trow-open {
  background: rgba(59,130,246,0.06);
  border-bottom: 0.5px solid var(--hairline);
}
[data-theme="dark"] .tp-trow.tp-trow-open { background: rgba(96,165,250,0.10); }
.tp-row-caret {
  font-size: 10px;
  color: var(--fg-faint);
  width: 12px;
  display: inline-block;
  text-align: center;
}

/* Expanded task detail row */
.tp-trow-detail {
  border-top: 0.5px solid var(--hairline-soft);
  border-bottom: 0.5px solid var(--hairline-soft);
  background: var(--glass-fill-faint);
  padding: 22px 28px 26px;
  animation: tpDetailIn 0.22s ease-out;
}
@keyframes tpDetailIn {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tp-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 32px;
  align-items: start;
}
.tp-detail-eyebrow {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--fg-mute);
  margin-bottom: 8px;
}
.tp-detail-desc {
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg);
  margin: 0;
  text-wrap: pretty;
}
.tp-ms-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.tp-ms-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--fg);
}
.tp-ms-item.tp-ms-done .tp-ms-label {
  color: var(--fg-mute);
  text-decoration: line-through;
  text-decoration-color: var(--fg-faint);
}
.tp-ms-check {
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1.2px solid var(--hairline);
  background: var(--surface);
  display: grid; place-items: center;
  cursor: pointer;
  color: #fff;
  flex: none;
  transition: background 0.15s, border-color 0.15s;
}
.tp-ms-check svg { width: 12px; height: 12px; }
.tp-ms-check.on {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
}
.tp-ms-check:hover { border-color: var(--brand-blue); }

.tp-detail-side {
  background: var(--surface);
  border: 0.5px solid var(--hairline-soft);
  border-radius: 10px;
  padding: 16px;
}
[data-theme="dark"] .tp-detail-side { background: rgba(255,255,255,0.03); }
.tp-detail-time {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.tp-detail-time-num {
  font-size: 28px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1;
}
.tp-detail-time-unit {
  font-size: 13px;
  color: var(--fg-mute);
}
.tp-detail-time-meta {
  font-size: 11px;
  color: var(--fg-faint);
  margin-top: 4px;
}
.tp-cell { color: var(--fg); }
.tp-cell-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 540;
}
.tp-check {
  width: 14px; height: 14px; border-radius: 4px;
  border: 1.2px solid var(--hairline);
  flex: none;
}
.tp-owner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tp-owner-name { font-size: 11.5px; color: var(--fg-mute); }
.tp-stars { color: var(--hairline); letter-spacing: 1px; font-size: 13px; }
.tp-star.on { color: #f59e0b; }

.tp-progress { display: flex; align-items: center; gap: 8px; }
.tp-progress-bar {
  flex: 1;
  height: 5px;
  background: var(--hairline);
  border-radius: 999px;
  overflow: hidden;
}
.tp-progress-bar-sm { height: 4px; }
.tp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, oklch(0.62 0.18 240), oklch(0.55 0.20 260));
  border-radius: 999px;
}
.tp-progress-num { font-size: 11.5px; color: var(--fg-mute); min-width: 30px; text-align: right; }
.tp-attach {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--fg-mute);
}
.tp-attach svg { width: 14px; height: 14px; }

.tp-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tp-meta-card {
  border: 0.5px solid var(--hairline);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--glass-fill-faint);
}
.tp-meta-card-title { font-weight: 600; font-size: 13.5px; margin-bottom: 4px; }
.tp-meta-card p { margin: 0; font-size: 12.5px; color: var(--fg-mute); text-wrap: pretty; }

/* Timeline */
.tp-tl {
  border: 0.5px solid var(--hairline);
  border-radius: 14px;
  overflow: hidden;
  background: var(--glass-fill-faint);
}
.tp-tl-head, .tp-tl-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  align-items: stretch;
}
.tp-tl-head {
  border-bottom: 0.5px solid var(--hairline);
  background: rgba(0,0,0,0.02);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-mute);
}
[data-theme="dark"] .tp-tl-head { background: rgba(255,255,255,0.03); }
.tp-tl-head-l { padding: 10px 14px; }
.tp-tl-head-r { display: grid; grid-template-columns: repeat(8, 1fr); }
.tp-tl-month {
  padding: 10px 8px;
  border-left: 0.5px solid var(--hairline-soft);
  text-align: center;
}
.tp-tl-row + .tp-tl-row { border-top: 0.5px solid var(--hairline-soft); }
.tp-tl-row-l {
  padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px;
  border-right: 0.5px solid var(--hairline-soft);
}
.tp-tl-row-name { font-weight: 530; }
.tp-tl-row-r {
  position: relative;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  height: 44px;
}
.tp-tl-grid { border-left: 0.5px solid var(--hairline-soft); }
.tp-tl-bar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 24px;
  border-radius: 8px;
  display: flex; align-items: center;
  padding: 0 10px;
  font-size: 11px;
  color: white;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.18);
}
.tp-tl-bar-blue   { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.tp-tl-bar-amber  { background: linear-gradient(135deg, #fbbf24, #d97706); }
.tp-tl-bar-violet { background: linear-gradient(135deg, #c084fc, #7e22ce); }
.tp-tl-bar-green  { background: linear-gradient(135deg, #4ade80, #047857); }
.tp-tl-bar-cyan   { background: linear-gradient(135deg, #67e8f9, #0e7490); }
.tp-tl-bar-red    { background: linear-gradient(135deg, #fca5a5, #b91c1c); }
.tp-tl-bar-slate  { background: linear-gradient(135deg, #94a3b8, #475569); }
.tp-tl-bar-label { overflow: hidden; text-overflow: ellipsis; }

/* Workload */
.tp-wl {
  border: 0.5px solid var(--hairline);
  border-radius: 14px;
  overflow: hidden;
  background: var(--glass-fill-faint);
}
.tp-wl-row {
  display: grid;
  grid-template-columns: 220px 1fr 80px 100px;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
}
.tp-wl-row + .tp-wl-row { border-top: 0.5px solid var(--hairline-soft); }
.tp-wl-person { display: flex; align-items: center; gap: 10px; }
.tp-wl-name { font-size: 13px; font-weight: 560; }
.tp-wl-role { font-size: 11.5px; color: var(--fg-mute); }
.tp-wl-meter { display: flex; flex-direction: column; gap: 5px; }
.tp-wl-meter-track {
  position: relative;
  height: 8px;
  background: var(--hairline);
  border-radius: 999px;
  overflow: visible;
}
.tp-wl-meter-fill {
  height: 100%;
  border-radius: 999px;
  position: relative;
  z-index: 1;
}
.tp-wl-fill-blue  { background: linear-gradient(90deg, #60a5fa, #2563eb); }
.tp-wl-fill-green { background: linear-gradient(90deg, #4ade80, #059669); }
.tp-wl-fill-amber { background: linear-gradient(90deg, #fbbf24, #d97706); }
.tp-wl-fill-red   { background: linear-gradient(90deg, #fca5a5, #dc2626); }
.tp-wl-meter-over {
  position: absolute;
  top: 0;
  left: 100%;
  height: 100%;
  background: repeating-linear-gradient(135deg, #ef4444 0 4px, #b91c1c 4px 8px);
  border-radius: 0 999px 999px 0;
  z-index: 2;
}
.tp-wl-meter-cap {
  position: absolute;
  right: 0;
  top: -3px;
  width: 2px;
  height: 14px;
  background: var(--fg-faint);
  z-index: 3;
}
.tp-wl-meter-meta {
  display: flex; justify-content: space-between;
  font-size: 11.5px;
  color: var(--fg-mute);
}
.tp-wl-pct-blue   { color: #2563eb; }
.tp-wl-pct-green  { color: #059669; }
.tp-wl-pct-amber  { color: #d97706; }
.tp-wl-pct-red    { color: #dc2626; font-weight: 600; }
.tp-wl-points { font-size: 13px; font-weight: 600; text-align: center; }

/* ─── Workload · Card grid (new design) ───────────────────────────────────── */
.tp-wl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  align-items: start;
}

.tp-wl-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 16px 18px;
  border-radius: 16px;
  border: 0.5px solid var(--hairline);
  background: var(--glass-fill);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 6px 18px rgba(15,23,42,0.06);
}
[data-theme="dark"] .tp-wl-card {
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 6px 18px rgba(0,0,0,0.30);
}

.tp-wl-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tp-wl-card-person {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.tp-wl-card-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tp-wl-card-toggle {
  width: 26px; height: 26px;
  border: 0; background: transparent;
  border-radius: 8px;
  color: var(--fg-mute);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background 0.15s, color 0.15s;
}
.tp-wl-card-toggle:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--fg);
}
[data-theme="dark"] .tp-wl-card-toggle:hover { background: rgba(255,255,255,0.08); }

/* Counts row + donut */
.tp-wl-card-counts {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
  gap: 12px;
}
.tp-wl-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tp-wl-stat-num {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg);
  line-height: 1.05;
}
.tp-wl-stat-lbl {
  font-size: 11.5px;
  color: var(--fg-mute);
  font-weight: 500;
}

/* Donut */
.tp-wl-donut {
  position: relative;
  display: inline-grid;
  place-items: center;
  color: var(--fg-faint);
}
.tp-wl-donut-label {
  position: absolute;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--fg);
}

/* Segmented progress bar */
.tp-wl-seg {
  display: flex;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.06);
}
[data-theme="dark"] .tp-wl-seg { background: rgba(255,255,255,0.06); }
.tp-wl-seg-piece { display: block; height: 100%; }
.tp-wl-seg-ready    { background: #a78bfa; } /* purple */
.tp-wl-seg-progress { background: #60a5fa; } /* blue */
.tp-wl-seg-review   { background: #fbbf24; } /* amber */
.tp-wl-seg-done     { background: linear-gradient(90deg, #4ade80, #059669); }

.tp-wl-card-divider {
  height: 0.5px;
  background: var(--hairline-soft);
  margin: 0 -16px;
}

/* Time estimate */
.tp-wl-time { display: flex; flex-direction: column; gap: 8px; }
.tp-wl-time-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--fg-faint);
}
.tp-wl-time-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
  gap: 12px;
}
.tp-wl-time-badge {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--hairline);
  display: grid; place-items: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--fg);
  background: var(--glass-fill-faint);
  letter-spacing: -0.01em;
}
.tp-wl-time-warn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--fg-mute);
  text-decoration: underline;
  text-decoration-color: var(--hairline);
  text-decoration-thickness: 0.5px;
  text-underline-offset: 3px;
}
.tp-wl-time-warn-icon { color: #d97706; font-size: 12px; }

/* Status sections */
.tp-wl-status-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tp-wl-status {
  border-top: 0.5px solid var(--hairline-soft);
  padding-top: 6px;
}
.tp-wl-status:first-child { border-top: 0; padding-top: 0; }
.tp-wl-status-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  padding: 6px 0;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: left;
}
.tp-wl-status-caret {
  font-size: 11px;
  width: 12px;
  display: inline-grid;
  place-items: center;
}
.tp-wl-status-label { letter-spacing: 0.08em; }
.tp-wl-status-count { font-weight: 500; opacity: 0.7; letter-spacing: 0; }

.tp-wl-status-ready    .tp-wl-status-head,
.tp-wl-status-ready    .tp-wl-status-caret { color: #8b5cf6; }
.tp-wl-status-progress .tp-wl-status-head,
.tp-wl-status-progress .tp-wl-status-caret { color: #2563eb; }
.tp-wl-status-review   .tp-wl-status-head,
.tp-wl-status-review   .tp-wl-status-caret { color: #d97706; }

.tp-wl-status-items {
  list-style: none;
  margin: 0;
  padding: 0 0 4px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tp-wl-status-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--fg);
  background: transparent;
  transition: background 0.12s;
}
.tp-wl-status-item:hover { background: rgba(15, 23, 42, 0.04); }
[data-theme="dark"] .tp-wl-status-item:hover { background: rgba(255,255,255,0.04); }
.tp-wl-status-item-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tp-wl-status-item-hours {
  font-size: 11.5px;
  color: var(--fg-mute);
  font-weight: 500;
}

/* TIME EST. column header — on first item if showing items */
.tp-wl-status.open .tp-wl-status-items::before {
  content: "TIME EST.";
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--fg-faint);
  text-align: right;
  padding: 2px 8px 4px 0;
  margin-top: -2px;
}

/* Collapsed state */
.tp-wl-card.collapsed { padding-bottom: 16px; }

/* Overview card */
.tp-wl-overview { gap: 12px; }
.tp-wl-overview-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.tp-wl-overview-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 6px;
  height: 110px;
  padding: 4px 4px 0;
}
.tp-wl-overview-col {
  flex: 1 1 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.tp-wl-overview-bar {
  position: relative;
  width: 14px;
  height: 100%;
  display: flex;
  align-items: flex-end;
}
.tp-wl-overview-bar-bg {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  border-radius: 999px 999px 0 0;
  background: rgba(15, 23, 42, 0.10);
}
[data-theme="dark"] .tp-wl-overview-bar-bg { background: rgba(255,255,255,0.10); }
.tp-wl-overview-bar-fill {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, #4ade80, #059669);
}
.tp-wl-overview-avatars {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 4px;
  padding: 0 2px;
}
.tp-wl-overview-avatars .proj-avatar {
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────────────────── */

/* ─── Team roster (Team tab) ───────────────────────────────────────────── */
.tp-roster-toolbar {
  gap: 8px;
  align-items: center;
}
.tp-roster-search {
  flex: 1 1 280px;
  min-width: 200px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 0.5px solid var(--hairline);
  background: var(--glass-fill);
  color: var(--fg);
  height: 34px;
}
.tp-roster-search-icon { color: var(--fg-mute); display: inline-flex; }
.tp-roster-search-icon svg { width: 14px; height: 14px; }
.tp-roster-search-input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: var(--fg);
  font-family: inherit;
}
.tp-roster-search-input::placeholder { color: var(--fg-faint); }

.tp-roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.tp-roster-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 16px 14px;
  border-radius: 16px;
  border: 0.5px solid var(--hairline);
  background: var(--glass-fill);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 6px 18px rgba(15,23,42,0.06);
  transition: box-shadow 0.15s, transform 0.15s;
}
[data-theme="dark"] .tp-roster-card {
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 6px 18px rgba(0,0,0,0.30);
}
.tp-roster-card:hover {
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 10px 26px rgba(15,23,42,0.10);
}

.tp-roster-card-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: flex-start;
  gap: 12px;
}
.tp-roster-avatar-wrap {
  position: relative;
  width: 64px;
  height: 64px;
}
.tp-roster-avatar-wrap .proj-avatar {
  width: 64px !important;
  height: 64px !important;
  font-size: 22px !important;
  flex-shrink: 0;
}
.tp-roster-presence {
  position: absolute;
  right: 2px; bottom: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid var(--glass-fill);
  background: #94a3b8;
}
.tp-roster-presence.online { background: #10b981; }
.tp-roster-id { min-width: 0; padding-top: 4px; }
.tp-roster-name {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  line-height: 1.25;
}
.tp-roster-lead-badge {
  font-size: 9.5px;
  letter-spacing: 0.08em;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  background: linear-gradient(180deg, #f59e0b, #d97706);
  color: white;
}
.tp-roster-role {
  font-size: 12px;
  color: var(--fg-mute);
  margin-top: 2px;
}
.tp-roster-loc {
  font-size: 11.5px;
  color: var(--fg-faint);
  margin-top: 2px;
}
.tp-roster-more {
  width: 24px; height: 24px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  font-size: 16px;
  color: var(--fg-faint);
  cursor: pointer;
  display: grid; place-items: center;
}
.tp-roster-more:hover { background: rgba(15,23,42,0.06); color: var(--fg); }
[data-theme="dark"] .tp-roster-more:hover { background: rgba(255,255,255,0.08); }

.tp-roster-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tp-roster-tag {
  font-size: 10.5px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15,23,42,0.05);
  color: var(--fg-mute);
}
[data-theme="dark"] .tp-roster-tag { background: rgba(255,255,255,0.06); }

.tp-roster-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px 4px;
  border-top: 0.5px solid var(--hairline-soft);
  border-bottom: 0.5px solid var(--hairline-soft);
}
.tp-roster-stat { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.tp-roster-stat-num {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg);
  line-height: 1.05;
}
.tp-roster-stat-lbl {
  font-size: 10.5px;
  color: var(--fg-mute);
  font-weight: 500;
}

.tp-roster-contact {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tp-roster-contact-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
  color: var(--fg-mute);
  text-decoration: none;
  border-radius: 6px;
}
.tp-roster-contact-row:hover { color: var(--fg); }
.tp-roster-contact-icon {
  width: 18px;
  display: inline-flex;
  justify-content: center;
  color: var(--fg-faint);
  font-size: 12px;
}
.tp-roster-contact-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tp-roster-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.tp-roster-action {
  font-size: 11.5px;
  padding: 6px 4px;
  border-radius: 8px;
  font-weight: 500;
}

.tp-roster-empty {
  padding: 40px 20px;
  text-align: center;
  border: 0.5px dashed var(--hairline);
  border-radius: 12px;
  color: var(--fg-mute);
}
.tp-roster-empty-title { font-size: 14px; font-weight: 600; color: var(--fg); margin-bottom: 4px; }
.tp-roster-empty-sub { font-size: 12px; color: var(--fg-mute); }

/* ─── Sales-team purpose strip + new roster bits ────────────────────────── */
.tp-purpose-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--hairline-soft);
  border: 0.5px solid var(--hairline-soft);
  border-radius: 12px;
  overflow: hidden;
  margin: 14px 0 16px;
}
.tp-purpose-tile {
  background: rgba(var(--glass-tint), 0.85);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
[data-theme="dark"] .tp-purpose-tile { background: rgba(15,23,42,0.5); }
.tp-purpose-num { font-size: 24px; font-weight: 600; color: var(--fg); line-height: 1.05; letter-spacing: -0.01em; }
.tp-purpose-suf { font-size: 13px; color: var(--fg-mute); font-weight: 500; }
.tp-purpose-lbl { font-size: 11px; color: var(--fg-mute); letter-spacing: 0.02em; }

/* +N pill hover preview */
.peek-team-hover { position: relative; }
.peek-team-more-pill { position: relative; cursor: pointer; }
.peek-team-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-30%);
  width: 280px;
  background: rgba(var(--glass-tint), 0.98);
  border: 0.5px solid var(--hairline);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
  padding: 10px 12px;
  z-index: 60;
  font-weight: 400;
}
[data-theme="dark"] .peek-team-pop { background: #0f172a; box-shadow: 0 12px 32px rgba(0,0,0,0.5); }
.peek-team-pop-head { font-size: 11px; color: var(--fg-mute); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 8px; }
.peek-team-pop-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.peek-team-pop-row { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.peek-team-pop-name { font-size: 12.5px; font-weight: 500; color: var(--fg); }
.peek-team-pop-role { font-size: 11px; color: var(--fg-mute); }
.peek-team-pop-leave { font-size: 10px; color: #b45309; background: rgba(245,158,11,0.15); padding: 2px 6px; border-radius: 6px; }
.peek-team-pop-foot { font-size: 11px; color: var(--fg-faint); margin-top: 8px; padding-top: 8px; border-top: 0.5px solid var(--hairline-soft); }

/* Roster card: utilisation bar at top */
.tp-roster-util {
  position: relative;
  height: 6px;
  margin: -16px -16px 12px;
  border-radius: 12px 12px 0 0;
  background: rgba(15,23,42,0.06);
  overflow: hidden;
}
[data-theme="dark"] .tp-roster-util { background: rgba(255,255,255,0.06); }
.tp-roster-util-fill { height: 100%; transition: width 0.2s; }
.tp-roster-util-low  .tp-roster-util-fill { background: linear-gradient(90deg, #38bdf8, #0284c7); }
.tp-roster-util-ok   .tp-roster-util-fill { background: linear-gradient(90deg, #4ade80, #059669); }
.tp-roster-util-high .tp-roster-util-fill { background: linear-gradient(90deg, #fbbf24, #d97706); }
.tp-roster-util-over .tp-roster-util-fill { background: linear-gradient(90deg, #f87171, #b91c1c); }
.tp-roster-util-num {
  position: absolute;
  top: -16px;
  right: 4px;
  font-size: 10px;
  color: var(--fg-mute);
  background: rgba(var(--glass-tint), 0.8);
  padding: 0 4px;
  border-radius: 4px;
  display: none;
}
.tp-roster-card:hover .tp-roster-util-num { display: inline; }

/* Supporting + leave card variants */
.tp-roster-card-supporting {
  border-style: dashed !important;
  background: repeating-linear-gradient(
    135deg,
    rgba(var(--glass-tint), 0.95),
    rgba(var(--glass-tint), 0.95) 12px,
    rgba(15,23,42,0.02) 12px,
    rgba(15,23,42,0.02) 13px
  );
}
[data-theme="dark"] .tp-roster-card-supporting {
  background: repeating-linear-gradient(
    135deg,
    rgba(15,23,42,0.65),
    rgba(15,23,42,0.65) 12px,
    rgba(255,255,255,0.02) 12px,
    rgba(255,255,255,0.02) 13px
  );
}
.tp-roster-card-leave { opacity: 0.78; }

/* Badges next to name */
.tp-roster-support-badge {
  font-size: 9px;
  letter-spacing: 0.08em;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  background: rgba(168,85,247,0.18);
  color: #7e22ce;
  vertical-align: middle;
}
[data-theme="dark"] .tp-roster-support-badge { background: rgba(168,85,247,0.25); color: #d8b4fe; }
.tp-roster-leave-badge {
  font-size: 9px;
  letter-spacing: 0.08em;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  background: rgba(245,158,11,0.2);
  color: #b45309;
  vertical-align: middle;
}
[data-theme="dark"] .tp-roster-leave-badge { color: #fbbf24; }

/* Meta row: location + creds inline */
.tp-roster-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 2px; }
.tp-roster-creds { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.tp-roster-cred {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(14,165,233,0.14);
  color: #0369a1;
}
[data-theme="dark"] .tp-roster-cred { background: rgba(56,189,248,0.18); color: #7dd3fc; }

/* Reports-to chip */
.tp-roster-reports {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 3px 8px 3px 4px;
  border-radius: 999px;
  border: 0.5px solid var(--hairline-soft);
  background: rgba(15,23,42,0.04);
  cursor: pointer;
  font-family: inherit;
}
[data-theme="dark"] .tp-roster-reports { background: rgba(255,255,255,0.04); }
.tp-roster-reports:hover { background: rgba(14,165,233,0.12); border-color: rgba(14,165,233,0.4); }
.tp-roster-reports-lbl { font-size: 10.5px; color: var(--fg-faint); padding-left: 4px; }
.tp-roster-reports-name { font-size: 11.5px; color: var(--fg-mute); font-weight: 500; }

/* Clickable skill tags */
.tp-roster-tag-btn {
  border: 0;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
}
.tp-roster-tag-btn:hover { background: rgba(14,165,233,0.18); color: #0369a1; }
[data-theme="dark"] .tp-roster-tag-btn:hover { background: rgba(56,189,248,0.2); color: #7dd3fc; }
.tp-roster-tag-btn.active {
  background: linear-gradient(135deg, #0ea5e9, #0369a1);
  color: white;
}

/* Filter strip */
.tp-roster-filter-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(14,165,233,0.08);
  border: 0.5px solid rgba(14,165,233,0.25);
  margin-bottom: 12px;
}
.tp-roster-filter-lbl { font-size: 11px; color: #0369a1; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600; }
.tp-roster-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px 3px 10px;
  border-radius: 999px;
  background: white;
  border: 0.5px solid rgba(14,165,233,0.4);
  font-size: 12px;
  font-weight: 600;
  color: #0369a1;
}
[data-theme="dark"] .tp-roster-filter-tag { background: rgba(15,23,42,0.6); color: #7dd3fc; }
.tp-roster-filter-x {
  width: 18px; height: 18px;
  border: 0;
  border-radius: 50%;
  background: rgba(14,165,233,0.18);
  color: #0369a1;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.tp-roster-filter-count { font-size: 11.5px; color: var(--fg-mute); font-weight: 500; }
.tp-roster-filter-hint { font-size: 11px; color: var(--fg-faint); margin-left: auto; }

/* Group selector */
.tp-roster-group { display: inline-flex; align-items: center; gap: 8px; }
.tp-roster-group-lbl { font-size: 11px; color: var(--fg-mute); letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600; }
.tp-roster-group-pills {
  display: inline-flex;
  background: rgba(15,23,42,0.05);
  border-radius: 8px;
  padding: 2px;
}
[data-theme="dark"] .tp-roster-group-pills { background: rgba(255,255,255,0.05); }
.tp-roster-group-pill {
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  color: var(--fg-mute);
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.tp-roster-group-pill.active {
  background: rgba(var(--glass-tint), 1);
  color: var(--fg);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  font-weight: 600;
}
[data-theme="dark"] .tp-roster-group-pill.active { background: #1e293b; }

/* Group section heading */
.tp-roster-group-section { margin-bottom: 24px; }
.tp-roster-group-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0 10px;
  margin-bottom: 12px;
  border-bottom: 0.5px solid var(--hairline-soft);
}
.tp-roster-group-title { font-size: 13px; font-weight: 600; color: var(--fg); margin: 0; letter-spacing: 0.01em; }
.tp-roster-group-sub { font-size: 11.5px; color: var(--fg-mute); margin-top: 2px; }
.tp-roster-group-count { margin-left: auto; font-size: 12px; color: var(--fg-faint); font-weight: 500; }
.tp-roster-eyebrow-sep { color: var(--fg-faint); margin: 0 4px; }
.tp-roster-eyebrow-sub { color: var(--fg-mute); font-weight: 500; }

/* Sales KPI tiles inside the card */
.tp-roster-kpis { gap: 12px; }
.tp-roster-kpi { display: flex; flex-direction: column; gap: 1px; }
.tp-roster-kpi-num { font-size: 17px; font-weight: 600; color: var(--fg); line-height: 1.05; letter-spacing: -0.01em; }
.tp-roster-kpi-suf { font-size: 11px; color: var(--fg-mute); font-weight: 500; }
.tp-roster-kpi-lbl { font-size: 10px; color: var(--fg-mute); letter-spacing: 0.02em; }

/* Supporting members get a note instead of KPIs */
.tp-roster-support-note {
  font-size: 11.5px;
  color: var(--fg-mute);
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(168,85,247,0.06);
  border: 0.5px dashed rgba(168,85,247,0.3);
  line-height: 1.4;
}
.tp-roster-support-note strong { color: #7e22ce; }
[data-theme="dark"] .tp-roster-support-note strong { color: #d8b4fe; }

/* Foot row: last active + contact toggle */
.tp-roster-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 0.5px solid var(--hairline-soft);
  margin-top: -2px;
}
.tp-roster-last-active { font-size: 11px; color: var(--fg-mute); display: flex; align-items: center; gap: 6px; }
.tp-roster-pulse-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  display: inline-block;
}
.tp-roster-pulse-dot.online { background: #10b981; box-shadow: 0 0 0 2px rgba(16,185,129,0.18); }
.tp-roster-pulse-dot.offline { background: #94a3b8; }
.tp-roster-pulse-dot.leave { background: #f59e0b; }

.tp-roster-contact-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 8px;
  border: 0.5px solid var(--hairline-soft);
  background: transparent;
  font-family: inherit;
  font-size: 11.5px;
  color: var(--fg-mute);
  cursor: pointer;
}
.tp-roster-contact-toggle:hover { background: rgba(15,23,42,0.04); color: var(--fg); }
[data-theme="dark"] .tp-roster-contact-toggle:hover { background: rgba(255,255,255,0.05); }
.tp-roster-contact-toggle.open { background: rgba(14,165,233,0.1); color: #0369a1; border-color: rgba(14,165,233,0.3); }
.tp-roster-contact-toggle-caret { font-size: 9px; }

/* Presence dot supports leave state */
.tp-roster-presence.leave { background: #f59e0b; }

/* ─── Timesheet (weekly grid) ──────────────────────────────────────────── */
.tp-ts-toolbar {
  align-items: center;
  gap: 6px;
}
.tp-ts-track-wrap {
  position: relative;
  display: inline-block;
}
.tp-ts-track-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
}
.tp-ts-track-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  min-width: 240px;
  padding: 6px;
  border-radius: 12px;
  background: var(--glass-fill);
  border: 0.5px solid var(--hairline);
  box-shadow: 0 12px 32px rgba(15,23,42,0.18);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
[data-theme="dark"] .tp-ts-track-menu { background: #0f172a; box-shadow: 0 12px 32px rgba(0,0,0,0.4); }
.tp-ts-track-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--fg);
  text-align: left;
  cursor: pointer;
  width: 100%;
}
.tp-ts-track-item:hover { background: rgba(15,23,42,0.05); }
[data-theme="dark"] .tp-ts-track-item:hover { background: rgba(255,255,255,0.06); }
.tp-ts-track-meta {
  margin-left: auto;
  font-size: 11px;
  color: var(--fg-mute);
}
.tp-ts-track-icon {
  width: 14px;
  font-size: 13px;
  color: var(--fg-mute);
  display: inline-flex;
  justify-content: center;
}
.tp-ts-track-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tp-ts-track-dot-billable  { background: #10b981; }
.tp-ts-track-dot-nonbill   { background: #94a3b8; }
.tp-ts-track-dot-pto       { background: #f59e0b; }
.tp-ts-track-dot-overtime  { background: #ef4444; }
.tp-ts-track-sep {
  height: 0.5px;
  background: var(--hairline-soft);
  margin: 4px 4px;
}

.tp-ts-rangebar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 0 8px 4px;
  font-size: 14px;
  color: var(--fg);
}
.tp-ts-rangebar .tp-sched-range { font-size: 14.5px; font-weight: 600; }

.tp-ts-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0 12px;
}
.tp-ts-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 0.5px solid var(--hairline);
  background: var(--glass-fill-faint);
  color: var(--fg-mute);
  font-size: 11.5px;
  font-weight: 500;
}
.tp-ts-chip-icon { font-size: 11px; opacity: 0.7; }

.tp-ts-wrap {
  border: 0.5px solid var(--hairline);
  border-radius: 14px;
  background: var(--glass-fill-faint);
  overflow: auto;
  max-width: 100%;
}
.tp-ts-grid {
  display: flex;
  flex-direction: column;
  min-width: max-content;
}
.tp-ts-row {
  display: grid;
  grid-template-columns: 260px repeat(7, minmax(98px, 1fr)) 100px;
  border-bottom: 0.5px solid var(--hairline-soft);
}
.tp-ts-row:last-child { border-bottom: 0; }
.tp-ts-head-row { background: var(--glass-fill); }
.tp-ts-head-cell {
  padding: 10px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--fg-mute);
  display: flex;
  align-items: center;
  background: var(--glass-fill);
}
.tp-ts-head-row .tp-ts-name-cell {
  background: var(--glass-fill);
  padding: 10px 16px;
  font-weight: 600;
  font-size: 12.5px;
  color: var(--fg);
}
.tp-ts-day-cell.tp-ts-head-cell { justify-content: flex-start; }
.tp-ts-day-lbl {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--fg-mute);
  white-space: nowrap;
}
.tp-ts-total-cell.tp-ts-head-cell { justify-content: flex-start; }

.tp-ts-name-cell {
  position: sticky; left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--glass-fill);
  border-right: 0.5px solid var(--hairline);
}
.tp-ts-name-text { flex: 1 1 auto; min-width: 0; }
.tp-ts-name {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tp-ts-cap {
  font-size: 11.5px;
  color: var(--fg-mute);
  margin-top: 2px;
}
.tp-ts-open {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 0.5px solid var(--hairline);
  background: var(--glass-fill);
  font-size: 11.5px;
  color: var(--fg);
  cursor: pointer;
  font-weight: 500;
  transition: background 0.12s;
  white-space: nowrap;
}
.tp-ts-open:hover { background: rgba(15,23,42,0.06); }
[data-theme="dark"] .tp-ts-open:hover { background: rgba(255,255,255,0.08); }
.tp-ts-open-arrow { font-size: 11px; color: var(--fg-mute); }

.tp-ts-cell {
  position: relative;
  padding: 8px 8px;
  display: flex;
  align-items: center;
  border-right: 0.5px solid var(--hairline-soft);
  background: var(--glass-fill-faint);
}
.tp-ts-cell:last-child { border-right: 0; }
.tp-ts-cell-pill {
  display: inline-flex;
  align-items: center;
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--fg-mute);
  background: var(--glass-fill);
  border: 0.5px solid var(--hairline-soft);
  font-weight: 500;
  white-space: nowrap;
}
.tp-ts-cell.hover .tp-ts-cell-pill {
  border-color: var(--hairline);
  background: rgba(96, 165, 250, 0.08);
}

.tp-ts-total-cell {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  background: var(--glass-fill-faint);
  border-left: 0.5px solid var(--hairline);
}
.tp-ts-cell-pill-total {
  background: transparent;
  border-color: transparent;
  color: var(--fg);
  font-weight: 600;
  padding: 0 4px;
}

/* Cell popover */
.tp-ts-pop {
  position: absolute;
  z-index: 40;
  min-width: 260px;
  padding: 14px 14px 10px;
  border-radius: 14px;
  background: #1f2937;
  color: #f1f5f9;
  box-shadow: 0 16px 36px rgba(0,0,0,0.40);
  font-size: 12.5px;
  pointer-events: none;
}

/* Portal version uses inline top/left + position:fixed; reset offset rules */
.tp-ts-pop-portal {
  position: fixed !important;
  bottom: auto;
  right: auto;
  transform: none !important;
}

/* Vertical placement: above (top) or below (bottom) the cell */
.tp-ts-pop-v-top    { bottom: calc(100% + 8px); }
.tp-ts-pop-v-bottom { top: calc(100% + 8px); }

/* Horizontal placement: align to left edge / center / right edge of cell */
.tp-ts-pop-h-center { left: 50%; transform: translateX(-50%); }
.tp-ts-pop-h-left   { left: 0; }
.tp-ts-pop-h-right  { right: 0; }

.tp-ts-pop::after {
  content: "";
  position: absolute;
  border: 6px solid transparent;
}

/* Arrow positioning — portal version uses --tp-ts-pop-arrow-left to align with cell center */
.tp-ts-pop-portal.tp-ts-pop-v-top::after {
  top: 100%;
  left: var(--tp-ts-pop-arrow-left, 50%);
  transform: translateX(-50%);
  border-top-color: #1f2937;
}
.tp-ts-pop-portal.tp-ts-pop-v-bottom::after {
  bottom: 100%;
  left: var(--tp-ts-pop-arrow-left, 50%);
  transform: translateX(-50%);
  border-bottom-color: #1f2937;
}

/* Legacy non-portal arrow rules (unused now but kept in case) */
.tp-ts-pop-v-top:not(.tp-ts-pop-portal).tp-ts-pop-h-center::after    { top: 100%; left: 50%; transform: translateX(-50%); border-top-color: #1f2937; }
.tp-ts-pop-v-top:not(.tp-ts-pop-portal).tp-ts-pop-h-left::after      { top: 100%; left: 24px; border-top-color: #1f2937; }
.tp-ts-pop-v-top:not(.tp-ts-pop-portal).tp-ts-pop-h-right::after     { top: 100%; right: 24px; border-top-color: #1f2937; }
.tp-ts-pop-v-bottom:not(.tp-ts-pop-portal).tp-ts-pop-h-center::after { bottom: 100%; left: 50%; transform: translateX(-50%); border-bottom-color: #1f2937; }
.tp-ts-pop-v-bottom:not(.tp-ts-pop-portal).tp-ts-pop-h-left::after   { bottom: 100%; left: 24px; border-bottom-color: #1f2937; }
.tp-ts-pop-v-bottom:not(.tp-ts-pop-portal).tp-ts-pop-h-right::after  { bottom: 100%; right: 24px; border-bottom-color: #1f2937; }
.tp-ts-pop-head { margin-bottom: 12px; }
.tp-ts-pop-title { font-size: 13.5px; font-weight: 600; color: #f8fafc; margin-bottom: 4px; }
.tp-ts-pop-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #94a3b8;
}
.tp-ts-pop-cap {
  background: rgba(255,255,255,0.08);
  border: 0.5px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: 3px 8px;
  font-weight: 600;
  color: #f1f5f9;
  font-size: 11.5px;
}
.tp-ts-pop-section {
  position: relative;
  padding: 8px 0 8px 14px;
  border-top: 0.5px solid rgba(255,255,255,0.08);
}
.tp-ts-pop-section:first-of-type { border-top: 0; padding-top: 4px; }
.tp-ts-pop-bar {
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 2px;
}
.tp-ts-pop-bar-tracked { background: linear-gradient(180deg, #60a5fa, #3b82f6); }
.tp-ts-pop-bar-rem     { background: rgba(255,255,255,0.18); }
.tp-ts-pop-row,
.tp-ts-pop-sub-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 3px 0;
}
.tp-ts-pop-sub-row { padding-left: 0; opacity: 0.95; }
.tp-ts-pop-row-label {
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 500;
}
.tp-ts-pop-sub-row .tp-ts-pop-row-label {
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 400;
}
.tp-ts-pop-pct {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
  min-width: 36px;
  text-align: right;
}
.tp-ts-pop-val {
  background: rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: #f1f5f9;
  border: 0.5px solid rgba(255,255,255,0.10);
  white-space: nowrap;
}
.tp-ts-pop-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 0.5px solid rgba(255,255,255,0.08);
  font-size: 11px;
  color: #94a3b8;
}
.tp-ts-pop-foot-icon { color: #10b981; font-size: 8px; }

/* ─── Timesheet drilldown (Open → per-task view) ──────────────────────── */
.tp-ts-dd { display: flex; flex-direction: column; gap: 12px; }

.tp-ts-dd-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 8px;
}
.tp-ts-dd-back {
  width: 30px; height: 30px;
  border: 0.5px solid var(--hairline);
  background: var(--glass-fill);
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
  color: var(--fg);
  cursor: pointer;
  display: grid; place-items: center;
}
.tp-ts-dd-back:hover { background: rgba(15,23,42,0.06); }
[data-theme="dark"] .tp-ts-dd-back:hover { background: rgba(255,255,255,0.08); }

.tp-ts-dd-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.tp-ts-dd-sub {
  font-size: 12px;
  color: var(--fg-mute);
  margin-left: auto;
}

.tp-ts-dd-wrap {
  border: 0.5px solid var(--hairline);
  border-radius: 14px;
  background: var(--glass-fill);
  overflow: auto;
  max-width: 100%;
}
.tp-ts-dd-grid {
  display: flex;
  flex-direction: column;
  min-width: max-content;
}
.tp-ts-dd-row {
  display: grid;
  grid-template-columns: 320px repeat(7, minmax(94px, 1fr)) 110px;
  border-bottom: 0.5px solid var(--hairline-soft);
  min-height: 56px;
}
.tp-ts-dd-row:last-child { border-bottom: 0; }

/* Header row */
.tp-ts-dd-head-row {
  background: var(--glass-fill-faint);
  min-height: 60px;
}
.tp-ts-dd-head-cell {
  padding: 8px 12px;
  font-size: 11.5px;
  color: var(--fg-mute);
  font-weight: 500;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  background: var(--glass-fill-faint);
  border-right: 0.5px solid var(--hairline-soft);
}
.tp-ts-dd-head-cell:last-child { border-right: 0; }
.tp-ts-dd-task-cell.tp-ts-dd-head-cell {
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--fg);
  background: var(--glass-fill);
  border-right: 0.5px solid var(--hairline);
}
.tp-ts-dd-day-cell.tp-ts-dd-head-cell.today {
  background: rgba(96, 165, 250, 0.08);
  color: #2563eb;
}
[data-theme="dark"] .tp-ts-dd-day-cell.tp-ts-dd-head-cell.today {
  background: rgba(96, 165, 250, 0.14);
  color: #93c5fd;
}
.tp-ts-dd-day-cell.tp-ts-dd-head-cell.today::after {
  content: "";
  display: block;
  height: 2px;
  background: #2563eb;
  margin-top: 2px;
  border-radius: 2px;
}
.tp-ts-dd-day-lbl {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--fg-mute);
  white-space: nowrap;
}
.tp-ts-dd-head-cell.today .tp-ts-dd-day-lbl { color: #2563eb; font-weight: 600; }
.tp-ts-dd-day-total {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.01em;
}
.tp-ts-dd-head-cell.today .tp-ts-dd-day-total { color: #2563eb; }

/* Task cell */
.tp-ts-dd-task-cell {
  position: sticky; left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--glass-fill);
  border-right: 0.5px solid var(--hairline);
}
.tp-ts-dd-task-info { flex: 1 1 auto; min-width: 0; }
.tp-ts-dd-task-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.005em;
}
.tp-ts-dd-task-icon {
  font-size: 11px;
  color: var(--fg-mute);
  display: inline-flex;
  width: 14px;
  justify-content: center;
}
.tp-ts-dd-task-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--fg-mute);
  flex-wrap: nowrap;
  overflow: hidden;
}
.tp-ts-dd-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(15,23,42,0.05);
  font-size: 10.5px;
  font-weight: 500;
  white-space: nowrap;
}
[data-theme="dark"] .tp-ts-dd-status { background: rgba(255,255,255,0.08); }
.tp-ts-dd-status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.tp-ts-dd-status-blue   { color: #2563eb; }
.tp-ts-dd-status-amber  { color: #d97706; }
.tp-ts-dd-status-slate  { color: #64748b; }
.tp-ts-dd-status-green  { color: #059669; }
.tp-ts-dd-task-client {
  font-size: 11px;
  color: var(--fg-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
}

.tp-ts-dd-play {
  width: 28px; height: 28px;
  border: 0.5px solid var(--hairline);
  background: var(--glass-fill);
  border-radius: 50%;
  font-size: 11px;
  color: var(--fg);
  cursor: pointer;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.tp-ts-dd-play:hover {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

/* Day cells */
.tp-ts-dd-cell {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  border-right: 0.5px solid var(--hairline-soft);
  background: var(--glass-fill-faint);
}
.tp-ts-dd-cell:last-of-type { border-right: 0; }
.tp-ts-dd-cell.today { background: rgba(96, 165, 250, 0.04); }
[data-theme="dark"] .tp-ts-dd-cell.today { background: rgba(96, 165, 250, 0.08); }
.tp-ts-dd-cell-val {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
}
.tp-ts-dd-cell-val.tnum { color: var(--fg); }

/* Total cell */
.tp-ts-dd-total-cell {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: var(--glass-fill);
  border-left: 0.5px solid var(--hairline);
}
.tp-ts-dd-cell-val-total {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
}
.tp-ts-dd-row-more {
  width: 22px; height: 22px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  color: var(--fg-faint);
  font-size: 14px;
  cursor: pointer;
  display: grid; place-items: center;
}
.tp-ts-dd-row-more:hover { background: rgba(15,23,42,0.06); color: var(--fg); }
[data-theme="dark"] .tp-ts-dd-row-more:hover { background: rgba(255,255,255,0.08); }

/* Footer */
.tp-ts-dd-foot {
  display: flex;
  padding: 4px;
}
.tp-ts-dd-add {
  font-size: 12.5px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tp-ts-dd-add svg { width: 14px; height: 14px; }

/* ─── Workload schedule grid (rendered under "Workload" tab) ─────────── */
.tp-sched-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 0 10px;
}
.tp-sched-toolbar-left,
.tp-sched-toolbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.tp-sched-tool {
  font-size: 12.5px;
  padding: 6px 10px;
  font-weight: 500;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.tp-sched-caret { font-size: 10px; opacity: 0.55; }
.tp-sched-icon-btn {
  width: 30px; height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  color: var(--fg-mute);
}
.tp-sched-chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(167, 139, 250, 0.12);
  color: #6d28d9;
  border: 0.5px solid rgba(167, 139, 250, 0.30);
  font-weight: 500;
}
[data-theme="dark"] .tp-sched-chip {
  background: rgba(167, 139, 250, 0.18);
  color: #c4b5fd;
}
.tp-sched-chip-active { box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.25) inset; }
.tp-sched-chip-x { font-size: 12px; opacity: 0.6; margin-left: 2px; }
.tp-sched-chip svg { width: 13px; height: 13px; }

.tp-sched-rangebar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 0 8px 12px;
  font-size: 12.5px;
  color: var(--fg);
}
.tp-sched-range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.tp-sched-range-nav { display: inline-flex; gap: 2px; }
.tp-sched-nav {
  width: 22px; height: 22px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  font-size: 16px;
  line-height: 1;
  color: var(--fg-mute);
  cursor: pointer;
  display: grid; place-items: center;
}
.tp-sched-nav:hover { background: rgba(15,23,42,0.06); color: var(--fg); }
[data-theme="dark"] .tp-sched-nav:hover { background: rgba(255,255,255,0.08); }
.tp-sched-range-icons {
  margin-left: auto;
  display: inline-flex;
  gap: 8px;
  color: var(--fg-mute);
  font-size: 13px;
}
.tp-sched-range-icon { cursor: default; opacity: 0.7; }

.tp-sched-wrap {
  border: 0.5px solid var(--hairline);
  border-radius: 14px;
  background: var(--glass-fill-faint);
  overflow: auto;
  max-width: 100%;
}
.tp-sched-grid {
  display: grid;
  min-width: max-content;
  /* grid-template-columns set inline */
}

/* Header rows */
.tp-sched-month-row,
.tp-sched-day-row,
.tp-sched-row {
  display: contents;
}
.tp-sched-month-row > *,
.tp-sched-day-row > * {
  border-bottom: 0.5px solid var(--hairline-soft);
  background: var(--glass-fill-faint);
}
.tp-sched-month-anchor,
.tp-sched-day-anchor {
  position: sticky; left: 0;
  z-index: 3;
  background: var(--glass-fill);
}
.tp-sched-month-label {
  padding: 8px 10px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.005em;
  border-bottom: 0;
}
.tp-sched-day-cell {
  padding: 4px 6px 8px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  font-size: 11.5px;
  color: var(--fg-mute);
  font-weight: 500;
}
.tp-sched-day-cell.weekend { color: var(--fg-faint); }
.tp-sched-day-cell.today {
  color: #2563eb;
  font-weight: 600;
}
.tp-sched-day-cell.today .tp-sched-date { color: #2563eb; }
.tp-sched-dow { font-size: 10.5px; opacity: 0.7; }
.tp-sched-date { font-size: 12px; }

/* Member rows */
.tp-sched-row > * {
  border-bottom: 0.5px solid var(--hairline-soft);
  background: var(--glass-fill-faint);
  min-height: 56px;
}
.tp-sched-row:last-child > * { border-bottom: 0; }

.tp-sched-name-cell {
  position: sticky; left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--glass-fill);
  border-right: 0.5px solid var(--hairline);
}
.tp-sched-name-text { min-width: 0; flex: 1 1 auto; }
.tp-sched-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tp-sched-role {
  font-size: 11px;
  color: var(--fg-mute);
  margin-top: 1px;
}
.tp-sched-cap {
  font-size: 11.5px;
  color: var(--fg-mute);
  font-weight: 500;
  white-space: nowrap;
}
.tp-sched-cap-sep { opacity: 0.5; margin: 0 1px; }
.tp-sched-row-toggle {
  width: 22px; height: 22px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  color: var(--fg-faint);
  font-size: 14px;
  cursor: pointer;
  display: grid; place-items: center;
}
.tp-sched-row-toggle:hover { background: rgba(15,23,42,0.06); color: var(--fg); }
[data-theme="dark"] .tp-sched-row-toggle:hover { background: rgba(255,255,255,0.08); }

/* Day cells */
.tp-sched-cell {
  position: relative;
  padding: 6px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 0.5px solid var(--hairline-soft);
  background: var(--glass-fill-faint);
}
.tp-sched-cell:last-child { border-right: 0; }
.tp-sched-cell.weekend {
  background: rgba(15,23,42,0.025);
}
[data-theme="dark"] .tp-sched-cell.weekend { background: rgba(255,255,255,0.025); }

.tp-sched-cell-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
  background: transparent;
  border: 0.5px solid transparent;
  white-space: nowrap;
}

/* Tone variants */
.tp-sched-tone-zero .tp-sched-cell-pill {
  color: var(--fg-faint);
  background: transparent;
  border-color: var(--hairline-soft);
  font-weight: 500;
}
.tp-sched-tone-low .tp-sched-cell-pill {
  background: #d1fae5;
  color: #047857;
  border-color: rgba(5, 150, 105, 0.18);
}
.tp-sched-tone-mid .tp-sched-cell-pill {
  background: #a7f3d0;
  color: #065f46;
  border-color: rgba(5, 150, 105, 0.30);
}
.tp-sched-tone-high .tp-sched-cell-pill {
  background: #fde68a;
  color: #92400e;
  border-color: rgba(217, 119, 6, 0.30);
}
.tp-sched-tone-over .tp-sched-cell-pill {
  background: #fca5a5;
  color: #7f1d1d;
  border-color: rgba(220, 38, 38, 0.35);
}
[data-theme="dark"] .tp-sched-tone-low  .tp-sched-cell-pill { background: rgba(5, 150, 105, 0.22); color: #6ee7b7; }
[data-theme="dark"] .tp-sched-tone-mid  .tp-sched-cell-pill { background: rgba(5, 150, 105, 0.34); color: #a7f3d0; }
[data-theme="dark"] .tp-sched-tone-high .tp-sched-cell-pill { background: rgba(217, 119, 6, 0.30); color: #fcd34d; }
[data-theme="dark"] .tp-sched-tone-over .tp-sched-cell-pill { background: rgba(220, 38, 38, 0.32); color: #fecaca; }

/* Today column highlight */
.tp-sched-cell.today { background: rgba(96, 165, 250, 0.06); }
[data-theme="dark"] .tp-sched-cell.today { background: rgba(96, 165, 250, 0.10); }

/* Unassigned row */
.tp-sched-row-unassigned > * {
  background: rgba(15,23,42,0.025);
}
[data-theme="dark"] .tp-sched-row-unassigned > * { background: rgba(255,255,255,0.025); }
.tp-sched-row-unassigned .tp-sched-name-cell {
  background: var(--glass-fill);
  color: var(--fg-mute);
}
.tp-sched-row-unassigned .tp-sched-name { color: var(--fg-mute); }

.tp-sched-footer {
  padding: 10px 4px 0;
  font-size: 11.5px;
  color: var(--fg-faint);
}

/* Box (kanban) */
.tp-box {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.tp-box-col {
  border: 0.5px solid var(--hairline);
  border-radius: 14px;
  background: var(--glass-fill-faint);
  display: flex;
  flex-direction: column;
  min-height: 240px;
}
.tp-box-col-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 0.5px solid var(--hairline-soft);
}
.tp-box-person { display: flex; align-items: center; gap: 10px; }
.tp-box-name { font-size: 12.5px; font-weight: 580; }
.tp-box-role { font-size: 11px; color: var(--fg-mute); }
.tp-box-list {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tp-box-card {
  background: var(--glass-fill);
  border: 0.5px solid var(--hairline-soft);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: grab;
  transition: transform 0.15s, box-shadow 0.15s;
}
.tp-box-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -4px rgba(0,0,0,0.12);
}
.tp-box-card-title { font-size: 12.5px; font-weight: 540; line-height: 1.35; }
.tp-box-card-meta { display: flex; align-items: center; gap: 8px; }
.tp-box-due { font-size: 11px; color: var(--fg-mute); }
.tp-box-card-foot {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--fg-mute);
}

/* Activity */
.tp-act { display: flex; flex-direction: column; }
.tp-act-row {
  display: grid;
  grid-template-columns: 80px 44px 1fr;
  gap: 12px;
  align-items: stretch;
}
.tp-act-time {
  padding-top: 16px;
  font-size: 11.5px;
  color: var(--fg-mute);
  text-align: right;
}
.tp-act-rail {
  position: relative;
  display: flex;
  justify-content: center;
  padding-top: 8px;
}
.tp-act-rail .proj-avatar { z-index: 2; }
.tp-act-line {
  position: absolute;
  top: 36px;
  bottom: -8px;
  left: 50%;
  width: 1.5px;
  margin-left: -0.75px;
  background: var(--hairline);
  z-index: 1;
}
.tp-act-row:last-child .tp-act-line { display: none; }
.tp-act-rail-comment .proj-avatar { box-shadow: 0 0 0 2px rgba(59,130,246,0.18); }
.tp-act-rail-done .proj-avatar    { box-shadow: 0 0 0 2px rgba(16,185,129,0.18); }
.tp-act-rail-edit .proj-avatar    { box-shadow: 0 0 0 2px rgba(168,85,247,0.18); }
.tp-act-rail-upload .proj-avatar  { box-shadow: 0 0 0 2px rgba(245,158,11,0.18); }
.tp-act-card {
  margin: 4px 0 14px;
  padding: 12px 14px;
  border: 0.5px solid var(--hairline-soft);
  border-radius: 10px;
  background: var(--glass-fill-faint);
}
.tp-act-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px;
  font-size: 13px;
}
.tp-act-who { font-weight: 600; }
.tp-act-verb { color: var(--fg-mute); }
.tp-act-obj { font-weight: 540; color: var(--brand-blue, #2563eb); }
.tp-act-where { color: var(--fg-mute); font-size: 11.5px; }
.tp-act-detail {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--fg-mute);
  text-wrap: pretty;
}

@media (max-width: 720px) {
  .tp-meta-grid { grid-template-columns: 1fr; }
  .tp-wl-row { grid-template-columns: 1fr; }
  .tp-tl-head, .tp-tl-row { grid-template-columns: 140px 1fr; }
}


/* =========================================================================
 * NEW TASK MODAL
 * ========================================================================= */
.ntm-backdrop {
  position: fixed; inset: 0;
  background: rgba(8, 12, 28, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 300;
  display: grid; place-items: center;
  padding: 24px;
  animation: peekFadeIn 0.16s ease-out;
}
[data-theme="dark"] .ntm-backdrop { background: rgba(0, 4, 16, 0.65); }
.ntm-shell {
  width: min(640px, 100%);
  max-height: 92vh;
  background: var(--glass-fill-strong);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
  backdrop-filter: blur(28px) saturate(1.5);
  border: 0.5px solid var(--hairline);
  border-radius: 18px;
  box-shadow: 0 30px 80px -10px rgba(0,0,0,0.32), 0 0 0 0.5px rgba(255,255,255,0.08) inset;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.ntm-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 0.5px solid var(--hairline-soft);
}
.ntm-eyebrow {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg-mute); font-weight: 600;
}
.ntm-title { margin: 4px 0 0; font-size: 20px; font-weight: 650; letter-spacing: -0.01em; }
.ntm-body {
  padding: 18px 22px;
  display: flex; flex-direction: column; gap: 16px;
  overflow-y: auto;
}
.ntm-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.ntm-field { display: flex; flex-direction: column; gap: 6px; }
.ntm-field-full { grid-column: 1 / -1; }
.ntm-label {
  font-size: 11.5px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--fg-mute); font-weight: 600;
}
.ntm-req { color: #ef4444; }
.ntm-input, .ntm-textarea {
  appearance: none;
  width: 100%;
  border: 0.5px solid var(--hairline);
  background: var(--glass-fill-faint);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--fg);
  font-family: inherit;
}
.ntm-input:focus, .ntm-textarea:focus {
  outline: none;
  border-color: var(--brand-blue, #3b82f6);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--brand-blue, #3b82f6), transparent 80%);
}
.ntm-input-lg { font-size: 16px; padding: 11px 14px; font-weight: 540; }
.ntm-input-sm { padding: 7px 10px; font-size: 12.5px; }
.ntm-textarea { resize: vertical; min-height: 60px; }
.ntm-assignees {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 6px;
  border: 0.5px solid var(--hairline);
  border-radius: 10px;
  background: var(--glass-fill-faint);
}
.ntm-assignee {
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid transparent;
  background: transparent;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  font-size: 12px; font-weight: 540;
  color: var(--fg);
}
.ntm-assignee:hover { background: rgba(0,0,0,0.04); }
[data-theme="dark"] .ntm-assignee:hover { background: rgba(255,255,255,0.06); }
.ntm-assignee.active {
  background: color-mix(in oklch, var(--brand-blue, #3b82f6), transparent 86%);
  border-color: color-mix(in oklch, var(--brand-blue, #3b82f6), transparent 60%);
  color: var(--brand-blue, #3b82f6);
}
.ntm-assignee-unassigned { padding-left: 8px; }
.ntm-unassigned-icon {
  display: inline-grid; place-items: center;
  width: 22px; height: 22px;
  border-radius: 999px;
  background: var(--hairline);
  color: var(--fg-mute);
}
.ntm-unassigned-icon svg { width: 14px; height: 14px; }
.ntm-prio-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
}
.ntm-prio {
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0.5px solid var(--hairline);
  background: var(--glass-fill-faint);
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px; font-weight: 540;
  color: var(--fg-mute);
}
.ntm-prio .pf-enum-dot { background: currentColor; }
.ntm-prio.active { color: var(--fg); border-width: 1.2px; }
.ntm-prio-slate.active { border-color: #64748b; background: color-mix(in oklch, #64748b, transparent 88%); }
.ntm-prio-blue.active  { border-color: #3b82f6; background: color-mix(in oklch, #3b82f6, transparent 86%); color: #2563eb; }
.ntm-prio-amber.active { border-color: #f59e0b; background: color-mix(in oklch, #f59e0b, transparent 86%); color: #b45309; }
.ntm-prio-red.active   { border-color: #ef4444; background: color-mix(in oklch, #ef4444, transparent 86%); color: #b91c1c; }

.ntm-stars { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.tp-star-edit { cursor: pointer; }
.ntm-clear {
  appearance: none; background: none; border: 0;
  color: var(--fg-mute); font-size: 11.5px; cursor: pointer; text-decoration: underline;
}
.ntm-range {
  width: 100%;
  accent-color: var(--brand-blue, #3b82f6);
}
.ntm-custom {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px;
  border: 0.5px dashed var(--hairline);
  border-radius: 12px;
  background: var(--glass-fill-faint);
}
.ntm-custom-head {
  display: flex; align-items: center; justify-content: space-between;
}
.ntm-add-btn {
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  background: transparent;
  border: 0.5px solid var(--hairline);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11.5px;
  color: var(--brand-blue, #2563eb);
}
.ntm-add-btn svg { width: 12px; height: 12px; }
.ntm-custom-empty {
  font-size: 12px; color: var(--fg-mute);
}
.ntm-custom-row {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 1.4fr 28px;
  gap: 8px;
  align-items: center;
}
.ntm-rm-btn {
  appearance: none; cursor: pointer;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: transparent;
  border: 0.5px solid var(--hairline);
  border-radius: 8px;
  color: var(--fg-mute);
}
.ntm-rm-btn:hover { color: #ef4444; border-color: #ef4444; }
.ntm-rm-btn svg { width: 12px; height: 12px; }
.ntm-check-wrap {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--fg);
  padding: 7px 10px;
  border: 0.5px solid var(--hairline);
  border-radius: 10px;
  background: var(--glass-fill-faint);
}
.ntm-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 8px; gap: 12px;
  border-top: 0.5px solid var(--hairline-soft);
  margin-top: 4px;
}
.ntm-foot-hint { font-size: 12px; color: var(--fg-mute); }
.ntm-foot-actions { display: flex; gap: 8px; }
.ntm-delete-btn {
  color: var(--status-red, #ef4444) !important;
  margin-right: auto;
}
.ntm-delete-btn:hover {
  background: rgba(239, 68, 68, 0.08) !important;
}

/* =========================================================================
 * TP TASKS — scrollable wrap + new-row + custom cells
 * ========================================================================= */
.tp-table-wrap {
  border: 0.5px solid var(--hairline);
  border-radius: 14px;
  overflow: auto;
  max-height: 460px;
  background: var(--glass-fill-faint);
  scrollbar-width: thin;
  scrollbar-color: var(--hairline) transparent;
}
.tp-table-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.tp-table-wrap::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 999px; }
.tp-table-wrap .tp-table { border: 0; border-radius: 0; min-width: 940px; }
/* Header sticks to top of the wrap; horizontal scroll is shared because head & body live in the same scroller. */
.tp-table-wrap .tp-thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--glass-fill-strong, var(--glass-fill-faint));
  backdrop-filter: blur(6px);
}
.tp-tbody {
  max-height: none;
  overflow: visible;
}
.tp-tbody {
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--hairline) transparent;
}
.tp-tbody::-webkit-scrollbar { width: 8px; }
.tp-tbody::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 999px; }
.tp-trow-new {
  background: color-mix(in oklch, var(--brand-blue, #3b82f6), transparent 92%);
  animation: tpNewFlash 1.6s ease-out;
}
@keyframes tpNewFlash {
  0% { background: color-mix(in oklch, var(--brand-blue, #3b82f6), transparent 70%); }
  100% { background: color-mix(in oklch, var(--brand-blue, #3b82f6), transparent 92%); }
}
.tp-new-pill {
  margin-left: 6px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--brand-blue, #3b82f6);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
}
.tp-unassigned {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--fg-mute); font-style: italic;
}
.tp-unassigned svg { width: 14px; height: 14px; opacity: 0.7; }
.tp-empty { color: var(--fg-faint); }
.tp-cell-custom { font-size: 12.5px; color: var(--fg); }

/* =========================================================================
 * LEADERBOARD
 * ========================================================================= */
.lb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.lb-card {
  border: 0.5px solid var(--hairline);
  border-radius: 16px;
  background: var(--glass-fill-faint);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.lb-card-head {
  position: relative;
  padding: 14px 16px 16px;
  color: white;
}
.lb-card-eyebrow {
  font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  font-weight: 700;
  opacity: 0.85;
}
.lb-card-title {
  margin-top: 4px;
  font-size: 15px; font-weight: 650;
  letter-spacing: -0.005em;
}
.lb-card-trophy {
  position: absolute;
  top: 10px; right: 14px;
  font-size: 26px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25));
}
.lb-top {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 16px 14px;
  border-bottom: 0.5px solid var(--hairline-soft);
}
.lb-top-avatar-wrap { position: relative; }
.lb-rank-1 {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 22px; height: 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: white;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800;
  border: 2px solid var(--glass-fill-faint);
  box-shadow: 0 2px 4px rgba(0,0,0,0.18);
}
.lb-top-body { flex: 1; min-width: 0; }
.lb-top-name {
  font-size: 14.5px; font-weight: 640;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lb-top-meta {
  margin-top: 3px;
  display: flex; gap: 6px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--fg-mute);
}
.lb-top-streak {
  margin-top: 5px;
  font-size: 11.5px;
  color: #b45309;
  font-weight: 540;
}
.lb-list {
  display: flex; flex-direction: column;
  padding: 8px 12px 12px;
  gap: 6px;
}
.lb-row {
  display: grid;
  grid-template-columns: 22px 24px 1fr 80px 32px 16px;
  align-items: center;
  gap: 8px;
  padding: 4px 4px;
  font-size: 12px;
}
.lb-row-rank {
  font-weight: 700;
  color: var(--fg-mute);
  text-align: center;
  font-size: 11px;
}
.lb-row-name {
  font-weight: 540;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lb-row-bar {
  height: 6px;
  background: var(--hairline);
  border-radius: 999px;
  overflow: hidden;
}
.lb-row-bar-fill { height: 100%; border-radius: 999px; }
.lb-row-score { text-align: right; font-weight: 600; }
.lb-row-trend.up { color: #059669; }
.lb-row-trend.down { color: #dc2626; }
.lb-row-trend.flat { color: var(--fg-faint); }

@media (max-width: 720px) {
  .ntm-row { grid-template-columns: 1fr; }
  .ntm-prio-row { grid-template-columns: repeat(2, 1fr); }
  .ntm-custom-row { grid-template-columns: 1fr 1fr; }
}


/* =========================================================================
 * NEW TASK MODAL — Time Required + Milestones additions
 * ========================================================================= */
.ntm-time-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ntm-time {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 0.5px solid var(--hairline);
  background: var(--glass-fill-faint);
  font-size: 12.5px;
  color: var(--fg);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ntm-time svg { width: 14px; height: 14px; color: var(--fg-mute); }
.ntm-time:hover { border-color: var(--fg-faint); }
.ntm-time.active {
  background: var(--brand-blue, #2563eb);
  border-color: transparent;
  color: white;
}
.ntm-time.active svg { color: white; }

.ntm-time-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 0.5px dashed var(--hairline);
  background: var(--glass-fill-faint);
}
.ntm-time-custom-input {
  width: 110px;
  -moz-appearance: textfield;
}
.ntm-time-custom-input::-webkit-outer-spin-button,
.ntm-time-custom-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.ntm-time-unit-row {
  display: inline-flex;
  gap: 0;
  border-radius: 8px;
  border: 0.5px solid var(--hairline);
  overflow: hidden;
  background: var(--glass-fill);
}
.ntm-time-unit {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-mute);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ntm-time-unit:hover { color: var(--fg); }
.ntm-time-unit.active {
  background: var(--brand-blue, #2563eb);
  color: white;
}

.ntm-milestones {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 0.5px solid var(--hairline);
  background: var(--glass-fill-faint);
}
.ntm-milestones-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.ntm-milestones-hint {
  font-size: 11.5px;
  color: var(--fg-mute);
  margin-top: 3px;
  text-wrap: pretty;
}
.ntm-milestones-empty {
  font-size: 12px;
  color: var(--fg-mute);
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px dashed var(--hairline);
  background: rgba(0,0,0,0.015);
}
[data-theme="dark"] .ntm-milestones-empty { background: rgba(255,255,255,0.02); }

.ntm-milestones-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ntm-milestone {
  display: grid;
  grid-template-columns: 28px 1fr 60px 28px;
  gap: 8px;
  align-items: center;
}
.ntm-milestone-check {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1.5px solid var(--hairline);
  background: var(--glass-fill);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-mute);
  font-size: 11px;
  font-weight: 600;
  transition: all 0.18s;
}
.ntm-milestone-check svg { width: 14px; height: 14px; }
.ntm-milestone-num { font-size: 11.5px; }
.ntm-milestone.done .ntm-milestone-check {
  background: linear-gradient(135deg, #4ade80, #059669);
  border-color: transparent;
  color: white;
}
.ntm-milestone.done .ntm-milestone-input {
  text-decoration: line-through;
  color: var(--fg-mute);
}
.ntm-milestone-input { width: 100%; }
.ntm-milestone-slice {
  font-size: 11px;
  color: var(--fg-mute);
  text-align: right;
}
.ntm-milestone.done .ntm-milestone-slice { color: #059669; font-weight: 600; }

.ntm-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
  border-top: 0.5px solid var(--hairline-soft);
}
.ntm-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  color: var(--fg-mute);
}
.ntm-progress-track {
  display: flex;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--hairline);
  overflow: hidden;
  gap: 2px;
  padding: 0;
}
.ntm-progress-empty {
  width: 0%;
  height: 100%;
}
.ntm-progress-seg {
  height: 100%;
  background: rgba(0,0,0,0.04);
  transition: background 0.25s ease, transform 0.25s ease;
}
[data-theme="dark"] .ntm-progress-seg { background: rgba(255,255,255,0.05); }
.ntm-progress-seg.done {
  background: linear-gradient(90deg, #4ade80, #059669);
}
.ntm-progress-seg:first-child { border-top-left-radius: 999px; border-bottom-left-radius: 999px; }
.ntm-progress-seg:last-child  { border-top-right-radius: 999px; border-bottom-right-radius: 999px; }


/* New task modal — fullscreen + head action group */
.ntm-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ntm-backdrop.ntm-fullscreen {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
}
.ntm-backdrop.ntm-fullscreen {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
  /* Solid white (light) / solid surface (dark) — no blur, no scrim */
  background: #ffffff;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
[data-theme="dark"] .ntm-backdrop.ntm-fullscreen {
  background: var(--bg, #0b0d12);
}
.ntm-backdrop.ntm-fullscreen .ntm-shell {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border-radius: 0;
  border: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}
.ntm-backdrop.ntm-fullscreen .ntm-head {
  border-bottom: 0.5px solid var(--hairline);
  background: transparent;
}
/* Side menu layout (fullscreen edit) */
.ntm-content { display: contents; }
.ntm-backdrop.ntm-fullscreen .ntm-content-fs {
  display: grid;
  grid-template-columns: 240px 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.ntm-side {
  border-right: 0.5px solid var(--hairline);
  padding: 24px 18px;
  overflow-y: auto;
  background: var(--glass-fill-faint);
}
[data-theme="dark"] .ntm-side { background: rgba(255,255,255,0.02); }
.ntm-side-eyebrow {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--fg-mute);
  margin-bottom: 8px;
  padding: 0 8px;
}
.ntm-side-nav { display: flex; flex-direction: column; gap: 2px; }
.ntm-side-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--fg);
  text-decoration: none;
  transition: background 0.15s;
}
.ntm-side-link svg { width: 15px; height: 15px; color: var(--fg-mute); flex: none; }
.ntm-side-link:hover { background: var(--glass-fill); }
.ntm-side-link:hover svg { color: var(--brand-blue); }
.ntm-side-team {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
}
.ntm-side-team-name { font-size: 12.5px; font-weight: 540; color: var(--fg); line-height: 1.2; }
.ntm-side-team-role { font-size: 10.5px; color: var(--fg-faint); margin-top: 2px; }
.ntm-side-status {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 10px;
}
.ntm-side-progress { font-size: 12px; font-weight: 600; color: var(--fg); }

.ntm-backdrop.ntm-fullscreen .ntm-content-fs .ntm-body {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 32px 24px;
  width: 100%;
  flex: none;
  overflow-y: auto;
  height: 100%;
}
.ntm-backdrop.ntm-fullscreen .ntm-body {
  max-width: 920px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 32px 40px;
  flex: 1;
  overflow-y: auto;
}
.ntm-backdrop.ntm-fullscreen .ntm-foot {
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
}
@media (min-width: 1100px) {
  .ntm-backdrop.ntm-fullscreen .ntm-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Pulse audit log ─────────────────────────────────────────────────── */
.pulse-detail {
  display: flex; flex-direction: column;
  gap: 18px;
  padding: 18px 22px 28px;
}
.pulse-head { display: flex; flex-direction: column; gap: 4px; }
.pulse-eyebrow {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--fg-faint); font-weight: 600;
}
.pulse-title { font-size: 22px; font-weight: 700; color: var(--fg); margin: 0; }
.pulse-sub   { font-size: 13.5px; color: var(--fg-faint); margin: 0; max-width: 64ch; }

.pulse-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.pulse-search { flex: 1 1 280px; max-width: 380px; }
.pulse-filters { display: flex; gap: 6px; flex-wrap: wrap; }

.pulse-feed { display: flex; flex-direction: column; gap: 22px; }

.pulse-day { display: flex; flex-direction: column; gap: 10px; }
.pulse-day-head {
  display: flex; align-items: center; gap: 10px;
  padding: 0 4px;
}
.pulse-day-label {
  font-size: 12.5px; font-weight: 700; color: var(--fg);
  letter-spacing: 0.02em;
}
.pulse-day-count { font-size: 11.5px; color: var(--fg-faint); }
.pulse-day-line { flex: 1; height: 1px; background: var(--border); }

.pulse-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column;
}
.pulse-row {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  padding: 0;
}
.pulse-rail {
  display: flex; flex-direction: column; align-items: center;
  padding-top: 8px;
}
.pulse-rail-line {
  flex: 1; width: 2px; min-height: 14px;
  background: linear-gradient(to bottom, var(--border), transparent);
  margin-top: 6px;
}
.pulse-row:last-child .pulse-rail-line { display: none; }

.pulse-avatar {
  width: 32px; height: 32px; border-radius: 999px;
  display: grid; place-items: center;
  color: #fff; font-size: 11px; font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
  flex: 0 0 auto;
}

.pulse-card {
  background: var(--glass-fill-faint);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex; flex-direction: column; gap: 6px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.pulse-card:hover {
  background: var(--glass-fill);
  border-color: var(--border-strong, var(--border));
}
.pulse-card-top {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.pulse-itemno {
  font-size: 11.5px; font-weight: 600; color: var(--fg-faint);
  background: var(--glass-fill);
  padding: 2px 8px; border-radius: 6px;
}
.pulse-when {
  font-size: 11.5px; color: var(--fg-faint);
  margin-left: auto;
}
.pulse-summary {
  font-size: 13.5px; color: var(--fg);
  line-height: 1.45;
}
.pulse-flow {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
}
.pulse-flow-from { color: var(--fg-faint); }
.pulse-flow-arrow { color: var(--fg-faint); opacity: 0.5; }
.pulse-flow-to { color: var(--fg); font-weight: 600; }
.pulse-byline {
  font-size: 11.5px; color: var(--fg-faint);
  margin-top: 2px;
}
.pulse-by-name { color: var(--fg); font-weight: 600; }
.pulse-by-role, .pulse-by-time { color: var(--fg-faint); }



/* =========================================================================
 * BOQ Automation — clickable rows + run sub-peek + view-all peek
 * ========================================================================= */

.boq-trow.boq-trow-click {
  cursor: pointer;
}
.boq-trow.boq-trow-click:focus-visible {
  outline: none;
  background: var(--glass-fill-faint);
  box-shadow: inset 2px 0 0 var(--brand-blue);
}

.icon-btn.boqa-viewall {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  border: 0.5px solid var(--hairline);
  background: var(--glass-fill-faint);
  color: var(--fg-mute);
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}
.icon-btn.boqa-viewall:hover {
  color: var(--bg-base);
  background: var(--fg);
  border-color: var(--fg);
}

/* Sub-peek (sits on top of the main page) */
.peek-backdrop.boqa-peek {
  z-index: 220;
  background: rgba(8,12,28,0.32);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
[data-theme="dark"] .peek-backdrop.boqa-peek { background: rgba(0,4,16,0.45); }
.peek-backdrop.boqa-peek.peek-expanded {
  z-index: 230;
}

/* Hero header */
.boqa-peek-hero {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 16px;
  align-items: center;
  padding: 28px 32px 20px;
  border-bottom: 0.5px solid var(--hairline-soft);
}
.boqa-peek-hero-icon {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, oklch(0.62 var(--brand-c) var(--brand-h)), oklch(0.48 var(--brand-c) var(--brand-h)));
  color: #fff;
  box-shadow: 0 12px 32px oklch(0.62 var(--brand-c) var(--brand-h) / 0.35);
}
.boqa-peek-hero-icon svg { width: 26px; height: 26px; }
.boqa-peek-eyebrow {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-faint);
  font-weight: 600;
}
.boqa-peek-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 4px 0 10px;
  text-wrap: balance;
}
.boqa-peek-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Stats row */
.boqa-peek-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 20px 32px 8px;
}
@media (max-width: 720px) {
  .boqa-peek-stats { grid-template-columns: repeat(2, 1fr); }
}
.boqa-peek-stat {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--glass-fill-faint);
  border: 0.5px solid var(--hairline-soft);
}
.boqa-peek-stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-faint);
  font-weight: 600;
  margin-bottom: 6px;
}
.boqa-peek-stat-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Section titles within peek */
.boqa-peek-section-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 24px 32px 10px;
}

/* Package list */
.boqa-peek-pkglist {
  margin: 0 32px;
  border-radius: 12px;
  border: 0.5px solid var(--hairline-soft);
  overflow: hidden;
}
.boqa-peek-pkghead, .boqa-peek-pkgrow {
  display: grid;
  grid-template-columns: 1.6fr 90px 110px 130px;
  align-items: center;
  padding: 10px 14px;
}
.boqa-peek-pkghead {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-faint);
  background: var(--glass-fill-faint);
  border-bottom: 0.5px solid var(--hairline);
}
.boqa-peek-pkgrow {
  font-size: 13px;
  border-bottom: 0.5px solid var(--hairline-soft);
}
.boqa-peek-pkgrow:last-child { border-bottom: 0; }
.boqa-peek-pkgname { font-weight: 500; }
.boqa-peek-pkgnum { text-align: right; font-size: 13px; color: var(--fg-mute); }
.boqa-peek-pkgnum strong { color: var(--fg); font-weight: 500; }

/* Two-up grid (exceptions + benchmark) */
.boqa-peek-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 0 32px;
  margin-top: 8px;
}
@media (max-width: 720px) {
  .boqa-peek-grid { grid-template-columns: 1fr; }
}

.boqa-peek-exclist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.boqa-peek-excrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--glass-fill-faint);
  border: 0.5px solid var(--hairline-soft);
}
.boqa-peek-exccount {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.boqa-peek-bench {
  border-radius: 12px;
  border: 0.5px solid var(--hairline-soft);
  background: var(--glass-fill-faint);
  overflow: hidden;
}
.boqa-peek-benchrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  font-size: 13px;
  border-bottom: 0.5px solid var(--hairline-soft);
}
.boqa-peek-benchrow:last-child { border-bottom: 0; }
.boqa-peek-benchrow strong { font-weight: 500; }

/* Timeline */
.boqa-peek-timeline {
  margin: 0 32px;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 1.5px solid var(--hairline);
  padding-left: 18px;
  position: relative;
}
.boqa-peek-tlrow {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: flex-start;
  padding: 10px 0;
  position: relative;
}
.boqa-peek-tltime {
  font-size: 11.5px;
  color: var(--fg-faint);
  font-weight: 500;
  padding-top: 1px;
}
.boqa-peek-tldot {
  position: absolute;
  left: -25px;
  top: 14px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand-blue);
  box-shadow: 0 0 0 3px var(--surface-1, var(--bg-base));
}
.boqa-peek-tllabel {
  font-size: 13px;
  font-weight: 500;
}
.boqa-peek-tlnote {
  font-size: 12px;
  color: var(--fg-mute);
  margin-top: 2px;
}

/* All-runs peek header */
.boqa-allruns-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 32px 18px;
  border-bottom: 0.5px solid var(--hairline-soft);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.boqa-allruns-head .boqa-peek-title {
  margin: 0 0 4px;
  font-size: 20px;
}
.peek-backdrop.boqa-peek .boq-table {
  margin: 0 32px;
}


/* =========================================================================
   Bidding Event page
   ========================================================================= */

.boq-stats.be-kpis { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1500px) { .boq-stats.be-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1100px) { .boq-stats.be-kpis { grid-template-columns: repeat(2, 1fr); } }

.be-section { margin-bottom: 0; }

.be-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-m);
}
@media (max-width: 1100px) { .be-grid-2 { grid-template-columns: 1fr; } }

/* ---------- Funnel ---------- */
.be-funnel-legend {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--fg-mute);
}
.be-fl { width: 12px; height: 8px; border-radius: 2px; }
.be-fl-full { background: var(--brand-blue); }
.be-fl-w { background: oklch(0.74 0.16 152); }

.be-funnel { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.be-funnel-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  align-items: center;
}
.be-funnel-stage { display: flex; gap: 10px; align-items: center; }
.be-funnel-step {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
  font-size: 11px; font-weight: 600;
  flex-shrink: 0;
}
.be-funnel-name { font-size: 13px; font-weight: 600; color: var(--fg); }
.be-funnel-meta { font-size: 11px; color: var(--fg-faint); margin-top: 1px; }
.be-funnel-bars { display: flex; flex-direction: column; gap: 4px; }
.be-funnel-bar {
  display: flex; align-items: center; justify-content: flex-end;
  padding: 0 10px;
  height: 22px;
  border-radius: 6px;
  font-size: 11.5px; font-weight: 600;
  color: white;
  min-width: 56px;
  transition: width 280ms ease;
}
.be-funnel-bar-full { background: var(--brand-blue); }
.be-funnel-bar-w { background: oklch(0.62 0.14 158); }

/* ---------- Active bids table ---------- */
.be-active-table .boq-thead,
.be-active-table .boq-trow {
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.4fr) 0.8fr 0.9fr 1fr 1fr 0.9fr 1fr 0.9fr;
}
.be-trow.be-tone-red { box-shadow: inset 3px 0 0 var(--status-red); }
.be-trow.be-tone-amber { box-shadow: inset 3px 0 0 oklch(0.7 0.16 65); }
.be-row-warn { background: oklch(0.66 0.20 25 / 0.04); }

.be-client { font-size: 12.5px; font-weight: 600; color: var(--fg); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.be-deadline-date { font-size: 12px; font-weight: 600; color: var(--fg); margin-bottom: 4px; }

.be-win, .be-docs { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.be-win-bar, .be-docs-bar {
  flex: 1; max-width: 60px;
  height: 4px; border-radius: 999px;
  background: var(--glass-fill-faint);
  overflow: hidden;
}
.be-win-fill { height: 100%; background: var(--brand-blue); border-radius: 999px; }
.be-docs-fill { height: 100%; border-radius: 999px; }
.be-docs-green { background: oklch(0.74 0.16 152); }
.be-docs-amber { background: oklch(0.72 0.16 65); }
.be-docs-red { background: var(--status-red); }

.be-avatar {
  width: 24px; height: 24px;
  border-radius: 999px;
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 600;
  border: 1px solid var(--hairline-soft);
}
.be-avatar-bd { background: oklch(0.78 0.16 65 / 0.18); color: oklch(0.55 0.16 55); }
[data-theme="dark"] .be-avatar-bd { color: oklch(0.85 0.16 70); }

/* ---------- Calendar ---------- */
.be-cal-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--fg-mute); }
.be-cal-dot { width: 8px; height: 8px; border-radius: 999px; }
.be-cal-dot-deadline { background: var(--brand-blue); }
.be-cal-dot-meet { background: oklch(0.72 0.16 295); }
.be-cal-dot-visit { background: oklch(0.7 0.14 65); }
.be-cal-dot-open { background: oklch(0.62 0.14 158); }

.be-cal { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.be-cal-head {
  display: grid; grid-template-columns: repeat(7, 1fr);
  font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--fg-faint);
  padding: 0 6px 6px;
}
.be-cal-week {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  border-radius: 10px;
  padding: 4px;
  position: relative;
}
.be-cal-load-cool { background: oklch(0.95 0.04 var(--brand-h, 250) / 0.4); }
.be-cal-load-warm { background: oklch(0.78 0.14 65 / 0.10); }
.be-cal-load-hot  { background: oklch(0.66 0.20 25 / 0.10); box-shadow: inset 0 0 0 1px oklch(0.66 0.20 25 / 0.25); }
[data-theme="dark"] .be-cal-load-cool { background: oklch(0.40 0.06 var(--brand-h, 250) / 0.25); }
[data-theme="dark"] .be-cal-load-warm { background: oklch(0.55 0.12 65 / 0.18); }
[data-theme="dark"] .be-cal-load-hot  { background: oklch(0.55 0.18 25 / 0.20); }

.be-cal-cell {
  min-height: 86px;
  border-radius: 8px;
  padding: 6px;
  background: var(--glass-fill-faint);
  border: 0.5px solid var(--hairline-soft);
  display: flex; flex-direction: column; gap: 4px;
}
.be-cal-empty { background: transparent; border: 0.5px dashed var(--hairline-soft); opacity: 0.4; }
.be-cal-day { font-size: 11px; font-weight: 600; color: var(--fg-mute); }
.be-cal-events { display: flex; flex-direction: column; gap: 3px; }
.be-cal-event {
  font-size: 10.5px;
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
  border-radius: 4px;
  padding: 2px 5px;
  display: flex; align-items: center; gap: 4px; justify-content: space-between;
  white-space: nowrap; overflow: hidden;
}
.be-cal-event-ref { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; font-weight: 600; }
.be-cal-event-val { font-size: 9.5px; opacity: 0.85; }
.be-cal-event-urgent { background: oklch(0.66 0.20 25 / 0.16); color: var(--status-red); }
.be-cal-event-meet { background: oklch(0.72 0.16 295 / 0.18); color: oklch(0.46 0.18 295); }
.be-cal-event-visit { background: oklch(0.78 0.14 65 / 0.18); color: oklch(0.55 0.14 65); }
.be-cal-event-open { background: oklch(0.74 0.16 152 / 0.18); color: oklch(0.42 0.14 158); }
.be-cal-event-more { font-size: 10px; color: var(--fg-faint); padding-left: 5px; }

/* ---------- Win/Loss ---------- */
.be-wl { display: flex; flex-direction: column; gap: 10px; }
.be-wl-row {
  display: grid;
  grid-template-columns: 130px 1fr 110px;
  gap: 12px; align-items: center;
}
.be-wl-label { font-size: 12.5px; font-weight: 500; color: var(--fg); }
.be-wl-bar { height: 10px; border-radius: 999px; background: var(--glass-fill-faint); display: flex; overflow: hidden; }
.be-wl-fill { height: 100%; }
.be-wl-won { background: oklch(0.62 0.14 158); }
.be-wl-lost { background: oklch(0.66 0.20 25); opacity: 0.7; }
.be-wl-meta { font-size: 12px; color: var(--fg-mute); text-align: right; }
.be-wl-pending { font-size: 11px; color: var(--fg-faint); font-style: italic; }

.be-loss-bar {
  display: flex; height: 12px; border-radius: 999px; overflow: hidden;
  margin-bottom: 16px;
  border: 0.5px solid var(--hairline-soft);
}
.be-loss-seg { transition: flex 200ms ease; }
.be-loss-list { display: flex; flex-direction: column; gap: 6px; }
.be-loss-row { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; }
.be-loss-dot { width: 10px; height: 10px; border-radius: 3px; }
.be-loss-label { font-size: 12.5px; color: var(--fg); }
.be-loss-pct { font-size: 12px; color: var(--fg-mute); font-weight: 600; }

/* ---------- Economics ---------- */
.be-econ-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap-m);
  margin-bottom: 16px;
}
@media (max-width: 1100px) { .be-econ-summary { grid-template-columns: repeat(2, 1fr); } }
.be-econ-tile {
  border-radius: var(--radius-m);
  background: var(--glass-fill-faint);
  border: 0.5px solid var(--hairline-soft);
  padding: 14px 16px;
}
.be-econ-label { font-size: 11px; color: var(--fg-faint); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.be-econ-value { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--fg); }
.be-econ-sub { font-size: 11px; color: var(--fg-mute); margin-top: 2px; }

.be-econ-list { display: flex; flex-direction: column; }
.be-econ-list-head, .be-econ-list-row {
  display: grid;
  grid-template-columns: 2fr 0.6fr 0.7fr 0.7fr 0.7fr;
  gap: 12px;
  align-items: center;
  padding: 10px 4px;
  border-top: 0.5px solid var(--hairline-soft);
}
.be-econ-list-head {
  border-top: 0;
  border-bottom: 0.5px solid var(--hairline);
  font-size: 11px; font-weight: 600; color: var(--fg-faint);
  text-transform: uppercase; letter-spacing: 0.04em;
  padding-bottom: 8px;
}
.be-econ-list-bid { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.be-econ-bid-name { font-size: 12.5px; font-weight: 500; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.be-econ-hrs-bar { height: 3px; border-radius: 999px; background: var(--glass-fill-faint); overflow: hidden; }
.be-econ-hrs-fill { height: 100%; background: var(--brand-blue); border-radius: 999px; }

/* ---------- Compliance ---------- */
.be-comp-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--fg-mute); }
.be-comp-grid {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  align-items: center;
}
.be-comp-doch {
  font-size: 10.5px;
  color: var(--fg-faint);
  text-align: center;
  line-height: 1.2;
  padding: 4px 2px;
  word-break: break-word;
}
.be-comp-rowh {
  font-size: 12.5px; font-weight: 600;
  color: var(--fg);
  padding: 6px 12px 6px 0;
}
.be-comp-cell {
  height: 26px;
  border-radius: 5px;
  display: inline-block;
  width: 100%;
}
.be-comp-0 { background: oklch(0.66 0.20 25 / 0.55); }
.be-comp-1 { background: oklch(0.78 0.14 65 / 0.55); }
.be-comp-2 { background: oklch(0.62 0.14 158 / 0.55); }
.be-comp-legend .be-comp-cell { width: 14px; height: 14px; border-radius: 3px; }

/* ---------- Instruments ---------- */
.be-instr-table .boq-thead,
.be-instr-table .boq-trow {
  grid-template-columns: 1fr 1fr 1.6fr 1fr 1.4fr 1.2fr 1.2fr;
}
.be-mono { font-family: ui-monospace, monospace; font-size: 12px; color: var(--fg-mute); }

/* ---------- PQ ---------- */
.be-pq { display: flex; flex-direction: column; gap: 10px; }
.be-pq-row {
  display: grid;
  grid-template-columns: 150px 1fr 130px;
  gap: 12px; align-items: center;
}
.be-pq-label { font-size: 12.5px; font-weight: 500; color: var(--fg); }
.be-pq-bar { height: 10px; border-radius: 999px; background: var(--glass-fill-faint); overflow: hidden; }
.be-pq-fill { height: 100%; background: var(--brand-blue); border-radius: 999px; }
.be-pq-rej .be-pq-fill { background: var(--status-red); opacity: 0.55; }
.be-pq-meta { font-size: 12px; color: var(--fg-mute); text-align: right; }

.be-pq-targets { display: flex; flex-direction: column; gap: 8px; }
.be-pq-target {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-m);
  background: var(--glass-fill-faint);
  border: 0.5px solid var(--hairline-soft);
  gap: 12px;
}
.be-pq-target-name { font-size: 13px; font-weight: 600; color: var(--fg); }
.be-pq-target-sector { font-size: 11.5px; color: var(--fg-mute); margin-top: 2px; }

/* ---------- Compete ---------- */
.be-compete-table .boq-thead,
.be-compete-table .boq-trow {
  grid-template-columns: 2fr 0.7fr 0.9fr 1fr 1fr 1fr 1.4fr;
}
.be-gap-ok   { color: oklch(0.62 0.14 158); font-weight: 600; }
.be-gap-warn { color: oklch(0.65 0.16 65); font-weight: 600; }
.be-gap-bad  { color: var(--status-red); font-weight: 600; }
.be-winner-name { font-size: 12px; color: var(--fg-mute); font-style: italic; }

/* ---------- Risk ---------- */
.be-risk-grid {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  align-items: center;
}
.be-risk-corner { /* empty */ }
.be-risk-doch {
  font-size: 10.5px;
  color: var(--fg-faint);
  text-align: center;
  padding: 4px 2px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.be-risk-rowh {
  font-size: 12.5px; font-weight: 600;
  color: var(--fg);
  padding: 6px 12px 6px 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.be-risk-cell {
  height: 32px;
  border-radius: 5px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
  color: white;
}
/* low score = risky red, high = green */
.be-risk-v0,.be-risk-v1,.be-risk-v2,.be-risk-v3 { background: oklch(0.55 0.18 25); }
.be-risk-v4 { background: oklch(0.62 0.18 35); }
.be-risk-v5 { background: oklch(0.7 0.16 55); }
.be-risk-v6 { background: oklch(0.74 0.14 90); color: oklch(0.25 0.05 90); }
.be-risk-v7 { background: oklch(0.74 0.14 130); color: oklch(0.25 0.05 130); }
.be-risk-v8 { background: oklch(0.62 0.14 158); }
.be-risk-v9,.be-risk-v10 { background: oklch(0.52 0.14 158); }


/* =========================================================================
   Find Item page (Procurement)
   ========================================================================= */

.fi-page { padding: 0 4px 32px; }

.fi-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 8px;
}
.fi-crumb { color: var(--fg-mute); }
.fi-crumb-current { color: var(--brand-blue); font-weight: 600; }
.fi-crumb-sep { color: var(--fg-faint); }

/* ── Hero ─────────────────────────────────────────────────────────── */
.fi-hero {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  padding: 22px 24px;
  margin-bottom: 18px;
}
.fi-hero-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-right: 0.5px solid var(--hairline);
  padding-right: 20px;
}
.fi-project-pick { position: relative; }
.fi-project-btn,
.fi-deliver {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--glass-fill-faint);
  border: 0.5px solid var(--hairline);
  text-align: left;
  cursor: pointer;
  width: 100%;
  appearance: none;
  font: inherit;
  color: var(--fg);
  transition: background 0.15s, border-color 0.15s;
}
.fi-project-btn:hover { background: var(--glass-fill); border-color: var(--brand-blue-soft); }
.fi-project-icon,
.fi-deliver-icon {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
  flex-shrink: 0;
}
.fi-deliver { cursor: default; }
.fi-deliver-icon { background: var(--accent-amber-soft); color: oklch(0.55 0.16 55); }
[data-theme="dark"] .fi-deliver-icon { color: oklch(0.85 0.16 70); }
.fi-project-meta,
.fi-deliver-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.fi-project-label,
.fi-deliver-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-faint);
}
.fi-project-value,
.fi-deliver-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fi-deliver-pin {
  display: inline-block;
  margin-left: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-mute);
  font-weight: 500;
}
.fi-project-caret { color: var(--fg-faint); margin-left: auto; font-size: 11px; }

.fi-project-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--glass-fill-strong);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 0.5px solid var(--hairline);
  border-radius: 12px;
  padding: 6px;
  box-shadow: var(--glass-shadow);
  z-index: 30;
}
.fi-project-opt {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.fi-project-opt:hover { background: var(--glass-fill); }
.fi-project-opt.is-current { color: var(--brand-blue); font-weight: 600; }
.fi-project-opt-tick { color: var(--brand-blue); }
.fi-project-opt-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fi-project-opt-name { font-size: 13px; font-weight: 600; }
.fi-project-opt-sub { font-size: 11px; color: var(--fg-faint); font-weight: 400; }
.fi-project-opt.is-current .fi-project-opt-sub { color: var(--brand-blue); opacity: 0.75; font-weight: 400; }

/* Deliver-to: subtle fade animation when project changes (key={projectIdx}) */
.fi-deliver { animation: fiDeliverFlash 0.35s ease-out; }
@keyframes fiDeliverFlash {
  0% { background: oklch(var(--brand-l) var(--brand-c) var(--brand-h) / 0.08); }
  100% { background: transparent; }
}

/* ─────────────────────────────────────────────────────────────────────
 * Find Item — Category center peek
 * ===================================================================== */
.peek-backdrop.fi-peek {
  z-index: 220;
  background: rgba(8,12,28,0.32);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
[data-theme="dark"] .peek-backdrop.fi-peek { background: rgba(0,4,16,0.45); }
.peek-backdrop.fi-peek .peek-shell {
  width: min(1180px, 100%);
  max-width: 1180px;
}
.peek-backdrop.fi-peek.peek-expanded { z-index: 230; }
.peek-backdrop.fi-peek.peek-expanded .peek-shell { max-width: none; width: 100%; }

.fi-peek-scroll { padding-bottom: 32px; }

/* Hero */
.fi-peek-hero {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 28px 32px 22px;
  border-bottom: 0.5px solid var(--hairline-soft);
}
.fi-peek-hero-icon {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
}
.fi-peek-hero-icon svg { width: 28px; height: 28px; }
.fi-peek-eyebrow {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-mute);
  font-weight: 700;
}
.fi-peek-pills .pill {
  background: rgba(255,255,255,0.92);
  color: #0f172a;
  border: 1px solid rgba(15,23,42,0.10);
}
.fi-peek-pills .pill-blue { background: rgba(37,99,235,0.12); color: var(--brand-blue); border-color: transparent; }
.fi-peek-pills .pill-green { background: rgba(34,197,94,0.14); color: oklch(0.42 0.14 158); border-color: transparent; }
[data-theme="dark"] .fi-peek-pills .pill { background: rgba(20,24,40,0.92); color: #f8fafc; border-color: rgba(255,255,255,0.10); }
[data-theme="dark"] .fi-peek-pills .pill-green { color: oklch(0.82 0.16 152); }
.fi-peek-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 4px 0 10px;
  text-wrap: balance;
}
.fi-peek-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.fi-peek-hero-cta { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 720px) {
  .fi-peek-hero { grid-template-columns: 1fr; }
  .fi-peek-hero-cta { flex-direction: row; }
}

/* Section titles inside peek */
.fi-peek-section-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  color: var(--fg);
  margin: 28px 32px 14px;
}

/* Tile rails */
.fi-peek-rail {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin: 0 32px;
}
@media (max-width: 1100px) { .fi-peek-rail { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px)  { .fi-peek-rail { grid-template-columns: repeat(2, 1fr); } }

.fi-peek-tile {
  appearance: none;
  border: 0.5px solid var(--hairline);
  background: var(--glass-fill-faint);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--fg);
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.fi-peek-tile:hover {
  transform: translateY(-1px);
  border-color: var(--brand-blue);
  background: var(--glass-fill);
}
.fi-peek-tile-img {
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.fi-peek-tile-img-schem {
  background: var(--bg);
  border: 0.5px solid var(--hairline-soft);
  color: var(--fg-mute);
}
[data-theme="dark"] .fi-peek-tile-img-schem { background: oklch(0.18 0.02 260); color: var(--fg-mute); }
.fi-peek-tile-body { padding: 0 2px; }
.fi-peek-tile-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin-bottom: 2px;
}
.fi-peek-tile-hint {
  font-size: 11.5px;
  color: var(--fg-faint);
  line-height: 1.35;
}

/* Photo + Schematic placeholders fill their containers */
.fi-photo, .fi-schem { width: 100%; height: 100%; }
.fi-schem { padding: 8px; }

/* Results header */
.fi-peek-results-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 32px 32px 12px;
  padding-top: 24px;
  border-top: 0.5px solid var(--hairline-soft);
}
.fi-peek-results-count {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
}
.fi-peek-results-sort {
  font-size: 12px;
  color: var(--fg-mute);
}
.fi-peek-results-sort strong { color: var(--fg); margin: 0 4px; }

/* Filter strip */
.fi-peek-filter-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 32px 18px;
  padding-bottom: 16px;
  border-bottom: 0.5px solid var(--hairline-soft);
}
.fi-peek-filter {
  appearance: none;
  border: 0.5px solid var(--hairline);
  background: var(--glass-fill-faint);
  border-radius: 999px;
  padding: 7px 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.fi-peek-filter:hover { background: var(--glass-fill); border-color: var(--brand-blue-soft); }
.fi-peek-filter-caret { color: var(--fg-faint); font-size: 10px; }
.fi-peek-filter-all {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
[data-theme="dark"] .fi-peek-filter-all { background: var(--fg); color: var(--bg-deep); }
.fi-peek-filter-all:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); opacity: 0.92; }
.fi-peek-filter-stock { margin-left: auto; }
.fi-peek-stock-ico { font-size: 13px; }

/* Result placeholder grid */
.fi-peek-result-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 0 32px;
}
@media (max-width: 1100px) { .fi-peek-result-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px)  { .fi-peek-result-grid { grid-template-columns: repeat(2, 1fr); } }
.fi-peek-result-card {
  position: relative;
  border: 0.5px solid var(--hairline);
  background: var(--glass-fill-faint);
  border-radius: 14px;
  padding: 12px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fi-peek-result-fav {
  position: absolute; top: 12px; right: 12px;
  z-index: 2;
  width: 30px; height: 30px;
  border-radius: 999px;
  border: 0.5px solid var(--hairline);
  background: var(--glass-fill);
  color: var(--fg-mute);
  cursor: pointer;
  font-size: 14px;
  display: grid; place-items: center;
}
.fi-peek-result-fav:hover { color: oklch(0.6 0.18 25); }
.fi-peek-result-badge {
  position: absolute; top: 12px; left: 12px;
  z-index: 2;
  padding: 3px 8px;
  border-radius: 6px;
  background: oklch(0.74 0.16 152 / 0.20);
  color: oklch(0.42 0.14 158);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
[data-theme="dark"] .fi-peek-result-badge { color: oklch(0.85 0.16 152); }
.fi-peek-result-img {
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
}
.fi-peek-result-meta { display: flex; flex-direction: column; gap: 4px; padding: 4px 2px 2px; }
.fi-peek-result-brand {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.fi-peek-result-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.25;
}
.fi-peek-result-spec {
  font-size: 11px;
  color: var(--fg-mute);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fi-peek-result-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 0.5px solid var(--hairline);
}
.fi-peek-result-price { font-size: 14px; font-weight: 700; color: var(--fg); }
.fi-peek-result-price-na { color: var(--fg-faint); font-weight: 500; }
.fi-peek-result-unit { font-size: 10px; color: var(--fg-mute); font-weight: 500; margin-left: 2px; }
.fi-peek-result-lead { font-size: 11px; color: var(--brand-blue); font-weight: 600; }
.fi-peek-result-meta2 {
  display: flex; gap: 6px; flex-wrap: wrap;
  font-size: 10px; color: var(--fg-faint); font-weight: 500;
}
@keyframes fiSkel {
  0% { background-position: 0% 0; }
  100% { background-position: -200% 0; }
}

/* Filter dropdown */
.fi-peek-filter-wrap { position: relative; display: inline-flex; }
.fi-peek-filter-wrap.is-open .fi-peek-filter,
.fi-peek-filter.is-picked {
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
  border-color: transparent;
  font-weight: 600;
}
.fi-peek-filter-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(0,0,0,0.08);
  color: inherit;
  font-size: 10px;
  margin-left: 4px;
  cursor: pointer;
}
.fi-peek-filter-x:hover { background: rgba(0,0,0,0.18); }
.fi-peek-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 60;
  min-width: 240px;
  max-width: 340px;
  max-height: 360px;
  overflow-y: auto;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(15,23,42,0.10);
  border-radius: 12px;
  box-shadow: 0 24px 56px -12px rgba(15,23,42,0.28), 0 6px 16px rgba(15,23,42,0.12);
  padding: 6px;
}
[data-theme="dark"] .fi-peek-filter-menu {
  background: #ffffff;
  color: #0f172a;
}
.fi-peek-filter-menu-foot {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 6px 4px;
  background: #ffffff;
  border-top: 1px solid rgba(15,23,42,0.08);
  margin-top: 4px;
}
.fi-peek-filter-menu-btn {
  flex: 1;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.fi-peek-filter-menu-btn-clear {
  background: transparent;
  color: #64748b;
}
.fi-peek-filter-menu-btn-clear:hover { background: rgba(15,23,42,0.05); }
.fi-peek-filter-menu-btn-apply {
  background: var(--brand-blue);
  color: #ffffff;
}
.fi-peek-filter-menu-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1.5px solid rgba(15,23,42,0.25);
  background: #ffffff;
  margin-right: 8px;
  flex: none;
  font-size: 10px;
  color: #ffffff;
  line-height: 1;
}
.fi-peek-filter-opt.is-current .fi-peek-filter-menu-check {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
}
.fi-peek-filter-menu-head {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  padding: 8px 10px 6px;
  border-bottom: 1px solid rgba(15,23,42,0.08);
  margin-bottom: 4px;
}
.fi-peek-filter-opt {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
}
.fi-peek-filter-opt:hover { background: rgba(37,99,235,0.08); }
.fi-peek-filter-opt.is-current { background: rgba(37,99,235,0.10); color: var(--brand-blue); font-weight: 600; }
.fi-peek-filter-opt-label { flex: 1; }
.fi-peek-filter-tick { font-size: 11px; color: var(--brand-blue); }

/* Search column */
.fi-hero-search { display: flex; flex-direction: column; gap: 12px; }
.fi-search-scopes { display: flex; gap: 4px; }
.fi-scope {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 0.5px solid var(--hairline);
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  color: var(--fg-mute);
  font: inherit;
  font-size: 12px;
  transition: all 0.15s;
}
.fi-scope:hover { color: var(--fg); border-color: var(--fg-mute); }
.fi-scope.is-active {
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
  border-color: transparent;
  font-weight: 600;
}
.fi-scope-count {
  font-size: 11px;
  color: var(--fg-faint);
  font-weight: 500;
}
.fi-scope.is-active .fi-scope-count { color: var(--brand-blue); opacity: 0.7; }

.fi-search-box {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  align-items: center;
  height: 56px;
  border-radius: 14px;
  background: var(--glass-fill-strong);
  border: 1px solid var(--hairline);
  padding: 0 10px 0 0;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.fi-search-box:focus-within {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 4px var(--brand-blue-soft);
}
.fi-search-icon {
  display: grid; place-items: center;
  color: var(--fg-mute);
}
.fi-search-input {
  border: 0;
  background: transparent;
  outline: 0;
  font: inherit;
  font-size: 16px;
  color: var(--fg);
  padding: 0 8px;
  letter-spacing: -0.01em;
}
.fi-search-input::placeholder { color: var(--fg-faint); }
.fi-search-kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-faint);
  border: 0.5px solid var(--hairline);
  padding: 3px 6px;
  border-radius: 6px;
  margin-right: 6px;
}
.fi-search-go {
  appearance: none;
  border: 0;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--brand-blue);
  color: white;
  display: grid; place-items: center;
  cursor: pointer;
  transition: filter 0.15s;
}
.fi-search-go:hover { filter: brightness(1.1); }

.fi-search-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.fi-search-hint-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-faint);
  margin-right: 4px;
}
.fi-hint-chip {
  appearance: none;
  border: 0.5px solid var(--hairline);
  background: transparent;
  border-radius: 999px;
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
  color: var(--fg-mute);
  cursor: pointer;
  transition: all 0.15s;
}
.fi-hint-chip:hover {
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
  border-color: transparent;
}

/* ── Strip: recent + AI ───────────────────────────────────────────── */
.fi-strip {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 18px;
  margin-bottom: 22px;
}
.fi-recent { padding: 18px 20px; }
.fi-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.fi-section-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}
.fi-section-link {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12px;
  color: var(--brand-blue);
  cursor: pointer;
}
.fi-section-link:hover { text-decoration: underline; }

.fi-recent-list { display: flex; flex-direction: column; gap: 2px; }
.fi-recent-row {
  appearance: none;
  border: 0;
  background: transparent;
  display: grid;
  grid-template-columns: 24px 1fr auto 16px;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: var(--fg);
  transition: background 0.15s;
}
.fi-recent-row:hover { background: var(--glass-fill-faint); }
.fi-recent-ico { color: var(--fg-faint); display: grid; place-items: center; }
.fi-recent-q { font-size: 13px; font-weight: 500; }
.fi-recent-meta { font-size: 11px; color: var(--fg-faint); }
.fi-recent-arrow { color: var(--fg-faint); font-size: 14px; }

.fi-ai {
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(70% 80% at 100% 0%, var(--brand-blue-soft) 0%, transparent 60%),
    var(--glass-fill);
}
.fi-ai-spark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--brand-blue);
  color: white;
  display: grid; place-items: center;
  margin-bottom: 12px;
}
.fi-ai-eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-blue);
  font-weight: 600;
  margin-bottom: 4px;
}
.fi-ai-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.fi-ai-body {
  font-size: 12.5px;
  color: var(--fg-mute);
  line-height: 1.5;
  margin: 0 0 14px;
}
.fi-ai-actions { display: flex; gap: 8px; }
.btn-sm { height: 30px !important; padding: 0 12px !important; font-size: 12px !important; }

/* ── Category grid ────────────────────────────────────────────────── */
.fi-cat-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 4px 14px;
}
.fi-cat-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}
.fi-cat-controls { display: flex; align-items: center; gap: 16px; }
.fi-cat-meta { font-size: 12px; color: var(--fg-faint); }
.fi-cat-tabs { display: flex; gap: 2px; padding: 3px; background: var(--glass-fill-faint); border-radius: 10px; border: 0.5px solid var(--hairline); }
.fi-cat-tab {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 6px 12px;
  border-radius: 7px;
  font: inherit;
  font-size: 12px;
  color: var(--fg-mute);
  cursor: pointer;
  transition: all 0.15s;
}
.fi-cat-tab:hover { color: var(--fg); }
.fi-cat-tab.is-active {
  background: var(--glass-fill-strong);
  color: var(--fg);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15,23,42,0.06);
}

.fi-cat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.fi-cat-cell {
  appearance: none;
  border: 0.5px solid var(--hairline);
  background: var(--glass-fill);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border-radius: 14px;
  padding: 16px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: var(--fg);
  position: relative;
  transition: all 0.15s ease;
  min-height: 76px;
}
.fi-cat-cell:hover {
  border-color: var(--brand-blue);
  transform: translateY(-1px);
  box-shadow: var(--glass-shadow);
}
.fi-cat-ico {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--glass-fill-faint);
  color: var(--brand-blue);
  flex-shrink: 0;
  border: 0.5px solid var(--hairline);
  transition: background 0.15s;
}
.fi-cat-cell:hover .fi-cat-ico { background: var(--brand-blue-soft); }
.fi-cat-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.fi-cat-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fi-cat-count {
  font-size: 11px;
  color: var(--fg-faint);
  font-weight: 500;
}

.fi-cat-cell.is-tagged-live .fi-cat-ico {
  background: oklch(0.66 0.20 25 / 0.12);
  color: oklch(0.55 0.18 25);
}
[data-theme="dark"] .fi-cat-cell.is-tagged-live .fi-cat-ico { color: oklch(0.78 0.18 25); }
.fi-cat-cell.is-tagged-saved .fi-cat-ico {
  background: var(--accent-amber-soft);
  color: oklch(0.55 0.16 55);
}
[data-theme="dark"] .fi-cat-cell.is-tagged-saved .fi-cat-ico { color: oklch(0.85 0.16 70); }
.fi-cat-cell.is-tagged-rate .fi-cat-ico {
  background: oklch(0.74 0.16 152 / 0.18);
  color: oklch(0.42 0.14 158);
}
[data-theme="dark"] .fi-cat-cell.is-tagged-rate .fi-cat-ico { color: oklch(0.82 0.16 152); }

.fi-cat-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.fi-cat-tag-live { background: oklch(0.66 0.20 25 / 0.16); color: oklch(0.50 0.18 25); }
.fi-cat-tag-saved { background: var(--accent-amber-soft); color: oklch(0.55 0.16 55); }
.fi-cat-tag-rate { background: oklch(0.74 0.16 152 / 0.18); color: oklch(0.42 0.14 158); }
.fi-live-dot {
  width: 5px; height: 5px;
  border-radius: 999px;
  background: currentColor;
  animation: fiPulse 1.6s ease-in-out infinite;
}
@keyframes fiPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ── Spotlight ────────────────────────────────────────────────────── */
.fi-spot {
  position: relative;
  border-radius: var(--radius-l);
  background: linear-gradient(120deg,
    oklch(0.62 var(--brand-c) var(--brand-h)) 0%,
    oklch(0.48 var(--brand-c) calc(var(--brand-h) + 20)) 100%);
  color: white;
  padding: 28px 32px;
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: var(--glass-shadow);
}
.fi-spot-grid {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 28px;
  align-items: center;
  position: relative;
  z-index: 2;
}
.fi-spot-hatch {
  position: absolute;
  inset: 0;
  color: rgba(255,255,255,0.18);
  pointer-events: none;
  z-index: 1;
  mask-image: linear-gradient(105deg, black 0%, black 35%, transparent 70%);
}
.fi-spot-body { max-width: 720px; }
.fi-spot-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  margin-bottom: 10px;
}
.fi-spot-pulse {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--accent-amber);
  box-shadow: 0 0 0 4px rgba(255,255,255,0.15);
  animation: fiPulse 1.6s ease-in-out infinite;
}
.fi-spot-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0 0 8px;
  color: white;
}
.fi-spot-text {
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 18px;
  color: rgba(255,255,255,0.85);
  max-width: 560px;
}
.fi-spot-stats {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 28px;
  border-top: 1px solid rgba(255,255,255,0.18);
  padding-top: 14px;
  width: fit-content;
}
.fi-spot-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.6);
  margin-bottom: 4px;
}
.fi-spot-stat-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.fi-spot-stat-unit {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.7;
  margin-left: 2px;
}
.fi-spot-stat-good { color: oklch(0.85 0.18 145); }
.fi-spot-cta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
.fi-spot-cta .btn-primary {
  background: white !important;
  color: oklch(0.42 var(--brand-c) var(--brand-h)) !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
}
.fi-spot-cta .btn-glass {
  background: rgba(255,255,255,0.16) !important;
  color: white !important;
  border: 0.5px solid rgba(255,255,255,0.25) !important;
}
.fi-spot-cta .btn-glass:hover { background: rgba(255,255,255,0.24) !important; }
.fi-spot-foot {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  text-align: center;
  margin-top: 4px;
}

/* ── Brand row ────────────────────────────────────────────────────── */
.fi-brand-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.fi-brand-cell {
  appearance: none;
  border: 0.5px solid var(--hairline);
  background: var(--glass-fill);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: var(--fg);
  transition: all 0.15s;
  min-height: 132px;
}
.fi-brand-cell:hover {
  border-color: var(--brand-blue);
  transform: translateY(-1px);
}
.fi-brand-mark {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.02em;
}
.fi-brand-meta { display: flex; flex-direction: column; gap: 3px; }
.fi-brand-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.fi-brand-sku {
  font-size: 11px;
  color: var(--fg-faint);
  text-transform: lowercase;
}
.fi-brand-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--fg-mute);
  margin-top: auto;
}
.fi-brand-rating { color: oklch(0.55 0.16 55); font-weight: 600; }
[data-theme="dark"] .fi-brand-rating { color: oklch(0.85 0.16 70); }
.fi-brand-dot { color: var(--fg-faint); }

/* responsive */
@media (max-width: 1280px) {
  .fi-cat-grid { grid-template-columns: repeat(4, 1fr); }
  .fi-brand-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 980px) {
  .fi-hero { grid-template-columns: 1fr; }
  .fi-hero-left { border-right: 0; border-bottom: 0.5px solid var(--hairline); padding-right: 0; padding-bottom: 14px; }
  .fi-strip { grid-template-columns: 1fr; }
  .fi-cat-grid { grid-template-columns: repeat(3, 1fr); }
  .fi-spot-grid { grid-template-columns: 1fr; }
}

/* ── BOQ Automation · live pricing run (BOQFillPeek) ───────────────────── */
.boqf-peek .peek-shell { display: flex; flex-direction: column; }
.boqf-dl { height: 32px; padding: 0 14px; gap: 6px; }
.boqf-dl:disabled { opacity: 0.45; cursor: not-allowed; }
.boqf-error {
  display: flex; align-items: center; gap: 8px;
  margin: 24px 0; padding: 14px 16px; border-radius: 12px;
  background: var(--accent-amber-soft); color: var(--accent-amber);
  font-size: 13px; font-weight: 600;
}
.boqf-progress-wrap { margin: 18px 0 20px; }
.boqf-progress-row {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 8px;
}
.boqf-progress-label { font-size: 12.5px; color: var(--fg-mute); }
.boqf-progress-label strong { color: var(--fg); }
.boqf-progress-pct { font-size: 13px; font-weight: 700; color: var(--brand-blue); }

.boqf-table { margin-top: 4px; }
.boqf-thead, .boqf-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 120px 64px 130px;
  gap: 10px; align-items: center;
}
.boqf-thead {
  padding: 8px 12px; font-size: 10.5px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--fg-faint);
  border-bottom: 0.5px solid var(--hairline);
}
.boqf-section {
  margin: 10px 0 2px; padding: 8px 12px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--brand-blue);
  background: var(--brand-blue-soft); border-radius: 8px;
}
.boqf-row {
  padding: 9px 12px; font-size: 12.5px;
  border-bottom: 0.5px solid var(--hairline-soft);
  transition: background 160ms ease;
}
.boqf-srno { color: var(--fg-mute); font-size: 12px; }
.boqf-mat {
  color: var(--fg); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; min-width: 0;
}
.boqf-qty { text-align: right; color: var(--fg-mute); }
.boqf-uom { color: var(--fg-faint); font-size: 11.5px; }
.boqf-rate {
  text-align: right; display: flex; align-items: center;
  justify-content: flex-end; gap: 6px; min-height: 18px;
}
.boqf-rate-val { font-weight: 700; color: var(--status-green); }
.boqf-rate-na { color: var(--fg-faint); }
.boqf-row-active { background: var(--brand-blue-soft); }
.boqf-row-filled .boqf-rate-val { animation: boqf-pop 360ms ease; }
@keyframes boqf-pop {
  0% { opacity: 0; transform: translateY(4px); }
  100% { opacity: 1; transform: translateY(0); }
}
.boqf-loading {
  display: flex; align-items: center; gap: 10px;
  padding: 28px 12px; color: var(--fg-mute); font-size: 13px;
}

/* ── New-project modal ─────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 10, 16, 0.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.modal-card {
  width: 100%;
  max-width: 440px;
  border-radius: 18px;
  padding: 22px 22px 18px;
  display: flex;
  flex-direction: column;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--fg);
}
.modal-x {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--fg-faint);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.15s;
}
.modal-x:hover { background: var(--glass-fill); color: var(--fg); }
.modal-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-mute);
  margin-bottom: 6px;
}
.modal-label + .modal-input { margin-bottom: 14px; }
.modal-optional {
  font-weight: 400;
  color: var(--fg-faint);
  font-size: 11px;
}
.modal-input {
  appearance: none;
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 0.5px solid var(--glass-edge);
  background: var(--glass-fill);
  color: var(--fg);
  font: inherit;
  font-size: 13.5px;
  transition: border-color 0.15s, background 0.15s;
}
.modal-input::placeholder { color: var(--fg-faint); }
.modal-input:focus {
  outline: none;
  border-color: var(--brand-blue);
  background: var(--glass-fill-strong);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}
.modal-actions .btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ── Empty states ──────────────────────────────────────────────────────── */
.card-empty {
  padding: 40px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--fg-faint);
}
.proj-empty-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
}
.proj-empty-icon svg { width: 21px; height: 21px; }
.proj-empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 5px;
}
.proj-empty-sub {
  font-size: 13px;
  color: var(--fg-mute);
  margin: 0 auto 18px;
  max-width: 34ch;
  line-height: 1.55;
}

/* User-created project rows carry fewer columns than the old demo rows. */
.proj-row.proj-row-simple {
  grid-template-columns: 36px 1fr auto 28px;
  cursor: default;
}
.proj-row.proj-row-simple:hover { background: transparent; }
.proj-row-simple .proj-icon { color: var(--fg-mute); }
.proj-row-simple .proj-icon svg { width: 17px; height: 17px; }
.proj-remove {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--fg-faint);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transition: all 0.15s;
}
.proj-row-simple:hover .proj-remove { opacity: 1; }
.proj-remove:hover { background: var(--glass-fill); color: var(--fg); }
.proj-remove:focus-visible { opacity: 1; }

.kpi-delta.kpi-delta-muted { color: var(--fg-faint); }

/* Google account photos in the sidebar pill. */
.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

/* Neutral KPI delta — no green/red pill when there is nothing to trend. */
.kpi-delta.kpi-delta-muted {
  color: var(--fg-faint);
  background: transparent;
}
/* Stat strips that carry only a couple of real metrics. */
.boq-stats.boq-stats-compact {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* ── RDS submission view ───────────────────────────────────────────────── */
.sub-panel { margin-top: 22px; }
.sub-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin-bottom: 16px; flex-wrap: wrap;
}
.sub-title {
  font-family: var(--font-display); font-size: 19px; font-weight: 600;
  letter-spacing: -0.015em; margin: 0 0 3px; color: var(--fg);
}
.sub-sub { font-size: 12.5px; color: var(--fg-mute); margin: 0; max-width: 62ch; line-height: 1.5; }
.sub-actions { display: flex; gap: 8px; flex-shrink: 0; }

.sub-totals {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; margin-bottom: 16px;
}
.sub-total {
  background: var(--glass-fill); border: 0.5px solid var(--glass-edge);
  border-radius: 12px; padding: 12px 14px;
}
.sub-total label {
  display: block; font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--fg-faint); margin-bottom: 5px;
}
.sub-total b { font-size: 21px; font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; }
.sub-total small { font-size: 12px; font-weight: 500; color: var(--fg-mute); }

.sub-ahus {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.sub-ahu {
  background: var(--glass-fill); border: 0.5px solid var(--glass-edge);
  border-radius: 14px; padding: 14px; cursor: pointer; transition: all 0.15s ease;
}
.sub-ahu:hover { background: var(--glass-fill-strong); }
.sub-ahu.active { border-color: var(--brand-blue); box-shadow: 0 0 0 1px var(--brand-blue); }
.sub-ahu-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.sub-ahu-head strong { font-size: 14px; color: var(--fg); }
.sub-ahu-rooms { margin-left: auto; font-size: 11.5px; color: var(--fg-faint); }
.sub-chip {
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 999px;
  background: var(--brand-blue-soft); color: var(--brand-blue);
}
.sub-ahu-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 8px; margin-bottom: 12px;
}
.sub-ahu-grid label {
  display: block; font-size: 10px; color: var(--fg-faint); margin-bottom: 2px;
}
.sub-ahu-grid b { font-size: 14px; font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; }
.sub-ahu-grid small { font-size: 10.5px; font-weight: 500; color: var(--fg-faint); }

.sub-oa { border-top: 0.5px solid var(--hairline-soft); padding-top: 10px; margin-bottom: 10px; }
.sub-oa-label {
  display: block; font-size: 10px; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--fg-faint); margin-bottom: 6px;
}
.sub-oa-rules { display: flex; flex-wrap: wrap; gap: 5px; }
.sub-oa-rule {
  font-size: 10.5px; padding: 3px 8px; border-radius: 7px;
  background: rgba(var(--glass-tint), 0.55); color: var(--fg-mute);
  font-variant-numeric: tabular-nums;
}
.sub-oa-rule b { color: var(--fg-mute); font-weight: 600; }
/* The rule that actually set the fresh-air quantity. */
.sub-oa-rule.wins { background: var(--brand-blue-soft); color: var(--brand-blue); }
.sub-oa-rule.wins b { color: var(--brand-blue); }

.sub-ahu-plant {
  display: flex; flex-wrap: wrap; gap: 4px 12px;
  border-top: 0.5px solid var(--hairline-soft); padding-top: 10px;
  font-size: 11px; color: var(--fg-faint);
}
.sub-ahu-plant b { color: var(--fg-mute); font-weight: 600; font-variant-numeric: tabular-nums; }

.sub-table-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 10px; flex-wrap: wrap;
}
.sub-clear {
  appearance: none; border: 0; background: var(--brand-blue-soft);
  color: var(--brand-blue); font: inherit; font-size: 11.5px; font-weight: 500;
  padding: 4px 10px; border-radius: 999px; cursor: pointer;
}
.sub-table-scroll {
  overflow-x: auto; border: 0.5px solid var(--glass-edge);
  border-radius: 12px; background: var(--glass-fill);
}
.sub-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12px; }
.sub-table th {
  position: sticky; top: 0; z-index: 2;
  background: var(--glass-fill-strong); backdrop-filter: blur(8px);
  text-align: left; font-size: 10.5px; font-weight: 600; letter-spacing: 0.03em;
  color: var(--fg-mute); padding: 9px 10px; white-space: nowrap;
  border-bottom: 0.5px solid var(--hairline);
}
.sub-table td {
  padding: 8px 10px; white-space: nowrap; color: var(--fg-mute);
  border-bottom: 0.5px solid var(--hairline-soft);
}
.sub-table tbody tr:hover td { background: rgba(var(--glass-tint), 0.4); }
.sub-table tbody tr:last-child td { border-bottom: 0; }
.sub-num { text-align: right; font-variant-numeric: tabular-nums; }
.sub-name { color: var(--fg); font-weight: 500; max-width: 230px; overflow: hidden; text-overflow: ellipsis; }

/* Identity columns stay put while the wide numeric groups scroll. */
.sub-table .sub-pin { position: sticky; z-index: 1; background: var(--glass-fill-strong); }
.sub-table th.sub-pin { z-index: 3; }
.sub-pin-1 { left: 0; width: 46px; }
.sub-pin-2 { left: 46px; }
.sub-pin-3 { left: 126px; box-shadow: 1px 0 0 var(--hairline); }

.sub-empty {
  padding: 40px 20px; text-align: center; font-size: 13px; color: var(--fg-faint);
  border: 0.5px dashed var(--hairline); border-radius: 12px;
}


/* ==========================================================================
   Room Data Sheet
   --------------------------------------------------------------------------
   Entered by opening a take-off, never from the nav — so the screen has to
   say what drawing it is showing and carry the whole job: check the schedule,
   calculate, download. The table is the product, so it gets the room: a tall
   scroll area with the header row and the room name pinned, because checking
   200 rooms means scrolling in both directions without losing your place.
   ========================================================================== */

.rds-page {
  padding-bottom: 72px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.rds-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 14px 18px;
  margin-bottom: 2px;
  border-radius: var(--radius-l);
  background: var(--glass-fill-strong);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  box-shadow:
    inset 0 1.5px 0 var(--glass-rim-top),
    inset 0 0 0 0.5px var(--glass-edge),
    var(--glass-shadow);
}

.rds-identity { display: flex; align-items: center; gap: 13px; min-width: 0; }

/* The wordmark the module is known by. */
.rds-badge {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 14px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(155deg, var(--brand-blue), var(--brand-blue-deep));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 3px 10px oklch(0.62 var(--brand-c) var(--brand-h) / 0.32);
}

.rds-heading { min-width: 0; }
.rds-heading h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--fg);
}
.rds-source {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--fg-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46ch;
}
.rds-source strong { color: var(--fg); font-weight: 500; }

.rds-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rds-actions .btn { height: 34px; }
.rds-actions .btn:disabled { opacity: 0.42; cursor: not-allowed; }

/* ── Extraction summary ─────────────────────────────────────────────────── */

.rds-extract { display: flex; flex-direction: column; gap: 10px; }

.rds-chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px;
}
.rds-chip {
  padding: 11px 14px;
  border-radius: var(--radius-m);
  background: var(--glass-fill);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.rds-chip-val {
  font-size: 21px;
  font-weight: 600;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.rds-chip-lbl {
  margin-top: 2px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
/* A count of rooms still needing typing is a to-do, not a statistic. */
.rds-chip-warn { background: oklch(0.72 0.15 70 / 0.14); }
.rds-chip-warn .rds-chip-val { color: oklch(0.50 0.15 70); }
[data-theme="dark"] .rds-chip-warn .rds-chip-val { color: oklch(0.84 0.14 70); }

.rds-extract-meta {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  font-size: 12px; color: var(--fg-mute);
}
.rds-extract-meta code {
  font-size: 11.5px; padding: 1.5px 7px; border-radius: 6px;
  background: rgba(var(--glass-tint), 0.6); color: var(--fg-mute);
}
.rds-extract-sep { color: var(--fg-faint); }
.rds-extract-note {
  font-size: 12px; color: var(--fg-mute); line-height: 1.55;
  padding: 9px 12px; border-radius: 10px;
  background: var(--glass-fill-faint);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

/* ── Section card ───────────────────────────────────────────────────────── */

.rds-card {
  border-radius: var(--radius-l);
  background: var(--glass-fill);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  box-shadow:
    inset 0 1.5px 0 var(--glass-rim-top),
    inset 0 0 0 0.5px var(--glass-edge),
    var(--glass-shadow);
  overflow: hidden;
}
.rds-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  border-bottom: 0.5px solid var(--hairline);
}
.rds-card-head h2 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0;
  color: var(--fg);
}
.rds-card-sub { margin: 2px 0 0; font-size: 11.5px; color: var(--fg-faint); }
.rds-card-body { padding: 16px 18px; }

/* ── Project fields ─────────────────────────────────────────────────────── */

.rds-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 13px;
}
.rds-meta-field { display: flex; flex-direction: column; gap: 5px; }
.rds-meta-field span {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--fg-faint);
}
.rds-meta-field input {
  height: 34px; padding: 0 11px;
  border-radius: 9px;
  border: 1px solid var(--hairline);
  background: var(--glass-fill-faint);
  color: var(--fg);
  font-size: 13px;
  outline: none;
  transition: border-color 0.12s, background 0.12s;
}
.rds-meta-field input:focus {
  border-color: var(--brand-blue);
  background: var(--glass-fill-strong);
}

/* ── The sheet ──────────────────────────────────────────────────────────── */

/* Sticky cells cannot be translucent — whatever they cover would read through
   them. These give the pinned header and first column something solid to sit
   on. The sheet card then takes the same surface and drops the blur it
   inherits from .rds-card, for two reasons:

   Cost — blurring the backdrop of a card holding 249 rows means recompositing
   a very tall surface on every keystroke. Measured on the Zanzibar drawing:
   149 ms per keystroke with the blur, 94 ms without. That is the difference
   between a field that feels broken and one that does not.

   And it bought nothing: the pinned header and room-name column are opaque by
   necessity, and the rows cover the rest, so almost none of the blurred
   backdrop was ever visible. The glass rim and shadow still read as glass. */
.rds-sheet {
  --rds-solid: rgba(252, 252, 254, 0.97);
  background: var(--rds-solid);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
[data-theme="dark"] .rds-sheet { --rds-solid: rgba(23, 25, 39, 0.97); }

.rds-table-scroll {
  max-height: min(64vh, 660px);
  overflow: auto;
  overscroll-behavior: contain;
}
.rds-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12.5px; }

.rds-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 9px 10px;
  text-align: center;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg-faint);
  background: var(--rds-solid);
  border-bottom: 0.5px solid var(--hairline);
}
.rds-table tbody td {
  padding: 3px 5px;
  text-align: center;
  border-bottom: 0.5px solid var(--hairline-soft);
}
.rds-table tbody tr:last-child td { border-bottom: none; }
.rds-table tbody tr:hover td { background: rgba(var(--glass-tint), 0.42); }

/* Room name is pinned so a row stays identifiable while reading across. */
.rds-table th.rds-col-name,
.rds-table td.rds-col-name {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
  background: var(--rds-solid);
  box-shadow: 1px 0 0 var(--hairline);
}
.rds-table thead th.rds-col-name { z-index: 3; }
.rds-table tbody tr:hover td.rds-col-name { background: var(--rds-solid); }

/* A row the drawing could not measure. Flagged, not filled — the blank is the
   point, and this marks which blanks still need an engineer. */
.rds-row-todo td.rds-col-name { box-shadow: inset 2px 0 0 oklch(0.72 0.15 70), 1px 0 0 var(--hairline); }

.rds-cell {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border-radius: 7px;
  border: 0.5px solid transparent;
  background: transparent;
  color: var(--fg);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  outline: none;
  transition: background 0.12s, border-color 0.12s;
}
.rds-cell:hover { background: var(--glass-fill-faint); border-color: var(--hairline); }
.rds-cell:focus {
  background: var(--glass-fill-strong);
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px var(--brand-blue-soft);
}
.rds-cell-name { text-align: left; font-weight: 500; }
select.rds-cell { cursor: pointer; }

/* Read-only sheet: values, not fields. A dash marks what the drawing could not
   give — distinct from a zero, which would read as a measurement. */
.rds-table tbody td {
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  white-space: nowrap;
}
.rds-table td.rds-col-name {
  font-weight: 500;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rds-void { color: var(--fg-faint); }

.rds-row-del {
  width: 24px; height: 24px;
  border: none; border-radius: 7px;
  background: transparent;
  color: var(--fg-faint);
  font-size: 15px; line-height: 1; cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.rds-row-del:hover { background: oklch(0.62 0.20 25 / 0.14); color: oklch(0.58 0.20 25); }

.rds-sheet-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 18px;
  border-top: 0.5px solid var(--hairline);
  font-size: 12px; color: var(--fg-faint);
}

.rds-empty {
  padding: 46px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--fg-faint);
}
.rds-empty strong { display: block; font-size: 14px; color: var(--fg-mute); margin-bottom: 4px; }

/* ── Messages ───────────────────────────────────────────────────────────── */

.rds-error {
  padding: 11px 14px;
  border-radius: var(--radius-m);
  background: oklch(0.62 0.20 25 / 0.12);
  color: oklch(0.50 0.20 25);
  font-size: 13px;
  font-weight: 500;
  box-shadow: inset 0 0 0 0.5px oklch(0.62 0.20 25 / 0.28);
}
[data-theme="dark"] .rds-error { color: oklch(0.82 0.16 25); }

.rds-reopen {
  align-self: flex-start;
  padding: 9px 14px;
  border: none;
  border-radius: var(--radius-m);
  background: oklch(0.72 0.15 70 / 0.16);
  color: oklch(0.48 0.14 70);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background 0.12s;
}
.rds-reopen:hover { background: oklch(0.72 0.15 70 / 0.26); }
[data-theme="dark"] .rds-reopen { color: oklch(0.86 0.14 70); }

/* ── Results ────────────────────────────────────────────────────────────── */

.rds-results { display: flex; flex-direction: column; gap: 14px; }

.rds-stamp {
  padding: 11px 16px;
  border-radius: var(--radius-m);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-align: center;
}
.rds-stamp-prelim {
  background: oklch(0.72 0.15 70 / 0.16); color: oklch(0.46 0.14 70);
  box-shadow: inset 0 0 0 0.5px oklch(0.72 0.15 70 / 0.4);
}
[data-theme="dark"] .rds-stamp-prelim { color: oklch(0.86 0.14 70); }
.rds-stamp-ok {
  background: oklch(0.74 0.16 152 / 0.16); color: oklch(0.40 0.14 158);
  box-shadow: inset 0 0 0 0.5px oklch(0.74 0.16 152 / 0.4);
}
[data-theme="dark"] .rds-stamp-ok { color: oklch(0.84 0.14 155); }

.rds-warnings {
  margin: 0; padding: 12px 16px 12px 32px;
  border-radius: var(--radius-m);
  background: var(--glass-fill-faint);
  box-shadow: inset 0 0 0 1px var(--hairline);
  font-size: 12.5px; color: var(--fg-mute); line-height: 1.6;
}

.rds-ahu-head {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
}
.rds-ahu-head strong { font-family: var(--font-display); font-size: 15px; font-weight: 600; }
.rds-ahu-head span { font-size: 11.5px; color: var(--fg-faint); font-variant-numeric: tabular-nums; }

.rds-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  padding: 16px 18px;
}
.rds-stat {
  padding: 11px 13px;
  border-radius: var(--radius-m);
  background: var(--glass-fill-faint);
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.rds-stat label {
  display: block;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--fg-faint);
  margin-bottom: 3px;
}
.rds-stat b { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.015em; }
.rds-stat b small { font-size: 11px; font-weight: 500; color: var(--fg-faint); margin-left: 2px; }
/* Not computed is not zero. It is coloured as an absence so nobody reads a
   placeholder as a tonnage and buys a chiller against it. */
.rds-stat-void { background: oklch(0.62 0.20 25 / 0.09); }
.rds-stat-void b { font-size: 13px; font-weight: 500; color: oklch(0.54 0.18 25); }
[data-theme="dark"] .rds-stat-void b { color: oklch(0.82 0.16 25); }

.rds-table-out { font-size: 12px; }
.rds-table-out tbody td { padding: 7px 10px; font-variant-numeric: tabular-nums; }
.rds-out-name { text-align: left !important; white-space: nowrap; font-weight: 500; }

/* ── Blocking questions ─────────────────────────────────────────────────── */

.rds-modal-backdrop {
  position: fixed; inset: 0; z-index: 9000;
  display: grid; place-items: center; padding: 24px;
  background: rgba(10, 10, 16, 0.46);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.rds-modal {
  width: min(640px, 100%);
  max-height: 84vh;
  display: flex; flex-direction: column;
  border-radius: var(--radius-l);
  background: var(--card-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  box-shadow: inset 0 0 0 0.5px var(--glass-edge), var(--glass-shadow-lg);
}
.rds-modal-head { padding: 22px 24px 14px; border-bottom: 0.5px solid var(--hairline); }
.rds-modal-head h2 {
  margin: 0 0 5px; font-family: var(--font-display);
  font-size: 18px; font-weight: 600; letter-spacing: -0.015em;
}
.rds-modal-head p { margin: 0; font-size: 13px; color: var(--fg-mute); line-height: 1.5; }
.rds-modal-body { padding: 4px 24px; overflow-y: auto; }
.rds-modal-foot {
  display: flex; justify-content: flex-end; gap: 9px;
  padding: 14px 24px; border-top: 0.5px solid var(--hairline);
}

.rds-question { padding: 16px 0; border-bottom: 0.5px solid var(--hairline-soft); }
.rds-question:last-child { border-bottom: none; }
.rds-question-head { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; flex-wrap: wrap; }
.rds-question-head strong { font-size: 13.5px; }
.rds-col {
  font-size: 10.5px; padding: 1.5px 7px; border-radius: 6px;
  background: rgba(var(--glass-tint), 0.6); color: var(--fg-faint);
}
.rds-impact {
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 2.5px 8px; border-radius: var(--radius-pill);
}
.rds-impact-1 { background: oklch(0.62 0.20 25 / 0.16); color: oklch(0.50 0.20 25); }
.rds-impact-2 { background: oklch(0.72 0.15 70 / 0.18); color: oklch(0.48 0.14 70); }
.rds-impact-3, .rds-impact-4 { background: rgba(var(--glass-tint), 0.6); color: var(--fg-mute); }
[data-theme="dark"] .rds-impact-1 { color: oklch(0.82 0.16 25); }
[data-theme="dark"] .rds-impact-2 { color: oklch(0.86 0.14 70); }

.rds-question-text { margin: 0 0 5px; font-size: 13px; line-height: 1.5; }
.rds-why, .rds-detail, .rds-affected {
  margin: 0 0 4px; font-size: 12px; color: var(--fg-faint); line-height: 1.5;
}
.rds-why { font-style: italic; }

.rds-question input[type="text"], .rds-question select {
  width: 100%; height: 34px; margin-top: 7px; padding: 0 11px;
  border-radius: 9px; border: 1px solid var(--hairline);
  background: var(--glass-fill-faint); color: var(--fg);
  font-size: 13px; outline: none;
}
.rds-question input[type="text"]:focus, .rds-question select:focus { border-color: var(--brand-blue); }

.rds-scope {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  margin-top: 9px; font-size: 11.5px; color: var(--fg-faint);
}
.rds-scope label { display: flex; align-items: center; gap: 4px; color: var(--fg); cursor: pointer; }

@media (max-width: 900px) {
  .rds-topbar { align-items: flex-start; }
  .rds-actions { width: 100%; }
}

/* ---------------------------------------------------------------------------
   HVAC BOQ — boq-hvac.jsx
   Reuses the RDS primitives (.rds-page, .rds-card, .rds-sheet, .rds-table).
   Only what the RDS has no equivalent for is defined here.
   --------------------------------------------------------------------------- */

/* The way through from the RDS to the bill. The client asked for this to be
   prominent, so it carries a filled accent rather than sitting among the ghost
   buttons — it is the next thing an engineer does after Calculate. */
.btn-build-boq {
  background: linear-gradient(135deg, #2f7d5c, #1f5d43);
  border-color: #2f7d5c;
  font-weight: 600;
}
.btn-build-boq:hover:not(:disabled) {
  background: linear-gradient(135deg, #369068, #23694b);
}
.btn-build-boq:disabled { opacity: 0.4; }

/* A line whose rule disagrees with the client's signed sheet. Marked rather
   than hidden — HANDOFF §7.2 lists four questionnaire answers that are wrong,
   and someone ordering against one needs to see it. */
.boq-row-unconfirmed { background: rgba(190, 140, 40, 0.07); }
.boq-flag {
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(190, 140, 40, 0.18);
  color: #c89b3c;
  vertical-align: middle;
}

/* The arithmetic behind a quantity, in words. Quieter than the quantity, but
   present — a reviewer should be able to check a line without reading code. */
.boq-basis {
  font-size: 11px;
  color: var(--text-dim, #7b8794);
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.boq-gaps li { margin-bottom: 10px; }
.boq-gaps .rds-why { margin-top: 2px; }

.boq-duct-toggle {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.boq-duct-toggle input { width: auto; margin: 0; }

/* ══════════════════════════════════════════════════════════════════════════
   PROJECTS — board tiles, detail panel, and the states in between
   Everything above the tile art is inherited from the demo board. What is new
   here belongs to the live module: counts read off take-offs, the editable
   field rows in the detail panel, and the banners a real API needs when it is
   slow, unreachable or refuses a write.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Tile ───────────────────────────────────────────────────────────────── */

/* Counts, in place of the demo board's progress bar. Three at most, so they
   stay legible at tile width. */
.proj-tile-stats {
  display: flex;
  gap: 18px;
  margin: 12px 0 4px;
}
.proj-stat { min-width: 0; }
.proj-stat-value {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--fg);
  line-height: 1.2;
}
/* --fg-mute, not --fg-faint: these sit on frosted glass over a full-bleed
   illustration, and the faint token disappears into the brighter ones. */
.proj-stat-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-mute);
  letter-spacing: 0.01em;
  margin-top: 1px;
  white-space: nowrap;
}

/* A project with no drawings yet. Deliberately quiet: it is a fact about the
   project, not a warning. */
.proj-tile-quiet {
  margin: 12px 0 4px;
  font-size: 12px;
  color: var(--fg-faint);
}

.proj-tile-foot { gap: 10px; }
.proj-tile-budget {
  font-size: 11.5px;
  color: var(--fg-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Board chrome ───────────────────────────────────────────────────────── */

/* The search pill was a decorative label everywhere it appeared. Here it takes
   a real input, so it has to hold one without looking like a form field. */
.proj-search { cursor: text; }
.proj-search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  color: var(--fg);
}
.proj-search-input::placeholder { color: var(--fg-mute); }

.proj-empty-page {
  padding: 64px 24px;
  text-align: center;
}

/* Says which half of the screen is stale, and why. Used by the board, the
   dashboard card and the detail panel — one voice for one class of failure. */
.proj-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  border-radius: 10px;
  border: 0.5px solid oklch(0.66 0.20 25 / 0.28);
  background: oklch(0.66 0.20 25 / 0.10);
  color: oklch(0.45 0.18 25);
  font-size: 12.5px;
  line-height: 1.5;
}
.proj-banner span { flex: 1; min-width: 0; }
.proj-banner .btn { flex: 0 0 auto; }

.proj-error {
  margin: 4px 0 12px;
  font-size: 12.5px;
  color: oklch(0.50 0.18 25);
}

.proj-row-count {
  font-size: 11.5px;
  color: var(--fg-faint);
  white-space: nowrap;
}

/* ── Detail panel ───────────────────────────────────────────────────────── */

/* Two columns, not the four of .pf-row: a field the user can edit needs a
   label and a control, and nothing else earns the width. */
.proj-field {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 8px 4px;
  border-bottom: 0.5px solid var(--hairline-soft);
  font-size: 13px;
  border-radius: 6px;
  transition: background 0.1s;
}
.proj-field:hover { background: var(--glass-fill-faint); }
.proj-field:last-child { border-bottom: 0; }

/* .pf-input / .pf-textarea were referenced by the old peek and never styled —
   its fields were never saved, so nobody noticed. They are saved now. */
.pf-input,
.pf-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 10px;
  border-radius: 8px;
  border: 0.5px solid transparent;
  background: transparent;
  font: inherit;
  color: var(--fg);
  outline: none;
  transition: background 0.12s, border-color 0.12s;
}
.pf-input:hover,
.pf-textarea:hover { background: var(--glass-fill-faint); }
.pf-input:focus,
.pf-textarea:focus {
  background: var(--surface);
  border-color: oklch(0.62 var(--brand-c) var(--brand-h) / 0.45);
}
.pf-input::placeholder,
.pf-textarea::placeholder { color: var(--fg-faint); }
.pf-input:disabled,
.pf-textarea:disabled { opacity: 0.55; cursor: progress; }
.pf-textarea { resize: vertical; line-height: 1.55; }

/* Every field saves on blur, so the only signal that a write happened is this.
   It has to be visible without stealing attention from the field just left. */
.proj-save-state {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.proj-save-saving { color: var(--fg-mute); background: var(--glass-fill-faint); }
.proj-save-saved  { color: oklch(0.42 0.14 158); background: oklch(0.74 0.16 152 / 0.16); }
.proj-save-error  { color: oklch(0.45 0.18 25); background: oklch(0.66 0.20 25 / 0.14); }

/* .pf-stub-stats carries no bottom margin — in the old peek it sat inside a
   card that spaced it. Here it leads the panel, so the first section would
   otherwise collide with it. */
.proj-detail-stats { margin-bottom: 28px; }

.proj-detail-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 0.5px solid var(--hairline-soft);
}
.proj-detail-foot-meta {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  color: var(--fg-faint);
}
.proj-detail-danger { color: oklch(0.52 0.18 25); }
.proj-detail-danger:hover { background: oklch(0.66 0.20 25 / 0.12); }

/* Per-row actions on the Docs tab — download and delete sit against the
   right edge, where the take-offs tab puts its value figure. */
.proj-doc-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* A select styled as one of the modal's inputs — the new-project dialog asks
   for a stage, and a raw browser select in a glass card reads as a bug. */
.modal-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 34px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px 10px;
}
.modal-label + .modal-select { margin-bottom: 14px; }

/* Dark theme. The tinted plates above are translucent and read correctly in
   both themes, but their ink does not: the light-theme reds and greens land
   around 2:1 against a dark backdrop, and the banner explaining that the tiles
   on screen are stale is the last thing that should be unreadable. Same lift
   the .pill-* family already uses — see .pill-red. */
[data-theme="dark"] .proj-banner        { color: oklch(0.78 0.18 25); }
[data-theme="dark"] .proj-error         { color: oklch(0.78 0.18 25); }
[data-theme="dark"] .proj-save-saved    { color: oklch(0.82 0.16 152); }
[data-theme="dark"] .proj-save-error    { color: oklch(0.78 0.18 25); }
[data-theme="dark"] .proj-detail-danger { color: oklch(0.78 0.18 25); }

/* ══════════════════════════════════════════════════════════════════════════
   CREDITS & ADMIN
   The pack deck, the ledger's empty states, and the credit desk. The balance
   card, stat tiles, pack grid and history table above are reused as-is — what
   is new here is what the real API brought with it: a tier accent per pack, a
   cost shown before an upload, and the admin table.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Pack deck ──────────────────────────────────────────────────────────── */

/* Each tier carries an accent, the way the pricing deck does. The card stays
   glass rather than a flat colour block so it belongs to this UI: the colour
   arrives as a wash and a chip, not as the whole surface. */
.pack-card { --pack-accent: oklch(0.62 var(--brand-c) var(--brand-h)); }
.pack-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(120% 80% at 100% 0%, var(--pack-accent), transparent 62%);
  opacity: 0.14;
}
[data-theme="dark"] .pack-card::after { opacity: 0.20; }
/* Lift the content over the wash — but not the badge, which is positioned
   against the card and would become a full-width block if made relative. */
.pack-card > *:not(.pack-popular-badge) { position: relative; z-index: 1; }
.pack-card .pack-popular-badge { z-index: 2; }

/* Five tiers across, with 11,50,000 to fit in one of them. */
.pack-card .pack-amt { flex-wrap: wrap; row-gap: 2px; min-width: 0; }
.pack-card .pack-amt-num { font-size: 27px; }
.pack-card .pack-price { font-size: 14px; }
.pack-card .pack-meta { font-size: 12px; }
@media (max-width: 1400px) {
  .pack-card .pack-amt-num { font-size: 23px; }
}

.pack-tint-starter    { --pack-accent: oklch(0.70 0.16 240); }
.pack-tint-growth     { --pack-accent: oklch(0.52 0.20 255); }
.pack-tint-pro        { --pack-accent: oklch(0.58 0.24 285); }
.pack-tint-scale      { --pack-accent: oklch(0.66 0.22 35); }
.pack-tint-enterprise { --pack-accent: oklch(0.45 0.06 260); }

/* Enterprise is the dark card in the deck — it is the one you talk to someone
   about, and it should read as the end of the row. */
.pack-tint-enterprise {
  background: oklch(0.18 0.02 260);
  border-color: oklch(0.18 0.02 260);
  color: #fff;
}
[data-theme="dark"] .pack-tint-enterprise { background: #000; border-color: oklch(0.30 0.04 260); }
.pack-tint-enterprise .pack-divider { background: rgba(255,255,255,0.12); }
.pack-tint-enterprise .pack-meta { color: rgba(255,255,255,0.78); }
.pack-tint-enterprise .pack-tier { background: rgba(255,255,255,0.14); color: #fff; }
.pack-tint-enterprise .pack-amt-unit { color: rgba(255,255,255,0.62); }
.pack-tint-enterprise .pack-cta { background: #fff; color: oklch(0.20 0.02 260); }

.pack-tier {
  align-self: flex-start;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--pack-accent) 18%, transparent);
  color: var(--pack-accent);
}
[data-theme="dark"] .pack-tier { color: color-mix(in oklab, var(--pack-accent) 70%, white); }

.pack-amt-unit {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.pack-bonus {
  align-self: flex-start;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--pack-accent) 22%, transparent);
  color: var(--pack-accent);
}
[data-theme="dark"] .pack-bonus { color: color-mix(in oklab, var(--pack-accent) 72%, white); }
.pack-tint-enterprise .pack-bonus { background: rgba(255,255,255,0.16); color: #fff; }
.pack-bonus-inline {
  margin-left: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-blue);
}

.pack-cta {
  margin-top: auto;
  width: 100%;
  justify-content: center;
  height: 38px;
  border-radius: 999px;
  font-weight: 600;
  background: var(--pack-accent);
  color: #fff;
  border: 0;
}
.pack-cta:hover { filter: brightness(1.08); }

/* ── Balance card, honest states ────────────────────────────────────────── */

/* The card used to be padded out by a progress bar over an invented quota.
   Without it there is nothing to stretch to, so it sizes to its content. */
.credits-balance { align-items: start; }
.credits-balance-foot {
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 0.5px solid var(--hairline-soft);
}
.credits-balance-foot strong { color: var(--fg); font-weight: 650; }

/* "credits" is the unit on the balance, not a warning. It inherited the same
   red the pack cards used for their unit. */
.credits-balance-unit { color: var(--fg-faint); font-size: 18px; }

.credits-history-empty {
  padding: 30px 18px;
  text-align: center;
  font-size: 13px;
  color: var(--fg-faint);
}

/* An account that cannot pay for a take-off has to be told plainly, and told
   what to do about it — checkout is not open, so the answer is a person. */
.credits-empty-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
  border-radius: 12px;
  border: 0.5px solid oklch(0.84 0.14 75 / 0.42);
  background: oklch(0.84 0.14 75 / 0.12);
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg);
}
.credits-empty-icon { color: oklch(0.60 0.16 60); display: grid; place-items: center; }
[data-theme="dark"] .credits-empty-note { border-color: oklch(0.84 0.14 75 / 0.30); }

.credits-soon-body {
  font-size: 13px;
  line-height: 1.6;
  color: var(--fg-mute);
  margin: 0 0 14px;
}
.credits-soon-pack {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--glass-fill-faint);
  border: 0.5px solid var(--hairline-soft);
  margin-bottom: 4px;
}
.credits-soon-pack-label { font-size: 13px; font-weight: 650; }
.credits-soon-pack-meta { font-size: 12px; color: var(--fg-mute); margin-top: 2px; }

/* ── The pill, and the cost of an upload ────────────────────────────────── */

/* Not enough for the next take-off. Amber rather than red: nothing is broken,
   the account simply cannot start another one. */
.token-pill-low {
  border-color: oklch(0.84 0.14 75 / 0.55) !important;
  background: oklch(0.84 0.14 75 / 0.14) !important;
}
.token-pill-low .token-label { color: oklch(0.50 0.16 60); }
[data-theme="dark"] .token-pill-low .token-label { color: oklch(0.86 0.14 75); }

.boq-staged-cost { color: var(--fg-mute); font-weight: 500; }
.boq-staged-short {
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: oklch(0.50 0.16 60);
}
[data-theme="dark"] .boq-staged-short { color: oklch(0.86 0.14 75); }

/* ── Admin ──────────────────────────────────────────────────────────────── */

.admin-table { border-radius: 16px; overflow: hidden; }
.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px 150px 120px;
  gap: 14px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 0.5px solid var(--hairline-soft);
  font-size: 13px;
}
.admin-row:last-child { border-bottom: 0; }
.admin-row-head {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-faint);
  background: var(--glass-fill-faint);
}
@media (max-width: 860px) {
  .admin-row { grid-template-columns: minmax(0, 1fr) 110px; }
  .admin-row > :nth-child(2) { display: none; }
}

.admin-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.admin-avatar {
  width: 30px; height: 30px;
  flex: 0 0 auto;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, oklch(0.62 var(--brand-c) var(--brand-h)), oklch(0.48 0.18 285));
}
.admin-name {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-badge { font-size: 10px; padding: 2px 8px; }
.admin-mail {
  font-size: 11.5px;
  color: var(--fg-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-seen { font-size: 12px; color: var(--fg-mute); }
.admin-balance { text-align: right; font-weight: 650; }
.admin-balance-sub {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-faint);
}
.admin-empty { padding: 34px 18px; text-align: center; font-size: 13px; color: var(--fg-faint); }
.admin-foot-note { margin-top: 12px; font-size: 11.5px; color: var(--fg-faint); }

.admin-flash {
  padding: 10px 14px;
  margin-bottom: 14px;
  border-radius: 10px;
  border: 0.5px solid oklch(0.74 0.16 152 / 0.34);
  background: oklch(0.74 0.16 152 / 0.12);
  color: oklch(0.40 0.14 158);
  font-size: 12.5px;
}
[data-theme="dark"] .admin-flash { color: oklch(0.82 0.16 152); }

.admin-grant-who {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--glass-fill-faint);
  border: 0.5px solid var(--hairline-soft);
  margin-bottom: 16px;
}
.admin-grant-name { font-size: 13px; font-weight: 650; }
.admin-grant-meta { font-size: 12px; color: var(--fg-mute); margin-top: 1px; }

.admin-quick-amounts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.admin-quick {
  font: inherit;
  font-size: 11.5px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 0.5px solid var(--hairline);
  background: transparent;
  color: var(--fg-mute);
  cursor: pointer;
}
.admin-quick:hover { background: var(--glass-fill); color: var(--fg); }

.admin-grant-preview {
  font-size: 12.5px;
  color: var(--fg-mute);
  margin-bottom: 6px;
}
.admin-grant-warn { color: oklch(0.50 0.18 25); font-weight: 600; }
[data-theme="dark"] .admin-grant-warn { color: oklch(0.78 0.18 25); }
