/* Quick DDP: User=店长和运营在早会前快速定动作 | Tension=数据密度 BUT 不压迫 | Archetype=母版经营智能舱, keep left rail/task drawer/colors, add V1.1 multi-store drilldown */
:root {
  --bg: #edf5f3;
  --surface: #fbfffd;
  --line: rgba(11, 45, 37, .12);
  --ink: #0b2d25;
  --muted: #64756f;
  --green: #50f27a;
  --green-soft: #eafff0;
  --green-line: rgba(80,242,122,.48);
  --green-deep: #073c31;
  --red: #e15850;
  --red-soft: #ffe9e6;
  --blue: #5b73e8;
  --blue-soft: #edf2ff;
  --amber: #d59a20;
  --amber-soft: #fff5dc;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
  background:
    linear-gradient(180deg, #e5eef0 0%, var(--bg) 48%, #f7fbfa 100%);
}

a { color: inherit; text-decoration: none; }

.app-shell {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  min-height: 100dvh;
}

.shell.app-shell {
  grid-template-columns: 232px minmax(0, 1fr);
  max-width: 1680px;
  margin: 0 auto;
  padding: 22px;
  gap: 20px;
}

.sidebar {
  position: sticky;
  top: 22px;
  height: calc(100vh - 44px);
  padding: 22px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(155deg, rgba(255,255,255,.78), rgba(234,247,240,.58));
  box-shadow: 0 20px 70px rgba(31, 64, 73, .10);
  overflow: auto;
}

.brand {
  display: block;
  padding: 8px 10px 22px;
  border-bottom: 1px solid var(--line);
}

.brand strong {
  display: block;
  font-size: 17px;
  line-height: 1.1;
}

.brand span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.nav {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 840;
}

.nav a.is-active,
.nav a:hover {
  background: linear-gradient(135deg, var(--green-deep), #07523c);
  color: white;
  box-shadow: inset 0 0 0 1px var(--green-line), 0 10px 22px rgba(80,242,122,.12);
}

.nav i {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid currentColor;
  border-radius: 8px;
  font-style: normal;
  font-size: 11px;
}

.side-rail {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 18px 12px;
  background: linear-gradient(180deg, var(--green-deep), #082820);
  border-right: 1px solid var(--green-line);
  display: grid;
  align-content: start;
  gap: 14px;
}

.brand-mark,
.rail-item {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-weight: 800;
}

.brand-mark {
  background: linear-gradient(135deg, var(--green), #8bffad);
  color: var(--green-deep);
}

.rail-item {
  color: rgba(255,255,255,.72);
  border: 1px solid rgba(255,255,255,.12);
}

.rail-item.is-active,
.rail-item:hover {
  background: rgba(80,242,122,.14);
  color: white;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.stage {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 6px 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

h1, h2, p { margin-top: 0; }

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  font-size: 17px;
  margin-bottom: 14px;
}

.section {
  margin-bottom: 18px;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  margin-bottom: 14px;
}

.kicker {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.sub {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.red { color: var(--red); }
.green { color: var(--green-deep); }

.month-axis,
.hour-axis,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.month-axis span,
.hour-axis span,
.chip-row span {
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.58);
  font-size: 13px;
}

.month-axis .is-today {
  border-color: var(--green-line);
  background: var(--green-soft);
  color: var(--green-deep);
  font-weight: 800;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr .9fr;
  gap: 12px;
  margin-bottom: 14px;
}

.metric-card,
.decision-card,
.metric,
.task-stat,
.actions-card,
.panel,
.task-card,
.store-row,
.warning-card {
  border: 1px solid var(--line);
  background: rgba(251,255,253,.86);
  border-radius: 8px;
}

.decision-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.operator-master-exec .decision-strip {
  margin-top: 20px;
  max-width: 1040px;
}

.operator-master-exec .topbar,
.profile .topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 20px;
  margin-bottom: 0;
}

.decision-card {
  min-height: 128px;
  padding: 18px;
  background: rgba(255,255,255,.7);
}

.decision-card span,
.metric span,
.actions-card span,
.drawer-section span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.decision-card strong,
.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.decision-card p,
.metric p,
.actions-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
}

.decision-action {
  margin-top: 11px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--green-line);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--green), #8bffad);
  color: var(--green-deep);
  font-size: 12px;
  font-weight: 900;
}

.operator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
  margin-top: 14px;
}

.role-card,
.profile,
.drawer-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251,255,253,.86);
}

