/* ==========================================================================
   TNT Design Team Timeline — 3 Visual Themes (Classic, Heatmap Pro, Dark)
   ========================================================================== */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Layout metrics */
  --left-col-w: 274px;
  --day-w: 62px;
  --designer-row-h: 42px;
  --project-row-h: 48px;
  --header-h: 64px;
  --radius-sm: 6px;
  --radius-md: 9px;
  --radius-lg: 14px;

  /* Classic Light palette (default base) */
  --bg-page: #f6f7fb;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f3f8;
  --bg-designer-row: #eceff5;
  --bg-designer-row-hover: #e4e8f1;
  --bg-weekend: #f5f3fa;
  --bg-today-col: rgba(109, 74, 255, 0.065);
  --bg-hover-row: #fafbff;

  --text-primary: #181c28;
  --text-secondary: #5a6275;
  --text-muted: #8a93a6;

  --border-color: #e4e7f0;
  --border-subtle: #eef0f6;
  --accent: #6d4aff;
  --accent-soft: rgba(109, 74, 255, 0.12);
  --accent-text: #ffffff;

  /* Stage colors (Classic soft pastels matching reference screenshot) */
  --stage-lilac-bg: #e7d9fb;
  --stage-lilac-border: #d0b6f6;
  --stage-lilac-text: #4c2785;

  --stage-amber-bg: #fcebb7;
  --stage-amber-border: #edd078;
  --stage-amber-text: #6e4e06;

  --stage-sky-bg: #cde4fd;
  --stage-sky-border: #9ec8fa;
  --stage-sky-text: #164982;

  --stage-mint-bg: #c6eedd;
  --stage-mint-border: #93dcbd;
  --stage-mint-text: #135a41;

  --stage-lime-bg: #d9f0be;
  --stage-lime-border: #b3de83;
  --stage-lime-text: #2f5c10;

  --stage-violet-bg: #d8c8fa;
  --stage-violet-border: #b99df5;
  --stage-violet-text: #452087;

  /* Heatmap load cells */
  --load-0-bg: rgba(16, 185, 129, 0.08);
  --load-0-text: #0f766e;
  --load-1-bg: rgba(59, 130, 246, 0.12);
  --load-1-text: #1d4ed8;
  --load-2-bg: rgba(245, 158, 11, 0.18);
  --load-2-text: #b45309;
  --load-3-bg: rgba(239, 68, 68, 0.19);
  --load-3-text: #b91c1c;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.10);
  --shadow-drawer: -12px 0 36px rgba(15, 23, 42, 0.14);
}

/* Zoom levels */
body[data-zoom="s"] { --day-w: 44px; --left-col-w: 252px; }
body[data-zoom="m"] { --day-w: 62px; --left-col-w: 274px; }
body[data-zoom="l"] { --day-w: 84px; --left-col-w: 286px; }

/* Theme 1: Classic (strictly clean like reference screenshot) */
body.theme-classic .summary-strip {
  display: none;
}
body.theme-classic .designer-heatmap-strip {
  display: none;
}

/* Theme 2: Heatmap Pro (enhanced studio view) */
body.theme-heatmap {
  --bg-page: #f3f5fa;
  --bg-designer-row: #eef1f8;
}
body.theme-heatmap .stage-pill[data-category="wait"] {
  background: repeating-linear-gradient(
    -45deg,
    rgba(252, 235, 183, 0.62),
    rgba(252, 235, 183, 0.62) 6px,
    rgba(255, 248, 224, 0.85) 6px,
    rgba(255, 248, 224, 0.85) 12px
  );
  border-style: dashed;
}

