/* =====================================================================
   ERC · Oracle ERP Phase 2 — Delivery Cockpit
   STRICT PALETTE — every hex below is from the 7-token palette only.
   Off-palette hex values will not appear anywhere in this file (alpha
   variants of palette tokens are derived via rgba() of the same hex).
   ===================================================================== */

:root {
  /* === Palette (semantic roles) =================================== */
  --bg-primary:        #FFFFFF;   /* main canvas */
  --bg-surface:        #ECECEC;   /* cards, panels */
  --text-primary:      #0A0A0A;   /* primary text */
  --brand-deep:        #003D2E;   /* top nav, KPIs, primary buttons */
  --brand-shadow:      #14322B;   /* hover/depth, dark panels */
  --accent-success:    #2BA05A;   /* on-track, success, primary chart */
  --accent-highlight:  #D5E81C;   /* sparing: active, focus, alert */

  /* === Derived alpha variants (still palette-pure) ================ */
  --on-light-muted:    rgba(10, 10, 10, 0.62);
  --on-light-faint:    rgba(10, 10, 10, 0.42);
  --on-light-line:     rgba(10, 10, 10, 0.09);
  --on-light-line-2:   rgba(10, 10, 10, 0.18);

  --on-deep-muted:     rgba(255, 255, 255, 0.72);
  --on-deep-faint:     rgba(255, 255, 255, 0.48);
  --on-deep-line:      rgba(255, 255, 255, 0.14);
  --on-deep-line-2:    rgba(255, 255, 255, 0.26);

  --brand-deep-08:     rgba(0, 61, 46, 0.08);
  --brand-deep-16:     rgba(0, 61, 46, 0.16);
  --brand-deep-30:     rgba(0, 61, 46, 0.30);
  --highlight-12:      rgba(213, 232, 28, 0.12);
  --highlight-30:      rgba(213, 232, 28, 0.30);
  --success-12:        rgba(43, 160, 90, 0.12);
  --success-30:        rgba(43, 160, 90, 0.30);

  /* === Status semantics =========================================== */
  --s-todo:        var(--on-light-muted);
  --s-progress:    var(--brand-deep);
  --s-review:      var(--brand-shadow);
  --s-done:        var(--accent-success);
  --s-blocked:     var(--accent-highlight);
  --s-onhold:      var(--brand-shadow);

  /* === Type ======================================================= */
  --f-display: 'Space Grotesk', 'Manrope', system-ui, sans-serif;
  --f-body:    'Manrope', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  /* === Radii / shadows ============================================ */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --shadow-1: 0 1px 2px rgba(10,10,10,0.05), 0 4px 14px rgba(10,10,10,0.05);
  --shadow-2: 0 12px 36px rgba(10,10,10,0.10);
  --shadow-deep: 0 14px 38px rgba(0,61,46,0.18);
  --focus-ring: 0 0 0 3px var(--accent-highlight), 0 0 0 5px var(--brand-deep);
}

/* =====================================================================
   BASE
   ===================================================================== */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--f-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}

button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 6px; }

/* =====================================================================
   TOPBAR — sits on --brand-deep
   ===================================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px 28px;
  background: var(--brand-deep);
  color: #FFFFFF;
  border-bottom: 2px solid var(--accent-highlight);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--brand-shadow);
  border: 1px solid var(--on-deep-line);
  flex-shrink: 0;
}
.brand-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 15px;
  color: #FFFFFF;
}
.brand-sub {
  font-size: 11px;
  color: var(--on-deep-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.topbar-nav { display: flex; gap: 6px; margin-left: 12px; }
.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--on-deep-line);
  background: transparent;
  color: var(--on-deep-muted);
  font-size: 12.5px;
  font-weight: 600;
  transition: background .15s, color .15s, border-color .15s;
}
.chip:hover {
  color: #FFFFFF;
  border-color: var(--on-deep-line-2);
  background: var(--brand-shadow);
}
.chip-active {
  color: var(--brand-deep);
  background: var(--accent-highlight);
  border-color: var(--accent-highlight);
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.sync-state {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
  color: var(--on-deep-muted);
  padding: 8px 12px;
  background: var(--brand-shadow);
  border: 1px solid var(--on-deep-line);
  border-radius: 999px;
}
.sync-state .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-highlight);
  box-shadow: 0 0 0 4px var(--highlight-30);
  animation: pulse 1.6s ease-in-out infinite;
}
.sync-state.is-ok .dot      { background: var(--accent-success); box-shadow: 0 0 0 4px var(--success-30); }
.sync-state.is-loading .dot { background: var(--accent-highlight); }
@keyframes pulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50%     { transform: scale(1.3); opacity: 0.6; }
}
.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--on-deep-line);
  border-radius: 10px;
  background: transparent;
  color: #FFFFFF;
  transition: background .15s;
}
.icon-btn:hover { background: var(--brand-shadow); }

/* When the icon-btn appears on a light surface (drill, sheet), invert tone */
.drill-actions .icon-btn,
.sheet-head .icon-btn {
  border-color: var(--on-light-line-2);
  color: var(--text-primary);
}
.drill-actions .icon-btn:hover,
.sheet-head .icon-btn:hover { background: var(--bg-surface); }