.role-card {
  padding: 20px;
}

.role-card strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
  line-height: 1.12;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.mini {
  min-height: 88px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.58);
}

.mini span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.mini b {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1;
}

.profile {
  padding: 20px;
  background: linear-gradient(155deg, var(--green-deep), #07523c);
  color: white;
}

.profile .avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--green), #8bffad);
  color: var(--green-deep);
  font-weight: 950;
}

.profile strong {
  display: block;
  margin-top: 14px;
  font-size: 22px;
  line-height: 1.18;
}

.profile p {
  margin-top: 10px;
  color: rgba(255,255,255,.78);
  font-size: 12px;
  line-height: 1.5;
  font-weight: 760;
}

.profile .pill {
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.76);
}

.profile .pill b {
  color: white;
}

.summary-board .metrics,
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric {
  min-height: 132px;
  padding: 16px;
  background: rgba(251,255,253,.82);
}

.metric.signal-danger {
  background: linear-gradient(135deg, rgba(255,233,230,.8), rgba(255,255,255,.72));
}

.metric.signal-warning {
  background: linear-gradient(135deg, rgba(255,245,220,.8), rgba(255,255,255,.72));
}

.metric.signal-success {
  background: linear-gradient(135deg, rgba(234,255,240,.84), rgba(255,255,255,.72));
}

.metric-card {
  min-height: 112px;
  padding: 18px;
  display: grid;
  align-content: space-between;
}

.metric-card span,
.task-card span,
.store-row em,
.store-row i,
.drawer-metric span {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.metric-card b {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 28px;
}

.store-board {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.store-row {
  min-height: 64px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr 140px 100px 82px;
  gap: 12px;
  align-items: center;
}

.store-row:hover {
  border-color: var(--green-line);
  transform: translateY(-1px);
}

.store-row b,
.data-line b,
.task-metrics b {
  font-family: "SFMono-Regular", Consolas, monospace;
}

.hour-axis {
  padding-top: 8px;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(0, 1.4fr);
  gap: 14px;
}

.quality-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 14px;
  margin-top: 14px;
}

.panel {
  padding: 18px;
}

.data-line {
  min-height: 42px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
}

.data-line:first-of-type { border-top: 0; }
.data-line span { color: var(--muted); }
.data-line em { color: var(--blue); font-style: normal; }

.quality-row {
  min-height: 44px;
  display: grid;
  grid-template-columns: minmax(82px, .35fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--line);
}

.quality-row:first-of-type { border-top: 0; }
.quality-row b { overflow-wrap: anywhere; }
.quality-row span {
  color: var(--muted);
  overflow-wrap: anywhere;
}
.quality-row.is-ok b { color: var(--green-deep); }

.task-pool {
  display: grid;
  gap: 10px;
}

.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.62);
}

.tab {
  min-height: 32px;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.tab.active {
  background: var(--green-deep);
  color: #f5fbf8;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.68);
  color: var(--muted);
  font-size: 12px;
  font-weight: 860;
  white-space: nowrap;
}

.task-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.task-board {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.64);
}

.task-filter-status {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(234,255,240,.56);
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
}

.task-board.is-queue-mode .task-list {
  display: none;
}

.task-board:not(.is-queue-mode) .queue-preview {
  display: none;
}

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

.task-mode {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.62);
}

.task-mode button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
}

.task-mode button.active {
  background: var(--green-deep);
  color: #f5fbf8;
}

