@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700;800&display=swap");

/* ── Design tokens ── */
:root {
  color-scheme: light;
  --bg: #f0f4f8;
  --surface: #ffffff;
  --surface-soft: #f7f9fb;
  --surface-strong: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.72);
  --ink: #1a202c;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --teal: #f15b22;
  --teal-deep: #c74412;
  --teal-soft: #fff1eb;
  --coral: #f15b22;
  --coral-soft: #fff1eb;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --green: #16a34a;
  --green-soft: #f0fdf4;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --charcoal: #1e293b;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 6px 16px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 6px rgba(0,0,0,0.04), 0 20px 40px rgba(0,0,0,0.06);
  --sidebar-width: 250px;
  --sidebar-collapsed: 72px;
  --transition: 220ms cubic-bezier(0.4, 0, 0.2, 1);
  --row: 42px;
  --name-col: 540px;
  --task-columns: 70px minmax(420px, 1.35fr) 92px 92px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; min-width: 320px; background: var(--bg); }
body { color: var(--ink); background: var(--bg); min-height: 100vh; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin-top: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }

/* ── Utilities ── */
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.dash-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.eyebrow { margin: 0 0 6px; color: var(--teal); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; display: flex; align-items: center; gap: 6px; }
.eyebrow .dash-icon { width: 16px; height: 16px; }
h1 { font-size: 1.4rem; font-weight: 800; line-height: 1.2; margin-bottom: 4px; max-width: 900px; }
h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; line-height: 1.2; }
.meta-line { color: var(--muted); font-size: 0.82rem; margin-bottom: 0; }

/* ── Fade-in ── */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1), transform 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ════════════════════════════════════════
   SIDEBAR (shared with front page)
   ════════════════════════════════════════ */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns var(--transition);
}

.app-shell:has(.sidebar.collapsed) {
  grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr) !important;
}

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: #1e293b;
  border-right: 1px solid rgba(255,255,255,0.06);
  overflow-y: auto; overflow-x: hidden;
  z-index: 100;
  width: var(--sidebar-width);
  transition: width var(--transition);
}

