/* ============================================
   GANTT Builder — Theme System
   ============================================ */

/* ============================================
   SHELL — page chrome (topbar + stage) — never themed
   ============================================ */

:root {
  --shell-bg: #111010;
  --shell-page: #0d0c0a;
  --shell-elev: #1c1a18;
  --shell-rail: #242220;
  --shell-fg: #edeae4;
  --shell-mute: #7a7570;
  --shell-faint: #3a3733;
  --shell-border: #2c2926;
  --shell-shadow: 0 1px 0 rgba(255,255,255,0.04) inset;
  --shell-radius: 6px;
  --shell-font: 'Inter Tight', system-ui, sans-serif;
  --shell-mono: 'JetBrains Mono', monospace;
}

/* Panel shell — editor e settings sempre light, indipendenti dal tema */
.panel-shell {
  --bg: #f6f4ef;
  --bg-elev: #ffffff;
  --bg-rail: #ede9e2;
  --fg: #1a1816;
  --fg-mute: #6b6863;
  --fg-faint: #b5b1a8;
  --border: #d8d5cc;
  --border-strong: #1a1816;
  --accent: #d97757;
  --accent-soft: rgba(217,119,87,0.15);
  --radius: 6px;
  --radius-lg: 10px;
  --font-ui: 'Inter Tight', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-display: 'Inter Tight', system-ui, sans-serif;
  --shadow: 0 1px 0 rgba(0,0,0,0.04), 0 16px 40px -8px rgba(0,0,0,0.14);
  flex-shrink: 0;
  width: 360px;
  overflow: hidden;
  border-left: 1px solid var(--shell-border, #d8d5cc);
  animation: panel-push-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.panel-shell--settings { width: 300px; }

@keyframes panel-push-in {
  from { width: 0; }
  to { width: 360px; }
}
@keyframes panel-push-in-sm {
  from { width: 0; }
  to { width: 300px; }
}
.panel-shell--settings { animation-name: panel-push-in-sm; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body, #root {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  font-family: var(--shell-font);
  background: var(--shell-page);
  color: var(--shell-fg);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
}

.themed { display: contents; }



/* ============================================
   APP CHROME
   ============================================ */

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

.main-area {
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.gantt-card {
  width: 100%;
  max-width: 1800px;
  background: var(--bg-elev);
  border-radius: var(--card-radius, calc(var(--radius-lg) + 10px));
  border-width: var(--card-border-w, 1px);
  border-style: solid;
  border-color: var(--card-border-c, var(--border));
  box-shadow: var(--card-shadow,
    0 1px 2px rgba(0,0,0,0.04),
    0 12px 24px -8px rgba(0,0,0,0.08),
    0 32px 64px -16px rgba(0,0,0,0.12));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--shell-bg);
  border-bottom: 1px solid var(--shell-border);
  z-index: 10;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.brand-mark {
  font-family: var(--shell-font);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--shell-fg);
}

.brand-sub {
  font-family: var(--shell-mono);
  font-size: 11px;
  color: var(--shell-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.theme-select {
  font-family: var(--shell-font);
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 28px 7px 11px;
  border-radius: var(--shell-radius);
  border: 1px solid var(--shell-border);
  background: var(--shell-elev);
  color: var(--shell-fg);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  transition: background 0.15s ease;
}
.theme-select:hover { background-color: var(--shell-rail); }

.btn {
  font-family: var(--shell-font);
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 11px;
  border-radius: var(--shell-radius);
  border: 1px solid var(--shell-border);
  background: var(--shell-elev);
  color: var(--shell-fg);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn:hover { background: var(--shell-rail); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--shell-fg);
  color: var(--shell-elev);
  border-color: var(--shell-fg);
  font-weight: 600;
}
.btn-primary:hover { opacity: 0.88; background: var(--shell-fg); }

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Export dropdown — also in shell */
.export-menu { position: relative; }
.export-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--shell-elev);
  border: 1px solid var(--shell-border);
  border-radius: var(--shell-radius);
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.18);
  padding: 4px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.export-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: calc(var(--shell-radius) - 2px);
  text-align: left;
  font-family: var(--shell-font);
}
.export-option:hover { background: var(--shell-rail); }
.opt-label { font-size: 13px; font-weight: 600; color: var(--shell-fg); }
.opt-sub { font-family: var(--shell-mono); font-size: 10px; color: var(--shell-mute); letter-spacing: 0.04em; }

/* Stage — animated gradient background */
@keyframes gradient-drift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.stage {
  flex: 1;
  min-width: 0;
  padding: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  background: linear-gradient(-40deg,
    #dce8f5,
    #e4dff7,
    #d8eef0,
    #f0e6d8,
    #daeef5,
    #e8f0e0
  );
  background-size: 400% 400%;
  animation: gradient-drift 22s ease infinite;
}

/* ============================================
   GANTT
   ============================================ */

.gantt {
  display: grid;
  grid-template-columns: 280px 1fr;
  background: var(--bg-elev);
}
.gantt.no-sidebar {
  grid-template-columns: 1fr;
}

.gantt-sidebar {
  background: var(--bg-elev);
  border-right-width: var(--sidebar-bw, 1px);
  border-right-style: solid;
  border-right-color: var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  height: 36px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom-width: var(--sidebar-bw, 1px);
  border-bottom-style: solid;
  border-bottom-color: var(--border);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sidebar-header-color, var(--fg-mute));
  background: var(--bg-elev);
  position: sticky;
  top: 0;
  z-index: 5;
}