/* =====================================================================
   EXEC STRIP — sits on --bg-primary
   ===================================================================== */

.exec-strip {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1.2fr;
  gap: 14px;
  padding: 22px 28px;
  background: var(--bg-primary);
}
.exec-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--on-light-line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  overflow: hidden;
}
.exec-card-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.exec-eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-light-muted);
}
.exec-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--success-12);
  color: var(--accent-success);
  border: 1px solid var(--accent-success);
}
.exec-pill--warn {
  background: transparent;
  color: var(--brand-deep);
  border-color: var(--accent-highlight);
  box-shadow: inset 0 0 0 2px var(--accent-highlight);
}

/* Hero phase tile sits on --brand-deep */
.exec-card--phase {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: #FFFFFF;
}
.exec-card--phase .exec-eyebrow { color: var(--on-deep-muted); }
.exec-card--phase .exec-pill {
  background: var(--accent-highlight);
  color: var(--brand-deep);
  border-color: var(--accent-highlight);
}
.exec-headline {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.exec-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px;
  color: var(--on-deep-muted);
}
.exec-card--phase .exec-meta strong { color: var(--accent-highlight); }
.dot-sep { width: 4px; height: 4px; border-radius: 50%; background: var(--on-deep-faint); }

.exec-stat-row {
  display: flex; gap: 18px; margin-bottom: 12px;
}
.exec-stat { display: flex; flex-direction: column; gap: 2px; }
.exec-stat-num {
  font-family: var(--f-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text-primary);
}
.exec-stat-num--alert   { color: var(--brand-deep); border-bottom: 3px solid var(--accent-highlight); padding-bottom: 2px; display: inline-block; }
.exec-stat-num--warn    { color: var(--brand-deep); }
.exec-stat-num--success { color: var(--accent-success); }
.exec-stat-lbl {
  font-size: 10.5px;
  color: var(--on-light-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.exec-bar {
  display: flex;
  height: 8px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(10,10,10,0.06);
}
.exec-bar > span { display: block; height: 100%; }

.risk-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.risk-list li {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px;
  color: var(--text-primary);
}
.risk-list li::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-highlight);
  box-shadow: 0 0 0 3px var(--highlight-30);
  flex-shrink: 0;
}

/* =====================================================================
   TRACK CARDS (Level 1)
   ===================================================================== */

.track-section { padding: 8px 28px 28px; background: var(--bg-primary); }
.track-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.track-card {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  border: 1px solid var(--on-light-line);
  background: var(--bg-surface);
  cursor: pointer;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.track-card:hover {
  transform: translateY(-2px);
  border-color: var(--on-light-line-2);
  box-shadow: var(--shadow-2);
}
.track-card-bg { display: none; }                 /* removed gradient noise */

.track-card-head {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 24px 28px 26px;
  background: var(--brand-deep);
  color: #FFFFFF;
  position: relative;
  overflow: hidden;
}
/* Bottom chevron-stripe — Expo Riyadh 2030 motif, replaces the flat colored line */
.track-card-head::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 8px;
  background-image:
    linear-gradient(135deg, currentColor 25%, transparent 25%, transparent 50%, currentColor 50%, currentColor 75%, transparent 75%);
  background-size: 12px 8px;
  background-repeat: repeat-x;
}
.track-card--ops .track-card-head::after { color: var(--accent-highlight); }
.track-card--del .track-card-head::after { color: var(--accent-success); }

