:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #20252a;
  background: #edf0f1;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --orange: #f26a21;
  --orange-dark: #bd480c;
  --orange-soft: #fff0e7;
  --graphite: #20252a;
  --canvas: #edf0f1;
  --paper: #fff;
  --line: #dfe3e5;
  --muted: #687178;
  --muted-2: #8b949a;
  --green: #16815e;
  --red: #bf3e32;
  --shadow: 0 1px 2px rgba(20,26,31,.07), 0 10px 28px rgba(20,26,31,.05);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; min-width: 320px; min-height: 100%; margin: 0; }
body { overflow: hidden; background: var(--canvas); -webkit-font-smoothing: antialiased; }
.root-shell { position: relative; width: 100%; height: 100vh; background: #17130f; }
.root-shell .dashboard-frame { width: 100%; height: 100vh; }
.productive-standalone { min-height: 100vh; overflow: auto; }
.productive-standalone .productive-view { min-height: 100vh; }
button { font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid rgba(242,106,33,.3); outline-offset: 2px; }

.shell-header {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 64px;
  padding: 0 24px;
  color: #fff;
  background: var(--graphite);
  box-shadow: 0 6px 20px rgba(18,22,25,.16);
}
.brand { display: inline-flex; align-items: center; gap: 10px; width: max-content; color: inherit; text-decoration: none; }
.brand img { width: 38px; height: 42px; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0,0,0,.24)); }
.brand span { display: flex; flex-direction: column; gap: 1px; }
.brand strong { font-size: 11px; letter-spacing: .08em; }
.brand small { color: #9fa8ad; font-size: 8px; font-weight: 650; }
.view-tabs { display: inline-flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid rgba(255,255,255,.1); border-radius: 7px; background: rgba(255,255,255,.035); }
.view-tabs button { min-height: 38px; padding: 0 18px; border: 0; border-radius: 5px; color: #aeb7bc; background: transparent; cursor: pointer; font-size: 11px; font-weight: 800; transition: color 150ms ease, background 150ms ease, transform 150ms ease; }
.view-tabs button:hover { color: #fff; background: rgba(255,255,255,.07); }
.view-tabs button:active { transform: scale(.97); }
.view-tabs button[aria-selected="true"] { color: #fff; background: var(--orange); box-shadow: 0 5px 14px rgba(242,106,33,.24); }
.source-state { justify-self: end; display: inline-flex; align-items: center; gap: 7px; color: #aeb7bc; font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.source-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(22,129,94,.12); }

.shell-main { height: calc(100vh - 64px); }
.shell-view { position: relative; width: 100%; height: 100%; }
.shell-view:not(.is-active) { display: none; }
.dashboard-frame { display: block; width: 100%; height: 100%; border: 0; background: #17130f; }
.dashboard-loading { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; align-content: center; gap: 12px; color: #d6d0ca; background: radial-gradient(circle at 50% 38%,rgba(242,106,33,.16),transparent 29%),#17130f; transition: opacity 180ms ease, visibility 180ms ease; }
.dashboard-loading.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.dashboard-loading img { width: 54px; height: 60px; object-fit: contain; }
.dashboard-loading p { margin: 0; font-size: 12px; }

.productive-view { overflow: auto; padding: 28px; background: var(--canvas); }
#productive-content { width: min(1380px,100%); margin: 0 auto; padding-bottom: 40px; animation: surface-in 260ms cubic-bezier(.23,1,.32,1) both; }
@keyframes surface-in { from { opacity: 0; transform: translateY(7px); } }
.productive-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.eyebrow { margin: 0 0 7px; color: var(--orange-dark); font: 800 9px ui-monospace,Consolas,monospace; letter-spacing: .15em; text-transform: uppercase; }
.productive-heading h1 { max-width: 760px; margin: 0; font-size: clamp(27px,3vw,40px); line-height: 1.05; letter-spacing: -.035em; text-wrap: balance; }
.productive-heading .description { max-width: 760px; margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; text-wrap: pretty; }
.data-stamp { flex: 0 0 auto; padding: 8px 10px; color: var(--muted); background: #f8f9f9; border: 1px solid var(--line); border-radius: 5px; font-size: 9px; font-weight: 750; }
.source-summary { display: flex; align-items: flex-end; flex-direction: column; gap: 6px; flex: 0 0 auto; }
.source-summary small { color: var(--muted-2); font-size: 8px; }
.source-badge { display: inline-flex; align-items: center; gap: 7px; padding: 7px 9px; color: var(--muted); background: #f8f9f9; border: 1px solid var(--line); border-radius: 5px; font-size: 8px; font-weight: 850; letter-spacing: .08em; }
.source-badge i { width: 7px; height: 7px; border-radius: 50%; background: #c79035; }
.source-badge.is-active i { background: var(--green); box-shadow: 0 0 0 4px rgba(22,129,94,.1); }

.metric-strip { display: grid; grid-template-columns: repeat(6,1fr); margin-bottom: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); box-shadow: var(--shadow); }
.metric-strip article { display: grid; grid-template-columns: 1fr auto; gap: 4px; min-height: 98px; padding: 16px; border-right: 1px solid var(--line); }
.metric-strip article:last-child { border-right: 0; }
.metric-strip span { color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.metric-strip strong { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--graphite); font-size: 28px; font-variant-numeric: tabular-nums; }
.metric-strip small { color: var(--muted-2); font-size: 8px; }
.metric-strip .is-risk strong { color: var(--red); }
.metric-strip .is-accent strong { color: var(--orange-dark); }

.executive-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 12px; }
.panel { padding: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow); }
.panel-wide { grid-column: 1 / -1; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; font-size: 17px; letter-spacing: -.015em; }
.panel-heading p:last-child { max-width: 620px; margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.panel-heading > span { color: var(--orange-dark); font-size: 18px; }

.capacity-layout { display: grid; grid-template-columns: .9fr .65fr 2.45fr; gap: 8px; margin-top: 16px; }
.capacity-cycle, .capacity-throughput, .capacity-stages article { min-height: 104px; padding: 15px; border: 1px solid var(--line); border-radius: 5px; }
.capacity-cycle, .capacity-throughput, .capacity-stages article { display: flex; flex-direction: column; justify-content: center; }
.capacity-cycle { color: #fff; background: var(--graphite); border-color: var(--graphite); }
.capacity-throughput { background: var(--orange-soft); border-color: #f5d3c1; }
.capacity-stages { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.capacity-stages article { background: #fafbfb; }
.capacity-layout span { color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.capacity-cycle span { color: #b9c1c6; }
.capacity-layout strong { margin-top: 7px; color: var(--graphite); font-size: 20px; font-variant-numeric: tabular-nums; }
.capacity-cycle strong { color: #fff; font-size: 28px; }.capacity-throughput strong { color: var(--orange-dark); font-size: 28px; }
.capacity-layout small { margin-top: 5px; color: var(--muted-2); font-size: 8px; line-height: 1.35; }
.capacity-cycle small { color: #8f999f; }

.stage-list, .brand-list, .upcoming-list { display: grid; gap: 11px; margin-top: 16px; }
.stage-row { display: grid; grid-template-columns: minmax(100px,150px) 1fr 28px; align-items: center; gap: 10px; }
.stage-row span, .brand-row span { color: #596269; font-size: 9px; font-weight: 750; }
.stage-row b, .brand-row b { font-size: 10px; text-align: right; font-variant-numeric: tabular-nums; }
.data-progress { width: 100%; height: 7px; overflow: hidden; border: 0; border-radius: 99px; appearance: none; background: #edf0f1; }
.data-progress::-webkit-progress-bar { border-radius: 99px; background: #edf0f1; }
.data-progress::-webkit-progress-value { border-radius: 99px; background: linear-gradient(90deg,var(--orange),#ff9a62); }
.data-progress::-moz-progress-bar { border-radius: 99px; background: linear-gradient(90deg,var(--orange),#ff9a62); }
.data-progress.is-neutral::-webkit-progress-value { background: #525b61; }
.data-progress.is-neutral::-moz-progress-bar { background: #525b61; }
.brand-row { display: grid; grid-template-columns: 70px 1fr 28px; align-items: center; gap: 10px; }
.upcoming-list { grid-template-columns: 1fr 1fr; column-gap: 22px; }
.upcoming-row { display: grid; grid-template-columns: 84px 52px 1fr; align-items: center; gap: 8px; min-height: 62px; border-bottom: 1px solid var(--line); }
.upcoming-row time { color: var(--orange-dark); font: 750 8px ui-monospace,Consolas,monospace; }
.brand-pill { display: inline-flex; justify-content: center; padding: 4px 6px; border-radius: 4px; color: #506068; background: #edf1f2; font-size: 8px; font-weight: 850; }
.upcoming-row div { min-width: 0; }
.upcoming-row strong, .upcoming-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upcoming-row strong { font-size: 9.5px; }.upcoming-row small { margin-top: 4px; color: var(--muted-2); font-size: 8px; }
.empty { margin: 18px 0 0; color: var(--muted); font-size: 10px; }

.productive-loading, .productive-error { display: grid; place-items: center; align-content: center; min-height: calc(100vh - 120px); color: var(--muted); }
.productive-loading p, .productive-error p { margin: 12px 0 0; font-size: 11px; }
.loading-line { width: min(420px,70vw); height: 13px; border-radius: 4px; background: linear-gradient(90deg,#e3e7e9,#f8f9f9,#e3e7e9); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.loading-line.short { width: min(260px,48vw); margin-top: 7px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.productive-error strong { color: var(--graphite); }
.productive-error button { min-height: 40px; margin-top: 18px; padding: 0 15px; border: 0; border-radius: 5px; color: #fff; background: var(--orange); cursor: pointer; font-size: 11px; font-weight: 800; }

@media (max-width: 960px) {
  .shell-header { grid-template-columns: auto 1fr auto; padding-inline: 14px; }
  .brand span, .source-state { display: none; }
  .view-tabs { justify-self: center; }
  .productive-view { padding: 22px 14px; }
  .metric-strip { grid-template-columns: repeat(3,1fr); }
  .metric-strip article:nth-child(3) { border-right: 0; }
  .metric-strip article:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .executive-grid { grid-template-columns: 1fr; }
  .panel-wide { grid-column: 1; }
  .capacity-layout { grid-template-columns: 1fr 1fr; }
  .capacity-stages { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .shell-header { height: 58px; }
  .shell-main { height: calc(100vh - 58px); }
  .brand img { width: 32px; height: 36px; }
  .view-tabs button { min-height: 36px; padding-inline: 12px; font-size: 10px; }
  .productive-heading { align-items: flex-start; flex-direction: column; }
  .source-summary { align-items: flex-start; }
  .productive-heading h1 { font-size: 28px; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .metric-strip article, .metric-strip article:nth-child(3) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .metric-strip article:nth-child(even) { border-right: 0; }
  .metric-strip article:last-child { border-right: 0; border-bottom: 0; }
  .capacity-layout { grid-template-columns: 1fr; }
  .capacity-stages { grid-column: 1; grid-template-columns: 1fr 1fr; }
  .upcoming-list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
