:root {
  --bg: #f6f5f2; --surface: #ffffff; --ink: #1d1d1b; --muted: #6b6a66; --line: #e4e2dc;
  --accent: #2f5d8a; --ok: #2e7d4f; --bad: #b3261e; --warn: #9a6700; --grey: #b8b6b0;
  --ai: #6b4fa0; --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161615; --surface: #201f1d; --ink: #ecebe7; --muted: #9c9a94; --line: #34332f;
    --accent: #7fa8d4; --ok: #5cbf86; --bad: #f08a80; --warn: #e0b354; --grey: #5d5b56; --ai: #b39ddb;
  }
}
:root[data-theme="dark"] {
  --bg: #161615; --surface: #201f1d; --ink: #ecebe7; --muted: #9c9a94; --line: #34332f;
  --accent: #7fa8d4; --ok: #5cbf86; --bad: #f08a80; --warn: #e0b354; --grey: #5d5b56; --ai: #b39ddb;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
main { max-width: 1200px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.5rem; margin: 0 0 12px; }
h2 { font-size: 1.05rem; margin: 0 0 12px; }
h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 6px; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { font-weight: 700; color: var(--ink); }
.version { font-size: .75rem; font-weight: 500; color: var(--muted); margin-left: 4px; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.ok { color: var(--ok); } .bad { color: var(--bad); }
.error { color: var(--bad); }
button, select, input, textarea { font: inherit; color: inherit; }
button { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 5px 10px; cursor: pointer; }
button:hover { border-color: var(--accent); }
button:disabled { opacity: .6; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.link { border: 0; background: none; color: var(--accent); padding: 0; }
input, select, textarea { border: 1px solid var(--line); background: var(--bg); border-radius: 6px; padding: 6px 8px; min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; }
.kpi .label { font-size: .8rem; color: var(--muted); }
.kpi .value { font-size: 1.6rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: .8rem; color: var(--muted); }
.kpi .value small { font-size: .8rem; font-weight: 400; }
.tag { display: inline-block; font-size: .75rem; padding: 0 6px; border-radius: 4px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); margin-left: 4px; }
.tag.ai { color: var(--ai); border-color: var(--ai); }
.alarm { border-left: 3px solid var(--bad); padding-left: 8px; }
.priorities li { margin-bottom: 8px; }
.ask, .add { display: flex; gap: 8px; margin-top: 12px; }
.ask input, .add input { flex: 1; }
.answer { white-space: pre-wrap; margin-top: 8px; }
details summary { cursor: pointer; color: var(--muted); margin-top: 12px; }
.actions { list-style: none; padding: 0; margin: 0; }
.actions li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0 8px 10px; border-bottom: 1px solid var(--line); border-left: 3px solid var(--grey); }
.actions li.impact-alto { border-left-color: var(--bad); }
.actions li.impact-medio { border-left-color: var(--warn); }
.actions li.proposal { background: color-mix(in srgb, var(--ai) 7%, transparent); }
.actions li.done { opacity: .55; }
.row-actions { display: flex; gap: 6px; align-items: flex-start; flex-shrink: 0; }
.projects { width: 100%; border-collapse: collapse; }
.projects td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.projects td.dot { width: 18px; }
.projects td.stage { white-space: nowrap; color: var(--muted); }
.projects td.git { white-space: nowrap; text-align: right; }
.light { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--grey); margin-top: 6px; }
.light.green { background: var(--ok); } .light.red { background: var(--bad); }
.prio { font-size: .7rem; margin-left: 6px; color: var(--muted); }
.prio.p1 { color: var(--bad); font-weight: 700; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; overflow-wrap: anywhere; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
.stack label > * { color: var(--ink); }
.login { max-width: 360px; margin: 12vh auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.login form { display: flex; flex-direction: column; gap: 12px; }
.login label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; margin-bottom: 16px; }
.hero > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.hero .label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.hero .big { font-size: 2.6rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--ok); }
.hero .sub { font-size: .85rem; color: var(--muted); margin: 0; }
.stecche ul { margin: 4px 0 0; padding-left: 18px; }
.stecche li { margin: 2px 0; } .stecche li.grave, .stecche li.grave a { color: var(--bad); font-weight: 600; }
.stecche.clean .label { color: var(--ok); }
.orchestra { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 20px; }
.orchestra h3 { margin-top: 4px; }
.instrument { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.instrument .light { flex-shrink: 0; }
.links a { margin-right: 14px; }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .projects td.next, .projects td.git { display: none; }
  .actions li { flex-direction: column; }
}