.track-icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--brand-shadow);
  border: 1px solid var(--on-deep-line);
  color: #FFFFFF;
  flex-shrink: 0;
}
.track-card--ops .track-icon { background: var(--accent-highlight); color: var(--brand-deep); border-color: var(--accent-highlight); }
.track-card--del .track-icon { background: var(--accent-success);   color: #FFFFFF;          border-color: var(--accent-success); }

.track-eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-deep-muted);
  margin-bottom: 4px;
}
.track-title {
  font-family: var(--f-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 4px;
  color: #FFFFFF;
}
.track-sub {
  font-size: 13.5px;
  color: var(--on-deep-muted);
  margin: 0;
}

.track-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 22px 22px 18px;
}
.track-stat {
  background: var(--bg-primary);
  border: 1px solid var(--on-light-line);
  border-radius: var(--r-md);
  padding: 12px 14px;
}
.track-stat-num {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
}
.track-stat-lbl {
  font-size: 10.5px;
  color: var(--on-light-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 4px;
}
.track-stat--crit .track-stat-num { color: var(--brand-deep); border-bottom: 3px solid var(--accent-highlight); padding-bottom: 2px; display: inline-block; }
.track-stat--high .track-stat-num { color: var(--brand-deep); }
.track-stat--med  .track-stat-num { color: var(--text-primary); }
.track-stat--low  .track-stat-num { color: var(--accent-success); }
.track-stat--done .track-stat-num { color: var(--accent-success); }

.track-modules {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 22px 18px;
}
.module-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--bg-primary);
  border: 1px solid var(--on-light-line);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.module-row:hover {
  border-color: var(--brand-deep);
  background: var(--bg-surface);
}
.module-name {
  font-weight: 600;
  font-size: 13.5px;
  display: flex; align-items: center; gap: 10px;
  color: var(--text-primary);
}
.module-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand-deep);
  flex-shrink: 0;
}
.module-progress {
  width: 110px;
  height: 6px;
  border-radius: 4px;
  background: rgba(10,10,10,0.08);
  overflow: hidden;
}
.module-progress > span {
  display: block;
  height: 100%;
  background: var(--accent-success);
}
.module-meta {
  display: flex; gap: 6px;
  font-size: 11.5px;
  color: var(--on-light-muted);
  font-variant-numeric: tabular-nums;
}
.module-meta .pip {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--on-light-line);
  color: var(--text-primary);
}
.module-meta .pip--crit {
  background: var(--accent-highlight);
  border-color: var(--accent-highlight);
  color: var(--brand-deep);
  font-weight: 700;
}
.module-meta .pip--high {
  background: var(--brand-deep);
  border-color: var(--brand-deep);
  color: #FFFFFF;
  font-weight: 700;
}

.track-card-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 22px 22px;
  border-top: 1px solid var(--on-light-line);
  font-size: 12.5px;
  color: var(--text-primary);
}
.ghost-btn {
  background: var(--brand-deep);
  border: 1px solid var(--brand-deep);
  color: #FFFFFF;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  transition: background .15s, border-color .15s;
}
.ghost-btn:hover {
  background: var(--brand-shadow);
  border-color: var(--accent-highlight);
}

/* =====================================================================
   DRILL-DOWN
   ===================================================================== */

