@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-glass: rgba(255, 255, 255, 0.72);
  --ink: #1a202c;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --teal: #f15b22;
  --teal-soft: #fff1eb;
  --teal-deep: #c74412;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --green: #16a34a;
  --green-soft: #f0fdf4;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --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);
  --shadow-glow: 0 0 0 1px rgba(241, 91, 34, 0.08);
  --sidebar-width: 250px;
  --sidebar-collapsed: 72px;
  --transition: 220ms cubic-bezier(0.4, 0, 0.2, 1);
  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; }

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; }

/* ── 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;
}

h1 { font-size: 1.5rem; font-weight: 800; line-height: 1.2; margin-bottom: 4px; }
h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; }
h3 { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; letter-spacing: 0.04em; }
.meta-line { color: var(--muted); font-size: 0.82rem; margin-bottom: 0; }
.meta-line:empty { display: none; }

/* ── Fade-in animations ── */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  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); }

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(241, 91, 34, 0.3); }
  50% { box-shadow: 0 0 0 8px rgba(241, 91, 34, 0); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ── App layout ── */
.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 ── */
.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;
  transition: width var(--transition);
  width: var(--sidebar-width);
}

.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 1 auto;
  min-height: 0;
  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 {
  flex: 0 0 auto;
  margin-top: auto;
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(2, 8, 23, 0.18);
}

.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.66rem; margin: 8px 0 0; text-align: center; }

/* Collapsed sidebar */
.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}
.sidebar.collapsed ~ .main-content {
  margin-left: 0;
}
.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.25rem;
  margin-bottom: 0;
  letter-spacing: 0;
  text-transform: uppercase;
}
.topbar > div:first-of-type > :not(h1) {
  display: none !important;
}
.topbar-sub { color: var(--muted); font-size: 0.8rem; font-weight: 500; }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.updated-badge {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  border: 1px solid rgba(249, 115, 22, 0.45);
  border-radius: 8px;
  background: rgba(249, 115, 22, 0.1);
  color: #fb923c;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-glow 2s infinite;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.4);
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
}

.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;
}

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

/* ── Countdown ── */
.dashboard-countdown-wrap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-countdown {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 24px 28px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(241, 91, 34, 0.06) 0%, rgba(255, 255, 255, 0.9) 50%, rgba(37, 99, 235, 0.04) 100%),
    var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
}

.dashboard-countdown::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f15b22, #ff8a50, #f15b22);
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}

.dashboard-countdown-mermaid::before {
  background: linear-gradient(90deg, #38bdf8, #22c55e, #38bdf8);
  background-size: 200% 100%;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.countdown-info h2 {
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  font-weight: 800;
  margin-bottom: 6px;
}

.dashboard-countdown-grid {
  display: flex;
  align-items: center;
  gap: 6px;
}

.countdown-digit {
  min-width: 82px;
  padding: 14px 12px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition);
}

.countdown-digit:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.countdown-digit strong {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.countdown-digit span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.countdown-sep {
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 1.6rem;
  font-weight: 700;
  opacity: 0.4;
  padding-bottom: 18px;
}

/* ── Visual dashboard ── */
.visual-dashboard {
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.visual-dashboard-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.visual-card-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.visual-card {
  --card-color: var(--teal);
  --card-soft: var(--teal-soft);
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr;
  justify-items: center;
  gap: 10px;
  min-height: 190px;
  padding: 16px 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  transition: all 200ms cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
}

.visual-card::before {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-color);
  content: "";
  transition: height 200ms ease;
}

.visual-card > * { position: relative; z-index: 1; }

.visual-card:hover {
  border-color: var(--card-color);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 0 0 1px color-mix(in srgb, var(--card-color) 20%, transparent);
  transform: translateY(-3px);
}
.visual-card:hover::before { height: 4px; }

.visual-card.blue { --card-color: var(--blue); --card-soft: var(--blue-soft); }
.visual-card.green { --card-color: var(--green); --card-soft: var(--green-soft); }
.visual-card.amber { --card-color: var(--amber); --card-soft: var(--amber-soft); }
.visual-card.red { --card-color: var(--red); --card-soft: var(--red-soft); }

.visual-card-icon {
  display: grid;
  width: 40px; height: 40px;
  place-items: center;
  border-radius: 10px;
  background: var(--card-soft);
  color: var(--card-color);
  transition: transform var(--transition);
}
.visual-card:hover .visual-card-icon { transform: scale(1.08); }

.visual-ring {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  width: 78px; height: 78px;
  place-items: center;
  border-radius: 999px;
  background: conic-gradient(var(--card-color) calc(var(--value) * 1%), var(--line) 0);
  isolation: isolate;
  transition: transform var(--transition);
}
.visual-card:hover .visual-ring { transform: scale(1.04); }

.visual-ring::before {
  position: absolute;
  inset: 8px;
  border-radius: inherit;
  background: var(--surface);
  content: "";
}

.visual-ring b {
  position: relative; z-index: 1;
  display: block; width: 100%;
  color: var(--ink);
  font-family: "JetBrains Mono", monospace;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.visual-card-text { display: grid; gap: 3px; min-width: 0; }
.visual-card-text strong { font-size: 0.88rem; line-height: 1.2; }
.visual-card-text span { color: var(--muted); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.visual-card-text small { color: var(--muted); font-size: 0.72rem; line-height: 1.3; }

/* ── Panels ── */
.panel, .overview-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);
}
.panel:hover, .overview-panel:hover {
  box-shadow: var(--shadow-lg);
}

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

.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);
}