.task-pool-status {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.task-stat {
  padding: 12px;
  background: rgba(255,255,255,.56);
  color: var(--muted);
  font-size: 12px;
}

.task-stat b {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 18px;
}

.task-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.task {
  min-height: 150px;
  padding: 16px;
  border: 1px solid rgba(225,88,80,.22);
  border-radius: 8px;
  background: linear-gradient(110deg, rgba(255,233,230,.72), rgba(255,255,255,.72));
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.task:hover,
.task.is-active {
  border-color: var(--green-line);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(7,60,49,.10);
}

.task.p1 {
  border-color: rgba(80,242,122,.36);
  background: linear-gradient(110deg, rgba(234,255,240,.78), rgba(255,255,255,.72));
}

.task.p2 {
  border-color: rgba(213,154,32,.25);
  background: linear-gradient(110deg, rgba(255,245,220,.7), rgba(255,255,255,.72));
}

.task.observe {
  border-color: rgba(107,129,123,.22);
  background: linear-gradient(110deg, rgba(237,245,243,.72), rgba(255,255,255,.72));
}

.task.tone-success {
  border-color: rgba(80,242,122,.36);
  background: linear-gradient(110deg, rgba(234,255,240,.78), rgba(255,255,255,.72));
}

.task.tone-warning {
  border-color: rgba(213,154,32,.25);
  background: linear-gradient(110deg, rgba(255,245,220,.7), rgba(255,255,255,.72));
}

.task.tone-muted {
  border-color: rgba(107,129,123,.22);
  background: linear-gradient(110deg, rgba(237,245,243,.72), rgba(255,255,255,.72));
}

.task-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(225,88,80,.13);
  color: var(--red);
  font-size: 13px;
  font-weight: 940;
  white-space: nowrap;
}

.task h3 {
  margin: 12px 0 0;
  font-size: 19px;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.task p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 760;
}

.support-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.task-card {
  padding: 16px;
  display: grid;
  gap: 12px;
  box-shadow: inset 4px 0 0 var(--green-deep);
}

.task-card h2 {
  margin: 0;
  font-size: 20px;
}

.task-card.support {
  box-shadow: inset 4px 0 0 var(--blue);
}

.task-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.task-row .task-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.chip {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.58);
  font-size: 12px;
  color: var(--muted);
  font-weight: 820;
}

.chip b {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.row-chip-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.row-chip {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.66);
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.row-chip b {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.task-metrics b {
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--amber-soft);
  color: var(--ink);
}

.task-row .chip b {
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.task-metrics em {
  color: var(--muted);
  font-style: normal;
}

button {
  width: max-content;
  min-height: 36px;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--green-deep);
  color: white;
  cursor: pointer;
}

button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.ghost-btn {
  margin-top: 12px;
  border: 1px solid rgba(7,60,49,.18);
  background: rgba(255,255,255,.68);
  color: var(--green-deep);
}

.queue-preview {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(7,60,49,.2);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(234,255,240,.76), rgba(255,255,255,.78));
  overflow-x: auto;
}

.queue-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.queue-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.queue-table tr[data-product-id] {
  cursor: pointer;
}

.queue-table tr[data-product-id]:hover,
.queue-table tr[data-product-id].is-active {
  background: rgba(80,242,122,.10);
}

.compact {
  min-height: 30px;
  padding: 5px 10px;
  margin-top: 0;
}

.trend-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 14px;
  padding: 0 18px 18px;
}

.chart-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.66);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

#monthMetricTabs.tabs {
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

#monthMetricTabs .tab {
  min-height: 42px;
  padding: 8px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  color: var(--muted);
  box-shadow: none;
}

#monthMetricTabs .tab.active {
  border-color: var(--green-deep);
  background: var(--green-deep);
  color: white;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(31, minmax(18px, 1fr));
  gap: 4px;
  min-height: 220px;
  align-items: end;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

#monthGrid.month-grid {
  position: relative;
  display: block;
  min-height: 286px;
  padding: 12px 0 0;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,.18));
}

.month-svg {
  display: block;
  width: 100%;
  height: 226px;
  overflow: visible;
}

.month-overlay {
  position: absolute;
  left: 0;
  top: 14px;
  width: 100%;
  height: 226px;
  pointer-events: none;
  z-index: 2;
}

.month-grid-line {
  stroke: rgba(11,45,37,.055);
  stroke-width: 1;
}