/* Theme 3: Dark Broadcast */
body.theme-dark {
  --bg-page: #0c0e14;
  --bg-surface: #131620;
  --bg-subtle: #1a1e2b;
  --bg-designer-row: #1b2030;
  --bg-designer-row-hover: #22283c;
  --bg-weekend: #171826;
  --bg-today-col: rgba(139, 92, 246, 0.13);
  --bg-hover-row: #181c28;

  --text-primary: #eef1f8;
  --text-secondary: #a1abc2;
  --text-muted: #6c768f;

  --border-color: #252b3d;
  --border-subtle: #1e2333;
  --accent: #8b5cf6;
  --accent-soft: rgba(139, 92, 246, 0.22);
  --accent-text: #ffffff;

  --stage-lilac-bg: rgba(168, 85, 247, 0.24);
  --stage-lilac-border: rgba(192, 132, 252, 0.55);
  --stage-lilac-text: #e9d5ff;

  --stage-amber-bg: rgba(245, 158, 11, 0.14);
  --stage-amber-border: rgba(251, 191, 36, 0.42);
  --stage-amber-text: #fde68a;

  --stage-sky-bg: rgba(56, 189, 248, 0.22);
  --stage-sky-border: rgba(56, 189, 248, 0.55);
  --stage-sky-text: #bae6fd;

  --stage-mint-bg: rgba(52, 211, 153, 0.22);
  --stage-mint-border: rgba(52, 211, 153, 0.55);
  --stage-mint-text: #a7f3d0;

  --stage-lime-bg: rgba(163, 230, 53, 0.22);
  --stage-lime-border: rgba(163, 230, 53, 0.52);
  --stage-lime-text: #d9f99d;

  --stage-violet-bg: rgba(139, 92, 246, 0.30);
  --stage-violet-border: rgba(167, 139, 250, 0.65);
  --stage-violet-text: #ede9fe;

  --load-0-bg: rgba(16, 185, 129, 0.14);
  --load-0-text: #6ee7b7;
  --load-1-bg: rgba(56, 189, 248, 0.16);
  --load-1-text: #7dd3fc;
  --load-2-bg: rgba(245, 158, 11, 0.22);
  --load-2-text: #fcd34d;
  --load-3-bg: rgba(248, 113, 113, 0.26);
  --load-3-text: #fca5a5;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.55);
  --shadow-drawer: -12px 0 40px rgba(0, 0, 0, 0.65);
}

body.theme-dark .stage-pill[data-category="wait"] {
  border-style: dashed;
}

body.theme-dark .seg-btn.is-active {
  background: #2a324a;
  color: #ffffff;
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ==========================================================================
   Topbar
   ========================================================================== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.date-range-pill {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-subtle);
  font-variant-numeric: tabular-nums;
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
}

/* Segmented Controls & Buttons */
.segmented {
  display: inline-flex;
  padding: 2px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  gap: 2px;
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.14s ease;
  white-space: nowrap;
}

.seg-btn:hover { color: var(--text-primary); }

.seg-btn.is-active {
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.segmented-compact .seg-btn { padding: 4px 8px; font-size: 11.5px; }

.btn-primary, .btn-secondary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.14s ease;
  white-space: nowrap;
}

.btn-sm { font-size: 12px; padding: 6px 11px; }
.btn-xs { font-size: 11.5px; padding: 4px 8px; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  border: 1px solid transparent;
}
.btn-primary:hover { filter: brightness(1.07); }

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover { background: var(--bg-subtle); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}
.btn-ghost:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

/* ==========================================================================
   Summary KPI Strip (Heatmap & Dark themes)
   ========================================================================== */
.summary-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 10px 18px;
  background: var(--bg-page);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color 0.14s ease, transform 0.14s ease;
  min-width: 0;
}

.kpi-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.kpi-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.kpi-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.kpi-value {
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.kpi-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-delivery .kpi-value { color: var(--accent); }
.kpi-wait .kpi-value { color: #d97706; }
.kpi-free .kpi-value { color: #10b981; }
.kpi-overload .kpi-value { color: #ef4444; }

/* ==========================================================================
   Toolbar
   ========================================================================== */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 18px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  width: 190px;
}

.search-box:focus-within {
  border-color: var(--accent);
  background: var(--bg-surface);
}

.search-box input {
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12.5px;
  width: 100%;
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.toggle-chip input { accent-color: var(--accent); margin: 0; }
.toggle-chip:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text-primary);
}

.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  display: inline-block;
  border: 1px solid transparent;
}

.dot-lilac  { background: var(--stage-lilac-bg);  border-color: var(--stage-lilac-border); }
.dot-sky    { background: var(--stage-sky-bg);    border-color: var(--stage-sky-border); }
.dot-mint   { background: var(--stage-mint-bg);   border-color: var(--stage-mint-border); }
.dot-lime   { background: var(--stage-lime-bg);   border-color: var(--stage-lime-border); }
.dot-violet { background: var(--stage-violet-bg); border-color: var(--stage-violet-border); }
.dot-amber  { background: var(--stage-amber-bg);  border-color: var(--stage-amber-border); }

/* ==========================================================================
   Main Timeline Grid
   ========================================================================== */
.main-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
}