.drill {
  margin: 8px 28px 28px;
  background: var(--bg-surface);
  border: 1px solid var(--on-light-line);
  border-radius: var(--r-xl);
  overflow: hidden;
  animation: rise .35s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.drill-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 24px 22px;
  background: var(--brand-deep);
  color: #FFFFFF;
  position: relative;
  overflow: hidden;
}
.drill-head::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 6px;
  background-image:
    linear-gradient(135deg, currentColor 25%, transparent 25%, transparent 50%, currentColor 50%, currentColor 75%, transparent 75%);
  background-size: 12px 6px;
  background-repeat: repeat-x;
  color: var(--accent-highlight);
}
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: var(--on-deep-muted);
  flex-wrap: wrap;
}
.breadcrumb .crumb {
  background: transparent;
  border: 0;
  padding: 4px 10px;
  border-radius: 8px;
  color: var(--on-deep-muted);
}
.breadcrumb .crumb:hover { background: var(--brand-shadow); color: #FFFFFF; }
.breadcrumb .crumb-active {
  color: var(--brand-deep);
  font-weight: 700;
  background: var(--accent-highlight);
}
.breadcrumb .sep { color: var(--on-deep-faint); }

.drill-actions { display: flex; align-items: center; gap: 10px; }
.seg {
  display: flex;
  background: var(--brand-shadow);
  border: 1px solid var(--on-deep-line);
  border-radius: 10px;
  padding: 3px;
}
.seg-btn {
  background: transparent;
  border: 0;
  padding: 6px 12px;
  border-radius: 7px;
  color: var(--on-deep-muted);
  font-size: 12.5px;
  font-weight: 600;
}
.seg-btn:hover { color: #FFFFFF; }
.seg-btn--active {
  background: var(--accent-highlight);
  color: var(--brand-deep);
}

/* Override icon-btn in drill-head to look on-deep */
.drill-head .icon-btn {
  border-color: var(--on-deep-line);
  color: #FFFFFF;
}
.drill-head .icon-btn:hover { background: var(--brand-shadow); }

.drill-summary {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--on-light-line);
  background: var(--bg-surface);
}
.drill-summary .ds-cell {
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--bg-primary);
  border: 1px solid var(--on-light-line);
}
.drill-summary .ds-num {
  font-family: var(--f-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
}
.drill-summary .ds-num--alert   { color: var(--brand-deep); border-bottom: 3px solid var(--accent-highlight); padding-bottom: 2px; display: inline-block; }
.drill-summary .ds-num--warn    { color: var(--brand-deep); }
.drill-summary .ds-num--success { color: var(--accent-success); }
.drill-summary .ds-lbl {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-light-muted);
  margin-top: 4px;
}

.view {
  padding: 22px 24px;
  min-height: 240px;
  background: var(--bg-surface);
}

/* ----- Board / tree view ----- */
.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.bucket-card {
  background: var(--bg-primary);
  border: 1px solid var(--on-light-line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.bucket-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 14px 18px;
  border-bottom: 1px solid var(--on-light-line);
  background: var(--bg-primary);
}
.bucket-card--accent .bucket-head {
  border-top: 3px solid var(--brand-deep);
}
.bucket-title {
  font-family: var(--f-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  color: var(--text-primary);
}
.bucket-sub {
  font-size: 11.5px;
  color: var(--on-light-muted);
}
.bucket-progress-ring {
  width: 38px; height: 38px;
  position: relative;
}
.bucket-progress-ring svg { transform: rotate(-90deg); }
.bucket-progress-ring .pct {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--f-display);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.task-list { list-style: none; margin: 0; padding: 8px 8px 12px; }
.task-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
}
.task-row:hover { background: var(--bg-surface); }
.task-row + .task-row { margin-top: 2px; }

.task-status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--s-todo);
  border: 1px solid var(--on-light-line-2);
}
.task-meta-line { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.task-key {
  font-family: var(--f-display);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--on-light-muted);
  text-transform: uppercase;
}
.task-summary {
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Priority chips (palette-bound) */
.task-pri {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.task-pri--P1, .task-pri--Critical {
  background: var(--accent-highlight);
  color: var(--brand-deep);
  border-color: var(--accent-highlight);
}
.task-pri--P2, .task-pri--High {
  background: var(--brand-deep);
  color: #FFFFFF;
  border-color: var(--brand-deep);
}
.task-pri--P3, .task-pri--Medium {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--on-light-line-2);
}
.task-pri--Low {
  background: transparent;
  color: var(--on-light-muted);
  border-color: var(--on-light-line-2);
}

.task-due {
  font-size: 11.5px;
  color: var(--on-light-muted);
  font-variant-numeric: tabular-nums;
}
.task-due.is-overdue {
  color: var(--brand-deep);
  font-weight: 700;
  border-bottom: 2px solid var(--accent-highlight);
  padding-bottom: 1px;
}

.subtask-toggle {
  background: transparent;
  border: 0;
  padding: 0 6px;
  color: var(--on-light-muted);
  font-size: 14px;
}
.subtask-list { list-style: none; padding: 0 0 4px 28px; margin: 4px 0 0; }
.subtask-list .task-row { padding: 6px 10px; }

/* ----- Gantt view ----- */
.gantt {
  display: grid;
  grid-template-columns: 280px 1fr;
  background: var(--bg-primary);
  border: 1px solid var(--on-light-line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.gantt-rows-side {
  border-right: 1px solid var(--on-light-line);
  background: var(--bg-surface);
}
.gantt-row-side, .gantt-row-track {
  height: 36px;
  display: flex; align-items: center;
  border-bottom: 1px solid var(--on-light-line);
}
.gantt-row-side {
  padding: 0 14px;
  font-size: 12.5px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  gap: 8px;
}
.gantt-row-side .gs-key {
  font-family: var(--f-display);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--on-light-muted);
  text-transform: uppercase;
}
.gantt-rows-side .gantt-head, .gantt-track-wrap .gantt-head {
  height: 40px;
  background: var(--brand-deep);
  color: #FFFFFF;
  font-family: var(--f-display);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 14px;
  display: flex; align-items: center;
  border-bottom: 1px solid var(--brand-shadow);
}
.gantt-track-wrap {
  position: relative;
  overflow-x: auto;
  background: var(--bg-primary);
}
.gantt-timescale {
  position: relative;
  display: flex;
  height: 40px;
  border-bottom: 1px solid var(--on-light-line);
  background: var(--bg-surface);
}
.gantt-month {
  font-family: var(--f-display);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-light-muted);
  display: flex; align-items: center;
  padding: 0 12px;
  border-right: 1px dashed var(--on-light-line);
}
.gantt-bars { position: relative; }
.gantt-row-track {
  position: relative;
  border-bottom: 1px solid var(--on-light-line);
}
.gantt-grid-line {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: var(--on-light-line);
}
.gantt-today {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--accent-highlight);
  z-index: 4;
}
.gantt-today::before {
  content: 'TODAY';
  position: absolute;
  top: -22px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--f-display);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--brand-deep);
  background: var(--accent-highlight);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}
