:root {
  color-scheme: light;
  view-transition-name:none;
  --ink: #18202a;
  --muted: #77818d;
  --line: rgba(30, 42, 54, .1);
  --card: rgba(255, 255, 255, .86);
  --blue: #4267f5;
  --blue-deep: #2849ca;
  --green: #20a66a;
  --yellow: #e49b20;
  --red: #df4c56;
  --shadow: 0 18px 55px rgba(28, 43, 65, .09);
  --cursor-x: 72vw;
  --cursor-y: 18vh;
}

@property --progress {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei UI", "Segoe UI", sans-serif;
  background: #f3f6fb;
}
body::before {
  content: "";
  position: fixed;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(520px circle at var(--cursor-x) var(--cursor-y), rgba(85, 119, 245, .075), transparent 64%);
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.ambient { position: fixed; border-radius: 50%; filter: blur(2px); opacity: .55; pointer-events: none; }
.ambient-a { width: 430px; height: 430px; right: -150px; top: -180px; background: radial-gradient(circle, #c6d5ff, transparent 68%); animation:ambient-drift-a 18s ease-in-out infinite alternate; }
.ambient-b { width: 500px; height: 500px; left: 8%; bottom: -340px; background: radial-gradient(circle, #ccefe5, transparent 68%); animation:ambient-drift-b 22s ease-in-out infinite alternate; }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 30px; }
.login-card {
  position: relative; z-index: 1; width: min(410px, 100%); padding: 42px;
  border: 1px solid rgba(255,255,255,.9); border-radius: 28px; background: var(--card);
  box-shadow: var(--shadow); backdrop-filter: blur(18px);
}
.brand-mark {
  width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px;
  color: white; background: linear-gradient(145deg, #4f73ff, #2c48c8); font-size: 25px;
  box-shadow: 0 12px 28px rgba(66, 103, 245, .28);
}
.brand-mark.small { width: 42px; height: 42px; border-radius: 13px; font-size: 18px; flex: 0 0 auto; }
.eyebrow { margin: 20px 0 5px; color: #6977a4; font-size: 11px; font-weight: 800; letter-spacing: .13em; }
.login-card h1 { margin: 0; font-size: 29px; }
.login-note { color: var(--muted); font-size: 14px; margin: 10px 0 26px; }
label { display: grid; gap: 8px; color: #46505b; font-size: 13px; font-weight: 650; margin: 16px 0; }
input {
  width: 100%; padding: 13px 14px; border: 1px solid #dce2ec; border-radius: 12px;
  outline: none; background: rgba(255,255,255,.8); color: var(--ink);
}
input { transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease; }
input:focus { border-color: #8198f8; box-shadow: 0 0 0 3px rgba(66,103,245,.11), 0 8px 24px rgba(66,103,245,.08); background:#fff; }
button { cursor: pointer; border: 0; }
.primary { padding: 11px 18px; border-radius: 11px; color: white; background: var(--blue); font-weight: 700; }
.primary:hover { background: var(--blue-deep); }
.primary, .ghost, .detail-actions button { transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s ease, background-color .18s ease; }
.primary:hover, .ghost:hover, .detail-actions button:hover { transform:translateY(-1px); box-shadow:0 8px 20px rgba(36,58,98,.12); }
.primary:active, .ghost:active, .detail-actions button:active { transform:translateY(0) scale(.985); }
.wide { width: 100%; }
.ghost { padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.55); color: #4d5965; }
.login-card small { display: block; text-align: center; margin-top: 14px; color: #919aa5; }
.form-error { min-height: 20px; color: var(--red); font-size: 13px; margin-top: 8px; }

.admin-app { min-height: 100vh; display: grid; grid-template-columns: 246px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; z-index: 2; padding: 25px 18px;
  display: flex; flex-direction: column; border-right: 1px solid rgba(255,255,255,.9);
  background: rgba(247,249,253,.82); backdrop-filter: blur(20px);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 9px 25px; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 15px; }
.brand span { color: var(--muted); font-size: 11px; margin-top: 4px; }
nav { display: grid; gap: 5px; }
nav a { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 11px; color: #5d6875; text-decoration: none; font-size: 14px; font-weight: 650; transition:transform .2s cubic-bezier(.2,.8,.2,1), background-color .2s ease, color .2s ease, box-shadow .2s ease; }
nav a i { width: 22px; text-align: center; font-style: normal; }
nav a:hover { background: rgba(255,255,255,.8); transform:translateX(3px); }
nav a.active { color: #304fc9; background: white; box-shadow: 0 5px 18px rgba(44,63,95,.07); }
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; padding: 15px 8px 0; }
.sidebar-foot small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.live-state { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #66717e; }
.live-state span { width: 8px; height: 8px; border-radius: 50%; background: #aab3bd; box-shadow: 0 0 0 4px rgba(170,179,189,.14); }
.live-state.connected span { background: var(--green); box-shadow: 0 0 0 4px rgba(32,166,106,.13); }
.live-state.error span { background: var(--red); }

main { min-width: 0; padding: 0 34px 50px; }
.topbar { height: 112px; display: flex; justify-content: space-between; align-items: center; }
.topbar .eyebrow { margin: 0 0 5px; }
.topbar h1 { margin: 0; font-size: 25px; }
.release-chip { color: #315ee8; background: #e9efff; border: 1px solid #d7e1ff; border-radius: 999px; padding: 7px 11px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 12px; }
.admin-chip { padding: 8px 12px; border: 1px solid white; border-radius: 10px; background: rgba(255,255,255,.65); }
.view { position: relative; z-index: 1; view-transition-name:none; }
.view.is-fetching::before {
  content:"";
  position:fixed;
  z-index:20;
  top:0;
  left:246px;
  width:22%;
  height:2px;
  border-radius:99px;
  background:linear-gradient(90deg,transparent,#5275f4,transparent);
  animation:fetching-line .9s ease-in-out infinite;
}
.loading, .empty { padding: 70px 20px; text-align: center; color: var(--muted); }
.error-card { padding: 22px; background: #fff4f4; border: 1px solid #f2cecf; color: #a53a43; border-radius: 15px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 18px; }
.metric, .panel {
  border: 1px solid rgba(255,255,255,.95); background: var(--card); border-radius: 18px;
  box-shadow: 0 8px 32px rgba(31,48,74,.055); backdrop-filter: blur(14px);
}
[data-motion-depth] {
  --spot-x:50%;
  --spot-y:50%;
  --motion-rx:0deg;
  --motion-ry:0deg;
  --motion-lift:0px;
  transform:perspective(1100px) translateY(var(--motion-lift)) rotateX(var(--motion-rx)) rotateY(var(--motion-ry));
  transform-style:preserve-3d;
  transition:transform .24s cubic-bezier(.2,.75,.2,1), box-shadow .24s ease, border-color .24s ease;
}
[data-motion-depth].is-pointer-active {
  will-change:transform;
  border-color:rgba(122,151,255,.3);
  box-shadow:0 18px 44px rgba(38,59,98,.105), inset 0 0 42px rgba(96,130,255,.035);
}
[data-motion-depth="0"] { transform:none; }
.metric { padding: 20px; }
.metric .label { color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin-top: 8px; font-size: 29px; }
.metric small { color: #8c96a2; }
.metric.red strong { color: var(--red); }
.metric.green strong { color: var(--green); }
.metric.yellow strong { color: var(--yellow); }
.panel { overflow: hidden; margin-bottom: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 12px; }
.panel-head h2 { margin: 0; font-size: 16px; }
.panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.source-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.source-filter { padding: 7px 11px; border-radius: 9px; color: var(--muted); background: #f1f4f9; font-size: 12px; font-weight: 700; transition:transform .18s cubic-bezier(.2,.8,.2,1), color .18s ease, background-color .18s ease, box-shadow .18s ease; }
.source-filter:hover, .price-filter:hover, .view-switch a:hover { transform:translateY(-1px); }
.source-filter.active { color: #2456e8; background: #e9efff; box-shadow: inset 0 0 0 1px #cad7ff; }
.panel-link { color: var(--blue); text-decoration: none; font-size: 12px; }
.split-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px; }

.planning-grid { display:grid; grid-template-columns:minmax(0,1.55fr) minmax(300px,.65fr); gap:18px; }
.planning-panel { min-width:0; }
.planning-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-bottom:18px; }
.planning-summary article { padding:16px 18px; border:1px solid rgba(255,255,255,.95); border-radius:16px; background:var(--card); box-shadow:0 8px 28px rgba(31,48,74,.045); }
.planning-summary span,.planning-summary small { display:block; color:var(--muted); font-size:11px; }
.planning-summary strong { display:block; margin:6px 0 2px; font-size:25px; }
.planning-summary .warning strong { color:var(--yellow); }
.planning-summary .danger strong { color:var(--red); }
.planning-summary .money strong { color:#7a52cf; }

.planning-toolbar { display:flex; align-items:flex-end; flex-wrap:wrap; gap:10px 14px; padding:0 20px 16px; border-bottom:1px solid var(--line); }
.planning-filter-block { display:grid; gap:5px; }
.planning-filter-block>span,.date-filter,.amount-filter { color:var(--muted); font-size:10px; font-weight:750; }
.date-filter,.amount-filter { display:grid; gap:5px; margin:0; }
.date-filter input,.amount-filter input { height:31px; padding:6px 9px; border-radius:9px; font-size:11px; }
.date-filter input { width:132px; }
.amount-filter input { width:96px; }
.price-filter { align-self:flex-end; padding:8px 11px; border-radius:9px; color:#7755b8; background:#f1ebff; text-decoration:none; font-size:11px; font-weight:800; transition:transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s ease, background-color .18s ease; }
.price-filter.active { color:white; background:#7654ca; box-shadow:0 5px 15px rgba(118,84,202,.22); }
.view-switch { display:flex; align-self:flex-end; padding:3px; border-radius:10px; background:#eef1f5; }
.view-switch a { padding:6px 10px; border-radius:8px; color:var(--muted); text-decoration:none; font-size:11px; font-weight:750; transition:transform .18s cubic-bezier(.2,.8,.2,1), color .18s ease, background-color .18s ease, box-shadow .18s ease; }
.view-switch a.active { color:var(--blue); background:white; box-shadow:0 2px 8px rgba(34,50,78,.1); }
.filter-result { align-self:flex-end; margin-left:auto; padding-bottom:7px; color:var(--muted); font-size:11px; }

.table-scroll { max-width:100%; overflow-x:auto; }
.order-table { min-width:1180px; }
.deadline-cell { min-width:112px; color:#53606d; font-size:11px !important; white-space:nowrap; }
.deadline-cell.overdue,.gantt-due.overdue { color:var(--red); font-weight:800; }
.money-cell { color:#60419f; font-weight:800; white-space:nowrap; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 11px 16px; color: #8a949f; background: rgba(245,247,250,.62); text-align: left; font-size: 11px; font-weight: 700; }
.data-table td { padding: 14px 16px; border-top: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.data-table tbody tr[data-route] { cursor: pointer; }
.data-table tbody tr[data-route] { transition:background-color .18s ease, box-shadow .18s ease; }
.data-table tbody tr[data-route]:hover { background: rgba(66,103,245,.045); box-shadow:inset 3px 0 #6d87f1; }
.main-cell strong, .main-cell span { display: block; }
.main-cell span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 8px; background: #eef1f5; color: #5e6975; font-size: 11px; font-weight: 700; white-space: nowrap; transition:color .28s ease, background-color .28s ease, transform .28s ease; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.running, .badge.online, .badge.green, .badge.completed { color: var(--green); background: #e9f7f0; }
.badge.waiting_input, .badge.yellow { color: #b67a16; background: #fff5df; }
.badge.stuck, .badge.crashed, .badge.red, .badge.critical { color: var(--red); background: #fff0f1; }
.badge.offline, .badge.paused, .badge.stopped, .badge.resolved { color: #7f8994; background: #eef1f4; }
.badge.warning { color: #b67a16; background: #fff5df; }
.source-badge { display:inline-flex; align-items:center; padding:5px 8px; border-radius:7px; font-size:10px; font-weight:850; letter-spacing:.08em; }
.source-badge.test { color:#687583; background:#edf0f4; }
.source-badge.real { color:#1a7852; background:#e3f7ed; box-shadow:inset 0 0 0 1px rgba(26,120,82,.12); }
.readonly-real { padding:9px 12px; border-radius:10px; color:#176d4c; background:#e5f7ee; font-size:11px; font-weight:750; }
.progress { width: 105px; height: 7px; overflow: hidden; border-radius: 99px; background: #e8ecf2; }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#6683ff,#3e62ee); transition:width .65s cubic-bezier(.2,.8,.2,1); }

.gantt-chart { padding:0 20px 20px; min-width:760px; }
.gantt-axis,.gantt-row { display:grid; grid-template-columns:minmax(190px,1.05fr) minmax(390px,2.2fr) 112px; gap:14px; align-items:center; }
.gantt-axis { position:sticky; top:0; z-index:2; min-height:33px; color:#8a949f; background:rgba(255,255,255,.95); font-size:10px; font-weight:750; }
.gantt-axis>div { position:relative; height:26px; border-bottom:1px solid #dfe4ec; }
.gantt-axis>div span { position:absolute; bottom:5px; transform:translateX(-50%); white-space:nowrap; }
.gantt-axis>div span:first-child { transform:none; }
.gantt-axis>div span:last-child { transform:translateX(-100%); }
.gantt-row { min-height:54px; border-top:1px solid rgba(30,42,54,.07); cursor:pointer; }
.gantt-row:hover { background:rgba(66,103,245,.035); }
.gantt-order { min-width:0; }
.gantt-order strong,.gantt-order span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.gantt-order strong { font-size:12px; }
.gantt-order span { margin-top:4px; color:var(--muted); font-size:10px; }
.gantt-track { position:relative; height:28px; border-radius:7px; background:repeating-linear-gradient(90deg,#f5f7fa 0,#f5f7fa calc(14.285% - 1px),#e9edf2 calc(14.285% - 1px),#e9edf2 14.285%); overflow:hidden; }
.today-line { position:absolute; z-index:1; top:0; bottom:0; width:2px; background:rgba(223,76,86,.48); }
.gantt-bar { position:absolute; z-index:2; top:5px; height:18px; min-width:8px; overflow:hidden; border-radius:6px; background:#dbe3ff; box-shadow:0 2px 7px rgba(49,75,151,.14); transition:left .65s cubic-bezier(.2,.8,.2,1), width .65s cubic-bezier(.2,.8,.2,1), background-color .28s ease, transform .18s ease; }
.gantt-row:hover .gantt-bar { transform:scaleY(1.08); }
.gantt-bar>b { position:absolute; inset:0 auto 0 0; background:linear-gradient(90deg,#758cff,#4165ed); transition:width .65s cubic-bezier(.2,.8,.2,1), background-color .28s ease; }
.gantt-bar>em { position:absolute; z-index:1; inset:0; color:#26365f; font-size:9px; font-style:normal; font-weight:850; line-height:18px; text-align:center; text-shadow:0 1px rgba(255,255,255,.75); }
.gantt-bar.warning { background:#fff0c9; }
.gantt-bar.warning>b { background:linear-gradient(90deg,#efbf52,#dc9217); }
.gantt-bar.danger { background:#ffdde0; }
.gantt-bar.danger>b { background:linear-gradient(90deg,#ee7a82,#d9434e); }
.gantt-bar.complete { background:#d9f2e8; }
.gantt-bar.complete>b { background:linear-gradient(90deg,#50bf8a,#1e9f64); }
.gantt-due { color:#596574; font-size:10px; white-space:nowrap; }
.gantt-empty { padding:48px 20px; color:var(--muted); text-align:center; }
.gantt-more { padding:10px 0 0; color:var(--muted); font-size:10px; text-align:center; }
.unscheduled-strip { display:flex; align-items:center; flex-wrap:wrap; gap:6px; margin-top:12px; padding:10px; border-radius:10px; background:#f4f6f9; color:var(--muted); font-size:10px; }
.unscheduled-strip b { margin-right:4px; color:#626d79; }
.unscheduled-strip span { padding:5px 7px; border-radius:7px; background:white; cursor:pointer; }
.gantt-chart.compact { min-width:0; }
.gantt-chart.compact .gantt-axis,.gantt-chart.compact .gantt-row { grid-template-columns:minmax(150px,.95fr) minmax(240px,1.8fr) 98px; gap:10px; }

.step-gantt { display:grid; gap:12px; min-width:720px; padding:0 20px 20px; }
.step-gantt.compact { min-width:0; }
.step-gantt-legend { display:flex; align-items:center; flex-wrap:wrap; gap:12px; color:var(--muted); font-size:10px; }
.step-gantt-legend>span { display:inline-flex; align-items:center; gap:5px; }
.step-gantt-legend i,.portfolio-legend i { width:8px; height:8px; border-radius:3px; background:#dfe4eb; }
.step-gantt-legend i.completed,.portfolio-legend i.completed { background:#2caf72; }
.step-gantt-legend i.in_progress,.portfolio-legend i.in_progress { background:#5275f4; }
.step-gantt-legend i.blocked,.portfolio-legend i.blocked { background:#df4c56; }
.step-gantt-legend i.pending,.portfolio-legend i.pending { background:#dfe4eb; }
.step-gantt-legend em { margin-left:auto; color:#87919d; font-style:normal; }
.step-gantt-row { position:relative; padding:14px; overflow:hidden; border:1px solid rgba(52,72,102,.09); border-radius:15px; background:linear-gradient(145deg,rgba(255,255,255,.92),rgba(248,250,254,.78)); cursor:pointer; box-shadow:0 5px 18px rgba(34,51,80,.035); }
.step-gantt-row::before { content:""; position:absolute; inset:0 auto 0 0; width:3px; background:#59b98c; opacity:.72; }
.step-gantt-row.yellow::before { background:#e0a02d; }
.step-gantt-row.red::before { background:#df4c56; }
.step-gantt-row>header { display:grid; grid-template-columns:minmax(190px,.75fr) minmax(220px,1.25fr); gap:14px; align-items:start; margin-bottom:13px; }
.step-gantt-row>header>div:first-child { min-width:0; }
.step-gantt-row>header strong { display:block; overflow:hidden; font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.step-gantt-row>header>div:first-child>span { display:flex; align-items:center; gap:6px; margin-top:6px; }
.step-gantt-now { min-width:0; text-align:right; }
.step-gantt-now b,.step-gantt-now small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.step-gantt-now b { color:#35445e; font-size:11px; }
.step-gantt-now small { margin-top:5px; color:var(--muted); font-size:9px; }
.workflow-rail { position:relative; display:grid; grid-template-columns:repeat(var(--step-count),minmax(74px,1fr)); gap:7px; }
.workflow-rail::before { content:""; position:absolute; z-index:0; top:19px; right:4%; left:4%; height:2px; background:linear-gradient(90deg,#aedec8,#dbe2ea); }
.workflow-step { position:relative; z-index:1; display:grid; grid-template-columns:24px minmax(0,1fr); align-items:center; gap:6px; min-height:40px; padding:7px; border:1px solid #e2e7ed; border-radius:10px; color:#78828e; background:rgba(248,250,252,.96); transition:transform .22s cubic-bezier(.2,.8,.2,1),border-color .22s ease,box-shadow .22s ease,background-color .22s ease; }
.workflow-step:hover { z-index:3; transform:translateY(-3px); box-shadow:0 9px 20px rgba(37,54,85,.12); }
.workflow-step i { display:grid; place-items:center; width:22px; height:22px; border-radius:7px; background:#e5e9ef; color:#7c8793; font-size:10px; font-style:normal; font-weight:900; }
.workflow-step span { overflow:hidden; font-size:9px; font-weight:750; line-height:1.3; text-overflow:ellipsis; }
.workflow-step.completed { border-color:#cceadb; color:#276e51; background:#f0faf5; }
.workflow-step.completed i { color:white; background:#2caf72; }
.workflow-step.in_progress { border-color:#b9c9ff; color:#294caf; background:#edf2ff; box-shadow:0 5px 17px rgba(66,103,245,.14); }
.workflow-step.in_progress i { color:white; background:#5275f4; }
.workflow-step.blocked { border-color:#f1bfc3; color:#a9343e; background:#fff1f2; }
.workflow-step.blocked i { color:white; background:#df4c56; }
.workflow-step.paused { border-color:#ecd59f; color:#8b6819; background:#fff8e8; }
.workflow-step.current::after { content:""; position:absolute; inset:-4px; z-index:-1; border:1px solid currentColor; border-radius:13px; opacity:.2; animation:step-focus 2.2s ease-in-out infinite; }
.workflow-rail.compact { gap:5px; }
.workflow-rail.compact .workflow-step { display:grid; grid-template-columns:1fr; min-width:0; padding:6px 4px; text-align:center; }
.workflow-rail.compact .workflow-step i { margin:auto; }
.workflow-rail.compact .workflow-step span { font-size:0; }
.workflow-rail-meta { display:flex; justify-content:space-between; gap:10px; margin-top:8px; color:var(--muted); font-size:9px; }
.workflow-rail-meta b { color:#3654b8; }
.workflow-steps-missing { display:flex; justify-content:space-between; gap:10px; padding:12px; border:1px dashed #d6dce5; border-radius:10px; color:#707b87; background:#f7f9fb; font-size:10px; }
.workflow-steps-missing small { color:#929ba5; }
.step-gantt.compact .step-gantt-row { padding:12px; }
.step-gantt.compact .step-gantt-row>header { grid-template-columns:minmax(150px,.7fr) minmax(180px,1.3fr); margin-bottom:10px; }

.workflow-portfolio { display:grid; grid-template-columns:120px 1fr; align-items:center; gap:22px; min-height:230px; padding:22px; }
.portfolio-total { display:grid; place-content:center; width:116px; aspect-ratio:1; border:1px solid #dce5ff; border-radius:36px; color:#3456d1; text-align:center; background:radial-gradient(circle at 30% 24%,#fff,#edf2ff 72%); box-shadow:inset 0 0 28px rgba(82,117,244,.08),0 12px 30px rgba(52,86,180,.08); }
.portfolio-total strong { font-size:29px; }
.portfolio-total span { color:var(--muted); font-size:9px; }
.portfolio-body { min-width:0; }
.portfolio-track { display:flex; height:12px; overflow:hidden; border-radius:99px; background:#e8ecf2; box-shadow:inset 0 1px 3px rgba(30,45,70,.1); }
.portfolio-track i { min-width:0; transition:width .65s cubic-bezier(.2,.8,.2,1); }
.portfolio-track .completed { background:#2caf72; }
.portfolio-track .in_progress { background:#5275f4; }
.portfolio-track .blocked { background:#df4c56; }
.portfolio-track .pending { background:#dfe4eb; }
.portfolio-legend { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:22px; }
.portfolio-legend>div { display:grid; grid-template-columns:10px 1fr auto; align-items:center; gap:7px; color:var(--muted); font-size:10px; }
.portfolio-legend b { color:#3e4a57; font-size:12px; }
.portfolio-empty { display:grid; place-content:center; min-height:230px; padding:24px; color:var(--muted); text-align:center; }
.portfolio-empty strong { color:#4c5967; font-size:14px; }
.portfolio-empty span { max-width:320px; margin-top:7px; font-size:11px; line-height:1.6; }

.truth-chip { align-self:center; padding:6px 9px; border:1px solid #cbe8da; border-radius:99px; color:#237451; background:#edf9f3; font-size:9px; font-weight:800; white-space:nowrap; }
.truth-chip.subtle { border-color:#dbe1ea; color:#697583; background:#f4f6f9; }
.order-step-body { padding:2px 20px 20px; }
.observed-gantt { min-width:760px; padding:0 20px 20px; }
.truth-strip { display:flex; justify-content:space-between; gap:15px; margin-bottom:10px; padding:9px 11px; border:1px solid #cfe8dc; border-radius:10px; color:#2c7556; background:#f0faf5; font-size:9px; }
.truth-strip code { font-family:Consolas,monospace; }
.truth-strip b { white-space:nowrap; }
.observed-axis,.observed-row { display:grid; grid-template-columns:minmax(210px,.9fr) minmax(400px,2fr) 74px; gap:12px; align-items:center; }
.observed-axis { min-height:32px; color:#87919d; font-size:9px; font-weight:750; }
.observed-axis>div { position:relative; height:26px; border-bottom:1px solid #dfe4ec; }
.observed-axis>div span { position:absolute; bottom:5px; transform:translateX(-50%); white-space:nowrap; }
.observed-axis>div span:first-child { transform:none; }
.observed-axis>div span:last-child { transform:translateX(-100%); }
.observed-row { min-height:48px; border-top:1px solid rgba(30,42,54,.07); }
.observed-row>div:first-child { display:grid; grid-template-columns:22px minmax(0,1fr); align-items:center; gap:8px; min-width:0; }
.observed-row>div:first-child i { display:grid; place-items:center; width:22px; height:22px; border-radius:7px; color:#4c63b7; background:#edf1ff; font-size:9px; font-style:normal; font-weight:850; }
.observed-row>div:first-child span { overflow:hidden; font-size:10px; font-weight:700; text-overflow:ellipsis; white-space:nowrap; }
.observed-row>em { color:var(--muted); font-size:9px; font-style:normal; }
.observed-track { position:relative; height:28px; border-radius:7px; background:repeating-linear-gradient(90deg,#f7f8fa 0,#f7f8fa calc(25% - 1px),#e9edf2 calc(25% - 1px),#e9edf2 25%); }
.observed-bar { position:absolute; top:6px; height:16px; min-width:7px; border-radius:6px; background:linear-gradient(90deg,#6986fa,#4267f5); box-shadow:0 3px 10px rgba(66,103,245,.2); }
.observed-bar.completed { background:linear-gradient(90deg,#5ac493,#25a76c); }
.observed-bar.blocked { background:linear-gradient(90deg,#ef8188,#d9434e); }
.observed-bar.open { border:1px dashed #4267f5; background:linear-gradient(90deg,rgba(82,117,244,.72),rgba(82,117,244,.24)); }
.observed-bar b { position:absolute; left:50%; top:50%; color:white; font-size:8px; transform:translate(-50%,-50%); white-space:nowrap; }
.observed-milestone { position:absolute; top:8px; width:12px; height:12px; border-radius:3px; background:#2caf72; box-shadow:0 0 0 4px rgba(44,175,114,.13); transform:translateX(-50%) rotate(45deg); }
.observed-none { position:absolute; inset:0; display:grid; place-items:center; color:#9aa3ad; font-size:8px; }
.observed-note { margin:12px 0 0; color:#7f8995; font-size:9px; line-height:1.6; }
.truthful-empty { display:grid; gap:14px; padding:20px; color:var(--muted); }
.truthful-empty>strong { color:#4f5c69; }
.truthful-empty>span { font-size:11px; }

.chart-tooltip { position:fixed; z-index:100; max-width:320px; padding:10px 12px; border:1px solid rgba(255,255,255,.22); border-radius:11px; color:#f7f9ff; background:rgba(28,37,54,.94); box-shadow:0 14px 40px rgba(15,23,38,.24); opacity:0; transform:translateY(5px) scale(.98); pointer-events:none; white-space:pre-line; font-size:10px; line-height:1.55; backdrop-filter:blur(12px); transition:opacity .14s ease,transform .14s ease; }
.chart-tooltip.show { opacity:1; transform:none; }

.reveal-pending { opacity:0; transform:translateY(9px); }
.reveal-pending.reveal-visible { opacity:1; transform:none; transition:opacity .38s ease var(--reveal-delay,0ms),transform .45s cubic-bezier(.2,.8,.2,1) var(--reveal-delay,0ms); }

@keyframes step-focus {
  0%,100% { opacity:.12; transform:scale(.99); }
  50% { opacity:.34; transform:scale(1.015); }
}

.progress-overview { display:grid; grid-template-columns:150px 1fr; align-items:center; gap:20px; min-height:260px; padding:18px 22px 26px; }
.progress-ring { --progress:0; position:relative; width:132px; aspect-ratio:1; display:grid; place-content:center; border-radius:50%; text-align:center; background:radial-gradient(circle at center,#fff 58%,transparent 60%),conic-gradient(#4d70f0 calc(var(--progress) * 1%),#e8ecf3 0); transition:--progress .65s cubic-bezier(.2,.8,.2,1), transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s ease; }
.progress-ring strong,.progress-ring span { display:block; }
.progress-ring strong { color:#3456d1; font-size:25px; }
.progress-ring span { margin-top:3px; color:var(--muted); font-size:10px; }
.stage-bars { display:grid; gap:14px; }
.stage-row { display:grid; grid-template-columns:46px minmax(90px,1fr) 34px; gap:8px; align-items:center; color:var(--muted); font-size:10px; }
.stage-row>div { height:8px; overflow:hidden; border-radius:99px; background:#e9edf3; }
.stage-row i { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#8fa2f8,#496aef); transition:width .65s cubic-bezier(.2,.8,.2,1); }
.stage-row b { color:#465260; font-size:10px; white-space:nowrap; }

.detail-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; padding: 22px; }
.detail-head h2 { margin: 4px 0 7px; font-size: 22px; }
.detail-head p { margin: 0; color: var(--muted); font-size: 12px; }
.detail-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.detail-actions button { padding: 8px 10px; border-radius: 9px; background: #eef1f6; color: #596574; font-size: 11px; }
.detail-actions button.danger { color: #bd3d46; background: #fff0f1; }
.detail-actions button.warn { color: #a96f0f; background: #fff3d8; }
.info-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1px; border-top: 1px solid var(--line); background: var(--line); }
.info-item { padding: 16px 20px; background: rgba(255,255,255,.8); }
.info-item span, .info-item strong { display: block; }
.info-item span { color: var(--muted); font-size: 11px; margin-bottom: 7px; }
.info-item strong { font-size: 13px; overflow-wrap: anywhere; }
.progress-note { padding: 18px 20px; border-top: 1px solid var(--line); color: #4f5a66; line-height: 1.7; font-size: 13px; white-space: pre-line; }
.progress-note b { color: var(--ink); }
.timeline { padding: 0 20px 18px; }
.timeline-item { position: relative; padding: 11px 10px 11px 22px; border-left: 1px solid #dce2ea; }
.timeline-item::before { content:""; position:absolute; left:-4px; top:17px; width:7px; height:7px; border-radius:50%; background:#6a83ee; }
.timeline-item strong { font-size: 12px; }
.timeline-item span { display:block; margin-top:4px; color:var(--muted); font-size:11px; }
.timeline-item p { margin:6px 0 0; color:#4f5a66; font-size:12px; line-height:1.55; }

.blocker-panel { margin:16px 0; padding:20px; border:1px solid #efb45a; border-radius:14px; background:linear-gradient(135deg,#fff9ec,#fff3da); box-shadow:0 8px 24px rgba(183,117,18,.08); }
.blocker-title { display:flex; align-items:center; gap:12px; margin-bottom:16px; }
.blocker-title>span { display:grid; place-items:center; width:34px; height:34px; border-radius:50%; background:#d98a16; color:white; font-weight:800; }
.blocker-title strong { display:block; color:#6e4300; font-size:16px; }
.blocker-title small { display:block; margin-top:3px; color:#93641e; }
.operator-action-panel { margin:16px 0; padding:20px; border:1px solid #e4ad35; border-radius:14px; background:linear-gradient(135deg,#fffaf0,#fff2cf); box-shadow:0 8px 24px rgba(183,117,18,.08); }
.operator-action-title { display:flex; align-items:center; gap:12px; margin-bottom:10px; }
.operator-action-title>span { display:grid; place-items:center; width:34px; height:34px; border-radius:50%; background:#d98a16; color:white; font-weight:800; }
.operator-action-title strong { display:block; color:#6e4300; font-size:16px; }
.operator-action-title small { display:block; margin-top:3px; color:#93641e; }
.operator-action-panel p { margin:0; color:#5e420f; line-height:1.7; }
.blocker-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.blocker-grid>div,.blocker-evidence { padding:12px 14px; border:1px solid rgba(205,139,38,.28); border-radius:10px; background:rgba(255,255,255,.7); }
.blocker-grid b,.blocker-evidence b { color:#7c4e08; font-size:12px; }
.blocker-grid p,.blocker-evidence p { margin:5px 0 0; color:#3f3424; font-size:13px; line-height:1.6; white-space:pre-line; }
.blocker-evidence { margin-top:10px; }
.blocker-evidence ul { margin:6px 0 0; padding-left:20px; color:#3f3424; font-size:13px; line-height:1.65; }
@media (max-width:760px){.blocker-grid{grid-template-columns:1fr}}
.alert-list { display: grid; gap: 10px; padding: 0 18px 18px; }
.alert-item { display:grid; grid-template-columns: auto 1fr auto; gap:12px; align-items:start; padding:14px; border:1px solid var(--line); border-radius:12px; background:rgba(255,255,255,.55); }
.alert-item p { margin:5px 0 0; color:var(--muted); font-size:12px; line-height:1.55; }
.alert-icon { width:28px; height:28px; display:grid; place-items:center; border-radius:9px; background:#fff0f1; color:var(--red); font-weight:900; }
.alert-item.warning .alert-icon { background:#fff5df; color:#b67a16; }

.toast { position:fixed; right:24px; bottom:24px; z-index:10; max-width:360px; padding:12px 16px; color:white; background:#263244; border-radius:11px; box-shadow:var(--shadow); opacity:0; transform:translateY(10px); pointer-events:none; transition:.2s; font-size:13px; }
.toast.show { opacity:1; transform:none; }

.live-updated { animation:live-value-pulse .7s cubic-bezier(.2,.8,.2,1); }

@keyframes live-value-pulse {
  0% { filter:brightness(1); }
  35% { filter:brightness(1.08); text-shadow:0 0 16px rgba(66,103,245,.22); }
  100% { filter:brightness(1); text-shadow:none; }
}

@keyframes fetching-line {
  0% { transform:translateX(-120%); opacity:0; }
  25%, 75% { opacity:1; }
  100% { transform:translateX(520%); opacity:0; }
}

@keyframes ambient-drift-a {
  to { transform:translate(-46px,38px) scale(1.08); opacity:.72; }
}
@keyframes ambient-drift-b {
  to { transform:translate(56px,-28px) scale(.94); opacity:.42; }
}

::view-transition-old(admin-view) {
  animation:admin-view-out .14s ease both;
}
::view-transition-new(admin-view) {
  animation:admin-view-in .24s cubic-bezier(.2,.75,.2,1) both;
}
@keyframes admin-view-out {
  to { opacity:0; transform:translateY(3px) scale(.997); }
}
@keyframes admin-view-in {
  from { opacity:0; transform:translateY(7px) scale(.997); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior:auto !important;
    animation-duration:.001ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
  }
  [data-motion-depth] { transform:none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation:none !important; }
}

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2,1fr); }
  .split-grid { grid-template-columns: 1fr; }
  .planning-grid { grid-template-columns:1fr; }
  .info-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 760px) {
  .admin-app { grid-template-columns: 76px minmax(0,1fr); }
  .sidebar { padding:20px 10px; }
  .brand > div:last-child, nav a:not(.active) { font-size:0; }
  nav a { justify-content:center; }
  nav a.active { font-size:0; }
  nav a i { font-size:17px; }
  .sidebar-foot small, .live-state b { display:none; }
  main { padding:0 15px 35px; }
  .view.is-fetching::before { left:76px; }
  .top-actions #clock { display:none; }
  .metric-grid { grid-template-columns:1fr 1fr; }
  .planning-summary { grid-template-columns:1fr 1fr; }
  .planning-toolbar { align-items:flex-start; }
  .filter-result { width:100%; margin-left:0; }
  .progress-overview { grid-template-columns:1fr; justify-items:center; }
  .data-table { min-width:760px; }
  .panel { overflow-x:auto; }
}

/* Navigation stays stationary while the content pane changes. */
.sidebar nav a:hover { transform:none; }
