@import "../../styles.css";

/* Prototype compatibility aliases mapped onto Atlas tokens. */
:root {
  --mf-watermelon-900: var(--at-flush-600);
  --mf-watermelon-800: var(--at-flush-500);
  --mf-watermelon-700: var(--at-flush-400);
  --mf-watermelon-600: var(--at-flush-300);
  --mf-watermelon-500: var(--at-flush-200);
  --mf-watermelon-400: var(--at-flush-100);
  --mf-watermelon-300: var(--at-flush-100);
  --mf-watermelon-200: var(--at-flush-50);
  --mf-aubergine-900: var(--at-plum-900);
  --mf-aubergine-800: var(--at-plum-800);
  --mf-aubergine-700: var(--at-plum-700);
  --mf-aubergine-600: var(--at-plum-600);
  --mf-aubergine-500: var(--at-plum-500);
  --mf-aubergine-400: var(--at-plum-400);
  --mf-aubergine-300: var(--at-plum-300);
  --mf-aubergine-200: var(--at-plum-200);
  --mf-aubergine-100: var(--at-plum-100);
  --mf-black: var(--at-black);
  --mf-ink: var(--at-ink);
  --mf-white: var(--at-white);
}

/* Atlas — dense internal tool, applied prototype */
/* ---------- SEMANTIC ELEMENT STYLES ----------
 * Opt-in: wrap content in `.mf-type` to apply these defaults without
 * polluting global elements.
 */
.mf-type {
  font-family: var(--font-sans);
  color: var(--fg-2);
  font-size: var(--fs-body-1);
  line-height: var(--lh-body-1);
  letter-spacing: 0.02em;
  text-wrap: pretty;
}

.mf-type h1, .mf-h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
  color: var(--fg-2);
  letter-spacing: 0.02em;
  margin: 0;
}
.mf-type h2, .mf-h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  color: var(--fg-2);
  margin: 0;
}
.mf-type h3, .mf-h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  color: var(--fg-2);
  margin: 0;
}
.mf-type h4, .mf-h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-h4);
  line-height: var(--lh-h4);
  color: var(--fg-2);
  margin: 0;
}
.mf-type h5, .mf-h5 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--fs-h5);
  line-height: var(--lh-h5);
  color: var(--fg-2);
  margin: 0;
}
.mf-type h6, .mf-h6 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--fs-h6);
  line-height: var(--lh-h6);
  color: var(--fg-2);
  margin: 0;
}
.mf-type p, .mf-body-1 {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--fs-body-1);
  line-height: var(--lh-body-1);
  color: var(--fg-2);
  margin: 0 0 var(--space-sm) 0;
}
.mf-body-2 {
  font-family: var(--font-sans);
  font-size: var(--fs-body-2);
  line-height: var(--lh-body-2);
  color: var(--fg-2);
}
.mf-body-3 {
  font-family: var(--font-sans);
  font-size: var(--fs-body-3);
  line-height: var(--lh-body-3);
  color: var(--fg-3);
}

/* Editorial display — the serif hero style used on covers and page-openers */
.mf-display {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--fg-2);
  line-height: 1;
  letter-spacing: -0.005em;
}
.mf-display--accent { color: var(--fg-accent); }
.mf-display--ink    { color: var(--fg-2); }

/* Eyebrow — all caps, letter-spaced accent label used above headlines */
.mf-eyebrow {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-accent);
}


* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 18px;
  color: var(--fg-1);
  background: var(--bg-tint);
  font-feature-settings: "ss01", "cv11", "tnum";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
#root { height: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--mf-watermelon-900); outline-offset: 2px; border-radius: 4px; }

/* ============ App shell ============ */
.app {
  display: grid;
  grid-template-columns: 224px 1fr;
  height: 100vh;
  background: var(--bg-tint);
}

.sidebar {
  background: var(--mf-aubergine-900);
  color: var(--mf-white);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid #1d011a;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 14px 8px;
}
.brand-mark {
  width: 26px; height: 26px;
  background: var(--mf-watermelon-900);
  border-radius: 7px;
  display: grid; place-items: center;
  color: var(--mf-white);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.01em;
}
.brand-sub {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mf-aubergine-500);
  margin-top: 1px;
}
.nav-section {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mf-aubergine-600);
  padding: 14px 10px 6px 10px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--mf-aubergine-400);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: var(--mf-white); }
.nav-item.active {
  background: rgba(255,46,91,0.14);
  color: var(--mf-white);
}
.nav-item.active::before {
  content: "";
  position: absolute; left: -12px; top: 6px; bottom: 6px;
  width: 2px; background: var(--mf-watermelon-900);
  border-radius: 0 2px 2px 0;
}
.nav-item .nav-icon { width: 16px; height: 16px; opacity: 0.85; flex-shrink: 0; }
.nav-item .nav-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--mf-aubergine-500);
  font-variant-numeric: tabular-nums;
}
.nav-kbd {
  margin-left: auto;
  font-size: 10px;
  color: var(--mf-aubergine-600);
  font-family: var(--font-sans);
}

.sidebar-foot {
  margin-top: auto;
  padding: 10px;
  display: flex; align-items: center; gap: 10px;
  border-top: 1px solid rgba(255,255,255,0.07);
  font-size: 12px;
}
.user-pip {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mf-watermelon-700), var(--mf-watermelon-900));
  color: var(--mf-white);
  display: grid; place-items: center;
  font-weight: 600; font-size: 11px;
}
.user-pip-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-pip-name { color: var(--mf-white); }
.user-pip-role { color: var(--mf-aubergine-500); font-size: 11px; }