.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  min-height: 70px;
}
.brand-logo {
  flex-shrink: 0; width: 38px; height: 38px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #f15b22, #ff8a50);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(241, 91, 34, 0.35);
}
.brand-mark { color: #fff; font-size: 0.95rem; font-weight: 900; letter-spacing: -0.02em; }
.brand-text { min-width: 0; overflow: hidden; }
.brand-text .eyebrow { color: #f97316; margin-bottom: 2px; font-size: 0.65rem; }
.brand-sub { color: #94a3b8; font-size: 0.68rem; font-weight: 500; white-space: nowrap; }

.sidebar-toggle {
  margin-left: auto; flex-shrink: 0;
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 0; border-radius: 8px;
  background: rgba(255,255,255,0.06); color: #94a3b8;
  cursor: pointer; transition: all var(--transition);
}
.sidebar-toggle:hover { background: rgba(241, 91, 34, 0.15); color: #f97316; }
.sidebar-toggle .dash-icon { width: 18px; height: 18px; }

.sidebar-nav {
  flex: 1; padding: 12px 10px;
  display: flex; flex-direction: column; gap: 2px;
}
.nav-group-label {
  display: block; padding: 14px 10px 6px;
  color: #64748b; font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 8px;
  color: #94a3b8; font-size: 0.85rem; font-weight: 550;
  white-space: nowrap; transition: all var(--transition); position: relative;
}
.nav-item .dash-icon { flex-shrink: 0; width: 18px; height: 18px; opacity: 0.7; transition: opacity var(--transition); }
.nav-item:hover { background: rgba(255,255,255,0.06); color: #e2e8f0; }
.nav-item:hover .dash-icon { opacity: 1; }
.nav-item.active { background: rgba(241, 91, 34, 0.12); color: #f97316; }
.nav-item.active .dash-icon { opacity: 1; color: #f97316; }
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; border-radius: 0 3px 3px 0; background: #f97316;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-children {
  display: grid;
  gap: 2px;
  margin: -2px 0 6px 30px;
  padding-left: 12px;
  border-left: 1px solid rgba(249, 115, 22, 0.45);
}

.nav-child {
  display: flex;
  align-items: center;
  min-height: 28px;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: normal;
  transition: color var(--transition), background var(--transition);
}

.nav-child:hover,
.nav-child.active {
  color: #f97316;
}

.sidebar-footer { padding: 14px; border-top: 1px solid rgba(255,255,255,0.08); }

.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 38px; padding: 8px 12px;
  border: 1px solid rgba(241, 91, 34, 0.3); border-radius: 8px;
  background: rgba(241, 91, 34, 0.08); color: #f97316;
  font: inherit; font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.04em; cursor: pointer;
  transition: all var(--transition);
}
.theme-toggle:hover { background: rgba(241, 91, 34, 0.18); }

.source-meta { color: #64748b; font-size: 0.7rem; margin-top: 8px; text-align: center; }

.sidebar.collapsed { width: 72px; }
.sidebar.collapsed .brand-text, .sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-children,
.sidebar.collapsed .nav-group-label, .sidebar.collapsed .sidebar-footer,
.sidebar.collapsed .brand-sub { opacity: 0; width: 0; overflow: hidden; white-space: nowrap; }
.sidebar.collapsed .sidebar-brand {
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
  min-height: 124px;
  padding: 16px 0 12px;
}
.sidebar.collapsed .brand-logo {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
}
.sidebar.collapsed .sidebar-toggle {
  margin-left: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
}
.sidebar.collapsed .sidebar-toggle .dash-icon { width: 22px; height: 22px; }
.sidebar.collapsed .sidebar-nav {
  align-items: center;
  gap: 10px;
  padding: 14px 10px;
}
.sidebar.collapsed .nav-item {
  width: 52px;
  height: 52px;
  justify-content: center;
  padding: 0;
  border-radius: 14px;
}
.sidebar.collapsed .nav-item .dash-icon { width: 26px; height: 26px; }
.sidebar.collapsed .nav-item.active::before { display: none; }

/* ── Main content ── */
.main-content { min-width: 0; background: var(--bg); }

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 28px;
  background: var(--surface-glass);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.topbar h1 {
  font-size: 1.2rem;
  margin-bottom: 0;
  letter-spacing: 0;
  text-transform: uppercase;
}
.topbar > div:first-of-type > :not(h1) {
  display: none !important;
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.mobile-menu-btn {
  display: none; width: 38px; height: 38px; place-items: center;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); cursor: pointer;
}

.status-pill {
  display: inline-flex; align-items: center;
  min-height: 32px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--muted);
  font-size: 0.78rem; font-weight: 600; white-space: nowrap;
}
.status-pill.accent {
  border-color: color-mix(in srgb, var(--teal) 30%, var(--line));
  background: var(--teal-soft); color: var(--teal-deep);
  font-weight: 700;
}

main { padding: 24px 28px 40px; display: flex; flex-direction: column; gap: 20px; }

/* ── Panel link ── */
.panel-link {
  display: inline-flex; align-items: center;
  min-height: 34px; padding: 7px 14px;
  border: 1px solid color-mix(in srgb, var(--teal) 30%, transparent);
  border-radius: 8px;
  background: var(--teal-soft); color: var(--teal-deep);
  font-size: 0.8rem; font-weight: 700; white-space: nowrap;
  transition: all var(--transition);
}
.panel-link:hover {
  background: var(--teal); color: #fff; border-color: var(--teal);
  transform: translateY(-1px);
}

/* ════════════════════════════════════════
   HIGH LEVEL SCHEDULE / GANTT CHART
   ════════════════════════════════════════ */
.highlevel-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.highlevel-panel:hover { box-shadow: var(--shadow-lg); }

.highlevel-head { min-height: 68px; }

.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; min-height: 68px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.highlevel-frame {
  max-height: min(65vh, 660px);
  overflow-x: hidden; overflow-y: auto;
  padding: 12px;
  background:
    radial-gradient(circle at 20% 30%, rgba(37, 99, 235, 0.03), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(241, 91, 34, 0.02), transparent 40%),
    var(--surface-soft);
}

.highlevel-board {
  position: relative;
  width: 100%; min-width: 0; min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 2px 8px rgba(0,0,0,0.04);
}

/* ── Gantt title bar ── */
.hl-title {
  position: absolute;
  top: 0;
  left: var(--hl-board-pad);
  right: var(--hl-board-pad);
  height: 58px;
  display: grid;
  grid-template-columns: var(--hl-area-width) var(--hl-track-width);
  align-items: stretch;
  background: transparent;
  color: #fff;
  box-shadow: none;
  z-index: 6;
}
.hl-title-gutter {
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(241, 91, 34, 0.1), rgba(241, 91, 34, 0.04));
  border-right: 3px solid var(--teal);
  color: #e2e8f0;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.hl-title-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  padding: 8px 12px 8px 16px;
  background: linear-gradient(135deg, #1e293b, #334155);
  border-radius: 0 8px 8px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.hl-title-copy {
  min-width: 0;
}
.hl-title-copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.98rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.01em;
}
.hl-title-copy small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #94a3b8;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Month axis (arrow-shaped tabs) ── */
.hl-months {
  position: absolute; top: 66px;
  left: var(--hl-axis-left);
  width: var(--hl-track-width);
  height: 48px;
}

.hl-month {
  position: absolute; top: 0;
  display: grid; place-items: center;
  height: 40px;
  background: linear-gradient(135deg, #f15b22, #e04d15);
  color: #fff;
  font-size: 0.88rem; font-weight: 800;
  text-transform: uppercase;
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 50%, calc(100% - 22px) 100%, 0 100%, 18px 50%);
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  letter-spacing: 0.04em;
}

/* ── Lanes ── */
.hl-lane {
  position: absolute; left: 10px; right: 10px;
  display: grid;
  grid-template-columns: var(--hl-area-width) var(--hl-track-width);
  min-height: var(--lane-height);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
  transition: background var(--transition);
}
.hl-lane:hover { background: rgba(255, 255, 255, 0.7); }

.hl-area-label {
  display: grid; place-items: center;
  color: var(--charcoal);
  font-size: 0.82rem; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
  writing-mode: vertical-rl; transform: rotate(180deg);
  background: linear-gradient(180deg, rgba(241, 91, 34, 0.06), rgba(241, 91, 34, 0.02));
  border-right: 3px solid var(--teal);
}

.hl-lane-track { position: relative; overflow: hidden; }

.hl-monsoon, .hl-grid-line, .hl-current-line, .hl-item { position: absolute; }

.hl-grid-line {
  top: 0; bottom: 0; width: 1px;
  background: rgba(100, 116, 139, 0.1);
}

.hl-current-line {
  top: 0; bottom: 0; z-index: 2; width: 2px;
  background: linear-gradient(180deg, rgba(241, 91, 34, 0.8), rgba(241, 91, 34, 0.3));
  box-shadow: 0 0 8px rgba(241, 91, 34, 0.3);
}

.hl-monsoon {
  top: 0; bottom: 0;
  background: repeating-linear-gradient(
    -45deg,
    rgba(96, 165, 250, 0.08),
    rgba(96, 165, 250, 0.08) 4px,
    rgba(96, 165, 250, 0.15) 4px,
    rgba(96, 165, 250, 0.15) 8px
  );
  border-left: 2px solid rgba(96, 165, 250, 0.3);
  border-right: 2px solid rgba(96, 165, 250, 0.3);
}

.hl-monsoon-label {
  position: absolute; right: 20px; bottom: 12px; z-index: 3;
  padding: 3px 8px; border-radius: 4px;
  background: rgba(96, 165, 250, 0.12);
  color: #2563eb; font-size: 0.7rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.06em;
}

/* ── Gantt bars ── */
.hl-item {
  top: var(--y); left: var(--left);
  width: var(--width); min-width: 8px;
  height: 18px; z-index: 3;
  transition: filter 150ms ease;
}
.hl-item:hover { filter: brightness(1.1); z-index: 5; }

.hl-bar {
  display: block; width: 100%; height: 100%;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.3);
  transition: box-shadow 150ms ease;
}
.hl-item:hover .hl-bar {
  box-shadow: 0 4px 12px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.3);
}

.hl-item.rig .hl-bar      { background: linear-gradient(135deg, #ef4444, #dc2626); }
.hl-item.mpsv .hl-bar     { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.hl-item.dlb .hl-bar      { background: linear-gradient(135deg, #c084fc, #a855f7); }
.hl-item.support .hl-bar  { background: linear-gradient(135deg, #60a5fa, #3b82f6); }
.hl-item.precomm .hl-bar  { background: linear-gradient(135deg, #e2e8f0, #cbd5e1); border: 1px solid #94a3b8; }

/* ── Gantt labels ── */
.hl-label {
  position: absolute; left: calc(100% + 5px); top: 0;
  max-width: 170px;
  color: var(--ink); font-size: 0.58rem; font-weight: 800;
  line-height: 1.1; white-space: normal;
}
.hl-item.long .hl-label {
  left: 50%; top: 20px; max-width: min(210px, 96%);
  transform: translateX(-50%); text-align: center;
}
.hl-item.short .hl-label { display: none; }
.hl-item.short.rig .hl-label, .hl-item.short.precomm .hl-label {
  display: block; max-width: 56px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.hl-item.support .hl-label { display: none; }
.hl-item.precomm .hl-label { max-width: 110px; font-size: 0.54rem; }
.hl-item.milestone .hl-label { top: -2px; max-width: 170px; }

.hl-date {
  position: absolute; top: -13px;
  color: var(--blue); font-family: "JetBrains Mono", monospace;
  font-size: 0.56rem; font-weight: 700; white-space: nowrap;
}
.hl-date.start { left: 0; }
.hl-date.finish { right: 0; }
.hl-item.tiny .hl-date.finish { display: none; }
.hl-item.rig .hl-date, .hl-item.precomm .hl-date { color: var(--ink); }

/* ── Campaign milestone ── */
.hl-milestone {
  position: absolute; z-index: 4;
  width: 24px; height: 24px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}
.hl-milestone::before {
  content: ""; display: block; width: 20px; height: 20px;
  border: 2px solid var(--charcoal);
  background: #22c55e;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 56%, 79% 92%, 50% 70%, 21% 92%, 32% 56%, 2% 35%, 39% 35%);
}
.hl-milestone-label {
  position: absolute; left: 50%; top: 24px; width: 92px;
  transform: translateX(-50%);
  color: var(--blue); font-family: "JetBrains Mono", monospace;
  font-size: 0.56rem; font-weight: 800; line-height: 1.1; text-align: center;
}

/* ── Legend ── */
.hl-legend {
  position: static;
  flex: 0 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end;
  gap: 8px; max-width: 48%;
  padding: 6px 10px; border-radius: 8px;
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(8px);
  color: #fff;
}
.hl-legend strong { display: none; }
.hl-legend span { display: flex; align-items: center; gap: 5px; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.02em; }
.hl-legend i { width: 14px; height: 10px; border-radius: 3px; }
.hl-legend .rig     { background: linear-gradient(135deg, #ef4444, #dc2626); }
.hl-legend .mpsv    { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.hl-legend .dlb     { background: linear-gradient(135deg, #c084fc, #a855f7); }
.hl-legend .support { background: linear-gradient(135deg, #60a5fa, #3b82f6); }
.hl-legend .precomm { background: linear-gradient(135deg, #e2e8f0, #cbd5e1); }

.hl-empty {
  position: absolute; inset: 140px 24px 24px;
  display: grid; place-items: center;
  color: var(--muted); font-weight: 700;
}

/* ── Full view modes ── */
.highlevel-full-mode { overflow: hidden; }
.highlevel-full-mode .highlevel-panel {
  position: fixed; inset: 12px; z-index: 250;
  display: flex; flex-direction: column;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(0,0,0,0.25);
  border-radius: var(--radius-lg);
}
.highlevel-full-mode .highlevel-panel::before {
  position: fixed; inset: 0; z-index: -1;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(4px);
  content: "";
}
.highlevel-full-mode .highlevel-frame {
  flex: 1 1 auto; max-height: none; overflow: hidden;
}
.highlevel-full-mode #highlevelFullButton {
  background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 30%, transparent);
  color: var(--red);
}

/* ════════════════════════════════════════
   KPI GRID
   ════════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.kpi {
  min-height: 100px; padding: 16px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
  transition: all var(--transition);
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--teal) 25%, var(--line)); }

.kpi strong { display: block; margin-bottom: 8px; color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; }
.kpi span { display: block; font-family: "JetBrains Mono", monospace; font-size: 1.7rem; font-weight: 800; line-height: 1; }
.kpi small { display: block; margin-top: 8px; color: var(--muted); font-size: 0.76rem; line-height: 1.35; }

/* ════════════════════════════════════════
   CONTROLS
   ════════════════════════════════════════ */
.controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(180px, 230px) minmax(160px, 190px);
  align-items: end; gap: 12px;
  padding: 16px;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-box, .select-wrap { display: grid; gap: 6px; }
.search-box span, .select-wrap span {
  display: flex; align-items: center; gap: 4px;
  color: var(--muted); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}
.search-box span .dash-icon { width: 14px; height: 14px; }

.search-box input, .select-wrap select {
  width: 100%; height: 40px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-soft); color: var(--ink);
  transition: all var(--transition);
}
.search-box input { padding: 0 14px; }
.select-wrap select { padding: 0 34px 0 12px; }
.search-box input:focus, .select-wrap select:focus {
  outline: 2px solid color-mix(in srgb, var(--teal) 30%, transparent);
  border-color: var(--teal);
}

.control-group {
  display: inline-grid; grid-auto-flow: column; gap: 4px;
  min-height: 40px; padding: 3px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-soft);
}
.segmented {
  min-width: 84px; min-height: 32px; padding: 0 12px;
  border: 0; border-radius: 6px;
  background: transparent; color: var(--muted);
  font-size: 0.82rem; font-weight: 700;
  transition: all var(--transition);
}
.segmented:hover { color: var(--ink); }
.segmented.active {
  background: var(--surface); color: var(--ink);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* ════════════════════════════════════════
   EXECUTION TIMELINE (GANTT TABLE)
   ════════════════════════════════════════ */
.workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.workspace.schedule-only { grid-template-columns: minmax(0, 1fr); }

.schedule-panel {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow); overflow: hidden;
}

.legend {
  display: flex; flex-wrap: wrap; justify-content: flex-end;
  gap: 12px; color: var(--muted); font-size: 0.78rem; font-weight: 600;
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-box { width: 16px; height: 8px; border-radius: 4px; }
.legend-box.regular { background: var(--teal); }
.legend-box.summary { background: var(--charcoal); }
.legend-box.critical { background: var(--coral); }
.legend-box.hl-leg-rig { background: linear-gradient(135deg, #ef4444, #dc2626); }
.legend-box.hl-leg-mpsv { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.legend-box.hl-leg-dlb { background: linear-gradient(135deg, #c084fc, #a855f7); }
.legend-box.hl-leg-support { background: linear-gradient(135deg, #60a5fa, #3b82f6); }
.legend-box.hl-leg-precomm { background: linear-gradient(135deg, #e2e8f0, #cbd5e1); }

/* ── High level schedule image panel ── */
.highlevel-image-wrap {
  padding: 14px;
  overflow: auto;
  background:
    radial-gradient(circle at 20% 30%, rgba(37, 99, 235, 0.03), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(241, 91, 34, 0.02), transparent 40%),
    var(--surface-soft);
}
.highlevel-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  cursor: zoom-in;
}
body.theme-offshore .highlevel-image { border-color: var(--line-strong); box-shadow: 0 2px 10px rgba(0,0,0,0.25); }

/* ── High level image full-screen lightbox ── */
.highlevel-image-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 11, 22, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: hlModalIn 160ms ease;
}
@keyframes hlModalIn { from { opacity: 0; } to { opacity: 1; } }
.highlevel-image-modal-scroll {
  max-width: 100%;
  max-height: 100%;
  overflow: auto;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  cursor: default;
}
.highlevel-image-modal-img {
  display: block;
  width: min(96vw, 1700px);
  height: auto;
  border-radius: 12px;
  background: #fff;
}
.highlevel-image-modal-close {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 410;
  padding: 9px 16px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  background: rgba(241, 91, 34, 0.92);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  transition: background 150ms ease, transform 150ms ease;
}
.highlevel-image-modal-close:hover { background: #f15b22; transform: translateY(-1px); }

.timeline-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 12px; }
.timeline-full-button {
  background: var(--teal-soft); border-color: color-mix(in srgb, var(--teal) 30%, transparent);
  color: var(--teal-deep);
}

.timeline-full-mode { overflow: hidden; }
.timeline-full-mode .schedule-panel {
  position: fixed; inset: 12px; z-index: 250;
  display: flex; flex-direction: column;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(0,0,0,0.25);
  border-radius: var(--radius-lg);
}
.timeline-full-mode .schedule-panel::before {
  position: fixed; inset: 0; z-index: -1;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(4px);
  content: "";
}
.timeline-full-mode .schedule-panel .panel-head { flex: 0 0 auto; }
.timeline-full-mode .schedule-scroll { flex: 1 1 auto; max-height: none; min-height: 0; }
.timeline-full-mode .timeline-full-button {
  background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 30%, transparent);
  color: var(--red);
}

.schedule-scroll {
  position: relative;
  max-height: calc(100vh - 220px); min-height: 520px;
  overflow: auto; background: var(--surface-soft);
}
.schedule-scroll:focus { outline: none; }

.schedule-grid {
  position: relative;
  display: grid;
  grid-template-columns: var(--name-col) var(--timeline-width);
  isolation: isolate;
  min-width: calc(var(--name-col) + var(--timeline-width));
}

.name-header, .timeline-header {
  position: sticky; top: 0; z-index: 5;
  height: 52px;
  border-bottom: 2px solid var(--line-strong);
  background: var(--surface-soft);
}
.name-header {
  left: 0; z-index: 12;
  display: grid; grid-template-columns: var(--task-columns);
  align-items: center; gap: 8px; padding: 0 14px;
  border-right: 1px solid var(--line-strong);
  box-shadow: 8px 0 0 var(--surface-soft);
  color: var(--muted); font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.timeline-header { overflow: hidden; }

.month-band, .week-band { position: relative; width: var(--timeline-width); }
.month-band { height: 26px; border-bottom: 1px solid var(--line); }
.week-band { height: 26px; }

.month-label, .week-label {
  position: absolute; top: 0; height: 100%;
  display: flex; align-items: center; overflow: hidden;
  border-left: 1px solid var(--line);
  color: var(--muted); font-weight: 700; white-space: nowrap;
}
.month-label { padding-left: 8px; font-size: 0.72rem; }
.week-label { justify-content: center; font-size: 0.64rem; }
.month-label.start-month { padding-left: 78px; }
.week-label.data-week { color: transparent; }

.task-row { display: contents; }
.task-name-cell, .task-timeline-cell {
  min-height: var(--row);
  border-bottom: 1px solid var(--line);
}

.task-name-cell {
  position: sticky; left: 0; z-index: 10;
  display: grid; grid-template-columns: var(--task-columns);
  gap: 8px; align-items: center; padding: 0 14px;
  border-right: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: 8px 0 0 var(--surface);
  transition: background var(--transition);
}

.task-row:nth-child(even) .task-name-cell { background: var(--surface-soft); box-shadow: 8px 0 0 var(--surface-soft); }
.task-row:nth-child(even) .task-timeline-cell { background-color: rgba(247, 249, 251, 0.6); }
.task-row:hover .task-name-cell { background: var(--teal-soft) !important; box-shadow: 8px 0 0 var(--teal-soft) !important; }
.task-row:hover .task-timeline-cell { background-color: rgba(255, 241, 235, 0.3); }

.task-name-cell button {
  width: 100%; min-width: 0; border: 0; background: transparent;
  color: var(--ink); cursor: default; text-align: left;
}
.task-name-cell button:disabled { opacity: 1; }

.cell-id, .cell-wbs, .cell-date {
  color: var(--muted); font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem; font-weight: 500;
}
.cell-date { white-space: nowrap; }
.cell-title { display: flex; align-items: center; gap: 6px; min-width: 0; width: 100%; line-height: 1.15; }
.indent-mark { flex: 0 0 auto; width: var(--indent); }
.task-title { flex: 1 1 auto; min-width: 0; font-size: 0.84rem; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; white-space: normal; }
.summary .task-title { font-weight: 800; }
.critical-tag { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 4px rgba(241, 91, 34, 0.4); }

.task-timeline-cell {
  position: relative; z-index: 0;
  background:
    repeating-linear-gradient(90deg, rgba(100, 116, 139, 0.06) 0 1px, transparent 1px var(--week-width)),
    var(--surface);
}

/* ── Gantt bars in timeline ── */
.bar {
  position: absolute; z-index: 1;
  top: 14px; height: 20px; min-width: 8px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--teal), var(--teal-deep));
  box-shadow: 0 2px 8px rgba(241, 91, 34, 0.2);
  transition: filter 150ms ease;
}
.bar:hover { filter: brightness(1.1); }

.bar.summary {
  top: 18px; height: 12px; border-radius: 3px;
  background: linear-gradient(135deg, #475569, var(--charcoal));
  box-shadow: none;
}
.bar.critical {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

.bar-progress {
  position: absolute; inset: 0 auto 0 0;
  width: var(--progress); border-radius: inherit;
  background: rgba(255,255,255,0.3);
}

.bar-label {
  position: absolute; z-index: 2; top: 8px;
  max-width: 560px; padding: 4px 8px;
  border-radius: 5px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(4px);
  color: var(--ink); font-size: 0.7rem; font-weight: 700;
  line-height: 1.15; overflow: hidden;
  pointer-events: none; text-overflow: ellipsis; white-space: nowrap;
}
.bar-label.summary { color: var(--charcoal); }
.bar-label.critical { color: var(--coral); }

/* ── Date line (today marker) ── */
.date-line {
  position: absolute; top: 0; bottom: 0;
  width: 2px; background: var(--amber); z-index: 4;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.18);
}
.date-line::before {
  content: attr(data-label);
  position: absolute; top: 4px; left: 7px;
  padding: 2px 7px; border-radius: 5px 5px 2px 2px;
  background: var(--amber-soft); color: #92400e;
  font-size: 0.58rem; font-weight: 900;
  letter-spacing: 0.05em; text-transform: uppercase;
  white-space: nowrap;
}
.date-line::after {
  content: attr(data-date); position: absolute; top: 25px; left: 7px;
  padding: 2px 7px; border-radius: 2px 2px 5px 5px;
  background: var(--amber-soft); color: #92400e;
  font-size: 0.62rem; font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.row-date-line {
  position: absolute; top: 0; bottom: 0;
  width: 2px; background: rgba(217, 119, 6, 0.5); z-index: 3;
}
.timeline-data-date-line {
  position: absolute;
  top: 52px;
  bottom: 0;
  left: calc(var(--name-col) + var(--data-date-offset) - 1px);
  z-index: 30;
  width: 3px;
  background: #ef4444;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.35), 0 0 12px rgba(239, 68, 68, 0.35);
  pointer-events: none;
}

.empty-state { grid-column: 1 / -1; padding: 28px; color: var(--muted); }

/* old nav pills hidden */
.nav-pill { display: none; }
.status-stack { display: none; }

/* ════════════════════════════════════════
   OFFSHORE DARK THEME
   ════════════════════════════════════════ */
body.theme-offshore {
  --bg: #0c1221;
  --surface: #151d2e;
  --surface-soft: #1a2438;
  --surface-strong: #1e2940;
  --surface-glass: rgba(21, 29, 46, 0.82);
  --ink: #e2e8f0;
  --muted: #8892a4;
  --line: #1e2d44;
  --line-strong: #2d3f5a;
  --teal: #f97316;
  --teal-soft: rgba(249, 115, 22, 0.12);
  --teal-deep: #ea580c;
  --coral: #f97316;
  --coral-soft: rgba(249, 115, 22, 0.1);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.12);
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.1);
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.1);
  --blue: #38bdf8;
  --blue-soft: rgba(56, 189, 248, 0.1);
  --charcoal: #c8d6e5;
  --shadow: 0 4px 12px rgba(0,0,0,0.2), 0 16px 40px rgba(0,0,0,0.15);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.25), 0 32px 60px rgba(0,0,0,0.2);
  background:
    radial-gradient(ellipse at 80% 0%, rgba(56, 189, 248, 0.08), transparent 40%),
    radial-gradient(ellipse at 20% 10%, rgba(249, 115, 22, 0.06), transparent 40%),
    #0c1221;
}

body.theme-offshore .sidebar {
  background: rgba(12, 18, 33, 0.95);
  border-right-color: rgba(255,255,255,0.04);
}

body.theme-offshore .topbar {
  background: var(--surface-glass);
  border-bottom-color: var(--line);
}

body.theme-offshore .status-pill {
  background: rgba(255,255,255,0.04);
  border-color: var(--line);
  color: var(--muted);
}
body.theme-offshore .status-pill.accent {
  background: var(--teal-soft);
  border-color: rgba(249, 115, 22, 0.3);
  color: #f97316;
}

body.theme-offshore .panel-link {
  background: rgba(249, 115, 22, 0.1);
  border-color: rgba(249, 115, 22, 0.3);
  color: #f97316;
}
body.theme-offshore .panel-link:hover {
  background: #f97316;
  color: #fff;
}

/* ── High level panel (offshore) ── */
body.theme-offshore .highlevel-panel {
  background: var(--surface);
  border-color: var(--line);
}

body.theme-offshore .panel-head {
  background: rgba(255,255,255,0.02);
  border-bottom-color: var(--line);
}

body.theme-offshore .highlevel-frame {
  background:
    radial-gradient(circle at 20% 30%, rgba(56, 189, 248, 0.04), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(249, 115, 22, 0.03), transparent 40%),
    var(--surface-soft);
}

body.theme-offshore .highlevel-board {
  background: linear-gradient(180deg, #1a2438, #151d2e);
  border-color: var(--line-strong);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 2px 8px rgba(0,0,0,0.2);
}

body.theme-offshore .hl-title {
  background: transparent;
  box-shadow: none;
}

body.theme-offshore .hl-title-gutter {
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.1), rgba(249, 115, 22, 0.035));
  border-right-color: #f97316;
}

body.theme-offshore .hl-title-main {
  background: linear-gradient(135deg, #0c1221, #1a2438);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

body.theme-offshore .hl-lane {
  border-top-color: var(--line);
  background: rgba(255,255,255,0.02);
}
body.theme-offshore .hl-lane:hover {
  background: rgba(255,255,255,0.04);
}

body.theme-offshore .hl-area-label {
  color: #e2e8f0;
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.08), rgba(249, 115, 22, 0.03));
}

body.theme-offshore .hl-grid-line {
  background: rgba(255,255,255,0.05);
}

body.theme-offshore .hl-current-line {
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.9), rgba(249, 115, 22, 0.4));
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.4);
}

body.theme-offshore .hl-monsoon {
  background: repeating-linear-gradient(
    -45deg,
    rgba(56, 189, 248, 0.06),
    rgba(56, 189, 248, 0.06) 4px,
    rgba(56, 189, 248, 0.12) 4px,
    rgba(56, 189, 248, 0.12) 8px
  );
  border-left-color: rgba(56, 189, 248, 0.2);
  border-right-color: rgba(56, 189, 248, 0.2);
}

body.theme-offshore .hl-monsoon-label {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

body.theme-offshore .hl-label { color: var(--ink); }
body.theme-offshore .hl-date { color: #38bdf8; }
body.theme-offshore .hl-item.rig .hl-date,
body.theme-offshore .hl-item.precomm .hl-date { color: var(--ink); }

body.theme-offshore .hl-legend {
  background: rgba(12, 18, 33, 0.85);
  backdrop-filter: blur(8px);
}

body.theme-offshore .hl-milestone-label { color: #38bdf8; }

body.theme-offshore .hl-item.precomm .hl-bar {
  background: linear-gradient(135deg, #2d3f5a, #3d5274);
  border-color: #4a6382;
}

/* ── KPI cards (offshore) ── */
body.theme-offshore .kpi {
  background: rgba(255,255,255,0.03);
  border-color: var(--line);
}
body.theme-offshore .kpi:hover {
  border-color: rgba(249, 115, 22, 0.3);
}
body.theme-offshore .kpi span {
  color: #f97316;
}

/* ── Controls (offshore) ── */
body.theme-offshore .controls {
  background: var(--surface);
  border-color: var(--line);
}

body.theme-offshore .search-box input,
body.theme-offshore .select-wrap select {
  background: rgba(255,255,255,0.04);
  border-color: var(--line);
  color: var(--ink);
}
body.theme-offshore .search-box input:focus,
body.theme-offshore .select-wrap select:focus {
  border-color: #f97316;
  outline-color: rgba(249, 115, 22, 0.3);
}

body.theme-offshore .control-group {
  background: rgba(255,255,255,0.03);
  border-color: var(--line);
}
body.theme-offshore .segmented { color: var(--muted); }
body.theme-offshore .segmented:hover { color: var(--ink); }
body.theme-offshore .segmented.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ── Schedule panel / timeline table (offshore) ── */
body.theme-offshore .schedule-panel {
  background: var(--surface);
  border-color: var(--line);
}

body.theme-offshore .schedule-scroll {
  background: var(--surface-soft);
}

body.theme-offshore .name-header,
body.theme-offshore .timeline-header {
  background: var(--surface-soft);
  border-bottom-color: var(--line-strong);
}
body.theme-offshore .name-header {
  border-right-color: var(--line-strong);
  box-shadow: 8px 0 0 var(--surface-soft);
}

body.theme-offshore .task-name-cell {
  background: var(--surface);
  border-right-color: var(--line-strong);
  border-bottom-color: var(--line);
  box-shadow: 8px 0 0 var(--surface);
}
body.theme-offshore .task-row:nth-child(even) .task-name-cell {
  background: var(--surface-soft);
  box-shadow: 8px 0 0 var(--surface-soft);
}
body.theme-offshore .task-row:hover .task-name-cell {
  background: rgba(249, 115, 22, 0.08) !important;
  box-shadow: 8px 0 0 rgba(249, 115, 22, 0.08) !important;
}
body.theme-offshore .task-row:hover .task-timeline-cell {
  background-color: rgba(249, 115, 22, 0.04);
}

body.theme-offshore .task-timeline-cell {
  border-bottom-color: var(--line);
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0 1px, transparent 1px var(--week-width)),
    var(--surface);
}
body.theme-offshore .task-row:nth-child(even) .task-timeline-cell {
  background-color: rgba(255,255,255,0.015);
}

body.theme-offshore .task-name-cell button { color: var(--ink); }

body.theme-offshore .month-label,
body.theme-offshore .week-label {
  border-left-color: var(--line);
}

body.theme-offshore .month-band {
  border-bottom-color: var(--line);
}

/* ── Gantt bars in timeline (offshore) ── */
body.theme-offshore .bar-label {
  background: rgba(21, 29, 46, 0.92);
  backdrop-filter: blur(4px);
  color: var(--ink);
}
body.theme-offshore .bar-label.summary { color: #94a3b8; }
body.theme-offshore .bar-label.critical { color: #f97316; }

body.theme-offshore .bar.summary {
  background: linear-gradient(135deg, #64748b, #475569);
}

body.theme-offshore .date-line::after {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}
body.theme-offshore .date-line::before {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

body.theme-offshore .row-date-line {
  background: rgba(251, 191, 36, 0.35);
}

body.theme-offshore .timeline-data-date-line {
  background: #ef4444;
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.45), 0 0 16px rgba(239, 68, 68, 0.38);
}

/* ── Legend (offshore) ── */
body.theme-offshore .legend { color: var(--muted); }

/* ── Full-view backdrop (offshore) ── */
body.theme-offshore.highlevel-full-mode .highlevel-panel {
  background: var(--surface);
}
body.theme-offshore.highlevel-full-mode .highlevel-panel::before {
  background: rgba(0,0,0,0.6);
}
body.theme-offshore.timeline-full-mode .schedule-panel {
  background: var(--surface);
}
body.theme-offshore.timeline-full-mode .schedule-panel::before {
  background: rgba(0,0,0,0.6);
}

/* ── Mobile menu button (offshore) ── */
body.theme-offshore .mobile-menu-btn {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

/* ── Scrollbar (offshore) ── */
body.theme-offshore ::-webkit-scrollbar-thumb {
  background: #2d3f5a;
}
body.theme-offshore ::-webkit-scrollbar-thumb:hover {
  background: #3d5274;
}

/* ════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════ */
@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .controls { grid-template-columns: 1fr 1fr; }
  .control-group { width: 100%; }
  .segmented { min-width: 0; }
}

@media (max-width: 1024px) {
  .app-shell { grid-template-columns: 1fr; }
  .hl-title-main { gap: 8px; }
  .hl-title-copy strong { font-size: 0.86rem; }
  .hl-legend { display: none; }
  .sidebar {
    position: fixed; left: -280px; top: 0; width: 270px;
    transition: left var(--transition), box-shadow var(--transition);
    box-shadow: none; z-index: 200;
  }
  .sidebar.mobile-open {
    left: 0;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.35), 8px 0 24px rgba(0,0,0,0.2);
  }
  .sidebar.collapsed { width: 270px; }
  .sidebar.collapsed .brand-text, .sidebar.collapsed .nav-item span,
  .sidebar.collapsed .nav-children,
  .sidebar.collapsed .nav-group-label, .sidebar.collapsed .sidebar-footer,
  .sidebar.collapsed .brand-sub { opacity: 1; width: auto; }
  .sidebar.collapsed .sidebar-brand { justify-content: flex-start; padding: 18px 16px; }
  .sidebar.collapsed .nav-item { justify-content: flex-start; padding: 9px 12px; }
  .sidebar.collapsed .nav-item .dash-icon { width: 18px; height: 18px; }

  .mobile-menu-btn { display: grid; }
  main { padding: 18px 16px 32px; }
  .topbar { padding: 12px 16px; }
}

@media (max-width: 640px) {
  .kpi-grid, .controls { grid-template-columns: 1fr; }
  .control-group { grid-auto-flow: row; }
  .schedule-scroll { max-height: 65vh; }
  .topbar h1 { font-size: 1rem; }
  .panel-head { flex-direction: column; align-items: flex-start; }
  .timeline-actions { justify-content: flex-start; width: 100%; }
  .schedule-grid {
    --name-col: 500px;
    --task-columns: 58px minmax(200px, 1fr) 78px 78px;
  }
}