.month-area {
  fill: url(#monthAreaGradient);
}

.month-curve-shadow {
  fill: none;
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .12;
}

.month-curve {
  fill: none;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.month-average-line {
  stroke: rgba(11,45,37,.28);
  stroke-width: 1.4;
  stroke-dasharray: 6 7;
}

.month-average-label {
  position: absolute;
  transform: translate(-100%, -50%);
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
}

.month-risk-band {
  fill: url(#monthRiskGradient);
}

.month-risk-band-line {
  stroke: rgba(225,88,80,.2);
  stroke-width: 1;
  stroke-dasharray: 6 8;
}

.month-point,
.month-hit {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
}

.month-point {
  width: 14px;
  height: 14px;
  min-height: 14px;
  padding: 0;
  border: 3px solid rgba(255,255,255,.88);
  border-radius: 999px;
  background: var(--blue);
  color: white;
  font-size: 10px;
  font-weight: 900;
  transform: translate(-50%, -50%);
  box-shadow: 0 6px 14px rgba(31,64,73,.14);
}

.month-point.is-selected {
  width: 30px;
  height: 30px;
  min-height: 30px;
  background: var(--green-deep);
}

.month-point.is-risk {
  background: var(--red);
}

.month-point.is-warning {
  background: var(--amber);
}

.month-hit {
  top: 0;
  width: 26px;
  height: 226px;
  min-height: 226px;
  padding: 0;
  border: 0;
  background: transparent;
  transform: translateX(-50%);
}

.month-day-axis {
  display: grid;
  grid-template-columns: repeat(31, minmax(26px, 1fr));
  gap: 2px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(11,45,37,.08);
}

.day {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 5px;
  width: 100%;
  min-height: 40px;
  padding: 3px 1px 5px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}

.day label {
  font-size: 11px;
  font-weight: 860;
  line-height: 1;
}

.day small {
  font-size: 10px;
  font-weight: 760;
  line-height: 1;
  white-space: nowrap;
}

.day.has-data,
.day.selected {
  color: var(--green-deep);
}

.day.selected {
  background: rgba(80,242,122,.13);
  box-shadow: inset 0 -2px 0 var(--green);
}

.day.no-data {
  color: rgba(100,117,111,.58);
}

.month-day {
  display: grid;
  gap: 5px;
  justify-items: center;
  color: var(--muted);
  font-size: 11px;
}

.month-day i {
  display: block;
  width: 100%;
  max-width: 18px;
  border-radius: 999px 999px 3px 3px;
  background: rgba(107,129,123,.16);
}

.month-day.has-data i {
  background: var(--revenue-bar, linear-gradient(180deg, rgba(79,101,223,.72), rgba(79,101,223,.16)));
}

.month-day.has-data span,
.month-day.has-data b {
  color: var(--green-deep);
  font-weight: 900;
}

.month-day.is-negative i,
.hour-bar.is-negative i {
  background: linear-gradient(180deg, rgba(225,88,80,.72), rgba(225,88,80,.16));
}

.month-day b {
  writing-mode: vertical-rl;
  font-size: 10px;
  font-weight: 720;
}

.legend {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.selection-status {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(234,255,240,.56);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 780;
}

.day-focus,
.month-conclusions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.day-focus {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.month-conclusions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.day-focus-card,
.month-conclusion,
.note-card {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.58);
}

.day-focus-card.warning {
  background: linear-gradient(135deg, rgba(255,245,220,.84), rgba(255,255,255,.58));
}

.day-focus-card.strong {
  background: linear-gradient(135deg, rgba(234,255,240,.84), rgba(255,255,255,.58));
}

.day-focus-card span,
.month-conclusion span,
.note-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 860;
}

.day-focus-card b,
.month-conclusion b,
.note-card b {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.day-focus-card p,
.month-conclusion p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.42;
  font-weight: 740;
}

.month-conclusion.wide {
  grid-column: 1 / -1;
}

.hour-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.hour-mode {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.66);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.hour-mode.active {
  border-color: var(--green-deep);
  background: var(--green-deep);
  color: white;
}

.hour-caption {
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
}

.hour-chart {
  min-height: 220px;
  display: grid;
  grid-template-columns: repeat(24, minmax(8px, 1fr));
  gap: 5px;
  align-items: end;
  padding: 12px 0;
}

#hourSvg.hour-chart {
  display: block;
  width: 100%;
  min-height: 286px;
  padding: 0;
  overflow: visible;
}

.axis-label,
.point-label {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.hour-hit {
  fill: transparent;
  cursor: pointer;
  pointer-events: auto;
}

.hour-focus-strip {
  display: grid;
  grid-template-columns: 90px 1fr 1fr 1.4fr;
  gap: 8px;
  margin-top: 12px;
}

.hour-focus-cell {
  min-height: 66px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.58);
}

.hour-focus-cell.primary {
  background: var(--green-soft);
}

.hour-focus-cell.danger {
  background: var(--red-soft);
}

.hour-focus-cell span,
.hour-detail-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 860;
}

.hour-focus-cell b,
.hour-detail-item b {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.2;
}

.hour-key-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.hour-chip {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.66);
  color: var(--muted);
  font-size: 12px;
  font-weight: 860;
}