.timeline-scroll {
  flex: 1;
  overflow: auto;
  position: relative;
}

.timeline-grid {
  position: relative;
  min-width: max-content;
}

/* Sticky Calendar Header */
.cal-header {
  display: flex;
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  height: var(--header-h);
}

.cal-corner {
  position: sticky;
  left: 0;
  z-index: 35;
  width: var(--left-col-w);
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.cal-days-header {
  display: flex;
  position: relative;
}

.cal-day-cell {
  width: var(--day-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 6px 2px 8px;
  border-right: 1px solid var(--border-subtle);
  position: relative;
  user-select: none;
}

.cal-day-cell.is-weekend {
  background: var(--bg-weekend);
}

.cal-day-cell.is-today {
  background: var(--bg-today-col);
}

.cal-month-tag {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  white-space: nowrap;
  pointer-events: none;
}

.cal-day-num {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.cal-day-cell.is-today .cal-day-num {
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 8px var(--accent-soft);
}

.cal-day-dow {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 1px;
}

.cal-day-cell.is-weekend .cal-day-dow,
.cal-day-cell.is-weekend .cal-day-num {
  color: var(--text-muted);
}

/* Designer Group Header Row */
.designer-row {
  display: flex;
  height: var(--designer-row-h);
  background: var(--bg-designer-row);
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.12s ease;
}

.designer-row:hover {
  background: var(--bg-designer-row-hover);
}

.designer-left {
  position: sticky;
  left: 0;
  z-index: 20;
  width: var(--left-col-w);
  flex-shrink: 0;
  background: inherit;
  border-right: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
}

.designer-id-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.chevron {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.16s ease;
  width: 12px;
  text-align: center;
}

.designer-row.is-collapsed .chevron {
  transform: rotate(-90deg);
}

.avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.designer-name-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.designer-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.designer-vac-sub {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.15;
  white-space: nowrap;
}

.designer-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.count-badge {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.designer-track {
  position: relative;
  display: flex;
  flex: 1;
}

.vacation-pill {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: 999px;
  pointer-events: none;
}

/* Heatmap Strip inside Designer Row */
.designer-heatmap-strip {
  display: flex;
  width: 100%;
  height: 100%;
}

.hm-cell {
  width: var(--day-w);
  flex-shrink: 0;
  height: 100%;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.hm-cell.is-weekend { background: rgba(120, 110, 160, 0.04); }
.hm-cell.load-0 { color: var(--load-0-text); }
.hm-cell.load-0 .hm-dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--load-0-text); opacity: 0.35;
}
.hm-cell.load-1 { background: var(--load-1-bg); color: var(--load-1-text); }
.hm-cell.load-2 { background: var(--load-2-bg); color: var(--load-2-text); }
.hm-cell.load-3 { background: var(--load-3-bg); color: var(--load-3-text); }

/* Project Row */
.project-row {
  display: flex;
  height: var(--project-row-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.12s ease;
}

.project-row:hover {
  background: var(--bg-hover-row);
}

.project-row.is-hidden {
  display: none;
}

.project-left {
  position: sticky;
  left: 0;
  z-index: 15;
  width: var(--left-col-w);
  flex-shrink: 0;
  background: inherit;
  border-right: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px 0 22px;
  cursor: pointer;
}

.project-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-primary);
  flex-shrink: 0;
  opacity: 0.7;
}

.project-dot.is-delivery { background: var(--accent); opacity: 1; }
.project-dot.is-archived { background: var(--text-muted); opacity: 0.45; }

.project-info {
  min-width: 0;
  flex: 1;
}

.project-client {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.project-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.project-track {
  position: relative;
  display: flex;
  align-items: center;
}

.day-bg-cell {
  width: var(--day-w);
  height: 100%;
  flex-shrink: 0;
  border-right: 1px solid var(--border-subtle);
}

.day-bg-cell.is-weekend { background: var(--bg-weekend); }
.day-bg-cell.is-today   { background: var(--bg-today-col); }

/* Stage Pill */
.stage-pill {
  position: absolute;
  top: 7px;
  bottom: 7px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px 3px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.16s ease;
  z-index: 6;
  text-align: center;
}

.stage-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.14);
  z-index: 10;
}

.stage-pill-label {
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.stage-pill-date {
  font-size: 9.5px;
  font-weight: 500;
  opacity: 0.78;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  margin-top: 1px;
}

/* Color mapping */
.stage-lilac  { background: var(--stage-lilac-bg);  border-color: var(--stage-lilac-border);  color: var(--stage-lilac-text); }
.stage-amber  { background: var(--stage-amber-bg);  border-color: var(--stage-amber-border);  color: var(--stage-amber-text); }
.stage-sky    { background: var(--stage-sky-bg);    border-color: var(--stage-sky-border);    color: var(--stage-sky-text); }
.stage-mint   { background: var(--stage-mint-bg);   border-color: var(--stage-mint-border);   color: var(--stage-mint-text); }
.stage-lime   { background: var(--stage-lime-bg);   border-color: var(--stage-lime-border);   color: var(--stage-lime-text); }
.stage-violet { background: var(--stage-violet-bg); border-color: var(--stage-violet-border); color: var(--stage-violet-text); }

/* Focus on active work mode */
body.focus-work .stage-pill[data-category="wait"] {
  opacity: 0.22;
}
body.focus-work .stage-pill[data-category="wait"]:hover {
  opacity: 0.9;
}

/* Out-of-range notice inside project row */
.out-of-range-banner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px dashed var(--border-color);
  font-size: 11.5px;
  color: var(--text-secondary);
}

.out-of-range-link {
  border: none;
  background: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Today Vertical Line */
.today-line {
  position: absolute;
  top: var(--header-h);
  bottom: 0;
  width: 2px;
  background: var(--accent);
  opacity: 0.45;
  z-index: 3;
  pointer-events: none;
}

/* ==========================================================================
   Daily Digest View (Standup)
   ========================================================================== */
.digest-stage {
  flex: 1;
  overflow: auto;
  padding: 18px;
  background: var(--bg-page);
}

.digest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
}

.digest-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.digest-panel h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.digest-item {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: border-color 0.12s ease;
}

.digest-item:hover { border-color: var(--accent); }

.digest-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 12.5px;
}