.sidebar-row {
  height: var(--row-h, 48px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  transition: background 0.12s ease;
}
.sidebar-row:hover { background: var(--bg-rail); }
.sidebar-row.selected { background: var(--bg-rail); }
.sidebar-row.selected::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
}

.row-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--dot-radius, 50%);
  border: var(--dot-border, none);
  background: var(--row-dot-color, var(--accent));
  flex-shrink: 0;
}

.row-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 100%;
  margin-left: -4px;
  margin-right: -2px;
  color: var(--fg-faint);
  cursor: grab;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.row-drag-handle:active { cursor: grabbing; }
.sidebar-row:hover .row-drag-handle { opacity: 1; }
.sidebar-row.selected .row-drag-handle { opacity: 0.7; }

.row-dragging { opacity: 0.38; }

.row-drop-indicator {
  height: 2px;
  background: var(--accent);
  margin: 0 12px;
  border-radius: 1px;
  pointer-events: none;
  flex-shrink: 0;
}

.row-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.row-dates {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-mute);
  white-space: nowrap;
}

.row-edit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--fg-mute);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.12s ease, background 0.1s ease, color 0.1s ease;
  padding: 0;
}
.row-edit-btn:hover { background: var(--border); color: var(--fg); }
.sidebar-row:hover .row-edit-btn { opacity: 1; }
.sidebar-row.selected .row-edit-btn { opacity: 0.7; }

/* GANTT CHART AREA */

.gantt-chart {
  position: relative;
  overflow: clip;       /* clips without becoming a scroll container → sticky header still works */
  overflow-x: clip;
  min-width: 0;         /* allow grid item to shrink below canvas intrinsic width */
  background: var(--bg-elev);
}

.gantt-header-canvas {
  display: block;
  position: sticky;
  top: 0;
  z-index: 4;
}

.gantt-body-canvas {
  display: block;
}

.gantt-canvas {
  position: relative;
}

.timeline-header {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--bg-elev);
  border-bottom-width: var(--sidebar-bw, 1px);
  border-bottom-style: solid;
  border-bottom-color: var(--border);
}

.timeline-months {
  height: 36px;
  display: flex;
  position: relative;
}

.timeline-month {
  position: absolute;
  top: 0;
  height: 100%;
  border-right: 1px solid var(--grid);
  padding: 0 10px;
  display: flex;
  align-items: center;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  background: var(--bg-elev);
}
.timeline-month.month-break {
  border-left: 2px solid var(--grid-strong);
}

/* compact density */
.gantt-chart.dw-xs .timeline-month { padding: 0 4px; font-size: 10px; }

/* row grid */
.gantt-rows {
  position: relative;
}

.gantt-row {
  height: 48px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.gantt-row.selected { background: var(--bg-rail); }

.gantt-grid {
  position: absolute;
  inset: 0;
  display: flex;
  pointer-events: none;
}
.grid-cell {
  border-right: 1px solid var(--grid);
  flex-shrink: 0;
}
.grid-cell.weekend { background: var(--weekend); }
.month-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--grid-strong);
  pointer-events: none;
  z-index: 0;
}

.today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--today);
  z-index: 2;
  pointer-events: none;
}
.today-line::before {
  content: 'OGGI';
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--today);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  letter-spacing: 0.08em;
  border-radius: var(--today-label-radius, var(--radius));
  border: var(--today-label-border, none);
  white-space: nowrap;
}

/* BARS */
.bar {
  position: absolute;
  top: 8px;
  height: 32px;
  border-radius: var(--bar-radius);
  border: var(--bar-border);
  box-shadow: var(--bar-shadow);
  cursor: grab;
  display: flex;
  align-items: center;
  padding: 0 10px;
  overflow: hidden;
  transition: box-shadow 0.15s ease;
  -webkit-user-select: none;
  user-select: none;
  z-index: 1;
}
.bar:active { cursor: grabbing; }
.bar.dragging { z-index: 3; opacity: 0.92; }
.bar.selected { z-index: 3; }
.bar.selected::after {
  content: '';
  position: absolute;
  inset: -3px;
  border: 2px solid var(--fg);
  border-radius: calc(var(--bar-radius) + 3px);
  pointer-events: none;
}