.hour-chip.is-active {
  border-color: var(--green-deep);
  background: var(--green-deep);
  color: white;
}

.hour-chip.danger {
  border-color: rgba(225,88,80,.28);
  background: var(--red-soft);
  color: var(--red);
}

.hour-detail {
  margin-top: 12px;
}

.hour-detail summary {
  cursor: pointer;
  color: var(--green-deep);
  font-size: 13px;
  font-weight: 900;
}

.hour-detail-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.hour-detail-item {
  width: 100%;
  min-height: 54px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.58);
  color: var(--ink);
}

.hour-detail-item.is-active {
  border-color: var(--green-line);
  background: var(--green-soft);
}

.hour-detail-item.danger {
  border-color: rgba(225,88,80,.28);
  background: var(--red-soft);
}

.hour-note {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.note-card.conclusion {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(234,255,240,.86), rgba(255,255,255,.62));
}

.source {
  padding: 0 18px 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  font-weight: 740;
}

.hour-bar {
  display: grid;
  gap: 6px;
  justify-items: center;
  color: var(--muted);
  font-size: 10px;
}

.hour-bar i {
  width: 100%;
  max-width: 16px;
  border-radius: 999px 999px 3px 3px;
  background: linear-gradient(180deg, rgba(225,88,80,.42), rgba(225,88,80,.12));
}

.hour-bar b {
  writing-mode: vertical-rl;
  font-size: 9px;
  color: var(--muted);
}

.queue-table th,
.queue-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
}

.actionBoard .daily-action-grid,
.daily-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.actions-card {
  min-height: 120px;
  padding: 16px;
  background: rgba(251,255,253,.82);
}

.actions-card b {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  line-height: 1.22;
}

.drawer-grid {
  display: grid;
  grid-template-columns: 370px minmax(0, 1fr);
  gap: 18px;
}

.drawer-card {
  padding: 20px;
  background: rgba(255,255,255,.66);
}

.drawer-card h3 {
  margin: 12px 0 0;
  font-size: 24px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.evidence {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.evidence div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.58);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 760;
}

.evidence b {
  display: inline;
  color: var(--ink);
}

button:active { transform: translateY(1px); }

.download-link {
  display: inline-grid;
  place-items: center;
  min-height: 36px;
  margin-top: 14px;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--green-deep);
  color: white;
  font-size: 14px;
}

.upload-form {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.upload-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.upload-form input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
  color: var(--ink);
  padding: 8px 10px;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(7, 60, 49, .18);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.drawer-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.live-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 21;
  width: min(980px, 94vw);
  height: 100dvh;
  padding: 24px;
  background: var(--surface);
  border-left: 1px solid var(--green-line);
  transform: translateX(105%);
  transition: transform .26s cubic-bezier(.16, 1, .3, 1);
  overflow-y: auto;
}

.live-drawer.is-open {
  transform: translateX(0);
}

.drawer-close {
  margin-bottom: 20px;
  background: var(--red-soft);
  color: var(--red);
}

.drawer-lead {
  color: var(--muted);
}

.drawer-command-panel,
.drawer-section {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.68);
}

.drawer-command-panel h3 {
  margin: 12px 0 8px;
  font-size: 22px;
  line-height: 1.2;
}