/* ============ Main column ============ */
.main {
  display: flex; flex-direction: column;
  min-width: 0;
  background: var(--bg-tint);
}

.topbar {
  height: 48px;
  display: flex; align-items: center;
  padding: 0 16px;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(8px);
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.crumbs .crumb { color: var(--fg-3); }
.crumbs .crumb-sep { color: var(--fg-4); }
.crumbs .crumb-current { color: var(--fg-1); font-weight: 500; }
.topbar-spacer { flex: 1; }

.search-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px;
  background: var(--mf-white);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-size: 12px;
  color: var(--fg-3);
  min-width: 260px;
  cursor: pointer;
}
.search-pill:hover { border-color: var(--border-line); }
.search-pill .kbd-mini { margin-left: auto; }

.kbd {
  display: inline-flex; align-items: center;
  padding: 1px 5px;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  background: var(--mf-white);
  color: var(--fg-3);
  font-size: 10px;
  line-height: 14px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.kbd-dark {
  border-color: rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--mf-aubergine-400);
}
.kbd-mini {
  display: inline-block;
  padding: 0 4px;
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  font-size: 10px;
  color: var(--fg-4);
}

/* date pill */
.date-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--mf-white);
  cursor: pointer;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.date-pill .dp-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--mf-watermelon-900);
  box-shadow: 0 0 0 3px rgba(255,46,91,0.18);
}
.date-pill.is-past .dp-dot { background: var(--mf-aubergine-700); box-shadow: 0 0 0 3px rgba(132,104,125,0.22); }
.date-pill.is-future .dp-dot { background: #C58A2C; box-shadow: 0 0 0 3px rgba(197,138,44,0.22); }
.date-pill:hover { border-color: var(--mf-aubergine-700); }
.date-pill .dp-label { color: var(--fg-3); }
.date-pill .dp-date { color: var(--fg-1); font-weight: 500; }

/* time-travel ribbon (when not viewing today) */
.tt-ribbon {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 16px;
  background: var(--mf-aubergine-900);
  color: var(--mf-white);
  font-size: 12px;
}
.tt-ribbon .tt-tag {
  background: rgba(255,255,255,0.1);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tt-ribbon .tt-tag.is-future { background: rgba(255,193,82,0.18); color: #FFD79A; }
.tt-ribbon .tt-tag.is-past { background: rgba(255,46,91,0.18); color: var(--mf-watermelon-700); }
.tt-ribbon button.return {
  margin-left: auto;
  background: var(--mf-watermelon-900);
  color: var(--mf-white);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}
.tt-ribbon button.return:hover { background: var(--mf-watermelon-800); }

/* page content */
.page {
  flex: 1;
  overflow: auto;
  padding: 20px 24px 60px 24px;
}
.page-narrow { max-width: 1200px; margin: 0 auto; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 18px;
  gap: 24px;
}
.page-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 32px;
  line-height: 36px;
  color: var(--fg-1);
  margin: 0;
}
.eyebrow {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mf-watermelon-900);
  margin-bottom: 6px;
  display: block;
}
.page-meta {
  color: var(--fg-3); font-size: 13px;
  display: flex; gap: 14px; align-items: center;
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--mf-white);
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-1);
  height: 28px;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--mf-aubergine-700); }
.btn-primary {
  background: var(--mf-watermelon-900);
  border-color: var(--mf-watermelon-900);
  color: var(--mf-white);
}
.btn-primary:hover { background: var(--mf-watermelon-800); border-color: var(--mf-watermelon-800); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--fg-3); }
.btn-ghost:hover { background: var(--mf-aubergine-200); color: var(--fg-1); }
.btn-icon { width: 28px; padding: 0; justify-content: center; }
.btn .ic { width: 14px; height: 14px; }

/* ============ Cards / Surfaces ============ */
.card {
  background: var(--mf-white);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.card-title {
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.card-title .ic { width: 14px; height: 14px; color: var(--fg-3); }
.card-foot { padding: 8px 14px; border-top: 1px solid var(--border-subtle); color: var(--fg-3); font-size: 12px; }

/* ============ Stat strip ============ */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 18px;
}
.stat {
  background: var(--mf-white);
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.stat-label {
  font-size: 11px; color: var(--fg-3);
  letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500;
}
.stat-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  line-height: 32px;
  color: var(--fg-1);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.005em;
}
.stat-meta {
  font-size: 11px;
  color: var(--fg-3);
  display: flex; align-items: center; gap: 6px;
}
.stat-delta-pos { color: #2D8A4A; }
.stat-delta-neg { color: var(--mf-watermelon-900); }
.stat-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--mf-aubergine-200);
  overflow: hidden;
  display: flex;
  margin-top: 4px;
}
.stat-bar .seg-emp { background: var(--mf-aubergine-900); }
.stat-bar .seg-con { background: var(--mf-watermelon-900); }