.bar-label {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--bar-fg, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  letter-spacing: -0.005em;
  mix-blend-mode: normal;
}

.bar-progress {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.22);
  border-right: 1px solid rgba(255,255,255,0.4);
  pointer-events: none;
}

.bar-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: ew-resize;
  z-index: 2;
}
.bar-handle.left { left: 0; }
.bar-handle.right { right: 0; }
.bar-handle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 14px;
  background: rgba(255,255,255,0.5);
  border-radius: 1px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.bar:hover .bar-handle::before { opacity: 1; }


/* ============================================
   EDITOR PANEL
   ============================================ */

.editor {
  width: 100%;
  height: 100%;
  background: var(--bg-elev);
  display: flex;
  flex-direction: column;
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.editor-title {
  font-family: var(--font-display);
  font-size: var(--title-size, 18px);
  font-weight: var(--title-weight, 700);
  font-style: var(--title-style, normal);
  letter-spacing: -0.02em;
}

.close-btn {
  width: 28px; height: 28px;
  border: none; background: transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--fg-mute);
  border-radius: var(--radius);
}
.close-btn:hover { background: var(--bg-rail); color: var(--fg); }

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-mute);
  font-weight: 500;
}
.field-input, .field-date {
  font-family: var(--font-ui);
  font-size: 14px;
  padding: 10px 12px;
  border-width: var(--input-bw, 1px);
  border-style: solid;
  border-color: var(--border);
  background: var(--bg);
  color: var(--fg);
  border-radius: var(--input-radius, var(--radius));
  outline: none;
  transition: border-color 0.12s ease;
}
.field-input:focus, .field-date:focus { border-color: var(--accent); }
.field-date { font-family: var(--font-mono); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.swatch-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}
.swatch {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.12s ease;
  position: relative;
}
.swatch:hover { transform: scale(1.08); }
.swatch.active::after {
  content: '';
  position: absolute;
  inset: -3px;
  border: 2px solid var(--fg);
  border-radius: calc(var(--radius) + 3px);
}

/* ============================================
   EDITOR — COLOR SLOTS (gradient)
   ============================================ */

.color-slots {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.color-slot {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  background: var(--slot-color, var(--bg-rail));
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.12s ease, transform 0.12s ease;
  padding: 0;
}
.color-slot:hover { transform: scale(1.06); }
.color-slot--active { border-color: var(--fg); }
.color-slot--empty {
  background: var(--bg-rail);
  border-style: dashed;
  border-color: var(--border);
}
.color-slot--empty.color-slot--active { border-style: dashed; border-color: var(--fg); }
.color-slot--empty::after {
  content: '+';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  color: var(--fg-faint);
  pointer-events: none;
}

.color-slot-clear {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-rail);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  color: var(--fg-mute);
  padding: 0;
  transition: background 0.12s ease, color 0.12s ease;
}
.color-slot-clear:hover { background: var(--border); color: var(--fg); }

.custom-color-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  cursor: pointer;
}

.custom-color-preview {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--custom-color, #d97757);
  flex-shrink: 0;
  overflow: hidden;
}

.custom-color-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  padding: 0;
  border: none;
}

.custom-color-text {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg);
  letter-spacing: 0.04em;
  padding: 5px 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.12s ease;
  min-width: 0;
}
.custom-color-text:focus { border-color: var(--accent); }
.custom-color-text--error {
  border-color: #c0392b;
  color: #c0392b;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.progress-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: var(--slider-h, 6px);
  background: var(--bg-rail);
  border-radius: var(--slider-radius, 3px);
  border: var(--slider-border, none);
  outline: none;
}
.progress-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: var(--thumb-radius, 50%);
  background: var(--fg);
  cursor: pointer;
  border-width: var(--thumb-bw, 2px);
  border-style: solid;
  border-color: var(--bg);
}
.progress-value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  min-width: 42px;
  text-align: right;
}

.editor-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

.btn-danger {
  color: #c0392b;
  border-color: var(--border);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 16px;
  padding: 40px;
  color: var(--fg-mute);
  text-align: center;
}
.empty-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  font-style: var(--title-style, normal);
  color: var(--fg);
  letter-spacing: -0.02em;
  text-transform: var(--empty-title-transform, none);
  max-width: 480px;
}
.empty-sub {
  font-size: 14px;
  max-width: 380px;
  line-height: 1.5;
}