.drawer-metric-grid {
  display: grid;
  gap: 10px;
}

.drawer-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}

.drawer-roi-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 10px;
}

.drawer-metric {
  padding: 14px;
  border-radius: 8px;
  background: var(--green-soft);
}

.drawer-metric.danger {
  background: var(--red-soft);
}

.drawer-metric.safe {
  background: var(--green-soft);
}

.drawer-metric.danger b {
  color: var(--red);
}

.drawer-metric b {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.drawer-section b,
.drawer-section p {
  display: block;
  margin: 6px 0 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.drawer-section h4 {
  margin: 0 0 10px;
  font-size: 18px;
}

.drawer-lines {
  display: grid;
  gap: 8px;
}

.drawer-line {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
  line-height: 1.45;
  font-weight: 760;
}

.drawer-checklist {
  display: grid;
  gap: 8px;
}

.drawer-checklist div {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
  line-height: 1.45;
  font-weight: 760;
}

.ratio-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 80px;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.ratio-track {
  height: 14px;
  border-radius: 999px;
  background: rgba(107,129,123,.14);
  overflow: hidden;
}

.ratio-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(80,242,122,.56), rgba(80,242,122,.9));
}

.ratio-fill.warn {
  background: linear-gradient(90deg, rgba(225,88,80,.36), rgba(225,88,80,.86));
}

.signal-tags,
.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.signal-tag {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 12px;
  font-weight: 860;
}

.signal-tag.danger {
  background: var(--red-soft);
  color: var(--red);
}

.primary-btn {
  background: var(--green-deep);
  color: white;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 40;
  transform: translate(-50%, 20px);
  opacity: 0;
  padding: 12px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--green), #8bffad);
  color: var(--green-deep);
  font-size: 14px;
  font-weight: 860;
  box-shadow: 0 14px 40px rgba(6,22,19,.2);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}

.toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.break-even-bars,
.spec-bars {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.break-even-row,
.spec-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 64px;
  gap: 10px;
  align-items: center;
}

.break-even-row div,
.spec-row div {
  height: 14px;
  border-radius: 999px;
  background: rgba(107,129,123,.14);
  overflow: hidden;
}

.break-even-row i,
.spec-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(80,242,122,.56), rgba(80,242,122,.9));
}

.break-even-row.tone-danger i {
  background: linear-gradient(90deg, rgba(225,88,80,.36), rgba(225,88,80,.86));
}

.break-even-row b,
.spec-row b {
  font-size: 14px;
  text-align: right;
}

.spec-row {
  grid-template-columns: minmax(120px, .7fr) minmax(0, 1fr) 48px;
}

.spec-row strong,
.spec-row span {
  overflow-wrap: anywhere;
}

.spec-name em {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 760;
  line-height: 1.35;
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .shell.app-shell {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  .sidebar {
    position: sticky;
    top: 0;
    height: auto;
    z-index: 2;
  }
  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .side-rail {
    position: sticky;
    height: auto;
    grid-template-columns: repeat(5, max-content);
    z-index: 2;
  }
  .workspace {
    padding: 16px;
  }
  .topbar,
  .metric-grid,
  .decision-strip,
  .operator-grid,
  .mini-grid,
  .summary-board .metrics,
  .metrics,
  .trend-shell,
  .drawer-grid,
  .split-layout,
  .quality-grid,
  .support-grid,
  .section-head,
  .task-headline,
  .task-pool-status,
  .task-list,
  .day-focus,
  .month-conclusions,
  .hour-focus-strip,
  .hour-note,
  .task-row .task-metrics,
  .row-chip-grid,
  .daily-action-grid {
    grid-template-columns: 1fr;
  }
  .store-row {
    grid-template-columns: 1fr;
  }
  .month-grid {
    grid-template-columns: repeat(8, minmax(24px, 1fr));
  }
  .hour-chart {
    grid-template-columns: repeat(6, minmax(18px, 1fr));
  }
  .hour-detail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .break-even-row,
  .spec-row {
    grid-template-columns: 1fr;
  }
  .drawer-kpis {
    grid-template-columns: 1fr;
  }
}
