:root {
  --lenovo-red: #E31937;
  --lenovo-red-dark: #B8142C;
  --ink: #1A1A1A;
  --ink-2: #3D3D3D;
  --muted: #6B6B6B;
  --line: #E4E4E4;
  --surface: #FFFFFF;
  --bg: #F4F4F5;
  --bg-2: #EBEBED;
  --nav: #1A0B1F;
  --purple: #4D144A;
  --band-red: #E8B4B0;
  --band-green: #B4D2BE;
  --band-blue: #B0C6DE;
  --band-red-ink: #7A2E2A;
  --band-green-ink: #1F5C38;
  --band-blue-ink: #1E3A5F;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
  --radius: 10px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}
button, select, input { font: inherit; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  background: linear-gradient(180deg, var(--nav) 0%, #120814 100%);
  color: #EDE4F0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.brand { padding: 18px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand .logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.brand .logo .mark {
  background: var(--lenovo-red); color: #fff; font-size: 11px;
  padding: 3px 7px; border-radius: 4px; letter-spacing: .04em;
}
.brand .sub { margin-top: 8px; font-size: 12px; color: #B9A8BF; line-height: 1.35; }
.nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav button {
  appearance: none; border: 0; background: transparent; color: #D8CBDD;
  text-align: left; padding: 11px 12px; border-radius: 8px; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px;
}
.nav button:hover { background: rgba(255,255,255,.06); }
.nav button.active {
  background: rgba(227,25,55,.18); color: #fff;
  box-shadow: inset 3px 0 0 var(--lenovo-red);
}
.nav button .n { font-size: 13.5px; font-weight: 600; }
.nav button .d { font-size: 11px; color: #A998B0; }
.side-foot {
  padding: 12px 14px 16px; border-top: 1px solid rgba(255,255,255,.08);
  font-size: 11px; color: #9A879F; line-height: 1.4;
}
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding: 12px 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.topbar h1 { margin: 0; font-size: 18px; font-weight: 650; }
.topbar .meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.spacer { flex: 1; }
.field {
  display: flex; flex-direction: column; gap: 4px; font-size: 11px;
  color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.field select {
  min-width: 200px; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; background: #fff; color: var(--ink);
  font-size: 13.5px; font-weight: 500; text-transform: none; letter-spacing: 0;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #F8E8EB; color: var(--lenovo-red-dark); border: 1px solid #F0C9D0;
  border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 600;
}
.chip .live {
  width: 7px; height: 7px; border-radius: 50%; background: #22A06B;
  box-shadow: 0 0 0 3px rgba(34,160,107,.18);
}
.content { padding: 18px 20px 28px; overflow: auto; flex: 1; }
.view { display: none; animation: in .18s ease; }
.view.active { display: block; }
@keyframes in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.grid { display: grid; gap: 14px; }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-2 { grid-template-columns: 1.25fr 1fr; }
@media (max-width: 1100px) {
  .g-4, .g-3, .g-2 { grid-template-columns: 1fr; }
  .sidebar { width: 72px; }
  .nav button .d, .brand .sub, .side-foot, .brand .logo .txt { display: none; }
}
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card .hd {
  padding: 14px 16px 0; display: flex; align-items: baseline;
  justify-content: space-between; gap: 10px;
}
.card .hd h2 { margin: 0; font-size: 14px; font-weight: 650; }
.card .hd .hint { font-size: 12px; color: var(--muted); }
.card .bd { padding: 14px 16px 16px; }
.kpi { padding: 14px 16px; }
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi .value {
  margin-top: 6px; font-size: 28px; font-weight: 700;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.kpi .delta { margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); font-weight: 700; padding: 8px 10px;
  border-bottom: 1px solid var(--line); background: #FAFAFA;
}
table.data td {
  padding: 10px; border-bottom: 1px solid #F0F0F0; vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
table.data tr:hover td { background: #FCF7F8; }
table.data tr.clickable { cursor: pointer; }
.table-wrap { overflow-x: auto; }
.rank {
  width: 28px; height: 28px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; background: var(--bg-2); color: var(--ink-2);
}
.rank.top { background: #1A0B1F; color: #fff; }
.pill {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: 3px 9px; font-size: 12px; font-weight: 700;
}
.pill.red { background: var(--band-red); color: var(--band-red-ink); }
.pill.green { background: var(--band-green); color: var(--band-green-ink); }
.pill.blue { background: var(--band-blue); color: var(--band-blue-ink); }
.pill.none { background: #EEE; color: #666; }
.score-cell {
  font-weight: 700; border-radius: 6px; padding: 4px 8px;
  display: inline-block; min-width: 42px; text-align: center;
}
.score-cell.red { background: var(--band-red); color: var(--band-red-ink); }
.score-cell.green { background: var(--band-green); color: var(--band-green-ink); }
.score-cell.blue { background: var(--band-blue); color: var(--band-blue-ink); }
.score-cell.none { background: #F0F0F0; color: #888; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.note {
  background: #FFF8E8; border: 1px solid #F0E0B0; color: #6A5416;
  border-radius: 8px; padding: 10px 12px; font-size: 12.5px; line-height: 1.45;
}
.body { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.body.muted, .muted { color: var(--muted); }
.small { font-size: 12px; }
.idea, .rec, .trend, .plan-item, .lever {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  margin-bottom: 10px; background: #fff;
}
.idea h3, .rec h3, .trend h3 { margin: 0 0 6px; font-size: 14px; }
.idea p, .rec p, .trend p, .plan-item p, .lever p {
  margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.45;
}
.tag {
  font-size: 11px; font-weight: 700; color: var(--purple);
  background: #F4EAF3; border-radius: 999px; padding: 3px 8px;
  display: inline-block; margin: 2px 4px 0 0;
}
.checklist { margin: 0; padding-left: 18px; color: var(--ink-2); line-height: 1.7; font-size: 14px; }
.toast {
  position: fixed; bottom: 18px; right: 18px; background: #1A0B1F; color: #fff;
  padding: 10px 14px; border-radius: 8px; font-size: 13px; z-index: 20;
}
.toast.hidden { display: none; }
.empty { color: var(--muted); font-size: 13px; padding: 8px 0; }
.studio-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 12px;
}
.studio-controls .field input {
  min-width: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  width: 100%;
}
.btn:disabled { opacity: .55; cursor: wait; }
.studio-meta {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 10px;
}