/* ============ Chips, badges, status pills ============ */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: var(--mf-aubergine-200);
  color: var(--fg-2);
  line-height: 16px;
}
.chip-emp { background: var(--mf-aubergine-200); color: var(--mf-aubergine-900); }
.chip-con { background: var(--mf-watermelon-300); color: var(--mf-watermelon-900); }
.chip-planned { background: rgba(197,138,44,0.16); color: #8C5E12; }
.chip-active  { background: rgba(45,138,74,0.15); color: #1F6936; }
.chip-ended   { background: var(--mf-aubergine-200); color: var(--fg-4); }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; }
.chip-dot.emp { background: var(--mf-aubergine-900); }
.chip-dot.con { background: var(--mf-watermelon-900); }
.chip-fn  { background: rgba(50,3,39,0.06); color: var(--mf-aubergine-900); border: 1px solid var(--border-subtle); }

/* avatar */
.av {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--mf-aubergine-300);
  color: var(--mf-aubergine-900);
  display: inline-grid; place-items: center;
  font-weight: 600; font-size: 10px;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.av-lg { width: 56px; height: 56px; font-size: 18px; border-radius: 14px; }
.av-md { width: 32px; height: 32px; font-size: 12px; border-radius: 8px; }
.av-emp { background: var(--mf-aubergine-200); color: var(--mf-aubergine-900); }
.av-con { background: var(--mf-watermelon-300); color: var(--mf-watermelon-900); }
.av-stack { display: flex; }
.av-stack .av { box-shadow: 0 0 0 2px var(--mf-white); margin-left: -6px; }
.av-stack .av:first-child { margin-left: 0; }

/* ============ Tables ============ */
.tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.tbl thead th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-4);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--mf-aubergine-100);
  position: sticky; top: 0;
}
.tbl tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--fg-1);
  vertical-align: middle;
}
.tbl tbody tr:hover td { background: var(--mf-aubergine-100); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; }
.tbl .cell-person { display: flex; align-items: center; gap: 8px; }
.tbl .cell-person .pname { font-weight: 500; }
.tbl .cell-person .prole { color: var(--fg-3); font-size: 11px; }

/* ============ Matrix ============ */
.matrix-wrap {
  background: var(--mf-white);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
}
.matrix {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}
.matrix th, .matrix td {
  padding: 0;
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.matrix th:last-child, .matrix td:last-child { border-right: 0; }
.matrix .col-h, .matrix .row-h {
  background: var(--mf-aubergine-100);
}
.matrix .col-h {
  padding: 10px 12px;
  text-align: left;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-3);
  font-weight: 600;
  vertical-align: bottom;
  border-bottom: 1px solid var(--border-line);
}
.matrix .col-h .col-fn-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--fg-1);
  display: block;
  margin-bottom: 2px;
}
.matrix .col-h .col-fn-count { color: var(--fg-3); font-weight: 500; letter-spacing: 0.1em; }
.matrix .row-h {
  padding: 10px 12px;
  text-align: left;
  font-size: 12px;
  color: var(--fg-1);
  font-weight: 500;
  white-space: nowrap;
  border-right: 1px solid var(--border-line);
  vertical-align: middle;
  min-width: 200px;
}
.matrix .row-h .row-team {
  display: flex; align-items: center; gap: 8px;
}
.matrix .row-h .row-team .team-bullet {
  width: 8px; height: 8px; border-radius: 2px;
  background: var(--mf-watermelon-900);
}
.matrix .row-h .row-meta { color: var(--fg-3); font-size: 11px; font-weight: 400; }
.matrix .sub-row .row-h { padding-left: 32px; background: var(--mf-aubergine-100); }
.matrix .sub-row .row-h .team-bullet { background: var(--mf-aubergine-600); }
.matrix .row-totals .row-h { background: var(--mf-aubergine-200); font-weight: 600; }
.matrix .row-totals td { background: var(--mf-aubergine-200); }

.cell {
  position: relative;
  padding: 16px 18px;
  min-width: 84px;
  cursor: default;
}
.cell:hover { background: var(--mf-watermelon-200); }
.cell-num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  line-height: 20px;
  color: var(--fg-1);
}
.cell-num.muted { color: var(--mf-aubergine-500); }
.cell-split {
  height: 4px;
  border-radius: 2px;
  background: var(--mf-aubergine-100);
  margin-top: 8px;
  display: flex;
  overflow: hidden;
}
.cell-split .seg-emp { background: var(--mf-aubergine-900); }
.cell-split .seg-con { background: var(--mf-watermelon-900); }
.cell-meta { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--fg-4); margin-top: 6px; }
.cell-meta .dot { width: 5px; height: 5px; border-radius: 50%; }
.cell-meta .dot.emp { background: var(--mf-aubergine-900); }
.cell-meta .dot.con { background: var(--mf-watermelon-900); }
.cell-empty .cell-num { color: var(--mf-aubergine-400); }
.cell.is-highlight { background: var(--mf-watermelon-200); }

/* Dimension section header row inside the matrix */
.matrix .dim-sep td {
  padding: 0;
  background: var(--mf-aubergine-100);
  border-top: 1px solid var(--border-line);
  border-bottom: 1px solid var(--border-line);
}
.matrix .dim-sep .dim-sep-inner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
}
.matrix .dim-sep-eyebrow {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-3);
  font-weight: 600;
}
.matrix .dim-sep-dot {
  width: 8px; height: 8px; border-radius: 2px;
  background: var(--mf-watermelon-900);
}
.matrix .dim-sep-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--fg-1);
}
.matrix .dim-sep-desc { color: var(--fg-3); font-size: 11px; }
.matrix .dim-sep-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--fg-3);
  font-variant-numeric: tabular-nums;
}
.matrix .dim-subtotal .row-h {
  background: var(--mf-aubergine-200);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--fg-2);
  text-transform: uppercase;
}
.matrix .dim-subtotal td {
  background: var(--mf-aubergine-200);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-line);
}
.matrix .dim-subtotal .cell-num { font-size: 16px; }
.matrix .row-h { padding: 14px 16px; min-width: 200px; }

