:root {
  /* Brand — taken from the Project Assure logo */
  --brand-blue: #2563eb; --brand-blue-soft: #dbeafe; --brand-blue-deep: #1d4ed8;
  --brand-violet: #7c3aed; --brand-violet-soft: #ede9fe; --brand-violet-deep: #6d28d9;
  --brand-grad: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --brand-grad-soft: linear-gradient(135deg, #dbeafe 0%, #ede9fe 100%);
  --brand-grad-light: linear-gradient(135deg, rgba(37,99,235,0.06) 0%, rgba(124,58,237,0.06) 100%);

  /* Surfaces — light theme */
  --bg: #f7f8fb;
  --bg-pattern: rgba(15, 23, 42, 0.025);
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --surface-hover: #f8fafc;
  --surface-active: #eef2f7;
  --surface-elevated: #ffffff;

  /* Borders */
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --border-emph: #94a3b8;
  --border-focus: #2563eb;

  /* Text */
  --text: #0f172a; --text-2: #1e293b;
  --text-muted: #64748b; --text-faint: #94a3b8;
  --text-on-brand: #ffffff;

  /* Status */
  --critical: #dc2626; --critical-bg: #fef2f2; --critical-border: #fecaca;
  --critical-bar: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  --normal-bar: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
  --completed-bar: linear-gradient(180deg, #94a3b8 0%, #475569 100%);
  --milestone: #7c3aed; --milestone-bg: #f5f3ff;
  --baseline: #cbd5e1;
  --emerald: #059669; --emerald-bg: #ecfdf5;
  --amber: #d97706; --amber-bg: #fffbeb;
  --rose: #e11d48; --rose-bg: #fff1f2;

  /* Typography */
  --font-display: 'Fraunces', Georgia, serif;
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, monospace;

  /* Layout */
  --sidebar-w: 240px; --rail-w: 60px; --header-h: 60px; --status-h: 30px;
  --row-h: 34px; --gantt-row-h: 32px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 28px -8px rgba(15, 23, 42, 0.12), 0 8px 12px -6px rgba(15, 23, 42, 0.06);
  --shadow-brand: 0 6px 16px -4px rgba(124, 58, 237, 0.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font-family: var(--font-sans); font-size: 13px; font-weight: 400; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11','ss01','ss03'; }
body { background-image:
  radial-gradient(circle at 0% 0%, rgba(37,99,235,0.03) 0px, transparent 60%),
  radial-gradient(circle at 100% 100%, rgba(124,58,237,0.03) 0px, transparent 60%); }

/* GLOBAL FONT INHERITANCE — ensures all interactive controls use theme typography */
button, input, select, textarea, optgroup, option {
  font-family: var(--font-sans); font-size: 13px; line-height: 1.5; color: inherit;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
input.mono, select.mono, textarea.mono, .mono { font-family: var(--font-mono); }
code, kbd, samp, pre { font-family: var(--font-mono); font-size: 0.92em; }
/* Type scale (professional, professional-grade) */
h1 { font-family: var(--font-display); font-weight: 500; line-height: 1.2; font-size: 28px; letter-spacing: -0.02em; }
h2 { font-family: var(--font-display); font-weight: 500; line-height: 1.25; font-size: 22px; letter-spacing: -0.015em; }
h3 { font-family: var(--font-sans); font-weight: 600; line-height: 1.3; font-size: 15px; letter-spacing: -0.005em;
  color: var(--text); }
h4 { font-family: var(--font-sans); font-weight: 600; line-height: 1.3; font-size: 13px; letter-spacing: 0; color: var(--text); }
h5, h6 { font-family: var(--font-sans); font-weight: 600; line-height: 1.3; font-size: 12px; color: var(--text); }
strong, b { font-weight: 600; }
em { font-style: normal; color: var(--text-muted); font-family: var(--font-sans); font-weight: 400; font-size: 0.92em;
  letter-spacing: 0.01em; }
a { color: var(--brand-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
::placeholder { color: var(--text-faint); opacity: 1; font-family: var(--font-sans); font-style: italic; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(15,23,42,0.12); border-radius: 5px;
  border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(15,23,42,0.22); background-clip: padding-box; border: 2px solid transparent; }
::-webkit-scrollbar-corner { background: transparent; }

/* ==== APP SHELL ==== */
.app { display: grid;
  grid-template-rows: var(--header-h) 1fr var(--status-h);
  grid-template-columns: var(--rail-w) var(--sidebar-w) 1fr;
  grid-template-areas: "header header header" "rail sidebar main" "status status status";
  height: 100vh; }

/* ==== HEADER ==== */
.header { grid-area: header; display: flex; align-items: center; padding: 0 18px 0 0;
  background: var(--surface); border-bottom: 1px solid var(--border); z-index: 50; }
.brand { display: flex; align-items: center; gap: 12px;
  width: calc(var(--rail-w) + var(--sidebar-w)); padding: 0 18px;
  border-right: 1px solid var(--border); height: 100%; }
.brand-mark { width: 36px; height: 36px; flex-shrink: 0; display: grid; place-items: center;
  background: #0a0a0f; border-radius: 8px; box-shadow: var(--shadow-brand);
  position: relative; overflow: hidden; }
.brand-mark img { width: 30px; height: 30px; display: block; filter: drop-shadow(0 1px 2px rgba(124,58,237,0.4)); }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: var(--font-display); font-weight: 500; font-size: 11px;
  color: var(--text-muted); letter-spacing: 0.02em; font-style: italic;
  font-variation-settings: 'opsz' 20, 'SOFT' 50; }
.brand-product { font-family: var(--font-display); font-weight: 600; font-size: 22px;
  letter-spacing: -0.02em; color: var(--text); margin-top: 2px;
  background: var(--brand-grad); -webkit-background-clip: text;
  background-clip: text; -webkit-text-fill-color: transparent;
  font-variation-settings: 'opsz' 144; }

.header-center { flex: 1; display: flex; align-items: center; gap: 14px; padding: 0 22px; }
.project-selector { display: flex; align-items: center; gap: 10px; padding: 7px 14px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  cursor: pointer; transition: all 0.15s; min-width: 320px; box-shadow: var(--shadow-sm); }
.project-selector:hover { border-color: var(--brand-blue); background: var(--brand-grad-light);
  box-shadow: var(--shadow); }
.ps-code { font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  background: var(--brand-grad); -webkit-background-clip: text;
  background-clip: text; -webkit-text-fill-color: transparent;
  padding: 2px 0; letter-spacing: 0.04em; }
.ps-divider { width: 1px; height: 14px; background: var(--border); }
.ps-name { font-size: 13px; color: var(--text); flex: 1; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-arrow { color: var(--text-faint); font-size: 14px; }

.data-date { display: flex; flex-direction: column; align-items: flex-end;
  font-family: var(--font-mono); font-size: 11px;
  padding: 4px 14px; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.dd-label { font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-faint); }
.dd-val { color: var(--brand-blue-deep); font-weight: 600; margin-top: 2px; }

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

/* ==== RAIL NAV ==== */
.rail { grid-area: rail; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; padding: 12px 0; gap: 4px; }
.rail-btn { width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 8px; cursor: pointer; color: var(--text-muted);
  transition: all 0.12s; position: relative; border: 1px solid transparent; }
.rail-btn:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border); }
.rail-btn.active { background: var(--brand-grad-light); color: var(--brand-violet); border-color: var(--brand-violet-soft); }
.rail-btn.active::before { content: ''; position: absolute; left: -12px; top: 10px; bottom: 10px;
  width: 3px; background: var(--brand-grad); border-radius: 0 3px 3px 0; }
.rail-btn svg { width: 19px; height: 19px; stroke-width: 1.7; }
.rail-btn-label { position: absolute; left: 100%; margin-left: 10px;
  background: var(--text); color: white;
  padding: 5px 10px; border-radius: 6px; font-size: 11px; font-weight: 500; white-space: nowrap;
  opacity: 0; pointer-events: none; transform: translateX(-4px);
  transition: all 0.18s; z-index: 100; box-shadow: var(--shadow-md); }
.rail-btn:hover .rail-btn-label { opacity: 1; transform: translateX(0); }
.rail-btn-label::before { content: ''; position: absolute; left: -4px; top: 50%; transform: translateY(-50%);
  width: 0; height: 0; border-style: solid; border-width: 4px 4px 4px 0; border-color: transparent var(--text) transparent transparent; }
.rail-spacer { flex: 1; }

/* ==== SIDEBAR ==== */
.sidebar { grid-area: sidebar; background: var(--surface);
  border-right: 1px solid var(--border); overflow-y: auto; padding: 16px 12px; }
.sidebar-section { margin-bottom: 22px; }
.sidebar-title { font-size: 10px; font-weight: 600; color: var(--text-faint);
  letter-spacing: 0.14em; text-transform: uppercase; padding: 4px 10px; margin-bottom: 6px;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); }
.sidebar-add { cursor: pointer; color: var(--text-faint); width: 18px; height: 18px;
  display: grid; place-items: center; border-radius: 4px; }
.sidebar-add:hover { background: var(--surface-hover); color: var(--brand-blue); }
.sidebar-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  border-radius: 6px; cursor: pointer; font-size: 12.5px; color: var(--text);
  transition: background 0.1s; border: 1px solid transparent; user-select: none; }
.sidebar-item:hover { background: var(--surface-hover); }
.sidebar-item.active { background: var(--brand-grad-light); border-color: var(--brand-violet-soft); color: var(--brand-violet-deep); font-weight: 500; }
.sidebar-item svg { width: 14px; height: 14px; color: var(--text-muted); flex-shrink: 0; stroke-width: 1.6; }
.sidebar-item.active svg { color: var(--brand-violet); }
.si-badge { margin-left: auto; font-family: var(--font-mono); font-size: 10px;
  color: var(--text-muted); background: var(--surface-2); padding: 1px 7px; border-radius: 10px; font-weight: 500; }
.sidebar-item.active .si-badge { background: white; color: var(--brand-violet); }

/* ==== MAIN ==== */
.main { grid-area: main; overflow: hidden; display: flex; flex-direction: column;
  background: var(--bg); position: relative; }
.main-toolbar { height: 50px; display: flex; align-items: center; padding: 0 22px;
  gap: 10px; border-bottom: 1px solid var(--border); background: var(--surface); flex-shrink: 0;
  box-shadow: var(--shadow-sm); }
.toolbar-title { font-family: var(--font-display); font-size: 22px; font-weight: 500;
  letter-spacing: -0.02em; color: var(--text);
  font-variation-settings: 'opsz' 60, 'SOFT' 30; }
.toolbar-title em { font-style: normal; font-weight: 400; font-size: 14px;
  color: var(--text-muted); margin-left: 4px; vertical-align: 1px; }
.toolbar-meta { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.1em; padding-left: 12px; margin-left: 4px;
  border-left: 1px solid var(--border); font-weight: 500; }
.toolbar-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.toolbar-divider { width: 1px; height: 22px; background: var(--border); margin: 0 6px; }
.main-content { flex: 1; overflow: hidden; position: relative; }

/* ==== STATUS BAR ==== */
.status { grid-area: status; display: flex; align-items: center; padding: 0 18px;
  background: var(--surface); border-top: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); gap: 18px; z-index: 50; }
.status-pill { display: flex; align-items: center; gap: 6px; }
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; }
.status-pill .dot.blue { background: var(--brand-blue); box-shadow: 0 0 0 2px rgba(37,99,235,0.15); }
.status-pill .dot.violet { background: var(--brand-violet); box-shadow: 0 0 0 2px rgba(124,58,237,0.15); }
.status-pill .dot.red { background: var(--critical); box-shadow: 0 0 0 2px rgba(220,38,38,0.15); }
.status-pill .dot.green { background: var(--emerald); box-shadow: 0 0 0 2px rgba(5,150,105,0.15); }
.status-pill strong { color: var(--text); font-weight: 600; }
.status-spacer { flex: 1; }

/* ==== BUTTONS ==== */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px;
  font-family: var(--font-sans); font-size: 12.5px; font-weight: 500; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 7px;
  cursor: pointer; transition: all 0.12s; white-space: nowrap; box-shadow: var(--shadow-sm); }