.gantt-bar {
  position: absolute;
  top: 8px; height: 20px;
  border-radius: 4px;
  display: flex; align-items: center;
  padding: 0 8px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  border: 1px solid transparent;
}
.gantt-bar.s-Done       { background: var(--accent-success); color: var(--brand-deep); border-color: var(--accent-success); font-weight: 700; }
.gantt-bar.s-InProgress { background: var(--brand-deep);     color: #FFFFFF; border-color: var(--brand-deep); }
.gantt-bar.s-Todo       { background: var(--bg-surface);     color: var(--text-primary); border-color: var(--on-light-line-2); }
.gantt-bar.s-Review     { background: var(--brand-shadow);   color: #FFFFFF; border-color: var(--brand-shadow); }
.gantt-bar.s-Blocked    { background: var(--accent-highlight); color: var(--brand-deep); border-color: var(--brand-deep); }
.gantt-bar.s-OnHold     {
  background: repeating-linear-gradient(
    135deg,
    var(--brand-shadow) 0 6px,
    rgba(20,50,43,0.55) 6px 12px
  );
  color: #FFFFFF;
  border-color: var(--brand-shadow);
}

.gantt-bar-progress {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  background: rgba(255,255,255,0.30);
  border-radius: 4px 0 0 4px;
}
.gantt-bar.s-Todo .gantt-bar-progress     { background: var(--brand-deep-16); }
.gantt-bar.s-Blocked .gantt-bar-progress  { background: var(--brand-deep-16); }

.gantt-dep { position: absolute; pointer-events: none; z-index: 3; }

/* ----- Dependencies view ----- */
.deps-canvas {
  width: 100%;
  min-height: 520px;
  background: var(--bg-primary);
  border: 1px solid var(--on-light-line);
  border-radius: var(--r-lg);
  position: relative;
  overflow: hidden;
}
.dep-node {
  position: absolute;
  background: var(--bg-surface);
  border: 1px solid var(--on-light-line-2);
  border-left: 3px solid var(--brand-deep);
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 160px;
  max-width: 220px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s;
  color: var(--text-primary);
}
.dep-node:hover { transform: translateY(-2px); background: var(--bg-primary); box-shadow: var(--shadow-2); }
.dep-node-key {
  font-family: var(--f-display);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--on-light-muted);
  text-transform: uppercase;
}
.dep-node-title {
  font-size: 12px;
  margin-top: 3px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text-primary);
}
.dep-node-meta {
  display: flex; gap: 6px; align-items: center;
  margin-top: 6px;
  font-size: 10px;
  color: var(--on-light-muted);
}
.dep-node.s-Done       { border-left-color: var(--accent-success); }
.dep-node.s-InProgress { border-left-color: var(--brand-deep); }
.dep-node.s-Review     { border-left-color: var(--brand-shadow); }
.dep-node.s-Blocked    { border-left-color: var(--accent-highlight); }
.dep-node.s-OnHold     { border-left-color: var(--brand-shadow); }
.dep-node.s-Todo       { border-left-color: var(--on-light-line-2); }