/* ============ Treemap ============ */
.treemap {
  position: relative;
  background: var(--mf-white);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 8px;
  height: 520px;
}
.tm-tile {
  position: absolute;
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--mf-white);
  font-size: 12px;
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  cursor: pointer;
  border: 2px solid var(--mf-white);
}
.tm-tile:hover { filter: brightness(1.04); }
.tm-name { font-family: var(--font-display); font-weight: 600; font-size: 15px; line-height: 1.1; }
.tm-meta { font-size: 11px; opacity: 0.85; display: flex; align-items: center; gap: 8px; }

/* ============ Org card grid ============ */
.fn-group { margin-bottom: 24px; }
.fn-group-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.fn-group-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  color: var(--fg-1);
}
.fn-group-rule { flex: 1; height: 1px; background: var(--border-subtle); }
.fn-group-meta { color: var(--fg-3); font-size: 12px; }

.team-card {
  background: var(--mf-white);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
  cursor: pointer;
  transition: border-color 0.1s, transform 0.1s;
}
.team-card:hover { border-color: var(--mf-aubergine-700); transform: translateY(-1px); }
.team-card-name { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--fg-1); }
.team-card-sub { font-size: 11px; color: var(--fg-3); }
.team-card-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.team-card-row .stack-meta { color: var(--fg-3); font-size: 11px; }
.team-card-bar { height: 4px; border-radius: 2px; background: var(--mf-aubergine-100); overflow: hidden; display: flex; }
.team-card-bar .seg-emp { background: var(--mf-aubergine-900); }
.team-card-bar .seg-con { background: var(--mf-watermelon-900); }

/* ============ Time-travel scrubber overlay ============ */
.scrub-veil {
  position: fixed; inset: 0;
  background: rgba(50,3,39,0.32);
  z-index: 80;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 28px;
}
.scrub-panel {
  background: var(--mf-aubergine-900);
  color: var(--mf-white);
  border-radius: 14px;
  width: min(960px, calc(100vw - 48px));
  padding: 16px 18px 18px 18px;
  box-shadow: var(--shadow-lg);
}
.scrub-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.scrub-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.005em;
}
.scrub-date {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  color: var(--mf-watermelon-700);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.scrub-track-wrap { position: relative; padding: 0 8px; }
.scrub-axis {
  position: relative;
  height: 56px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
}
.scrub-tick {
  position: absolute; top: 0; bottom: 0;
  width: 1px; background: rgba(255,255,255,0.1);
}
.scrub-tick.major { background: rgba(255,255,255,0.22); }
.scrub-tick label {
  position: absolute; bottom: -18px; left: 0;
  transform: translateX(-50%);
  font-size: 10px; color: rgba(255,255,255,0.5);
  letter-spacing: 0.06em; text-transform: uppercase;
  white-space: nowrap;
}
.scrub-event {
  position: absolute;
  top: 14px;
  width: 8px; height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--mf-watermelon-700);
}
.scrub-event.hire { background: #6AC58C; }
.scrub-event.move { background: var(--mf-watermelon-700); }
.scrub-event.end  { background: #B9B0B6; }
.scrub-event.planned { background: #E9B254; }
.scrub-event.role { background: #BB8FE3; }
.scrub-today {
  position: absolute; top: -4px; bottom: -4px;
  width: 2px;
  background: var(--mf-watermelon-900);
  border-radius: 2px;
  margin-left: -1px;
}
.scrub-today::before {
  content: "Today"; position: absolute; top: -16px; left: 50%;
  transform: translateX(-50%); font-size: 10px;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--mf-watermelon-700);
}
.scrub-cursor {
  position: absolute; top: -6px; bottom: -6px;
  width: 4px; margin-left: -2px;
  background: var(--mf-watermelon-900);
  border-radius: 4px;
  box-shadow: 0 0 0 4px rgba(255,46,91,0.2);
  pointer-events: none;
}
.scrub-input {
  position: absolute; inset: 0;
  -webkit-appearance: none; appearance: none;
  background: transparent; cursor: ew-resize;
  width: 100%; height: 100%;
  margin: 0;
}
.scrub-input::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 56px; background: transparent; cursor: ew-resize; }
.scrub-input::-moz-range-thumb { width: 28px; height: 56px; background: transparent; border: 0; cursor: ew-resize; }

.scrub-foot {
  display: flex; align-items: center; gap: 12px;
  margin-top: 28px;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
}
.scrub-foot .legend { display: flex; align-items: center; gap: 6px; }
.scrub-foot .legend .ldot { width: 8px; height: 8px; border-radius: 50%; }
.scrub-foot .scrub-actions { margin-left: auto; display: flex; gap: 8px; }
.scrub-foot .btn-dark {
  background: rgba(255,255,255,0.08); color: var(--mf-white); border: 1px solid rgba(255,255,255,0.12);
}
.scrub-foot .btn-dark:hover { background: rgba(255,255,255,0.14); }

/* ============ Command palette ============ */
.palette-veil {
  position: fixed; inset: 0;
  background: rgba(50,3,39,0.36);
  z-index: 90;
  display: flex; justify-content: center;
  padding-top: 96px;
  animation: fadein 0.1s ease-out;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.palette {
  background: var(--mf-white);
  width: min(620px, calc(100vw - 48px));
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  max-height: 70vh;
}
.palette-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.palette-head input {
  flex: 1; border: 0; outline: 0; font-size: 14px; background: transparent;
}
.palette-head input::placeholder { color: var(--fg-4); }
.palette-context {
  background: var(--mf-aubergine-200);
  color: var(--fg-2);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
}
.palette-context .ic { width: 11px; height: 11px; }
.palette-list { overflow: auto; padding: 6px; }
.palette-sec { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-4); padding: 8px 10px 4px 10px; }
.palette-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.palette-item .pi-icon { width: 14px; height: 14px; color: var(--fg-3); flex-shrink: 0; }
.palette-item .pi-meta { color: var(--fg-3); font-size: 11px; margin-left: auto; }
.palette-item.is-active { background: var(--mf-watermelon-200); color: var(--mf-watermelon-900); }
.palette-item.is-active .pi-icon { color: var(--mf-watermelon-900); }
.palette-item.is-active .pi-meta { color: var(--mf-watermelon-900); }
.palette-foot {
  border-top: 1px solid var(--border-subtle);
  padding: 6px 12px;
  display: flex; gap: 14px;
  font-size: 11px; color: var(--fg-3);
}
.palette-foot .pf-hint { display: inline-flex; align-items: center; gap: 4px; }

/* ============ Drawer ============ */
.drawer-veil {
  position: fixed; inset: 0;
  background: rgba(50,3,39,0.32);
  z-index: 85;
  animation: fadein 0.12s ease-out;
}
.drawer {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: min(540px, 90vw);
  background: var(--mf-white);
  border-left: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  z-index: 86;
  display: flex; flex-direction: column;
  animation: slidein 0.18s cubic-bezier(0.22,1,0.36,1);
}
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.drawer-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
}
.drawer-eyebrow { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mf-watermelon-900); }
.drawer-title { font-family: var(--font-display); font-weight: 600; font-size: 22px; line-height: 1.1; margin-top: 2px; }
.drawer-body { flex: 1; overflow: auto; padding: 18px 18px 24px 18px; display: flex; flex-direction: column; gap: 14px; }
.drawer-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--border-subtle);
  display: flex; align-items: center; gap: 8px;
}
.drawer-foot .spacer { flex: 1; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 11px; font-weight: 500; color: var(--fg-3); letter-spacing: 0.04em; }
.field .ctrl {
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: var(--mf-white);
  padding: 6px 9px;
  font-size: 13px;
  min-height: 30px;
  display: flex; align-items: center; gap: 6px;
}
.field .ctrl:focus-within { border-color: var(--mf-watermelon-900); box-shadow: 0 0 0 3px rgba(255,46,91,0.12); }
.field .ctrl input, .field .ctrl select, .field .ctrl textarea {
  border: 0; outline: 0; background: transparent; flex: 1; font-size: 13px;
}
.field .hint { font-size: 11px; color: var(--fg-4); }