.btn:hover { background: var(--surface-hover); border-color: var(--border-strong); box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); box-shadow: var(--shadow-sm); }
.btn svg { width: 13px; height: 13px; stroke-width: 1.7; }
.btn.btn-primary { background: var(--brand-grad); color: white; border-color: transparent;
  font-weight: 600; box-shadow: var(--shadow-brand); }
.btn.btn-primary:hover { box-shadow: 0 8px 20px -4px rgba(124, 58, 237, 0.35); transform: translateY(-1px); }
.btn.btn-primary:active { transform: translateY(0); }
.btn.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); box-shadow: none; }
.btn.btn-ghost:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border); box-shadow: none; }
.btn.btn-sm { padding: 5px 10px; font-size: 11.5px; border-radius: 6px; }
.btn.btn-icon { padding: 7px; }
.btn.btn-danger { color: var(--critical); }
.btn.btn-danger:hover { background: var(--critical-bg); border-color: var(--critical-border); }
.btn.btn-active { background: var(--brand-grad-light); border-color: var(--brand-violet-soft); color: var(--brand-violet-deep); }

/* ==== INPUTS ==== */
.input, .select, .textarea { background: var(--surface); border: 1px solid var(--border);
  border-radius: 7px; padding: 7px 11px; font-family: var(--font-sans); font-size: 13px;
  color: var(--text); width: 100%; outline: none; transition: all 0.15s; box-shadow: var(--shadow-sm); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.input.mono { font-family: var(--font-mono); }
.textarea { resize: vertical; min-height: 84px; line-height: 1.55; }
.label { font-size: 10.5px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 5px; display: block;
  font-family: var(--font-mono); }
.checkbox { width: 16px; height: 16px; accent-color: var(--brand-blue); cursor: pointer; }

/* ==== TABLES ==== */
.dtable { width: 100%; border-collapse: collapse; font-size: 12px; background: var(--surface); }
.dtable th { text-align: left; font-weight: 600; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-muted); padding: 9px 12px;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1; white-space: nowrap; font-family: var(--font-mono); }
.dtable td { padding: 7px 12px; border-bottom: 1px solid var(--border); height: var(--row-h); vertical-align: middle; }
.dtable tbody tr { transition: background 0.08s; cursor: pointer; }
.dtable tbody tr:hover { background: var(--surface-hover); }
.dtable tbody tr.selected { background: var(--brand-grad-light); }
.dtable tbody tr.critical { color: var(--critical); }
.dtable tbody tr.critical .act-id { color: var(--critical); background: var(--critical-bg); border-color: var(--critical-border); }
.dtable tbody tr.completed { color: var(--text-faint); }
.dtable tbody tr.completed .act-id { background: var(--surface-2); color: var(--text-faint); }
.dtable .act-id { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--brand-blue-deep);
  background: var(--brand-blue-soft); padding: 2px 7px; border-radius: 4px; letter-spacing: 0.02em;
  border: 1px solid transparent; }