/* ── RTM front ── */
.rtm-front-head { align-items: center; }

.rtm-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.rtm-front-card {
  min-height: 94px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  text-align: center;
  transition: all var(--transition);
}
.rtm-front-card:hover {
  border-color: color-mix(in srgb, var(--teal) 40%, var(--line));
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

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

.rtm-issue-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.rtm-issue-shell {
  display: block;
}

.rtm-issue-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--ink);
  text-decoration: none;
  transition: all var(--transition);
}

.rtm-issue-item:hover,
.rtm-issue-item:focus-visible {
  border-color: color-mix(in srgb, var(--red) 42%, var(--line));
  box-shadow: var(--shadow);
  outline: none;
  transform: translateY(-1px);
}

.rtm-issue-rank {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  font-family: "JetBrains Mono", monospace;
  font-weight: 900;
}

.rtm-issue-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.rtm-issue-body strong {
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.25;
}

.rtm-issue-body small {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.rtm-issue-empty {
  display: grid;
  gap: 6px;
  margin: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.rtm-issue-empty span { color: var(--muted); }

/* ── Manhours ── */
.manhours-head {
  align-items: center;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 0.26fr);
}
.manhours-title-block { text-align: left; }
.manhours-overall-card { justify-self: end; width: min(260px, 100%); }

.manhours-total-card {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--teal) 25%, var(--line));
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--teal-soft), var(--surface));
  text-align: center;
}
.manhours-total-card.overall { background: linear-gradient(135deg, var(--teal-soft), #fff); }

.manhours-package-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 16px 0;
}

.manhours-package-card {
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  text-align: center;
  transition: all var(--transition);
}
.manhours-package-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.manhours-package-card span, .manhours-package-card small { display: block; color: var(--muted); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; }
.manhours-package-card strong { display: block; margin: 4px 0 2px; font-family: "JetBrains Mono", monospace; font-size: 1.3rem; line-height: 1; }
.manhours-total-card span, .manhours-total-card small { display: block; color: var(--muted); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; }
.manhours-total-card strong { display: block; margin: 4px 0 2px; font-family: "JetBrains Mono", monospace; font-size: 1.8rem; line-height: 1; }

.manhours-table-wrap { padding: 16px; overflow-x: auto; }

.manhours-table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.manhours-table th, .manhours-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.manhours-table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
}
.manhours-table td { font-size: 0.88rem; }
.manhours-table tbody tr { transition: background var(--transition); }
.manhours-table tbody tr:hover { background: var(--surface-soft); }
.manhours-table .num { font-family: "JetBrains Mono", monospace; font-weight: 600; }
.manhours-table .strong { color: var(--ink); font-weight: 800; }
.manhours-table tfoot td { background: var(--teal-soft); font-weight: 800; }
.manhours-table tfoot .package-total td { background: color-mix(in srgb, var(--teal-soft) 50%, var(--surface)); }
.manhours-table tfoot .overall-total td { background: var(--teal-soft); }