.dep-svg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.dep-edge {
  fill: none;
  stroke: var(--on-light-muted);
  stroke-width: 1.5;
  opacity: 0.8;
}
.dep-edge.is-blocking {
  stroke: var(--accent-highlight);
  stroke-width: 2;
  opacity: 1;
  stroke-dasharray: 4 4;
}

/* =====================================================================
   TASK SHEET
   ===================================================================== */

.sheet { position: fixed; inset: 0; z-index: 100; }
.sheet[hidden] { display: none; }
.sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(10,10,10,0.40);
  animation: fadein .2s ease;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.sheet-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(560px, 100%);
  background: var(--bg-primary);
  border-left: 1px solid var(--on-light-line);
  display: flex; flex-direction: column;
  animation: slidein .25s cubic-bezier(.2,.7,.2,1);
}
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head {
  padding: 22px 24px 14px;
  display: flex; justify-content: space-between; align-items: flex-start;
  border-bottom: 1px solid var(--on-light-line);
  background: var(--bg-surface);
}
.sheet-key {
  font-family: var(--f-display);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--on-light-muted);
  text-transform: uppercase;
}
.sheet-title {
  font-family: var(--f-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 4px 0 0;
  color: var(--text-primary);
}
.sheet-body {
  padding: 18px 24px 28px;
  overflow-y: auto;
  background: var(--bg-primary);
}
.sheet-fact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.sheet-fact {
  background: var(--bg-surface);
  border: 1px solid var(--on-light-line);
  border-radius: var(--r-md);
  padding: 10px 12px;
}
.sheet-fact-lbl {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-light-muted);
}
.sheet-fact-val {
  font-size: 13.5px;
  font-weight: 600;
  margin-top: 4px;
  color: var(--text-primary);
}
.sheet-fact-val.is-overdue {
  color: var(--brand-deep);
  border-bottom: 2px solid var(--accent-highlight);
  padding-bottom: 2px;
  display: inline-block;
}
.sheet-section { margin-top: 18px; }
.sheet-section-title {
  font-family: var(--f-display);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--on-light-muted);
  margin: 0 0 8px;
}
.sheet-desc {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.55;
}
.dep-item {
  display: flex; gap: 10px; align-items: center;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--on-light-line);
  margin-bottom: 6px;
  font-size: 12.5px;
  color: var(--text-primary);
  cursor: pointer;
}
.dep-item:hover { background: var(--bg-primary); border-color: var(--brand-deep); }
.dep-item .arrow { color: var(--on-light-muted); }

/* Status dot helpers (used inline) */
.s-dot       { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.s-dot-Todo       { background: transparent; border: 1px solid var(--on-light-line-2); }
.s-dot-InProgress { background: var(--brand-deep); }
.s-dot-Review     { background: var(--brand-shadow); }
.s-dot-Done       { background: var(--accent-success); }
.s-dot-Blocked    { background: var(--accent-highlight); box-shadow: 0 0 0 2px var(--highlight-30); }
.s-dot-OnHold     {
  background: repeating-linear-gradient(135deg, var(--brand-shadow) 0 2px, transparent 2px 4px);
  border: 1px solid var(--brand-shadow);
}

/* =====================================================================
   FOOTER
   ===================================================================== */

.page-foot {
  display: flex; justify-content: space-between;
  padding: 18px 28px 28px;
  font-size: 11.5px;
  color: var(--on-light-muted);
  background: var(--bg-primary);
  border-top: 1px solid var(--on-light-line);
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1180px) {
  .exec-strip { grid-template-columns: 1fr 1fr; }
  .drill-summary { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 880px) {
  .topbar { flex-wrap: wrap; gap: 12px; }
  .topbar-nav { order: 3; width: 100%; }
  .exec-strip, .track-grid { grid-template-columns: 1fr; }
  .gantt { grid-template-columns: 180px 1fr; }
  .drill-summary { grid-template-columns: repeat(2, 1fr); }
}