.dtable .num { font-family: var(--font-mono); text-align: right; font-feature-settings: 'tnum'; }
.dtable .indent { padding-left: calc(12px + var(--indent, 0) * 18px); }
.wbs-row { font-weight: 600; background: var(--brand-grad-light) !important; color: var(--text); }
.wbs-row .act-id { color: var(--brand-violet-deep); background: var(--brand-violet-soft); }

/* Linkable chips — clickable cross-references */
.linkable { transition: all 0.15s ease; position: relative; }
.linkable:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(124,58,237,0.25); filter: brightness(1.08); }
.linkable:hover::after { content: '↗'; position: absolute; top: -2px; right: -8px; font-size: 9px; color: var(--brand-violet); font-weight: 700; }
.linkable:active { transform: translateY(0); }

/* ==== GANTT ==== */
.gantt-container { display: grid; grid-template-columns: minmax(540px, 0.5fr) 1fr;
  height: 100%; overflow: hidden; background: var(--surface); }
.gantt-left { overflow: auto; border-right: 2px solid var(--border); background: var(--surface); }
.gantt-left-table { width: 100%; }
.gantt-left-table thead tr { height: 46px; }
.gantt-left-table thead th { position: sticky; top: 0; z-index: 5; background: var(--surface);
  height: 46px; border-bottom: 1px solid var(--border); box-shadow: 0 1px 0 var(--border); }
