:root {
  --night: #15101f;
  --panel: #1f1830;
  --panel-2: #271e3c;
  --line: rgba(255, 255, 255, 0.09);
  --ink: #efeaf7;
  --muted: #a39cb5;
  --lilac: #b79eeb;
  --gold: #e3b34f;
  --red: #e5484d;
  --blue: #4c8be0;
  --orange: #e8963c;
  --gray: #8a8698;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --night: #f4efe6; --panel: #ffffff; --panel-2: #f1ebf8; --line: rgba(40, 20, 70, 0.12);
    --ink: #1d1530; --muted: #6c6480; --lilac: #5b3fa3; --gold: #a9781a;
    color-scheme: light;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--night); color: var(--ink); font: 14px/1.45 var(--sans); }
h1, h2, h3 { font-family: var(--serif); margin: 0; line-height: 1.2; }
h1 { font-size: 22px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.boot { padding: 40px; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 12px; } .num { font-variant-numeric: tabular-nums; }
.gold { color: var(--gold); }

/* Estructura */
.shell { display: grid; grid-template-columns: 196px minmax(0, 1fr); height: 100vh; }
.side { border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 17px; padding: 0 8px 14px; }
.brand span { color: var(--gold); }
.nav { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px; border: 0; background: none; text-align: left; width: 100%; color: var(--muted); }
.nav:hover { background: var(--panel); color: var(--ink); }
.nav[aria-current="page"] { background: var(--panel-2); color: var(--ink); font-weight: 600; }
.nav i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: 0.6; }
.nav[aria-current="page"] i { background: var(--gold); opacity: 1; }
.account { margin-top: auto; padding: 8px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.main { overflow: auto; min-width: 0; padding: 18px 22px 40px; }
.head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.head .grow { flex: 1; min-width: 160px; }
.head p { margin: 2px 0 0; }

/* Piezas */
.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 12px; font-weight: 600; font-size: 13px; }
.btn:hover { border-color: var(--lilac); }
.btn.primary { background: var(--lilac); color: var(--night); border-color: transparent; }
.btn.ghost { background: none; }
.btn.danger { color: var(--red); }
.icon { width: 30px; height: 30px; padding: 0; border-radius: 50%; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { border: 0; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 600; background: color-mix(in srgb, var(--c, var(--lilac)) 16%, transparent); color: var(--c, var(--lilac)); }
.chip[aria-pressed="true"] { background: var(--c, var(--lilac)); color: var(--night); }
.quick { display: flex; gap: 8px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; }
.quick input { flex: 1; border: 0; background: none; outline: none; min-width: 0; }
.empty { text-align: center; color: var(--muted); padding: 22px 10px; font-size: 13px; }
.bar { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--gold) 20%, transparent); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--gold); border-radius: 3px; transition: width 0.25s; }

/* Tarea */
.task { display: flex; gap: 9px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 8px 10px; cursor: grab; }
.task.mini { padding: 6px 8px; border-radius: 8px; font-size: 13px; }
.task.dragging { opacity: 0.4; }
.task .check { flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--q, var(--gray)); background: none; padding: 0; }
.task.done .check { background: var(--gold); border-color: var(--gold); }
.task .body { flex: 1; min-width: 0; border: 0; background: none; padding: 0; text-align: left; }
.task .title { font-weight: 500; overflow-wrap: anywhere; }
.task.done .title { text-decoration: line-through; color: var(--muted); }
.task .meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 11px; color: var(--muted); margin-top: 2px; }
.task .meta b { color: var(--q); font-weight: 600; }
.task .late { color: var(--red); }
.task .go { flex: none; border: 0; background: none; color: var(--muted); font-size: 16px; padding: 0 2px; }
.task .go:hover { color: var(--gold); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--c); margin-right: 3px; }
.stack { display: flex; flex-direction: column; gap: 7px; }

/* Tablero */
.board { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px; align-items: start; }
.col { background: color-mix(in srgb, var(--panel) 55%, transparent); border: 1px solid var(--line); border-radius: 13px; padding: 10px; min-height: 200px; }
.col.over, .quad.over { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 9%, transparent); }
.col header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 9px; }
.col header span { margin-left: auto; }

