:root {
  --ink: #17213b;
  --muted: #687089;
  --line: #dfe4ee;
  --surface: #ffffff;
  --canvas: #f3f5f9;
  --navy: #14213d;
  --blue: #2457d6;
  --cyan: #2a9dbe;
  --green: #2b9a66;
  --amber: #e59b2f;
  --red: #d9535f;
  --purple: #7967d8;
  --shadow: 0 14px 36px rgba(26, 38, 72, 0.08);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
.app-shell { max-width: 1560px; margin: 0 auto; padding: 0 32px 60px; }
.topbar { min-height: 112px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
h1, h2, p { margin: 0; }
h1 { margin-top: 4px; font-size: clamp(28px, 4vw, 43px); letter-spacing: -0.045em; font-weight: 750; }
.topbar h1 { max-width: 760px; line-height: 1.06; }
h2 { font-size: 19px; letter-spacing: -0.02em; }
.eyebrow { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: 0.16em; }
.sync-state { display: flex; gap: 10px; align-items: center; padding: 10px 14px; background: #eaf5ef; color: #206b48; border-radius: 999px; font-size: 13px; }
.pulse { width: 8px; height: 8px; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 5px rgba(43,154,102,.12); }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; }
.page-switcher { display: inline-flex; padding: 4px; background: #e8ecf4; border-radius: 12px; }
.page-switcher a { padding: 8px 11px; color: #556078; border-radius: 9px; font-size: 12px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.page-switcher a:hover { color: var(--ink); }
.page-switcher a.active { color: white; background: var(--navy); box-shadow: 0 4px 12px rgba(20,33,61,.15); }
.user-menu { display: inline-flex; align-items: center; gap: 8px; padding: 5px 6px 5px 5px; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 5px 18px rgba(26,38,72,.05); }
.user-avatar { display: grid; place-items: center; width: 30px; height: 30px; color: white; background: var(--blue); border-radius: 9px; font-size: 9px; font-weight: 850; letter-spacing: .04em; }
.user-name { color: #455069; font-size: 10px; font-weight: 750; text-transform: capitalize; }
.logout-button { padding: 6px 8px; color: #59647b; background: #f1f3f7; border: 0; border-radius: 7px; cursor: pointer; font-size: 9px; font-weight: 800; }
.logout-button:hover { color: white; background: var(--navy); }
.filter-trigger { display: inline-flex; align-items: center; gap: 9px; min-height: 42px; padding: 9px 13px; color: white; background: var(--navy); border: 0; border-radius: 11px; cursor: pointer; font-weight: 750; box-shadow: 0 8px 20px rgba(20,33,61,.14); }
.filter-trigger:hover { background: #1d3057; }
.filter-trigger strong { display: grid; place-items: center; min-width: 21px; height: 21px; padding: 0 6px; color: var(--navy); background: white; border-radius: 999px; font-size: 11px; }
.filter-icon { position: relative; width: 16px; height: 12px; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; }
.filter-icon::after { content: ""; position: absolute; left: 3px; right: 3px; top: 4px; border-top: 2px solid currentColor; }
.scope-line { display: flex; align-items: center; gap: 9px; min-height: 54px; margin: 10px 0 8px; color: var(--muted); font-size: 12px; }
.scope-line #selection-count { color: var(--ink); font-weight: 750; }
.scope-line #auto-refresh-state { margin-left: auto; }
.scope-dot { width: 7px; height: 7px; background: var(--blue); border-radius: 50%; }

.filter-shell { margin: 28px 0 22px; padding: 22px; background: var(--navy); color: white; border-radius: 20px; box-shadow: var(--shadow); }
.filter-heading, .panel-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.filter-heading h2 { margin-top: 4px; font-size: 23px; }
.filter-actions { display: flex; align-items: center; gap: 10px; }
.selection-count { color: #b9c5df; font-size: 13px; margin-right: 6px; }
.button { border: 0; border-radius: 10px; padding: 10px 16px; cursor: pointer; font-weight: 700; }
.button.primary { background: #fff; color: var(--navy); }
.button.ghost { color: white; background: rgba(255,255,255,.1); }
.button:hover { transform: translateY(-1px); }
.filters-grid { display: grid; grid-template-columns: repeat(6, minmax(145px, 1fr)); gap: 10px; margin-top: 18px; align-items: start; }
.filter-menu { position: relative; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 11px; }
.filter-menu summary { list-style: none; cursor: pointer; padding: 12px; display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; }
.filter-menu summary::-webkit-details-marker { display: none; }
.filter-menu summary span { color: #aebbd7; font-weight: 600; }
.check-list { max-height: 230px; overflow: auto; padding: 0 10px 10px; }
.check-list label { display: flex; gap: 8px; align-items: flex-start; padding: 7px 3px; color: #e3e9f6; font-size: 12px; line-height: 1.3; }
.check-list label[hidden] { display: none; }
.check-list input { accent-color: #fff; margin-top: 2px; }
.check-list .select-all-option { position: sticky; top: 0; z-index: 1; margin-bottom: 3px; padding: 9px 3px; color: white; background: var(--navy); border-bottom: 1px solid rgba(255,255,255,.14); font-weight: 800; }
.date-filter { grid-column: 1 / -1; display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 10px; }
.date-filter label { color: #aebbd7; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.date-filter input, .date-filter select { display: block; width: 100%; margin-top: 6px; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; padding: 9px 10px; color: white; background: rgba(255,255,255,.09); }
.date-filter select option { color: var(--ink); }

.drawer-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(10,18,35,.42); backdrop-filter: blur(2px); }
.filter-drawer { position: fixed; z-index: 31; top: 0; right: 0; bottom: 0; width: min(460px, 94vw); padding: 26px; overflow-y: auto; color: white; background: var(--navy); box-shadow: -24px 0 60px rgba(8,18,38,.24); transform: translateX(102%); transition: transform .24s ease; }
.filter-drawer[aria-hidden="false"] { transform: translateX(0); }
.drawer-open { overflow: hidden; }
.drawer-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,.12); }
.drawer-header h2 { margin-top: 5px; font-size: 30px; }
.drawer-header > div > p:last-child { margin-top: 8px; color: #b9c5df; font-size: 13px; }
.drawer-close { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; color: white; background: rgba(255,255,255,.09); border: 0; border-radius: 10px; cursor: pointer; font-size: 26px; line-height: 1; }
.drawer-actions { display: flex; justify-content: space-between; align-items: center; padding: 17px 0 4px; color: #b9c5df; font-size: 12px; }
.reset-button { padding: 7px 10px; color: white; background: transparent; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; cursor: pointer; font-weight: 700; }
.filter-drawer .filters-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 12px; }
.filter-drawer .filter-menu { background: rgba(255,255,255,.06); }
.filter-drawer .check-list { max-height: 260px; }
.filter-search { display: grid; gap: 6px; margin: 10px 12px 2px; color: #b9c5df; font-size: 11px; font-weight: 700; }
.filter-search input { width: 100%; padding: 10px 11px; color: white; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.14); border-radius: 9px; outline: none; }
.filter-search input::placeholder { color: #9eabc7; }
.filter-search input:focus { border-color: #7897ec; box-shadow: 0 0 0 3px rgba(92,132,239,.16); }
.filter-drawer .date-filter { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 11px; }
.date-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.kpi-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi { padding: 18px; min-height: 112px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 5px 20px rgba(26,38,72,.04); }
.kpi span { color: var(--muted); font-size: 12px; font-weight: 650; }
.kpi strong { display: block; margin-top: 13px; font-size: 31px; letter-spacing: -.04em; }
.kpi-percent { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 700; }
.kpi::before { content: ""; display: block; width: 28px; height: 3px; margin-bottom: 12px; background: var(--accent, var(--blue)); border-radius: 3px; }

.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.panel { min-height: 360px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.panel-wide { grid-column: 1 / -1; }
.panel-title > span { color: var(--muted); font-size: 12px; }
.panel-title h2 { margin-top: 4px; }
.panel-title-actions { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.title-with-help { display: flex; align-items: center; gap: 9px; }
.help-button { display: inline-grid; place-items: center; width: 25px; height: 25px; flex: 0 0 auto; padding: 0; color: var(--blue); background: #edf2ff; border: 1px solid #cfdafd; border-radius: 50%; cursor: pointer; font-size: 13px; font-weight: 850; line-height: 1; }
.help-button:hover { color: white; background: var(--blue); border-color: var(--blue); transform: translateY(-1px); }
.help-button:focus-visible { outline: 3px solid rgba(36,87,214,.2); outline-offset: 2px; }
.help-button-dark { color: white; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.28); }
.help-button-dark:hover { color: var(--navy); background: white; border-color: white; }
.hierarchy-panel { min-height: 520px; }
.hierarchy-title { align-items: flex-end; }
.hierarchy-controls { display: flex; align-items: flex-end; gap: 8px; }
.compact-button { padding: 9px 11px; color: #3d4967; background: #f4f6fa; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-size: 11px; font-weight: 750; }
.hierarchy-metrics { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 20px 0; }
.hierarchy-metrics > div { padding: 12px 14px; background: #f6f8fb; border: 1px solid #e8ebf2; border-radius: 11px; }
.hierarchy-metrics span { display: block; color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.hierarchy-metrics strong { display: block; margin-top: 5px; font-size: 21px; }
.hierarchy-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 18px; align-items: start; }
.hierarchy-tree { max-height: 650px; padding: 4px 8px 12px 0; overflow: auto; }
.initiative-tree-section + .initiative-tree-section { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.initiative-tree-section > h3 { margin: 0 0 8px 2px; color: var(--blue); font-size: 13px; }
.initiative-tree-section > h3 a { color: inherit; text-decoration: none; }
.initiative-tree-section > h3 a:hover { text-decoration: underline; }
.initiative-tree-section > h3 span { margin-left: 7px; color: #3e475e; font-weight: 650; }
.hierarchy-branch > summary { display: block; list-style: none; cursor: pointer; }
.hierarchy-branch > summary::-webkit-details-marker { display: none; }
.hierarchy-branch > summary .hierarchy-node::before { content: "+"; display: grid; place-items: center; position: absolute; left: -10px; top: 19px; width: 20px; height: 20px; color: var(--blue); background: #edf2ff; border-radius: 6px; font-weight: 850; }
.hierarchy-branch[open] > summary .hierarchy-node::before { content: "−"; }
.hierarchy-children { position: relative; margin-left: 25px; padding-left: 19px; border-left: 1px solid #d8dfeb; }
.hierarchy-node { position: relative; display: grid; grid-template-columns: 34px minmax(220px, 1fr) minmax(145px, .55fr) 118px; gap: 12px; align-items: center; min-height: 58px; margin: 7px 0; padding: 9px 11px 9px 18px; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 3px 12px rgba(26,38,72,.04); }
.hierarchy-node.context-node { opacity: .58; border-style: dashed; }
.node-type { display: grid; place-items: center; width: 31px; height: 31px; color: white; background: var(--navy); border-radius: 9px; font-size: 10px; font-weight: 850; letter-spacing: .04em; }
.node-copy { min-width: 0; }
.node-copy > div { display: flex; align-items: center; gap: 7px; }
.node-copy strong, .node-copy a { color: var(--blue); font-size: 12px; font-weight: 800; text-decoration: none; }
.node-copy a:hover { text-decoration: underline; }
.node-copy p { margin-top: 4px; overflow: hidden; color: #3e475e; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.node-project { padding: 2px 5px; color: var(--muted); background: #f0f2f6; border-radius: 5px; font-size: 9px; font-weight: 800; }
.node-meta { display: grid; justify-items: start; gap: 5px; min-width: 0; color: var(--muted); font-size: 10px; }
.node-meta > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-chip { padding: 4px 7px; color: #4e5b75; background: #edf0f5; border-radius: 999px; font-weight: 750; }
.status-done { color: #21704d; background: #e6f5ed; }
.status-indeterminate { color: #9a6418; background: #fff3db; }
.status-new { color: #3154a4; background: #e9efff; }
.node-progress { display: grid; grid-template-columns: 1fr 30px; align-items: center; gap: 6px; height: 6px; background: #edf0f5; border-radius: 999px; }
.node-progress span { height: 100%; width: var(--progress); background: var(--green); border-radius: inherit; }
.node-progress b { color: var(--muted); font-size: 9px; }
.linked-work { padding: 15px; background: #f7f8fb; border: 1px solid var(--line); border-radius: 13px; }
.linked-work > .eyebrow { margin-bottom: 10px; }
.linked-card { padding: 11px 0; border-top: 1px solid #e3e7ef; }
.linked-card:first-child { border-top: 0; }
.linked-card > div { display: flex; justify-content: space-between; gap: 8px; }
.linked-card strong, .linked-card a { color: var(--blue); font-size: 12px; font-weight: 800; text-decoration: none; }
.linked-card a:hover { text-decoration: underline; }
.linked-card span { color: var(--purple); font-size: 10px; font-weight: 750; }
.linked-card p { margin-top: 5px; color: #424c63; font-size: 11px; line-height: 1.35; }
.linked-card small { display: block; margin-top: 6px; color: var(--muted); }
.empty.small { padding: 12px 0; font-size: 11px; }
.legend { display: flex; gap: 18px; justify-content: flex-end; margin: 8px 0; color: var(--muted); font-size: 12px; }
.legend span::before, .chart-legend i { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 2px; }
.total-dot::before { height: 4px !important; background: var(--green); vertical-align: middle; }
.planned-dot::before { background: #39b77d; }
.actual-dot::before { background: #172033; }
.burnup-legend { align-items: center; flex-wrap: wrap; }
.burnup-legend strong { padding: 5px 8px; color: #a4202e; background: #ffe7e9; border: 1px solid #f4c4c9; border-radius: 7px; font-size: 11px; }
.burnup-chart-wrap { position: relative; }
#burnup-chart { display: block; width: 100%; max-height: 320px; cursor: crosshair; }
.burnup-tooltip { position: absolute; z-index: 4; width: min(330px, calc(100% - 16px)); padding: 13px; color: var(--ink); background: rgba(255,255,255,.98); border: 1px solid #dce2eb; border-radius: 12px; box-shadow: 0 14px 38px rgba(17,31,60,.2); backdrop-filter: blur(5px); }
.burnup-tooltip[hidden] { display: none; }
.burnup-tooltip-title { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 7px; padding-bottom: 9px; border-bottom: 1px solid #e7eaf0; }
.burnup-tooltip-title > span { width: 8px; height: 8px; border-radius: 50%; }
.burnup-tooltip-title > span.planned { background: #39b77d; box-shadow: 0 0 0 4px rgba(57,183,125,.13); }
.burnup-tooltip-title > span.actual { background: #172033; box-shadow: 0 0 0 4px rgba(23,32,51,.1); }
.burnup-tooltip-title strong { font-size: 11px; }
.burnup-tooltip-title em { color: var(--muted); font-size: 9px; font-style: normal; font-weight: 750; }
.burnup-tooltip-list { display: grid; margin-top: 5px; }
.burnup-tooltip-list a { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 7px; padding: 7px 4px; color: inherit; border-radius: 6px; text-decoration: none; }
.burnup-tooltip-list a:hover { background: #f1f4fa; }
.burnup-tooltip-list strong { color: var(--blue); font-size: 10px; }
.burnup-tooltip-list span { overflow: hidden; color: #4e5870; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.burnup-tooltip > small { display: block; padding: 5px 4px 0; color: var(--muted); font-size: 9px; font-weight: 750; }
.dependency-panel { min-height: 360px; }
.dependency-view-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 750; }
.dependency-view-label select { padding: 8px 30px 8px 10px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 9px; font: inherit; outline: none; }
.dependency-view-label select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36,87,214,.1); }
.dependency-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 7px 0 20px; }
.dependency-kpi { padding: 13px 14px; background: #f7f8fb; border: 1px solid #e4e8f0; border-top: 3px solid var(--accent); border-radius: 11px; }
.dependency-kpi span { display: block; min-height: 26px; color: var(--muted); font-size: 10px; font-weight: 750; line-height: 1.25; }
.dependency-kpi strong { display: block; margin-top: 5px; font-size: 23px; }
.dependency-warning { margin-bottom: 14px; padding: 11px 13px; color: #8e2530; background: #fff0f1; border: 1px solid #f2c8cc; border-radius: 10px; font-size: 11px; font-weight: 750; }
.dependency-flow-header, .dependency-row { display: grid; grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr) 76px minmax(0, 1fr); gap: 10px; align-items: stretch; }
.dependency-flow-header { padding: 0 10px 8px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.dependency-flow { display: grid; gap: 10px; }
.dependency-row { padding: 11px; background: #fafbfc; border: 1px solid #e5e8ef; border-left: 4px solid var(--risk); border-radius: 13px; }
.dependency-red { --risk: var(--red); background: #fffafb; }
.dependency-amber { --risk: var(--amber); }
.dependency-card, .dependency-downstream { min-width: 0; padding: 12px; background: white; border: 1px solid #e2e6ee; border-radius: 10px; }
.dependency-card-top { display: flex; justify-content: space-between; gap: 8px; }
.dependency-card-top > div { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.dependency-card a, .dependency-downstream a { color: var(--blue); font-size: 11px; font-weight: 850; text-decoration: none; }
.dependency-card a:hover, .dependency-downstream a:hover { text-decoration: underline; }
.dependency-card-top > span { color: var(--muted); font-size: 9px; font-weight: 750; white-space: nowrap; }
.dependency-card em { padding: 3px 6px; color: var(--risk); background: color-mix(in srgb, var(--risk) 10%, white); border-radius: 999px; font-size: 8px; font-style: normal; font-weight: 850; letter-spacing: .03em; text-transform: uppercase; }
.dependency-card p { margin: 7px 0 9px; color: #3f4960; font-size: 11px; line-height: 1.35; }
.dependency-card-meta { display: flex; flex-wrap: wrap; gap: 5px 10px; color: var(--muted); font-size: 9px; }
.dependency-overdue { color: #b42635; font-weight: 850; }
.dependency-card-empty { display: flex; flex-direction: column; justify-content: center; color: var(--muted); }
.dependency-card-empty strong { color: #5d667b; font-size: 11px; }
.dependency-card-empty span { margin-top: 5px; font-size: 9px; line-height: 1.35; }
.dependency-arrow { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; color: var(--risk); }
.dependency-arrow span { font-size: 24px; line-height: 1; }
.dependency-arrow small { max-width: 74px; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 8px; font-weight: 750; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.dependency-downstream { display: grid; align-content: center; gap: 7px; }
.dependency-downstream > div { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 7px; min-width: 0; }
.dependency-downstream span { overflow: hidden; color: #59637a; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.dependency-downstream small { color: var(--muted); font-size: 9px; font-weight: 750; }
.dependency-footnote { min-height: 14px; margin-top: 10px; color: var(--muted); font-size: 9px; text-align: right; }
.dependency-empty { grid-column: 1 / -1; }
.donut-wrap { position: relative; width: 230px; margin: 24px auto 10px; }
.donut-wrap canvas { width: 230px; height: 230px; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-center strong { font-size: 30px; letter-spacing: -.04em; }
.donut-center span { color: var(--muted); font-size: 12px; }
.chart-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 12px; }
.status-view-toggle { display: inline-flex; padding: 3px; background: #eef1f6; border: 1px solid #e0e5ee; border-radius: 9px; }
.status-view-toggle button { padding: 6px 9px; color: var(--muted); background: transparent; border: 0; border-radius: 6px; cursor: pointer; font-size: 9px; font-weight: 800; }
.status-view-toggle button[aria-pressed="true"] { color: white; background: var(--navy); box-shadow: 0 2px 5px rgba(18,32,61,.18); }
.status-view-toggle button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.bar-list { display: grid; gap: 13px; margin-top: 25px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 1.2fr) 3fr 48px; align-items: center; gap: 12px; font-size: 12px; }
.bar-row .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #3c4560; }
.bar-track { height: 8px; background: #edf0f5; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; width: var(--width); background: var(--bar-color, var(--blue)); border-radius: inherit; transition: width .4s ease; }
.bar-value { text-align: right; font-weight: 750; }

.issues-panel { min-height: 430px; }
.table-search { color: var(--muted); font-size: 11px; font-weight: 700; }
.table-search input { width: min(320px, 42vw); margin-left: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; }
.table-wrap { margin-top: 17px; overflow: auto; max-height: 520px; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { position: sticky; top: 0; z-index: 1; background: white; padding: 13px 10px; color: var(--muted); text-align: left; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
td { padding: 12px 10px; border-top: 1px solid #edf0f5; vertical-align: middle; }
tr.overdue-row td { color: #8e2530; background: #fff0f1; border-top-color: #f2c8cc; }
tr.overdue-row .issue-summary { color: #74242c; }
tr.overdue-row .pill { color: #8e2530; background: #f9dadd; }
.due-date-cell { min-width: 125px; }
.due-date-cell strong { display: block; margin-top: 4px; color: #bd2938; font-size: 10px; }
.due-date-cell .due-today { color: #a86408; }
.issue-cell { min-width: 280px; }
.issue-key { display: inline-block; min-width: 76px; color: var(--blue); font-weight: 800; text-decoration: none; }
.issue-summary { color: #444c62; }
.pill { display: inline-block; padding: 5px 8px; background: #edf2ff; color: #3154a4; border-radius: 999px; font-weight: 700; }
.empty { color: var(--muted); padding: 30px 0; text-align: center; }

.login-page { min-height: 100vh; background: #eef2f8; }
.login-shell { display: grid; grid-template-columns: minmax(330px, .9fr) minmax(440px, 1.1fr); width: min(1050px, calc(100vw - 40px)); min-height: 650px; margin: max(28px, calc((100vh - 650px) / 2)) auto 28px; overflow: hidden; background: white; border: 1px solid #dce2ec; border-radius: 25px; box-shadow: 0 30px 90px rgba(20,33,61,.16); }
.login-brand { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 58px; overflow: hidden; color: white; background: var(--navy); }
.login-brand::before { content: ""; position: absolute; width: 380px; height: 380px; right: -210px; top: -170px; background: rgba(48,99,230,.24); border-radius: 50%; }
.login-brand .eyebrow { color: #7ea2ff; }
.login-brand h1 { margin: 16px 0 25px; font-size: clamp(44px, 5vw, 66px); line-height: .96; }
.login-brand > p:not(.eyebrow) { max-width: 370px; color: #c4cee3; font-size: 14px; line-height: 1.65; }
.login-brand-mark { display: flex; align-items: end; gap: 7px; height: 54px; margin-top: 54px; }
.login-brand-mark span { width: 9px; background: #3d74f2; border-radius: 8px; }
.login-brand-mark span:nth-child(1) { height: 20px; }
.login-brand-mark span:nth-child(2) { height: 36px; background: #43bb83; }
.login-brand-mark span:nth-child(3) { height: 52px; background: #f1ae42; }
.login-card { display: flex; flex-direction: column; justify-content: center; padding: 70px clamp(45px, 7vw, 90px); }
.login-card h2 { margin-top: 10px; font-size: 34px; }
.login-intro { margin-top: 11px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.login-card form { display: grid; gap: 20px; margin-top: 34px; }
.login-card label { color: #3f4960; font-size: 11px; font-weight: 800; }
.login-card input { display: block; width: 100%; margin-top: 7px; padding: 13px 14px; color: var(--ink); background: #f8f9fb; border: 1px solid #dce2eb; border-radius: 10px; outline: none; }
.login-card input:focus { background: white; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(36,87,214,.1); }
.login-card label small { display: block; margin-top: 6px; color: var(--muted); font-size: 9px; font-weight: 600; }
.login-card label small strong { color: #46516a; }
.login-submit { display: flex; align-items: center; justify-content: space-between; margin-top: 5px; padding: 13px 15px; color: white; background: var(--blue); border: 0; border-radius: 10px; cursor: pointer; font-size: 12px; font-weight: 800; box-shadow: 0 10px 22px rgba(36,87,214,.2); }
.login-submit:hover { background: #1c49ba; }
.login-submit:disabled { cursor: wait; opacity: .68; }
.login-error { padding: 10px 12px; color: #942936; background: #fff0f1; border: 1px solid #f2c8cc; border-radius: 9px; font-size: 10px; }
.login-support { margin-top: 25px; color: var(--muted); font-size: 10px; text-align: center; }

.overview-shell main { padding-top: 28px; }
.overview-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.overview-intro h2 { margin-top: 5px; font-size: 27px; }
.overview-intro > div > p:last-child { margin-top: 7px; color: var(--muted); font-size: 13px; }
.overview-search { display: grid; gap: 6px; width: min(340px, 100%); color: var(--muted); font-size: 11px; font-weight: 750; }
.overview-search input { width: 100%; padding: 10px 12px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 10px; outline: none; }
.overview-search input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36,87,214,.1); }
.overview-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.overview-summary article { padding: 17px 18px; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 5px 20px rgba(26,38,72,.04); }
.overview-summary article::before { content: ""; display: block; width: 28px; height: 3px; margin-bottom: 10px; background: var(--accent); border-radius: 3px; }
.overview-summary span { color: var(--muted); font-size: 11px; font-weight: 700; }
.overview-summary strong { display: block; margin-top: 6px; font-size: 28px; }
.initiative-overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.initiative-overview-card { display: flex; flex-direction: column; min-height: 350px; padding: 20px; background: white; border: 1px solid var(--line); border-left: 5px solid var(--traffic); border-radius: 17px; box-shadow: var(--shadow); }
.initiative-overview-card.traffic-green { --traffic: var(--green); }
.initiative-overview-card.traffic-amber { --traffic: var(--amber); }
.initiative-overview-card.traffic-red { --traffic: var(--red); }
.initiative-card-heading { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
.traffic-light { display: grid; align-content: start; gap: 4px; width: 26px; padding: 5px; background: var(--navy); border-radius: 9px; }
.traffic-light i { width: 16px; height: 16px; background: #4d5870; border-radius: 50%; opacity: .28; }
.traffic-red .traffic-light i:nth-child(1) { background: #f15b66; opacity: 1; box-shadow: 0 0 0 4px rgba(241,91,102,.14); }
.traffic-amber .traffic-light i:nth-child(2) { background: #f0aa39; opacity: 1; box-shadow: 0 0 0 4px rgba(240,170,57,.14); }
.traffic-green .traffic-light i:nth-child(3) { background: #40ba7c; opacity: 1; box-shadow: 0 0 0 4px rgba(64,186,124,.14); }
.initiative-card-key { display: flex; align-items: center; gap: 8px; }
.initiative-card-key a, .initiative-card-key { color: var(--blue); font-size: 12px; font-weight: 850; text-decoration: none; }
.initiative-card-key a:hover { text-decoration: underline; }
.initiative-card-key span { padding: 3px 7px; color: var(--traffic); background: color-mix(in srgb, var(--traffic) 11%, white); border-radius: 999px; font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.initiative-card-heading h2 { margin-top: 6px; font-size: 18px; line-height: 1.25; }
.initiative-card-heading p { margin-top: 6px; color: var(--muted); font-size: 11px; }
.initiative-card-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 19px 0 15px; }
.initiative-card-metrics > div { padding: 11px; background: #f5f7fa; border: 1px solid #e8ebf2; border-radius: 10px; }
.initiative-card-metrics span { display: block; min-height: 25px; color: var(--muted); font-size: 9px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.initiative-card-metrics strong { display: block; margin-top: 4px; font-size: 21px; }
.initiative-risk-summary { padding: 13px 14px; background: color-mix(in srgb, var(--traffic) 7%, white); border-radius: 11px; }
.initiative-risk-summary > strong { color: #27324c; font-size: 12px; }
.initiative-risk-summary > span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.initiative-risk-summary p { margin-top: 8px; color: #505b73; font-size: 11px; line-height: 1.4; }
.initiative-detail-link { display: flex; justify-content: space-between; margin-top: auto; padding-top: 16px; color: var(--blue); font-size: 12px; font-weight: 800; text-decoration: none; }
.initiative-detail-link:hover { text-decoration: underline; }
.overview-empty { grid-column: 1 / -1; }

.help-open { overflow: hidden; }
.help-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(9,17,34,.52); backdrop-filter: blur(3px); }
.help-modal { position: fixed; z-index: 51; top: 50%; left: 50%; width: min(560px, calc(100vw - 32px)); max-height: min(680px, calc(100vh - 40px)); padding: 27px 28px 25px; overflow-y: auto; transform: translate(-50%, -50%); color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 19px; box-shadow: 0 28px 80px rgba(8,18,38,.3); }
.help-modal[hidden], .help-backdrop[hidden] { display: none; }
.help-modal h2 { margin-top: 7px; padding-right: 34px; font-size: 24px; }
.help-modal-close { position: absolute; top: 15px; right: 15px; display: grid; place-items: center; width: 35px; height: 35px; padding: 0; color: #59647c; background: #f1f3f7; border: 0; border-radius: 10px; cursor: pointer; font-size: 24px; line-height: 1; }
.help-modal-close:hover { color: white; background: var(--navy); }
.help-modal-body { display: grid; gap: 11px; margin-top: 17px; color: #4c566d; font-size: 13px; line-height: 1.55; }
.help-modal-body p { margin: 0; }
.help-modal-body strong { color: #26324d; }

.loading-overlay { position: fixed; right: 24px; bottom: 24px; display: none; align-items: center; gap: 10px; padding: 12px 16px; background: var(--navy); color: white; border-radius: 12px; box-shadow: var(--shadow); font-size: 13px; }
.loading-overlay.visible { display: flex; }
.spinner { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.3); border-top-color: white; border-radius: 50%; animation: spin .8s linear infinite; }
.toast { position: fixed; left: 50%; bottom: 25px; transform: translateX(-50%); display: none; padding: 12px 18px; background: var(--red); color: white; border-radius: 10px; box-shadow: var(--shadow); }
.toast.visible { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
  .hierarchy-layout { grid-template-columns: 1fr; }
  .linked-work { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 14px; }
  .initiative-overview-grid { grid-template-columns: 1fr; }
  .dependency-flow-header { display: none; }
  .dependency-row { grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr); }
  .dependency-row .dependency-arrow + .dependency-card + .dependency-arrow, .dependency-row > :last-child { display: none; }
}
@media (max-width: 760px) {
  .app-shell { padding: 0 14px 40px; }
  .topbar, .panel-title { align-items: flex-start; flex-direction: column; padding: 18px 0; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .page-switcher { order: -1; width: 100%; }
  .page-switcher a { flex: 1; text-align: center; }
  .sync-state { align-self: flex-start; }
  .scope-line { flex-wrap: wrap; margin-bottom: 12px; }
  .scope-line #auto-refresh-state { width: 100%; margin-left: 16px; }
  .filter-drawer { padding: 20px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .panel-wide { grid-column: auto; }
  .hierarchy-title { gap: 14px; }
  .hierarchy-controls { width: 100%; flex-wrap: wrap; }
  .hierarchy-metrics { grid-template-columns: repeat(3, 1fr); }
  .hierarchy-node { grid-template-columns: 32px minmax(150px, 1fr); }
  .node-meta { grid-column: 2; grid-template-columns: auto 1fr; }
  .node-progress { grid-column: 2; }
  .hierarchy-children { margin-left: 9px; padding-left: 12px; }
  .linked-work { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 100px 1fr 40px; }
  .table-search input { width: 100%; margin: 7px 0 0; }
  .panel-title-actions { width: 100%; justify-content: space-between; }
  .overview-intro { align-items: stretch; flex-direction: column; }
  .overview-summary { grid-template-columns: repeat(2, 1fr); }
  .initiative-card-metrics { grid-template-columns: repeat(2, 1fr); }
  .dependency-kpis { grid-template-columns: repeat(2, 1fr); }
  .dependency-row { grid-template-columns: 1fr; }
  .dependency-row .dependency-arrow { min-height: 25px; transform: rotate(90deg); }
  .dependency-row .dependency-arrow + .dependency-card + .dependency-arrow, .dependency-row > :last-child { display: flex; }
  .login-shell { grid-template-columns: 1fr; min-height: 0; margin: 18px auto; }
  .login-brand { min-height: 250px; padding: 38px; }
  .login-brand h1 { margin: 12px 0 18px; font-size: 42px; }
  .login-brand-mark { position: absolute; right: 32px; bottom: 30px; margin: 0; }
  .login-card { padding: 42px 32px; }
  .user-name { display: none; }
}