/* PROFESSIONAL inline "+ Add Activity" row */
.gantt-add-row td { transition: background 0.15s, color 0.15s; }
.gantt-add-row:hover td { background: rgba(37,99,235,0.08) !important; color: var(--brand-blue-deep) !important; }
.gantt-right { overflow: auto; position: relative;
  background-image:
    linear-gradient(rgba(15,23,42,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,23,42,0.018) 1px, transparent 1px);
  background-size: 100% var(--gantt-row-h), var(--day-w, 24px) 100%; background-color: var(--surface); }
.gantt-splitter { background: var(--border); cursor: col-resize; transition: background 0.15s;
  position: relative; user-select: none; }
.gantt-splitter:hover { background: var(--brand-violet); }
.gantt-splitter::before { content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 2px; height: 32px; background: var(--text-muted); border-radius: 1px; opacity: 0.4; }
.gantt-splitter:hover::before { background: white; opacity: 1; }
.gantt-timescale { position: sticky; top: 0; z-index: 5; background: var(--surface);
  border-bottom: 1px solid var(--border); height: 46px; display: flex; flex-direction: column;
  box-shadow: 0 1px 0 var(--border); }
.gantt-timescale-row { height: 23px; display: flex; border-bottom: 1px solid var(--border);
  position: relative; white-space: nowrap; }
.gantt-timescale-row:last-child { border-bottom: none; }
.gts-cell { border-right: 1px solid var(--border); font-family: var(--font-mono);
  font-size: 10px; color: var(--text-muted); display: flex; align-items: center;
  justify-content: center; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500;
  flex-shrink: 0; height: 100%; }
.gts-cell.weekend { background: var(--surface-2); color: var(--text-faint); }
.gts-cell.today { color: var(--brand-violet); font-weight: 700; background: var(--brand-violet-soft); }
.gts-cell.month { font-size: 11px; color: var(--text); font-weight: 600; background: var(--surface); }

.gantt-canvas { position: relative; min-height: 100%; }
.gantt-row { position: absolute; left: 0; right: 0; height: var(--gantt-row-h);
  border-bottom: 1px solid var(--border); }
.gantt-row.wbs-row-bg { background: rgba(124,58,237,0.04); }
.gantt-bar { position: absolute; height: 18px; top: 7px; border-radius: 4px;
  background: var(--normal-bar); cursor: pointer; transition: filter 0.12s, box-shadow 0.12s, transform 0.12s;
  box-shadow: 0 1px 3px rgba(15,23,42,0.15); display: flex; align-items: center; overflow: hidden; user-select: none; }
.gantt-bar.dragging { opacity: 0.92; box-shadow: 0 10px 28px rgba(124,58,237,0.35), 0 0 0 2px rgba(124,58,237,0.5);
  z-index: 100; transition: none !important; cursor: grabbing !important; }
.gantt-bar.dragging .gantt-bar-progress { transition: none !important; }
/* Editable cell styling */
.editable-cell { position: relative; transition: background 0.1s; }
.editable-cell:hover { background: rgba(124,58,237,0.06); cursor: cell; box-shadow: inset 0 0 0 1px rgba(124,58,237,0.18); }
.editable-cell:hover::after { content: '✎'; position: absolute; top: 2px; right: 4px; font-size: 9px; color: var(--brand-violet); opacity: 0.5; }
.gantt-bar:hover { filter: brightness(1.1);
  box-shadow: 0 0 0 2px white, 0 0 0 3px var(--brand-blue), 0 4px 8px rgba(15,23,42,0.18); z-index: 4; }
.gantt-bar.critical { background: var(--critical-bar); }
.gantt-bar.completed { background: var(--completed-bar); }
.gantt-bar.selected { box-shadow: 0 0 0 2px white, 0 0 0 3px var(--text), 0 4px 12px rgba(15,23,42,0.2); z-index: 5; }
.gantt-bar.flash { animation: ganttFlash 1.4s cubic-bezier(.22,.61,.36,1); z-index: 10; }
@keyframes ganttFlash {
  0% { box-shadow: 0 0 0 0 rgba(124,58,237,0.7), 0 0 0 0 rgba(124,58,237,0.7); transform: scale(1); }
  20% { box-shadow: 0 0 0 4px rgba(124,58,237,0.85), 0 0 0 12px rgba(124,58,237,0.35); transform: scale(1.04); }
  60% { box-shadow: 0 0 0 3px rgba(124,58,237,0.4), 0 0 0 22px rgba(124,58,237,0); }
  100% { box-shadow: 0 0 0 2px white, 0 0 0 3px var(--text), 0 4px 12px rgba(15,23,42,0.2); transform: scale(1); }
}
.gantt-row-flash { animation: rowFlash 1.4s ease-out; }
@keyframes rowFlash {
  0% { background: rgba(124,58,237,0.20); }
  100% { background: transparent; }
}
.gantt-bar-progress { position: absolute; left: 0; top: 0; bottom: 0;
  background: rgba(0,0,0,0.28); border-radius: 4px 0 0 4px; }
.gantt-bar-baseline { position: absolute; height: 4px; bottom: 4px;
  background: var(--baseline); border-radius: 2px; pointer-events: none; opacity: 0.85; }
.gantt-bar-label { position: absolute; font-size: 11px; color: var(--text-2); font-weight: 500;
  white-space: nowrap; pointer-events: none; line-height: 18px; }
.gantt-bar-name { color: white; font-size: 10.5px; padding: 0 7px; font-weight: 500;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  position: relative; z-index: 1; }
.gantt-milestone { position: absolute; width: 16px; height: 16px; top: 8px;
  background: var(--milestone); transform: rotate(45deg); cursor: pointer;
  box-shadow: 0 0 0 2px white, 0 1px 3px rgba(15,23,42,0.25); border-radius: 2px; }