/* ── KPI rows ── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.schedule-panel .kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.kpi {
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  transition: all var(--transition);
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); 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.6rem; font-weight: 800; line-height: 1; }
.kpi small { display: block; margin-top: 8px; color: var(--muted); font-size: 0.74rem; line-height: 1.35; }

/* ── Summary grid ── */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.curve-panel { grid-column: 1 / -1; order: -1; }

/* ── Curve chart ── */
.curve-chart-stage {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 22% 12%, rgba(241, 91, 34, 0.04), transparent 30%),
    var(--surface-soft);
}

.curve-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.curve-chart-head strong { display: block; margin-bottom: 3px; font-size: 1rem; }
.curve-chart-head span { color: var(--muted); font-size: 0.82rem; }
.curve-chart-head.single { align-items: center; margin-bottom: 12px; }

.curve-options {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.curve-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  transition: all var(--transition);
}
.curve-option::before { width: 8px; height: 8px; border-radius: 999px; background: var(--line-color); content: ""; }
.curve-option b { color: var(--ink); font-size: 0.86rem; }
.curve-option.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.curve-metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
  margin: 0 0 10px;
  padding: 10px 0 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}
.curve-metric-row span { display: inline-flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.curve-metric-row b { color: var(--ink); font-family: "JetBrains Mono", monospace; font-size: 1rem; }
.curve-metric-row .bad b { color: var(--red); }
.curve-metric-row .good b { color: var(--green); }

.curve-visual-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 14px;
  align-items: center;
}

.curve-latest-panel {
  border: 1px solid var(--line);
  border-left: 5px solid var(--line-color);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
}
.curve-latest-panel span, .curve-latest-panel small, .curve-latest-panel em {
  display: block; color: var(--muted); font-size: 0.74rem; font-style: normal; font-weight: 700; text-transform: uppercase;
}
.curve-latest-panel strong { display: block; margin: 6px 0 4px; font-family: "JetBrains Mono", monospace; font-size: 2rem; line-height: 1; }
.curve-latest-panel em { margin-top: 12px; text-transform: none; line-height: 1.35; }

.curve-increment-panel {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  margin-top: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)),
    var(--surface-soft);
}
.curve-increment-panel strong, .curve-increment-panel span { display: block; }
.curve-increment-panel strong { margin-bottom: 6px; color: var(--ink); font-size: 0.82rem; line-height: 1.2; text-transform: uppercase; }
.curve-increment-panel span { color: var(--muted); font-size: 0.78rem; line-height: 1.45; }

.increment-bars {
  display: grid;
  grid-template-columns: repeat(12, minmax(54px, 1fr));
  gap: 8px;
  align-items: end;
  min-height: 152px;
  padding: 14px 14px 12px;
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(to top, rgba(148, 163, 184, 0.11) 1px, transparent 1px) 0 14px / 100% 30px,
    rgba(2, 8, 23, 0.16);
}

.increment-bar {
  display: grid;
  grid-template-rows: 108px auto auto;
  gap: 6px;
  min-width: 0;
  height: auto;
  color: var(--muted);
  text-align: center;
  background: none;
}