.digest-item-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.mini-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
}

/* ==========================================================================
   Side Drawer
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 60;
}
.drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 94vw);
  background: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  box-shadow: var(--shadow-drawer);
  transform: translateX(102%);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 70;
  display: flex;
  flex-direction: column;
}
.drawer.is-open { transform: translateX(0); }

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-color);
}

.drawer-eyebrow {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 3px;
}

.drawer-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.drawer-subtitle {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.icon-btn {
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-btn:hover { color: var(--text-primary); border-color: var(--accent); }

.drawer-body {
  flex: 1;
  overflow: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.tg-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.tg-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 6px;
}

.tg-card-text {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-primary);
}

.stage-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.stage-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.stage-list-row.is-current {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.stage-list-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid transparent;
}

.stage-list-dates {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Tooltip & Toast
   ========================================================================== */
.tooltip {
  position: fixed;
  z-index: 90;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  background: #141824;
  color: #f8fafc;
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 11.5px;
  line-height: 1.4;
  max-width: 280px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.tooltip.is-visible { opacity: 1; transform: translateY(0); }

.toast {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 95;
  background: #141824;
  color: #ffffff;
  padding: 9px 14px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.18s ease;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }

/* Responsive tweaks */
@media (max-width: 980px) {
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legend { display: none; }
  :root { --left-col-w: 190px; }
}