/* Prioridad */
.matrix { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quad { border: 1px solid color-mix(in srgb, var(--q) 35%, transparent); background: color-mix(in srgb, var(--q) 7%, transparent); border-radius: 13px; padding: 10px; min-height: 190px; }
.quad header { display: flex; gap: 8px; align-items: baseline; margin-bottom: 8px; }
.quad header h3 { color: var(--q); }
.quad header button { margin-left: auto; }
.next { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.next .grow { flex: 1; min-width: 0; }

/* Hoy */
.today { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.week { display: flex; gap: 4px; margin-bottom: 12px; }
.week button { flex: 1; border: 1px solid transparent; background: none; border-radius: 10px; padding: 5px 0; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.week button:hover { background: var(--panel); }
.week button[aria-pressed="true"] { background: var(--lilac); color: var(--night); }
.week .is-today { color: var(--lilac); font-weight: 700; }
.week button[aria-pressed="true"] .is-today { color: inherit; }
.week small { font-size: 10px; opacity: 0.75; }
.week .mark { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); visibility: hidden; }
.week .has .mark { visibility: visible; }
.timeline { position: relative; }
.hour { height: 40px; border-top: 1px solid var(--line); padding-left: 46px; position: relative; cursor: copy; }
.hour:hover { background: color-mix(in srgb, var(--lilac) 6%, transparent); }
.hour span { position: absolute; left: 0; top: -8px; font-size: 11px; color: var(--muted); background: var(--panel); padding-right: 6px; }
.block { position: absolute; left: 50px; right: 4px; border: 0; border-left: 3px solid var(--q, var(--lilac)); background: color-mix(in srgb, var(--q, var(--lilac)) 24%, var(--panel)); border-radius: 7px; padding: 2px 8px; text-align: left; font-size: 12px; overflow: hidden; display: flex; gap: 8px; }
.block b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.now { position: absolute; left: 44px; right: 0; height: 2px; background: var(--gold); pointer-events: none; }
.now::before { content: ""; position: absolute; left: -3px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.focus { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.ring { --p: 0; width: 48px; height: 48px; border-radius: 50%; background: conic-gradient(var(--gold) calc(var(--p) * 1%), color-mix(in srgb, var(--gold) 18%, transparent) 0); display: grid; place-items: center; flex: none; }
.ring span { width: 36px; height: 36px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font-size: 11px; font-weight: 700; }

/* Planificar */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.sprint { display: flex; gap: 12px; align-items: center; text-align: left; width: 100%; }
.sprint .grow { flex: 1; min-width: 0; }
.section { margin: 18px 0 8px; display: flex; align-items: center; gap: 10px; }
.section button { margin-left: auto; }
.proj { display: flex; flex-direction: column; gap: 6px; }
.proj header { display: flex; align-items: center; gap: 6px; }
.proj header button { margin-left: auto; }

/* Billetera */
.total { font-family: var(--serif); font-size: 30px; font-weight: 700; }
.days { display: flex; align-items: flex-end; gap: 2px; height: 54px; margin-top: 10px; }
.days i { flex: 1; background: var(--gold); border-radius: 2px 2px 0 0; min-height: 1px; opacity: 0.9; }
.days i.zero { background: var(--line); }
.exp { display: flex; gap: 10px; align-items: center; width: 100%; border: 0; background: none; text-align: left; padding: 7px 0; border-top: 1px solid var(--line); }
.exp:first-child { border-top: 0; }
.exp .grow { flex: 1; min-width: 0; }
.exp .name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wallet { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 14px; align-items: start; }
.dayhead { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin: 12px 2px 5px; }

/* Diálogo */
dialog { border: 1px solid var(--line); border-radius: 15px; background: var(--panel); color: var(--ink); padding: 18px; width: min(460px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(8, 5, 14, 0.6); }
form { display: grid; gap: 10px; }
label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
label.row { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; }
input[type="text"], input[type="number"], input[type="date"], input[type="datetime-local"], select, textarea {
  background: var(--night); border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; color: var(--ink); width: 100%; font-size: 14px;
}
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.actions .danger { margin-right: auto; }
.swatches { display: flex; gap: 8px; }
.swatches label { display: block; }
.swatches input { position: absolute; opacity: 0; }
.swatches span { display: block; width: 26px; height: 26px; border-radius: 50%; background: var(--c); border: 3px solid transparent; }
.swatches input:checked + span { border-color: var(--ink); }
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }
.center .card { max-width: 420px; padding: 26px; }
.center ol { text-align: left; padding-left: 18px; color: var(--muted); }

@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .side { order: 2; flex-direction: row; border-right: 0; border-top: 1px solid var(--line); padding: 6px; gap: 2px; }
  .brand, .account { display: none; }
  .nav { flex-direction: column; gap: 3px; font-size: 11px; padding: 6px 2px; align-items: center; }
  .main { padding: 14px 14px 24px; }
  .today, .wallet, .matrix { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(4, 82vw); overflow-x: auto; scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