.increment-bar-box {
  position: relative;
  display: block;
  height: 108px;
  border-bottom: 2px solid rgba(148, 163, 184, 0.24);
}
.increment-bar-box i {
  display: block;
  position: absolute;
  right: 50%;
  bottom: 0;
  width: min(34px, 72%);
  min-height: 8px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #fb923c 0%, #f97316 100%);
  box-shadow: 0 8px 16px rgba(249, 115, 22, 0.16);
  transform: translateX(50%);
  transition: height 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.increment-bar.latest .increment-bar-box i { width: min(38px, 78%); box-shadow: 0 0 0 1px rgba(251, 146, 60, 0.25), 0 10px 20px rgba(249, 115, 22, 0.22); }
.increment-bar.negative .increment-bar-box i { background: linear-gradient(180deg, #fb7185 0%, #ef4444 100%); box-shadow: 0 10px 18px rgba(239, 68, 68, 0.18); }
.increment-bar b { color: var(--ink); font-family: "JetBrains Mono", monospace; font-size: 0.72rem; line-height: 1; white-space: nowrap; }
.increment-bar small { overflow: hidden; color: var(--muted); font-size: 0.66rem; font-weight: 700; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }

.curve-svg { display: block; width: 100%; height: auto; max-height: 390px; }
.curve-svg.single-curve { margin-top: 2px; }
.curve-grid { stroke: rgba(100, 116, 139, 0.12); stroke-width: 1; }
.curve-axis { stroke: rgba(100, 116, 139, 0.35); stroke-width: 1.2; }
.curve-axis-label { fill: var(--muted); font-size: 13px; font-weight: 600; }
.curve-line { fill: none; stroke: var(--line-color); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1)); }
.curve-area { fill: var(--line-color); opacity: 0.1; }
.curve-point { fill: var(--surface); stroke: var(--line-color); stroke-width: 2.2; opacity: 0.86; }
.curve-dot { fill: var(--surface); stroke: var(--line-color); stroke-width: 4; filter: drop-shadow(0 3px 8px rgba(0,0,0,0.15)); }
.curve-reading { min-height: 86px; }

/* ── Split layout ── */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
}
.split.single-column { grid-template-columns: 1fr; }
.next-window-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mdr-pending-grid .focus-list { max-height: 470px; overflow: auto; padding-right: 4px; }

/* ── Lists ── */
.focus-list, .task-list, .discipline-list {
  display: grid;
  gap: 8px;
  margin: 0; padding: 0;
  list-style: none;
}

.focus-list li, .task-item, .discipline-item {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: all var(--transition);
}
.focus-list li:hover, .task-item:hover, .discipline-item:hover {
  border-color: color-mix(in srgb, var(--teal) 30%, var(--line));
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.focus-list b, .task-item b, .discipline-item b { display: block; margin-bottom: 4px; font-size: 0.86rem; line-height: 1.3; }
.focus-list span, .task-item span, .discipline-item span { color: var(--muted); font-size: 0.78rem; }

/* ── Bars ── */
.bar-list { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 0.75fr) minmax(0, 1fr) 54px; align-items: center; gap: 8px; }
.bar-row strong { overflow: hidden; font-size: 0.82rem; text-overflow: ellipsis; white-space: nowrap; }
.bar-row span:last-child { color: var(--muted); font-size: 0.76rem; font-weight: 700; text-align: right; }
.track { position: relative; height: 8px; overflow: hidden; border-radius: 999px; background: var(--line); }
.fill { position: absolute; inset: 0 auto 0 0; width: var(--value); border-radius: inherit; background: var(--teal); transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1); }
.fill.green { background: var(--green); }
.fill.amber { background: var(--amber); }
.fill.red { background: var(--red); }

/* ── Detail grid / Vendor ── */
.detail-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.ptr-detail-grid { grid-template-columns: 1fr; }

.vendor-load-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}

.vendor-load-card {
  display: grid;
  gap: 12px;
  min-height: 210px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  background: var(--surface);
  transition: all var(--transition);
}
.vendor-load-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.vendor-load-card.critical { border-left-color: var(--red); }
.vendor-load-card.behind { border-left-color: var(--amber); }

.vendor-load-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.vendor-load-head strong { display: block; margin-bottom: 4px; font-size: 0.88rem; line-height: 1.2; }
.vendor-load-head span { display: block; color: var(--muted); font-size: 0.74rem; line-height: 1.35; }

.vendor-load-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.vendor-load-stats span { min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); text-align: center; }
.vendor-load-stats small, .vendor-load-stats strong { display: block; }
.vendor-load-stats small { color: var(--muted); font-size: 0.65rem; font-weight: 700; text-transform: uppercase; }
.vendor-load-stats strong { margin-top: 3px; font-family: "JetBrains Mono", monospace; font-size: 0.88rem; }
.vendor-load-stats .bad strong { color: var(--red); }
.vendor-load-stats .good strong { color: var(--green); }