.diff-preview {
  background: var(--bg-tint);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12px;
}
.diff-preview .dp-title { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 8px; }
.diff-row { display: flex; gap: 10px; padding: 4px 0; font-variant-numeric: tabular-nums; }
.diff-row .dk { color: var(--fg-3); width: 96px; }
.diff-row .dv-from { color: var(--fg-4); text-decoration: line-through; }
.diff-row .dv-to { color: var(--mf-watermelon-900); font-weight: 500; }
.diff-arrow { color: var(--fg-4); }

/* ============ Person git log ============ */
.gitlog { position: relative; padding-left: 28px; }
.gitlog::before {
  content: "";
  position: absolute; left: 9px; top: 6px; bottom: 6px;
  width: 2px; background: var(--border-subtle);
}
.gl-node {
  position: relative;
  padding: 0 0 18px 0;
}
.gl-node::before {
  content: "";
  position: absolute; left: -22px; top: 14px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--mf-watermelon-900);
  box-shadow: 0 0 0 3px var(--mf-white), 0 0 0 4px var(--mf-watermelon-900);
}
.gl-node.is-planned::before { background: #E9B254; box-shadow: 0 0 0 3px var(--mf-white), 0 0 0 4px #E9B254; }
.gl-node.is-past::before { background: var(--mf-aubergine-500); box-shadow: 0 0 0 3px var(--mf-white), 0 0 0 4px var(--mf-aubergine-500); }
.gl-card {
  background: var(--mf-white);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 14px;
}
.gl-row1 { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.gl-type {
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 600;
  color: var(--mf-watermelon-900);
}
.gl-meta { margin-left: auto; color: var(--fg-4); font-size: 11px; display: flex; align-items: center; gap: 8px; }
.gl-title { font-weight: 500; font-size: 13px; color: var(--fg-1); margin-top: 4px; }
.gl-diff { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; }
.gl-diff-item { display: inline-flex; align-items: center; gap: 6px; padding: 2px 6px; background: var(--bg-tint); border-radius: 4px; }
.gl-diff-item .dk { color: var(--fg-4); font-size: 11px; }
.gl-diff-item .dv-from { color: var(--fg-4); text-decoration: line-through; }
.gl-diff-item .dv-arrow { color: var(--fg-4); }
.gl-diff-item .dv-to { color: var(--mf-watermelon-900); font-weight: 500; }
.gl-author { display: flex; align-items: center; gap: 6px; }
.gl-hash {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  color: var(--fg-4);
  background: var(--mf-aubergine-100);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ============ Gantt / timeline strips ============ */
.gantt {
  background: var(--mf-white);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px;
}
.gantt-axis {
  position: relative;
  height: 24px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 8px;
  font-size: 10px;
  color: var(--fg-4);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.gantt-axis-tick {
  position: absolute; top: 0; bottom: 0;
  border-left: 1px dashed var(--border-subtle);
  padding-left: 4px;
  display: flex; align-items: center;
}
.gantt-row { display: grid; grid-template-columns: 120px 1fr; align-items: center; padding: 4px 0; gap: 10px; }
.gantt-row .gr-label { font-size: 11px; color: var(--fg-3); letter-spacing: 0.04em; text-transform: uppercase; font-weight: 500; }
.gantt-track {
  position: relative;
  height: 22px;
  background: var(--bg-tint);
  border-radius: 6px;
}
.gantt-bar {
  position: absolute; top: 2px; bottom: 2px;
  border-radius: 4px;
  display: flex; align-items: center;
  padding: 0 8px;
  font-size: 11px;
  color: var(--mf-white);
  background: var(--mf-watermelon-900);
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
}
.gantt-bar.team-a { background: var(--mf-aubergine-800); }
.gantt-bar.team-b { background: var(--mf-watermelon-900); }
.gantt-bar.team-c { background: #C58A2C; color: var(--mf-white); }
.gantt-bar.team-d { background: #4E7BB3; }
.gantt-bar.team-e { background: #2D8A4A; }
.gantt-bar.is-future {
  background: repeating-linear-gradient(135deg, var(--mf-watermelon-900) 0 6px, var(--mf-watermelon-800) 6px 12px);
}
.gantt-now {
  position: absolute; top: 0; bottom: 0;
  width: 2px;
  background: var(--mf-watermelon-900);
  box-shadow: 0 0 0 4px rgba(255,46,91,0.12);
  pointer-events: none;
}
.gantt-cursor {
  position: absolute; top: -4px; bottom: -4px;
  width: 2px;
  background: rgba(50,3,39,0.4);
  pointer-events: none;
}

.gantt-sep {
  height: 1px;
  background: var(--border-line);
  margin: 8px 0;
  border-top: 1px dashed var(--border-subtle);
}
.gantt-row.is-group-row .gantt-bar { background: var(--mf-aubergine-800); }

/* ============ Dimension Explorer ============ */
.explorer {
  display: grid;
  grid-template-columns: 240px 1fr 320px;
  gap: 12px;
  align-items: stretch;
  height: calc(100vh - 200px);
  min-height: 600px;
}
.explorer.explorer-2col {
  grid-template-columns: 1fr 1fr;
  height: auto;
  min-height: 640px;
}

/* Dimension section header inside the tree */
.exp-dim-section { margin-bottom: 4px; }
.exp-dim-h {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 12px 12px 8px;
  background: var(--mf-aubergine-100);
  border-bottom: 1px solid var(--border-line);
  border-top: 1px solid var(--border-subtle);
  cursor: pointer;
  user-select: none;
  position: sticky; top: 0; z-index: 1;
}
.exp-dim-h:hover { background: var(--mf-aubergine-200); }
.exp-dim-h-dot {
  width: 10px; height: 10px; border-radius: 3px;
  flex-shrink: 0;
}
.exp-dim-h-eyebrow {
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
}
.exp-dim-h-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  color: var(--fg-1);
}
.exp-dim-h-desc {
  font-size: 11px;
  color: var(--fg-3);
  flex: 1;
}
.exp-dim-h-count {
  font-size: 11px;
  color: var(--fg-3);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.exp-dim-children { padding: 4px 0; }
.exp-dims, .exp-tree, .exp-detail {
  background: var(--mf-white);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.exp-dims { padding: 10px 8px; gap: 2px; overflow: auto; }
.exp-section-h {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-4);
  padding: 8px 8px 4px 8px;
  font-weight: 600;
}
.exp-dim {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 8px;
  border-radius: 8px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border: 1px solid transparent;
}
.exp-dim:hover { background: var(--mf-aubergine-100); }
.exp-dim.active {
  background: var(--bg-tint);
  border-color: var(--border-subtle);
  box-shadow: inset 2px 0 0 var(--dim-tint, var(--mf-watermelon-900));
}
.exp-dim-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--dim-tint, var(--mf-watermelon-900));
  flex-shrink: 0;
}
.exp-dim-meta { flex: 1; min-width: 0; }
.exp-dim-name { font-size: 13px; font-weight: 500; color: var(--fg-1); }
.exp-dim-desc { font-size: 10px; color: var(--fg-4); margin-top: 1px; line-height: 1.3; }
.exp-dim-count { text-align: right; }
.exp-dim-num { font-family: var(--font-display); font-weight: 600; font-size: 16px; line-height: 1; }
.exp-dim-sub { font-size: 10px; color: var(--fg-4); margin-top: 2px; font-variant-numeric: tabular-nums; }

.exp-tree-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 10px;
}
.exp-tree-body { flex: 1; overflow: auto; padding: 6px 8px; }

.exp-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px 5px 0;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.exp-row:hover { background: var(--mf-aubergine-100); }
.exp-row.active {
  background: var(--mf-watermelon-200);
  color: var(--mf-watermelon-900);
}
.exp-row.active .exp-row-name { color: var(--mf-watermelon-900); font-weight: 600; }
.exp-caret {
  width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg-3);
  flex-shrink: 0;
}
.exp-row-bullet {
  width: 8px; height: 8px;
  border-radius: 3px;
  flex-shrink: 0;
}
.exp-row-name { font-weight: 500; color: var(--fg-1); }
.exp-row-tag {
  font-size: 10px;
  color: var(--fg-4);
  background: var(--mf-aubergine-100);
  padding: 1px 6px;
  border-radius: 999px;
}
.exp-row-spacer { flex: 1; }
.exp-row-owner { flex-shrink: 0; opacity: 0.85; }
.exp-row-bar { width: 60px; flex-shrink: 0; }
.exp-row-bar-track {
  display: flex;
  height: 4px;
  background: var(--mf-aubergine-200);
  border-radius: 2px;
  overflow: hidden;
}
.exp-row-bar-track .seg-emp { background: var(--mf-aubergine-900); display: block; height: 100%; }
.exp-row-bar-track .seg-con { background: var(--mf-watermelon-900); display: block; height: 100%; }
.exp-row-count {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  font-size: 12px;
  min-width: 24px;
  text-align: right;
  flex-shrink: 0;
}
.exp-row-direct { color: var(--fg-4); font-size: 10px; }

.exp-children {
  position: relative;
  padding-left: 12px;
}
.exp-children::before {
  content: "";
  position: absolute; left: 16px; top: 0; bottom: 6px;
  border-left: 1px dashed var(--border-subtle);
}

.exp-detail {
  overflow: hidden;
}
.exp-detail-empty {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 24px;
  color: var(--fg-3);
}
.exp-detail-body { flex: 1; overflow: auto; display: flex; flex-direction: column; }

.exp-stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border-subtle);
  margin: 14px 16px 0 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  overflow: hidden;
}
.exp-stat { background: var(--mf-white); padding: 8px 10px; }
.exp-stat-label { font-size: 10px; color: var(--fg-3); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 500; }
.exp-stat-val { font-family: var(--font-display); font-weight: 600; font-size: 18px; line-height: 1.1; font-variant-numeric: tabular-nums; margin-top: 2px; }

.exp-meta { padding: 14px 16px; border-bottom: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.exp-section-divider {
  padding: 10px 16px 6px 16px;
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--fg-4); font-weight: 600;
}
.exp-member-list { display: flex; flex-direction: column; }
.exp-member {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 16px;
  cursor: pointer;
}
.exp-member:hover { background: var(--mf-aubergine-100); }
.tree { font-size: 12px; }
.tree-row {
  display: grid;
  grid-template-columns: 1fr 140px 140px 80px;
  gap: 10px;
  align-items: center;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
}
.tree-row:hover { background: var(--mf-aubergine-100); }
.tree-row.is-manager { background: rgba(255,46,91,0.04); }
.tree-row .person-cell { display: flex; align-items: center; gap: 8px; }
.tree-row .person-cell .indent { display: inline-block; height: 1px; }
.tree-row .person-cell .branch {
  color: var(--fg-4); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px;
  margin-right: 4px; flex-shrink: 0;
}
.tree-row .pname { font-weight: 500; }
.tree-row .prole { color: var(--fg-3); font-size: 11px; }

/* ============ Allocation visuals ============ */
.alloc-bar {
  width: 100%;
  height: 10px;
  background: var(--mf-aubergine-100);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
}
.alloc-seg {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 6px;
  color: var(--mf-white);
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  transition: filter 0.1s;
  cursor: default;
  border-right: 1px solid rgba(255,255,255,0.6);
}
.alloc-seg:last-child { border-right: 0; }
.alloc-seg:hover { filter: brightness(1.08); }
.alloc-seg-label { line-height: 1; }
.alloc-seg-empty {
  background: repeating-linear-gradient(
    45deg,
    var(--mf-aubergine-200) 0 6px,
    var(--mf-aubergine-100) 6px 12px
  );
}

.alloc-strip { display: flex; flex-direction: column; gap: 10px; }
.alloc-strip-bar-row { display: flex; align-items: center; gap: 10px; }
.alloc-strip-empty {
  color: var(--fg-4);
  font-size: 12px;
  font-style: italic;
}

.alloc-sum {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding: 2px 6px;
  border-radius: 6px;
}
.alloc-sum .ic { width: 11px; height: 11px; }
.alloc-sum-ok { background: rgba(45,138,74,0.12); color: #1F6936; }
.alloc-sum-over { background: rgba(255,46,91,0.12); color: var(--mf-watermelon-900); font-weight: 600; }
.alloc-sum-under { background: rgba(197,138,44,0.16); color: #8C5E12; }

.alloc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.alloc-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px 3px 4px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--mf-white);
  font-size: 11px;
  color: var(--fg-2);
  cursor: pointer;
  line-height: 1.2;
}
.alloc-chip:hover { border-color: var(--alloc-color, var(--fg-3)); }
.alloc-chip-swatch {
  width: 8px; height: 8px;
  border-radius: 2px;
  background: var(--alloc-color, var(--mf-aubergine-500));
  flex-shrink: 0;
}
.alloc-chip-dim {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-4);
  font-weight: 600;
}
.alloc-chip-name { color: var(--fg-1); }
.alloc-chip-pct { color: var(--alloc-color, var(--mf-watermelon-900)); font-weight: 600; font-variant-numeric: tabular-nums; }
.alloc-chip-dense { padding: 2px 6px 2px 4px; font-size: 10px; }
.alloc-chip-dense .alloc-chip-name { display: none; }
.alloc-chip-dense .alloc-chip-dim { display: none; }