.gantt-milestone.critical { background: var(--critical); }
.gantt-milestone.completed { background: var(--text-muted); }
.gantt-milestone:hover { filter: brightness(1.1); }
.gantt-wbs-bar { position: absolute; height: 9px; top: 11px;
  background: var(--text); border-radius: 1px; pointer-events: none; }
.gantt-wbs-bar::before, .gantt-wbs-bar::after { content: ''; position: absolute;
  bottom: -5px; width: 0; height: 0; border: 5px solid transparent;
  border-top-color: var(--text); }
.gantt-wbs-bar::before { left: 0; }
.gantt-wbs-bar::after { right: 0; }
.today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--brand-violet);
  pointer-events: none; z-index: 3; box-shadow: 0 0 8px rgba(124,58,237,0.4); }
.today-line::before { content: 'TODAY'; position: absolute; top: -1px; left: -22px;
  font-family: var(--font-mono); font-size: 8px; font-weight: 700; letter-spacing: 0.1em;
  color: white; background: var(--brand-violet); padding: 2px 5px; border-radius: 3px; }
.data-date-line { position: absolute; top: 0; bottom: 0; width: 1px;
  background: repeating-linear-gradient(180deg, var(--brand-blue) 0 4px, transparent 4px 8px);
  pointer-events: none; z-index: 2; }