.vendor-update-list { display: grid; gap: 4px; margin: 0; padding: 0; color: var(--muted); font-size: 0.74rem; line-height: 1.35; list-style: none; }
.vendor-update-list li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Tags ── */
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.tag.green { background: var(--green-soft); color: var(--green); }

.task-item, .discipline-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.empty { padding: 14px; color: var(--muted); font-size: 0.88rem; }

/* ── 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); }

/* ────────────────────────────────────────────
   OFFSHORE DARK THEME
   ──────────────────────────────────────────── */
body.theme-offshore {
  --bg: #0c1221;
  --surface: #151d2e;
  --surface-soft: #1a2438;
  --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;
  --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);
  --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 .live-badge {
  background: var(--green-soft);
}

body.theme-offshore .dashboard-countdown {
  background:
    linear-gradient(135deg, rgba(249, 115, 22, 0.08) 0%, rgba(21, 29, 46, 0.95) 50%, rgba(56, 189, 248, 0.06) 100%),
    var(--surface);
  border-color: var(--line);
}
body.theme-offshore .dashboard-countdown::before {
  background: linear-gradient(90deg, #f97316, #38bdf8, #f97316);
  background-size: 200% 100%;
}

body.theme-offshore .dashboard-countdown-mermaid::before {
  background: linear-gradient(90deg, #38bdf8, #22c55e, #38bdf8);
  background-size: 200% 100%;
}

body.theme-offshore .countdown-digit {
  background: rgba(255,255,255,0.03);
  border-color: var(--line);
}
body.theme-offshore .countdown-digit strong { color: #f97316; }

body.theme-offshore .visual-dashboard,
body.theme-offshore .panel,
body.theme-offshore .overview-panel {
  background: var(--surface);
  border-color: var(--line);
}

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

body.theme-offshore .visual-card {
  background: rgba(255,255,255,0.03);
  border-color: var(--line);
}
body.theme-offshore .visual-card:hover {
  background: rgba(255,255,255,0.05);
}

body.theme-offshore .visual-card-icon {
  background: rgba(255,255,255,0.04);
}

body.theme-offshore .visual-ring {
  background: conic-gradient(var(--card-color) calc(var(--value) * 1%), #2d3f5a 0);
}
body.theme-offshore .visual-ring::before { background: var(--surface); }
body.theme-offshore .visual-ring b { color: var(--ink); }

body.theme-offshore .rtm-front-card,
body.theme-offshore .kpi,
body.theme-offshore .manhours-package-card,
body.theme-offshore .manhours-total-card,
body.theme-offshore .vendor-load-card,
body.theme-offshore .focus-list li,
body.theme-offshore .task-item,
body.theme-offshore .discipline-item {
  background: rgba(255,255,255,0.03);
  border-color: var(--line);
}

body.theme-offshore .kpi span,
body.theme-offshore .rtm-front-card span,
body.theme-offshore .countdown-digit strong,
body.theme-offshore .manhours-total-card strong,
body.theme-offshore .manhours-package-card strong {
  color: #f97316;
}

body.theme-offshore .manhours-table { background: var(--surface); border-color: var(--line); }
body.theme-offshore .manhours-table th, body.theme-offshore .manhours-table td { border-color: var(--line); }
body.theme-offshore .manhours-table th { background: rgba(255,255,255,0.03); }
body.theme-offshore .manhours-table tfoot td,
body.theme-offshore .manhours-table tfoot .package-total td,
body.theme-offshore .manhours-table tfoot .overall-total td { background: rgba(249, 115, 22, 0.1); }
body.theme-offshore .manhours-table tbody tr:hover { background: rgba(255,255,255,0.03); }

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;
}

body.theme-offshore .track { background: #2d3f5a; }
body.theme-offshore .vendor-load-stats span { background: rgba(255,255,255,0.03); border-color: var(--line); }
body.theme-offshore .curve-options { background: rgba(255,255,255,0.03); border-color: var(--line); }
body.theme-offshore .curve-option.active { background: var(--surface); box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
body.theme-offshore .curve-chart-stage { background: rgba(255,255,255,0.01); }
body.theme-offshore .curve-latest-panel { background: var(--surface); border-color: var(--line); }
body.theme-offshore .curve-increment-panel {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)),
    rgba(255,255,255,0.02);
  border-color: var(--line);
}
body.theme-offshore .tag { border: 1px solid rgba(255,255,255,0.06); }

/* ── Responsive ── */
@media (max-width: 1280px) {
  .dashboard-countdown-wrap { grid-template-columns: 1fr; }
  .visual-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vendor-load-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .app-shell { grid-template-columns: 1fr; }

  .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 { align-items: flex-start; flex-wrap: wrap; padding: 12px 16px; }
  .topbar-actions { width: 100%; margin-left: 0; }
  .updated-badge { width: 100%; }

  .summary-grid { grid-template-columns: 1fr; }
  .dashboard-countdown-wrap { grid-template-columns: 1fr; }
  .dashboard-countdown { grid-template-columns: 1fr; }
  .manhours-head { grid-template-columns: 1fr; }
  .rtm-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .curve-panel { grid-column: auto; }
  .curve-visual-layout, .curve-increment-panel { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .visual-card-grid,
  .rtm-summary-grid,
  .kpi-row,
  .schedule-panel .kpi-row,
  .manhours-package-strip,
  .next-window-list,
  .vendor-load-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-countdown-grid { flex-wrap: wrap; justify-content: center; }
  .countdown-digit { min-width: 70px; flex: 1; }

  .topbar h1 { font-size: 1.05rem; }
  .split { grid-template-columns: 1fr; }
  .curve-chart-head { display: grid; }
  .curve-options { display: grid; grid-template-columns: 1fr; }
  .task-item, .discipline-item { grid-template-columns: 1fr; }
}

/* Quick-nav fallback (hidden by default, kept for script.js compat) */
.quick-nav { display: none; }

/* ════════════════════════════════════════
   HOME PAGE FINAL POLISH (20260524-final)
   Bring home page in line with the refined
   management-grade look of all other pages.
   ════════════════════════════════════════ */

/* ── Dashboard countdown — premium feel ── */
.dashboard-countdown {
  background:
    linear-gradient(135deg, rgba(249, 115, 22, 0.08) 0%, rgba(21, 29, 46, 0.4) 50%, rgba(56, 189, 248, 0.06) 100%),
    var(--surface) !important;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2), 0 8px 24px rgba(0,0,0,0.15);
}
.dashboard-countdown h2 {
  color: var(--ink);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.015em;
}
.dashboard-countdown .eyebrow { color: #fb923c; }
.dashboard-countdown .meta-line { color: var(--muted); }

.countdown-digit {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: all 200ms ease;
}
.countdown-digit:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(249, 115, 22, 0.3);
}
.countdown-digit strong {
  color: #f97316;
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
}
.countdown-digit span {
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.08em;
}
.countdown-sep { color: rgba(255,255,255,0.2); font-weight: 700; }

.dashboard-countdown-wrap .dashboard-countdown {
  grid-template-columns: minmax(220px, 0.82fr) minmax(0, 1fr);
  gap: clamp(12px, 1.15vw, 18px);
  min-height: 168px;
  padding: clamp(18px, 1.35vw, 24px) clamp(18px, 1.6vw, 28px);
}

.dashboard-countdown-wrap .countdown-info {
  min-width: 0;
  max-width: 340px;
}

.dashboard-countdown-wrap .dashboard-countdown h2 {
  font-size: clamp(1.3rem, 1.35vw, 1.55rem);
  line-height: 1.15;
}

.dashboard-countdown-wrap .dashboard-countdown .meta-line {
  max-width: 15rem;
  line-height: 1.3;
}

.dashboard-countdown-wrap .dashboard-countdown-grid {
  justify-content: flex-end;
  flex-wrap: nowrap;
  min-width: 0;
  max-width: 100%;
  gap: clamp(3px, 0.35vw, 5px);
}

.dashboard-countdown-wrap .countdown-digit {
  flex: 0 1 clamp(64px, 4.1vw, 84px);
  min-width: 0;
  padding: 12px 7px;
}

.dashboard-countdown-wrap .countdown-digit strong {
  font-size: clamp(1.65rem, 1.95vw, 2.2rem);
}

.dashboard-countdown-wrap .countdown-digit span {
  font-size: 0.62rem;
}

.dashboard-countdown-wrap .countdown-sep {
  flex: 0 0 8px;
  padding-bottom: 14px;
  font-size: 1.1rem;
  text-align: center;
}

/* Standardize countdown cards across laptop zoom and viewport differences */
.dashboard-countdown-wrap {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 760px), 1fr));
  align-items: stretch;
}