/* Allocation diff card (git log) */
.alloc-diff {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: stretch;
  background: var(--bg-tint);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 8px;
}
.alloc-diff-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.alloc-diff-h {
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-4);
  font-weight: 600;
}
.alloc-diff-list { display: flex; flex-direction: column; gap: 2px; }
.alloc-diff-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px;
}
.alloc-diff-name { flex: 1; color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alloc-diff-pct { font-variant-numeric: tabular-nums; color: var(--fg-1); font-weight: 500; display: inline-flex; gap: 4px; align-items: center; }
.alloc-delta { font-size: 10px; padding: 0 4px; border-radius: 3px; font-weight: 600; }
.alloc-delta.pos { background: rgba(45,138,74,0.14); color: #1F6936; }
.alloc-delta.neg { background: rgba(255,46,91,0.12); color: var(--mf-watermelon-900); }
.alloc-diff-note {
  grid-column: 1 / -1;
  font-size: 11px;
  color: var(--fg-3);
  font-style: italic;
  padding-top: 6px;
  border-top: 1px dashed var(--border-subtle);
}

/* Person screen large allocation summary */
.person-alloc-card {
  border: 1px solid var(--border-subtle);
  background: var(--mf-white);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.person-alloc-card .h {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  font-weight: 600;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}

/* Cell FTE meta line */
.cell-fte {
  font-size: 10px;
  color: var(--fg-4);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* Allocate form (drawer) */
.alloc-form-list { display: flex; flex-direction: column; gap: 6px; }
.alloc-form-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: 7px;
  background: var(--mf-white);
}
.alloc-form-select {
  flex: 1;
  border: 0; outline: 0;
  background: transparent;
  font-size: 12px;
  min-width: 0;
}
.alloc-form-pct {
  width: 50px;
  border: 0; outline: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 12px;
  background: transparent;
}

/* ============ Misc ============ */
.divider { height: 1px; background: var(--border-subtle); margin: 12px 0; }
.col2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: flex-start; }
.col3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }

.muted { color: var(--fg-3); }
.dim { color: var(--fg-4); }
.right { text-align: right; }
.tab-row { display: flex; gap: 4px; padding: 0 0 8px 0; margin-bottom: 14px; border-bottom: 1px solid var(--border-subtle); }
.tab {
  padding: 6px 10px;
  font-size: 12px;
  color: var(--fg-3);
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  position: relative;
  font-weight: 500;
}
.tab:hover { color: var(--fg-1); }
.tab.active { color: var(--fg-1); }
.tab.active::after {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: -9px;
  height: 2px; background: var(--mf-watermelon-900);
}
.tab .count {
  margin-left: 4px; font-size: 10px; color: var(--fg-4);
  background: var(--mf-aubergine-200); padding: 0 5px; border-radius: 999px;
}
.tab.active .count { background: var(--mf-watermelon-300); color: var(--mf-watermelon-900); }

.seg {
  display: inline-flex;
  background: var(--mf-aubergine-200);
  border-radius: 7px;
  padding: 2px;
  gap: 1px;
}
.seg button {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 5px;
  color: var(--fg-3);
  font-weight: 500;
}
.seg button.active { background: var(--mf-white); color: var(--fg-1); box-shadow: var(--shadow-sm); }

/* ============ Brand intensity variants ============ */
body.brand-subtle .page-title,
body.brand-subtle .card-title,
body.brand-subtle .stat-value,
body.brand-subtle .drawer-title,
body.brand-subtle .scrub-title,
body.brand-subtle .fn-group-name,
body.brand-subtle .team-card-name,
body.brand-subtle .matrix .row-h .row-team,
body.brand-subtle .matrix .col-h .col-fn-name,
body.brand-subtle .cell-num,
body.brand-subtle .tm-name {
  font-family: var(--font-sans);
  letter-spacing: 0;
}
body.brand-subtle .page-title { font-weight: 600; font-size: 22px; line-height: 28px; }
body.brand-subtle .stat-value { font-size: 22px; line-height: 26px; }

body.brand-utility {
  background: var(--mf-white);
}
body.brand-utility .main { background: var(--mf-white); }
body.brand-utility .topbar { background: var(--mf-white); }
body.brand-utility .page-title,
body.brand-utility .card-title,
body.brand-utility .stat-value,
body.brand-utility .drawer-title,
body.brand-utility .scrub-title,
body.brand-utility .fn-group-name,
body.brand-utility .team-card-name,
body.brand-utility .matrix .col-h .col-fn-name,
body.brand-utility .matrix .row-h .row-team,
body.brand-utility .cell-num,
body.brand-utility .tm-name {
  font-family: var(--font-sans);
  letter-spacing: 0;
}
body.brand-utility .page-title { font-weight: 600; font-size: 22px; line-height: 28px; }
body.brand-utility .stat-value { font-size: 22px; line-height: 26px; }
body.brand-utility .sidebar { background: #1a1a1a; }
body.brand-utility .nav-item.active { background: rgba(255,255,255,0.08); }
body.brand-utility .nav-item.active::before { background: var(--mf-white); }
body.brand-utility .brand-mark { background: var(--mf-white); color: #1a1a1a; }

/* ============ Animations / micro ============ */
.spin { animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.fadein-soft { animation: fadeinSoft 0.18s ease-out; }
@keyframes fadeinSoft { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }

/* hide scrollbars in webkit */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--mf-aubergine-300); border-radius: 5px; border: 2px solid var(--bg-tint); }
::-webkit-scrollbar-track { background: transparent; }