.gantt-rels { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.gantt-rels path { fill: none; stroke: rgba(15,23,42,0.3); stroke-width: 1.2; }
.gantt-rels path.critical { stroke: var(--critical); stroke-width: 1.4; }

/* ==== DASHBOARD / EVM ==== */
.dashboard { padding: 26px; overflow: auto; height: 100%; width: 100%; box-sizing: border-box; }
.dashboard > * { max-width: 100%; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px; margin-bottom: 20px; }
.kpi-card { background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 18px 20px; position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm); transition: all 0.15s; }
.kpi-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kpi-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: var(--brand-grad); }
.kpi-card.danger::before { background: linear-gradient(90deg, #ef4444, #dc2626); }
.kpi-card.success::before { background: linear-gradient(90deg, #34d399, #059669); }
.kpi-card.warn::before { background: linear-gradient(90deg, #fbbf24, #d97706); }
.kpi-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.14em; font-family: var(--font-mono); font-weight: 600; }
.kpi-value { font-family: var(--font-display); font-size: 36px; line-height: 1.1; font-weight: 500;
  color: var(--text); margin: 8px 0 4px; letter-spacing: -0.025em;
  font-variation-settings: 'opsz' 144, 'SOFT' 30; }
.kpi-value em { font-style: italic; font-weight: 400;
  background: var(--brand-grad); -webkit-background-clip: text;
  background-clip: text; -webkit-text-fill-color: transparent; }
.kpi-value .unit { font-size: 18px; color: var(--text-muted); margin-left: 4px; }
.kpi-sub { font-size: 11.5px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.kpi-sub.up { color: var(--emerald); }
.kpi-sub.down { color: var(--critical); }

.dash-section { background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 22px; margin-bottom: 16px; box-shadow: var(--shadow-sm); transition: padding 0.18s;
  overflow-x: auto; min-width: 0; }
.dash-section.collapsed { padding-bottom: 22px; }
.dash-section.collapsed .dash-section-h { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.dash-section.collapsed > *:not(.dash-section-h) { display: none; }
.dash-section-h { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px;
  padding-bottom: 14px; border-bottom: 1px solid var(--border); cursor: pointer; user-select: none;
  transition: opacity 0.12s; flex-wrap: wrap; }
.dash-section-h:hover { opacity: 0.85; }
.dash-section-h::before { content: '▾'; color: var(--text-muted); font-size: 11px;
  margin-right: -4px; transition: transform 0.18s; display: inline-block; flex-shrink: 0; }
.dash-section.collapsed .dash-section-h::before { transform: rotate(-90deg); }
.dash-section-h h3 { font-family: var(--font-sans); font-size: 15px; font-weight: 600;
  color: var(--text); letter-spacing: -0.005em; }
.dash-section-h h3 em { font-style: normal; font-weight: 400; font-size: 13px;
  color: var(--text-muted); -webkit-text-fill-color: var(--text-muted); background: none; margin-left: -2px; }
.dash-section-h .meta { font-family: var(--font-mono); font-size: 10px;
  color: var(--text-faint); letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; }
.dash-section-h .meta-action { margin-left: auto; }
.dash-section-h .meta-action, .dash-section-h button, .dash-section-h input, .dash-section-h select { cursor: auto; }

/* ==== EVM-specific ==== */
.evm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.evm-cell { padding: 14px; background: var(--surface-2); border-radius: 8px;
  border: 1px solid var(--border); }
.evm-cell .name { font-family: var(--font-mono); font-size: 9.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.evm-cell .full { font-size: 10px; color: var(--text-faint); margin-top: 2px; }
.evm-cell .val { font-family: var(--font-mono); font-size: 18px; font-weight: 600;
  color: var(--text); margin-top: 6px; font-feature-settings: 'tnum'; }
.evm-cell.indicator .val { font-size: 22px; }
.evm-cell.good .val { color: var(--emerald); }
.evm-cell.bad .val { color: var(--critical); }
.evm-cell.neutral .val { color: var(--text); }
.scurve-wrap { background: var(--surface-2); border-radius: 8px;
  padding: 18px; border: 1px solid var(--border); }
.scurve-wrap svg { width: 100%; height: 280px; display: block; }
.scurve-legend { display: flex; gap: 18px; justify-content: center; margin-top: 12px;
  font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.scurve-legend-item { display: flex; align-items: center; gap: 6px; }
.scurve-legend-item .swatch { width: 18px; height: 3px; border-radius: 2px; }

/* ==== DCMA ==== */
.dcma-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.dcma-item { padding: 14px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); transition: all 0.15s; }
.dcma-item.pass { border-color: rgba(5,150,105,0.4); background: var(--emerald-bg); }
.dcma-item.warn { border-color: rgba(217,119,6,0.4); background: var(--amber-bg); }
.dcma-item.fail { border-color: rgba(220,38,38,0.4); background: var(--critical-bg); }
.dcma-name { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.08em; font-weight: 600; font-family: var(--font-mono); }
.dcma-val { font-family: var(--font-mono); font-size: 22px; font-weight: 600;
  color: var(--text); margin: 6px 0 2px; font-feature-settings: 'tnum'; }
.dcma-target { font-size: 10px; color: var(--text-faint); font-family: var(--font-mono); }
.dcma-item.pass .dcma-val { color: var(--emerald); }
.dcma-item.warn .dcma-val { color: var(--amber); }
.dcma-item.fail .dcma-val { color: var(--critical); }

/* ==== MODAL ==== */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,0.4); backdrop-filter: blur(6px);
  z-index: 200; display: grid; place-items: center; padding: 40px; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  width: 100%; max-width: 640px; max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(15,23,42,0.25); }
.modal.large { max-width: 880px; }
.modal.xl { max-width: 1040px; }
.modal-head { display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-family: var(--font-sans); font-size: 16px; font-weight: 600;
  color: var(--text); letter-spacing: -0.005em; }
.modal-head h2 em { font-style: normal; font-weight: 400; font-size: 14px;
  color: var(--text-muted); -webkit-text-fill-color: var(--text-muted); background: none; margin-left: 2px; }
.modal-body { padding: 22px 24px; overflow-y: auto; overflow-x: hidden; flex: 1; }
.modal-body .form-grid { max-width: 100%; }
.modal-body input, .modal-body select, .modal-body textarea { max-width: 100%; box-sizing: border-box; }
/* Tables that can overflow horizontally — wrap in scroll container */
.dash-section { overflow-x: auto; }
.dash-section .dtable { min-width: 100%; }
.dash-section table.dtable { table-layout: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--border);
  background: var(--surface-2); border-radius: 0 0 12px 12px; }
.close-btn { width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 7px; cursor: pointer; color: var(--text-muted); transition: all 0.12s; }
.close-btn:hover { background: var(--surface-2); color: var(--text); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-row { display: flex; flex-direction: column; gap: 5px; }

/* ==== INSPECTOR ==== */
.inspector { position: absolute; top: 0; right: 0; bottom: 0; width: 440px;
  background: var(--surface); border-left: 1px solid var(--border); z-index: 30;
  display: flex; flex-direction: column; transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: -10px 0 30px rgba(15,23,42,0.06); }
.inspector.open { transform: translateX(0); }
.inspector-head { padding: 18px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 10px; flex-shrink: 0; }
.ins-id { font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  background: var(--brand-blue-soft); color: var(--brand-blue-deep);
  padding: 3px 8px; border-radius: 4px; margin-top: 2px; }
.inspector-head h3 { flex: 1; font-family: var(--font-display); font-size: 18px;
  font-weight: 500; color: var(--text); line-height: 1.3; letter-spacing: -0.01em;
  font-variation-settings: 'opsz' 60; }
.inspector-tabs { display: flex; gap: 2px; padding: 0 8px; border-bottom: 1px solid var(--border);
  flex-shrink: 0; background: var(--surface-2);
  overflow-x: auto; overflow-y: hidden; white-space: nowrap; scroll-behavior: smooth;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.inspector-tabs::-webkit-scrollbar { height: 4px; }
.inspector-tabs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.inspector-tabs::-webkit-scrollbar-track { background: transparent; }
.inspector-tab { padding: 10px 12px; font-size: 11.5px; font-weight: 500; color: var(--text-muted);
  border-bottom: 2px solid transparent; cursor: pointer; transition: all 0.15s;
  flex-shrink: 0; white-space: nowrap; }
.inspector-tab.active { color: var(--brand-violet); border-bottom-color: var(--brand-violet);
  background: var(--surface); }
.inspector-tab:hover:not(.active) { color: var(--text); background: rgba(0,0,0,0.02); }
.inspector-body { flex: 1; overflow: auto; padding: 18px 20px;
  display: flex; flex-direction: column; gap: 16px; }
.ins-section { padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.ins-section:last-child { border-bottom: none; }
.ins-section-h { font-size: 10px; color: var(--text-faint); text-transform: uppercase;
  letter-spacing: 0.14em; font-family: var(--font-mono); font-weight: 600; margin-bottom: 12px; }
.ins-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ins-field { display: flex; flex-direction: column; gap: 3px; }
.ins-field-label { font-size: 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; font-family: var(--font-mono); }
.ins-field-val { font-family: var(--font-mono); font-size: 12px; color: var(--text); font-weight: 500; }
.ins-field-val.crit { color: var(--critical); }
.ins-field-val.brand { color: var(--brand-blue-deep); }

/* ==== PARSER VIEW ==== */
.parser { display: grid; grid-template-columns: 1fr 1fr; height: 100%; overflow: hidden; }
.parser-left { padding: 26px; overflow: auto; border-right: 1px solid var(--border); background: var(--surface); }
.parser-right { padding: 26px; overflow: auto; background: var(--bg); }
.parser-dropzone { display: flex; align-items: center; gap: 16px; padding: 18px 22px;
  background: var(--surface-2); border: 2px dashed rgba(124,58,237,0.35); border-radius: 10px;
  cursor: pointer; margin-bottom: 14px; transition: all 0.16s; }
.parser-dropzone:hover, .parser-dropzone.drag {
  background: rgba(124,58,237,0.06); border-color: var(--brand-violet); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(124,58,237,0.10); }
.parser-dz-icon { color: var(--brand-violet); flex-shrink: 0; }
.parser-dz-text { display: flex; flex-direction: column; gap: 2px; line-height: 1.4; }
.parser-dz-text strong { font-family: var(--font-display); font-size: 14px; color: var(--text); font-weight: 500; }
.parser-dz-text span { font-size: 11.5px; color: var(--text-muted); font-family: var(--font-sans); }
.parser-dz-text .parser-dz-note { font-size: 10.5px; color: var(--text-faint); margin-top: 4px; font-family: var(--font-mono); }
.parser-textarea { width: 100%; min-height: 300px; font-family: var(--font-mono); font-size: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 16px; color: var(--text); line-height: 1.65; resize: vertical; box-shadow: var(--shadow-sm); }
.parser-textarea:focus { border-color: var(--brand-blue); outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.parser-h { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.parser-h h2 { font-family: var(--font-display); font-size: 22px; font-weight: 500;
  color: var(--text); letter-spacing: -0.015em; }
.parser-h h2 em { font-style: normal; font-weight: 400; font-size: 14px;
  color: var(--text-muted); -webkit-text-fill-color: var(--text-muted); background: none; margin-left: -2px; }
.parser-h .meta { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint);
  letter-spacing: 0.14em; text-transform: uppercase; font-weight: 600; }
.parser-intro { color: var(--text-muted); font-size: 13px; line-height: 1.65;
  margin-bottom: 20px; max-width: 64ch; }
.parser-intro strong { color: var(--text); font-weight: 600; }
.parser-intro code { font-family: var(--font-mono); font-size: 11px; padding: 2px 6px;
  background: var(--brand-blue-soft); border-radius: 4px; color: var(--brand-blue-deep); font-weight: 500; }
.detected-list { display: flex; flex-direction: column; gap: 8px; }
.detected-item { padding: 12px 14px; background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--brand-blue); border-radius: 7px; display: flex; gap: 12px; align-items: center;
  box-shadow: var(--shadow-sm); }
.detected-item.milestone { border-left-color: var(--milestone); }
.detected-item.deliverable { border-left-color: var(--emerald); }
.detected-item.duration { border-left-color: var(--amber); }
.detected-item.section { border-left-color: var(--text); }
.detected-tag { font-family: var(--font-mono); font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; padding: 3px 8px; border-radius: 4px;
  background: var(--surface-2); color: var(--text-muted); flex-shrink: 0; }
.detected-item.milestone .detected-tag { background: var(--milestone-bg); color: var(--brand-violet-deep); }
.detected-item.deliverable .detected-tag { background: var(--emerald-bg); color: var(--emerald); }
.detected-item.duration .detected-tag { background: var(--amber-bg); color: var(--amber); }
.detected-item.section .detected-tag { background: var(--text); color: white; }
.detected-text { flex: 1; font-size: 12.5px; color: var(--text); line-height: 1.5; }
.detected-meta { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); margin-top: 2px; }
.parser-empty { text-align: center; padding: 60px 20px; color: var(--text-faint); }
.parser-empty svg { opacity: 0.4; margin-bottom: 18px; }
.parser-empty h4 { font-family: var(--font-display); font-size: 22px; color: var(--text-muted);
  margin-bottom: 8px; font-weight: 500; }
.parser-empty p { font-size: 13px; }

/* ==== LIBRARY ==== */
.library { display: grid; grid-template-columns: 260px 1fr; height: 100%; overflow: hidden; }
.lib-cats { padding: 18px; border-right: 1px solid var(--border); overflow: auto; background: var(--surface); }
.lib-cat { padding: 9px 11px; border-radius: 7px; cursor: pointer;
  display: flex; align-items: center; gap: 9px; font-size: 13px;
  margin-bottom: 3px; border: 1px solid transparent; transition: all 0.12s; }
.lib-cat:hover { background: var(--surface-hover); }
.lib-cat.active { background: var(--brand-grad-light); border-color: var(--brand-violet-soft); color: var(--brand-violet-deep); font-weight: 500; }
.lib-cat svg { width: 15px; height: 15px; color: var(--text-muted); stroke-width: 1.6; }
.lib-cat.active svg { color: var(--brand-violet); }
.lib-cat-count { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--text-muted);
  background: var(--surface-2); padding: 1px 7px; border-radius: 10px; font-weight: 500; }
.lib-cat.active .lib-cat-count { background: white; color: var(--brand-violet); }
.lib-content { padding: 26px; overflow: auto; background: var(--bg); }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 16px; }
.lib-tpl { background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 18px; cursor: pointer; transition: all 0.18s; position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm); }
.lib-tpl:hover { border-color: var(--brand-violet-soft); transform: translateY(-2px);
  box-shadow: var(--shadow-md); }
.lib-tpl::before { content: ''; position: absolute; top: 0; left: 0; width: 4px;
  height: 100%; background: var(--brand-grad); opacity: 0; transition: opacity 0.18s; }
.lib-tpl:hover::before { opacity: 1; }
.lib-tpl-h { font-family: var(--font-display); font-size: 18px; font-weight: 500;
  color: var(--text); margin-bottom: 4px; letter-spacing: -0.01em; font-variation-settings: 'opsz' 60; }
.lib-tpl-meta { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted);
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 12px; font-weight: 600; }
.lib-tpl-desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.55; margin-bottom: 12px; }
.lib-tpl-stats { display: flex; gap: 14px; font-family: var(--font-mono); font-size: 10.5px;
  color: var(--text-muted); padding-top: 12px; border-top: 1px solid var(--border); font-weight: 500; }
.lib-tpl-stats span strong { color: var(--brand-blue-deep); }

/* ==== MISC ==== */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 40px; height: 100%; text-align: center; color: var(--text-muted); }
.empty-state svg { opacity: 0.25; margin-bottom: 20px; }
.empty-state h4 { font-family: var(--font-display); font-size: 24px; color: var(--text);
  font-weight: 500; margin-bottom: 8px; letter-spacing: -0.02em; }
.empty-state p { font-size: 13.5px; max-width: 50ch; line-height: 1.6; }

.toast { position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: white; border-radius: 8px;
  padding: 12px 18px; display: flex; align-items: center; gap: 10px; font-size: 13px;
  box-shadow: 0 10px 30px rgba(15,23,42,0.25); z-index: 300;
  opacity: 0; transition: all 0.28s cubic-bezier(0.32, 0.72, 0, 1); pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 8px var(--emerald); }
.toast.error .dot { background: var(--critical); box-shadow: 0 0 8px var(--critical); }
.toast.info .dot { background: var(--brand-blue); box-shadow: 0 0 8px var(--brand-blue); }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  border-radius: 12px; font-size: 10.5px; font-family: var(--font-mono); font-weight: 600;
  letter-spacing: 0.04em; background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.tag.crit { background: var(--critical-bg); color: var(--critical); border-color: var(--critical-border); }
.tag.normal { background: var(--brand-blue-soft); color: var(--brand-blue-deep); border-color: rgba(37,99,235,0.2); }
.tag.done { background: var(--emerald-bg); color: var(--emerald); border-color: rgba(5,150,105,0.2); }
.tag.late { background: var(--rose-bg); color: var(--rose); border-color: rgba(225,29,72,0.2); }
.tag.pending { background: var(--surface-2); color: var(--text-muted); }

.legend { display: flex; align-items: center; gap: 14px; font-size: 11px; color: var(--text-muted); font-weight: 500; }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-swatch { width: 16px; height: 9px; border-radius: 2px; }
.legend-swatch.normal { background: var(--normal-bar); }
.legend-swatch.critical { background: var(--critical-bar); }
.legend-swatch.completed { background: var(--completed-bar); }
.legend-swatch.milestone { width: 10px; height: 10px; background: var(--milestone);
  transform: rotate(45deg); border-radius: 1px; }
.legend-swatch.baseline { width: 16px; height: 4px; background: var(--baseline); }

.note { background: var(--brand-grad-light); border-left: 3px solid var(--brand-violet);
  padding: 12px 16px; font-size: 12.5px; color: var(--text-2); line-height: 1.6; border-radius: 0 6px 6px 0; }
.note strong { color: var(--text); font-weight: 600; }
.note code { font-family: var(--font-mono); font-size: 11px; padding: 1px 5px;
  background: white; border-radius: 4px; color: var(--brand-violet-deep); border: 1px solid var(--border); }

/* Column chooser */
.col-chooser { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.col-chooser-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 6px; cursor: pointer; font-size: 12.5px;
  background: var(--surface); transition: all 0.12s; }
.col-chooser-item:hover { background: var(--surface-hover); }
.col-chooser-item.checked { background: var(--brand-grad-light); border-color: var(--brand-violet-soft); color: var(--brand-violet-deep); font-weight: 500; }

/* Resource assignment row */
.res-asg { display: flex; gap: 8px; align-items: center; padding: 8px 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 7px; margin-bottom: 6px; }
.res-asg-code { font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  background: var(--brand-blue-soft); color: var(--brand-blue-deep); padding: 2px 7px; border-radius: 4px; }
.res-asg-name { font-size: 12px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-asg-units { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);
  width: 60px; text-align: right; }
.res-asg-cost { font-family: var(--font-mono); font-size: 11px; color: var(--text); font-weight: 500;
  width: 90px; text-align: right; }

/* XER drop zone */
.dropzone { border: 2px dashed var(--border-strong); border-radius: 10px;
  padding: 36px 24px; text-align: center; transition: all 0.15s; cursor: pointer;
  background: var(--surface-2); }
.dropzone:hover, .dropzone.dragover { border-color: var(--brand-blue); background: var(--brand-grad-light); }
.dropzone svg { width: 42px; height: 42px; color: var(--text-muted); margin: 0 auto 12px; display: block; }
.dropzone h4 { font-family: var(--font-display); font-size: 18px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.dropzone p { font-size: 12.5px; color: var(--text-muted); }
.dropzone code { font-family: var(--font-mono); font-size: 11px; padding: 1px 5px;
  background: white; border-radius: 4px; color: var(--brand-violet-deep); border: 1px solid var(--border); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.fadein { animation: fadeIn 0.22s ease-out; }
@keyframes shimmer { 0% { background-position: -200px 0; } 100% { background-position: 200px 0; } }
.shimmer { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-hover) 50%, var(--surface-2) 100%);
  background-size: 200px 100%; animation: shimmer 1.4s infinite; border-radius: 4px; }