@media (max-width: 1720px) {
  .dashboard-countdown-wrap {
    grid-template-columns: 1fr;
  }

  .dashboard-countdown-wrap .dashboard-countdown {
    grid-template-columns: minmax(260px, 0.78fr) minmax(360px, 1fr);
  }
}

@media (max-width: 820px) {
  .dashboard-countdown-wrap .dashboard-countdown {
    grid-template-columns: 1fr;
  }

  .dashboard-countdown-wrap .countdown-info {
    max-width: none;
  }

  .dashboard-countdown-wrap .dashboard-countdown-grid {
    justify-content: stretch;
  }

  .dashboard-countdown-wrap .countdown-digit {
    flex-basis: 0;
    max-width: none;
  }
}

/* ── Visual cards — refined ── */
.visual-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: all 250ms cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.visual-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  border-color: var(--card-color, rgba(249, 115, 22, 0.4));
}
.visual-card.amber { --card-color: #fbbf24; --card-soft: rgba(251, 191, 36, 0.12); }
.visual-card.red    { --card-color: #ef4444; --card-soft: rgba(239, 68, 68, 0.12); }
.visual-card.green  { --card-color: #10b981; --card-soft: rgba(16, 185, 129, 0.12); }
.visual-card.blue   { --card-color: #38bdf8; --card-soft: rgba(56, 189, 248, 0.12); }
.visual-card-icon {
  background: var(--card-soft, rgba(249, 115, 22, 0.12));
  color: var(--card-color, #fb923c);
  border-radius: 10px;
}
.visual-card-text strong {
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.005em;
}
.visual-card-text span,
.visual-card-text small { color: var(--muted); font-weight: 600; }
.visual-ring b {
  color: var(--ink);
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
}

/* ── RTM front cards — modern stat tiles ── */
.rtm-front-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: all 200ms ease;
}
.rtm-front-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(249, 115, 22, 0.3);
  transform: translateY(-1px);
}
.rtm-front-card strong {
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0.06em;
}
.rtm-front-card span {
  color: #f97316;
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
}
.rtm-front-card small { color: var(--muted); }
.rtm-front-card.warn span { color: #f87171; }
.rtm-front-card.good span { color: #34d399; }
.rtm-front-card.watch span { color: #fbbf24; }

/* ── Manhours cards refinement ── */
.manhours-overall-card,
.manhours-total-card {
  background: rgba(249, 115, 22, 0.06);
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: 12px;
  padding: 14px 18px;
}
.manhours-overall-card strong,
.manhours-total-card strong {
  color: #f97316;
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
}

.manhours-package-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  transition: all 200ms ease;
}
.manhours-package-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(249, 115, 22, 0.3);
  transform: translateY(-1px);
}
.manhours-package-card strong {
  color: #fb923c;
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
}

/* Manhours table — clean professional look */
.manhours-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.manhours-table th {
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 0.7rem;
  text-transform: uppercase;
  padding: 12px 14px;
  text-align: left;
}
.manhours-table td {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  padding: 11px 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.86rem;
}
.manhours-table tbody tr:nth-child(even) td {
  background: var(--surface-soft);
}
.manhours-table tbody tr:hover td {
  background: rgba(249, 115, 22, 0.06);
}
.manhours-table tfoot td,
.manhours-table .package-total td,
.manhours-table .overall-total td {
  background: rgba(249, 115, 22, 0.08) !important;
  color: var(--ink);
  font-weight: 800;
  border-color: rgba(249, 115, 22, 0.2);
}
.manhours-table .overall-total td {
  background: rgba(249, 115, 22, 0.12) !important;
  font-size: 0.92rem;
}

/* ── Overview panel refinement ── */
.overview-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.overview-panel .panel-head {
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--line);
}
.overview-panel .panel-head h2 { color: var(--ink); font-weight: 800; }
.overview-panel .panel-head .eyebrow { color: #fb923c; }

/* KPI row inside overview panels */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.kpi {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  transition: all 200ms ease;
}
.kpi:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(249, 115, 22, 0.3);
}
.kpi strong { color: var(--muted); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.kpi span {
  color: #f97316;
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
  font-size: 1.5rem;
}

/* ── Focus lists (Next 30 Days, Top 10 Pending IFR/IAF) ── */
.focus-list li,
.task-item,
.discipline-item {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px;
  padding: 12px 14px;
  transition: all 200ms ease;
}
.focus-list li:hover,
.task-item:hover,
.discipline-item:hover {
  background: rgba(255, 255, 255, 0.07) !important;
  border-color: rgba(249, 115, 22, 0.3) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.focus-list b,
.task-item b,
.discipline-item b {
  color: var(--ink);
  font-weight: 700;
}
.focus-list span,
.task-item span,
.discipline-item span {
  color: var(--muted);
  font-weight: 500;
}

/* ── Curve panels ── */
.curve-options {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}
.curve-option { color: var(--muted); }
.curve-option:hover { color: var(--ink); }
.curve-option.active {
  background: rgba(249, 115, 22, 0.12);
  border-radius: 6px;
  color: #fb923c;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.curve-option b { color: var(--ink); }
.curve-option.active b { color: #fb923c; }

.curve-chart-stage {
  background:
    radial-gradient(circle at 22% 12%, rgba(249, 115, 22, 0.04), transparent 30%),
    rgba(255, 255, 255, 0.02);
}
.curve-metric-row {
  border-top-color: var(--line);
  border-bottom-color: var(--line);
  color: var(--muted);
}
.curve-metric-row b { color: var(--ink); font-family: "JetBrains Mono", monospace; }
.curve-metric-row .good b { color: #34d399; }
.curve-metric-row .bad b { color: #f87171; }

.curve-latest-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-color, #f97316);
}
.curve-increment-panel {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015)),
    rgba(255, 255, 255, 0.02);
  border-color: var(--line);
}
.curve-axis-label,
.curve-axis { color: var(--muted); }
.curve-grid { stroke: rgba(255, 255, 255, 0.06); }

/* Increment bars */
.increment-bar {
  background: none;
}
.increment-bar.negative,
.increment-bar.down {
  background: none;
}

/* ── Vendor load card ── */
.vendor-load-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  transition: all 200ms ease;
}
.vendor-load-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(249, 115, 22, 0.3);
  transform: translateY(-1px);
}
.vendor-load-card strong {
  color: var(--ink);
  font-weight: 800;
}
.vendor-load-card small,
.vendor-load-card span { color: var(--muted); }
.vendor-load-stats span {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* ── Panel link (Open X) buttons ── */
.panel-link {
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.3);
  color: #fb923c;
  font-weight: 700;
  border-radius: 8px;
  padding: 7px 14px;
  transition: all 200ms ease;
}
.panel-link:hover {
  background: rgba(249, 115, 22, 0.2);
  border-color: rgba(249, 115, 22, 0.5);
  color: #f97316;
  transform: translateY(-1px);
}

/* ── Status pill in topbar (Live badge) ── */
.live-badge {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-weight: 700;
  border-radius: 999px;
  padding: 6px 12px;
}
.live-dot {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  animation: live-pulse 2s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.05); }
}

/* ── Bar list (Actual vs Plan) ── */
.bar-row strong { color: var(--ink); font-weight: 700; }
.bar-row span:last-child {
  color: var(--ink);
  font-family: "JetBrains Mono", monospace;
  font-weight: 800;
}
.bar-row .track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  overflow: hidden;
  height: 8px;
}
.bar-row .bar {
  background: linear-gradient(90deg, #f97316, #ea580c);
  border-radius: 999px;
  height: 100%;
}