.empty-illu {
  width: 360px;
  height: 140px;
  position: relative;
  margin-bottom: 8px;
}
.empty-illu .ill-bar {
  position: absolute;
  height: 16px;
  border-radius: var(--bar-radius);
  border: var(--bar-border);
}

/* ============================================
   MILESTONE DOT (sidebar)
   ============================================ */

.row-dot--milestone {
  border-radius: 2px;
  transform: rotate(45deg);
  width: 9px;
  height: 9px;
}

/* ============================================
   EDITOR — MILESTONE TOGGLE ROW
   ============================================ */

.editor-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
}

/* ============================================
   EDITOR — DEPS SECTION
   ============================================ */

.dep-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dep-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 4px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.1s ease;
}
.dep-row:hover { background: var(--bg-rail); }

.dep-check {
  flex-shrink: 0;
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.dep-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dep-color, var(--accent));
  flex-shrink: 0;
}

.dep-name {
  font-size: 13px;
  color: var(--fg);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dep-badge {
  font-size: 9px;
  color: var(--fg-mute);
  flex-shrink: 0;
}

.dep-empty {
  font-size: 12px;
  color: var(--fg-faint);
}

/* ============================================
   EDITOR — field-row single column variant
   ============================================ */

.field-row--single {
  grid-template-columns: 1fr;
}

/* scrollbar polish */
.gantt-chart::-webkit-scrollbar, .gantt-sidebar::-webkit-scrollbar, .editor-body::-webkit-scrollbar { width: 10px; height: 10px; }
.gantt-chart::-webkit-scrollbar-track, .gantt-sidebar::-webkit-scrollbar-track, .editor-body::-webkit-scrollbar-track { background: transparent; }
.gantt-chart::-webkit-scrollbar-thumb, .gantt-sidebar::-webkit-scrollbar-thumb, .editor-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 5px;
}
.gantt-chart::-webkit-scrollbar-thumb:hover, .gantt-sidebar::-webkit-scrollbar-thumb:hover { background: var(--fg-faint); }

/* status pill */
.status-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-mute);
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
}

/* ============================================
   EXPORT OVERLAY
   ============================================ */
.export-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 100;
  color: #fff;
  font-family: var(--font-ui);
  pointer-events: none;
}
.export-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.export-msg {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Hide handles & today-line label during export for cleanliness — optional */

/* ============================================
   SETTINGS PANEL
   ============================================ */

.settings-panel {
  width: 100%;
  height: 100%;
  background: var(--bg-elev);
  display: flex;
  flex-direction: column;
  font-family: var(--font-ui);
  color: var(--fg);
}

.settings-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px;
}

.settings-section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-mute);
  font-weight: 500;
  margin-bottom: 8px;
}

.settings-sep {
  height: var(--sep-h, 1px);
  background: var(--sep-bg, var(--border));
  flex-shrink: 0;
}

.settings-actions {
  display: flex;
  gap: 8px;
}

.settings-action-btn { flex: 1; justify-content: center; }

.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 38px;
  font-size: 13px;
}

.settings-num-row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  font-size: 13px;
}

.settings-num-label { flex: 1; }

.settings-num-unit {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-mute);
}

.num-input {
  width: 64px;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 6px 8px;
  border-width: var(--input-bw, 1px);
  border-style: solid;
  border-color: var(--border);
  background: var(--bg);
  color: var(--fg);
  border-radius: var(--input-radius, var(--radius));
  outline: none;
  text-align: center;
}
.num-input:focus { border-color: var(--accent); }

/* ============================================
   TOGGLE SWITCH
   ============================================ */

.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-track {
  width: 36px;
  height: 20px;
  background: var(--bg-rail);
  border-radius: var(--toggle-radius, 10px);
  border-width: var(--toggle-bw, 1px);
  border-style: solid;
  border-color: var(--toggle-bc, var(--border));
  position: relative;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.toggle input:checked + .toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}
.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--bg-elev);
  border-radius: var(--toggle-thumb-radius, 50%);
  transition: left 0.18s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}
.toggle input:checked + .toggle-track .toggle-thumb {
  left: 18px;
}

/* ============================================
   SETTINGS BUTTON (topbar)
   ============================================ */

.topbar-sep {
  width: 1px;
  height: 20px;
  background: var(--shell-faint);
  margin: 0 2px;
  flex-shrink: 0;
}

.btn.active {
  background: var(--shell-rail);
  border-color: var(--shell-mute);
}


/* ============================================
   GRID / WEEKEND VISIBILITY MODIFIERS
   ============================================ */

.gantt-chart.no-grid .grid-cell {
  border-right-color: transparent;
}
.gantt-chart.no-grid .grid-cell.weekend,
.gantt-chart.no-weekends .grid-cell.weekend {
  background: transparent;
}

