:root {
  --bg: #f6f5f1; --surface: #fff; --surface-2: #eeede7; --ink: #141413; --muted: #6b6a64; --line: #e3e1d9;
  --accent: #ff5a1f; --accent-deep: #d9480f; --accent-soft: #ffe7dc;
  --ok: #2f9e5f; --ok-soft: #dff3e7; --block: #9333ea; --block-soft: #f1e6fd; --prog: #2f5bd3; --prog-soft: #e2ecff;
  --night: #0d0d0c;
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif; --mono: "Geist Mono", ui-monospace, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; }
html { background: var(--bg); }
body { font-family: var(--font); color: var(--ink); -webkit-font-smoothing: antialiased; font-size: 15px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--night); }
.login form { width: 100%; max-width: 360px; background: var(--surface); border-radius: 24px; padding: 28px; display: grid; gap: 14px; }
.login .brand { margin-bottom: 6px; }
.login h1 { font-size: 24px; letter-spacing: -0.03em; }
.login p { color: var(--muted); font-size: 14px; }

/* ---------- Shell ---------- */
.shell { min-height: 100vh; padding-bottom: 96px; }
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -0.04em; font-size: 18px; text-decoration: none; }
.brand svg { width: 20px; height: 20px; fill: var(--ink); } .brand .a { fill: var(--accent); }
.brand small { font: 500 11px var(--mono); color: var(--muted); letter-spacing: .05em; text-transform: uppercase; margin-left: 4px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 14px; color: #fff; flex: none; }
.c0 { background: var(--ink); } .c1 { background: var(--accent-deep); } .c2 { background: var(--prog); } .cn { background: #b9b7ae; }

main { padding: 18px; max-width: 760px; margin: 0 auto; }
h1 { font-size: 28px; letter-spacing: -0.04em; font-weight: 700; }
.sub { color: var(--muted); margin-top: 4px; }
.sec { margin-top: 24px; }
.sec-title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; gap: 10px; }
.sec-title h2 { font: 500 12.5px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sec-title a, .link { font-size: 14px; color: var(--accent-deep); text-decoration: none; font-weight: 500; }
.empty { padding: 18px; color: var(--muted); text-align: center; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; text-align: left; text-decoration: none; display: block; }
.stat b { display: block; font-size: 26px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
.stat.hot { background: var(--accent); border-color: var(--accent); }
.stat.hot span { color: rgba(20,20,19,.75); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.list > * + * { border-top: 1px solid var(--line); }

/* Task rows */
.task { display: flex; gap: 12px; padding: 13px 14px; align-items: flex-start; width: 100%; text-align: left; cursor: pointer; }
.task:hover { background: #fbfaf7; }
.check { flex: none; width: 22px; height: 22px; border-radius: 7px; border: 2px solid #c9c7be; margin-top: 1px; display: grid; place-items: center; background: var(--surface); }
.check:hover { border-color: var(--ok); }
.done > .check, .check.on { background: var(--ok); border-color: var(--ok); }
.done > .check::after, .check.on::after { content: "✓"; color: #fff; font-size: 13px; font-weight: 700; }
.task.done .t-title { text-decoration: line-through; color: var(--muted); }
.t-body { flex: 1; min-width: 0; }
.t-title { font-weight: 550; font-size: 15.5px; line-height: 1.3; overflow-wrap: anywhere; }
.t-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; align-items: center; }
.pill { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.late { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }
.pill.today { background: #fff2c9; color: #8a5a00; font-weight: 600; }
.pill.bloqueada { background: var(--block-soft); color: var(--block); font-weight: 600; }
.pill.en_curso { background: var(--prog-soft); color: var(--prog); font-weight: 600; }
.pill.hecha { background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.pill.alta::before { content: "▲ "; }
.who { flex: none; width: 26px; height: 26px; border-radius: 50%; font-size: 11px; font-weight: 700; display: grid; place-items: center; color: #fff; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 0 18px 4px; margin: 14px -18px 0; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 500; white-space: nowrap; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.quick { display: flex; gap: 8px; margin-top: 16px; }
.quick input { flex: 1; min-width: 0; }

/* Forms */
input, select, textarea { width: 100%; font-size: 16px; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
textarea { resize: vertical; min-height: 90px; line-height: 1.45; }
label.f { display: grid; gap: 5px; }
label.f > span { font: 500 11.5px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form { display: grid; gap: 12px; }
.btn { padding: 11px 16px; border-radius: 12px; background: var(--accent); font-weight: 600; text-align: center; text-decoration: none; display: inline-block; }
.btn:disabled { opacity: .5; cursor: progress; }
.btn.ink { background: var(--ink); color: var(--bg); }
.btn.ghost { background: var(--surface); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: #b42318; border: 1px solid #f3c7c2; }
.btn.small { padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.err { color: #b42318; font-size: 14px; min-height: 1em; }

/* Projects */
.proj { padding: 16px; display: block; width: 100%; text-align: left; text-decoration: none; }
.proj:hover { background: #fbfaf7; }
.proj-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.proj h3 { font-size: 17px; letter-spacing: -0.02em; }
.proj p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.progress { height: 8px; background: var(--surface-2); border-radius: 4px; margin-top: 12px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.proj-foot { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 8px; gap: 8px; }

/* Leads */
.lead { padding: 16px; }
.lead-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.lead h3 { font-size: 16px; overflow-wrap: anywhere; }
.lead .meta { font: 12.5px var(--mono); color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.lead p { margin-top: 10px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* Money */
.row { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; gap: 10px; }
.row .l { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.row .l small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; margin-top: 2px; }
.row .r { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.x { width: 28px; height: 28px; border-radius: 8px; color: var(--muted); font-size: 18px; line-height: 1; }
.x:hover { background: var(--surface-2); color: #b42318; }
.split { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.month { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.month b { min-width: 130px; text-align: center; }

/* Activity */
.act { padding: 11px 14px; font-size: 14px; }
.act small { color: var(--muted); display: block; font-size: 12.5px; margin-top: 2px; }

/* ---------- Bottom navigation (phone) ---------- */
.nav { position: fixed; bottom: 0; left: 0; right: 0; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); padding: 8px 6px calc(10px + env(safe-area-inset-bottom)); z-index: 10; }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); padding: 6px 0; border-radius: 12px; position: relative; text-decoration: none; }
.nav svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav a.on { color: var(--ink); font-weight: 600; }
.nav a.on svg { stroke: var(--accent-deep); }
.badge { position: absolute; top: 2px; right: calc(50% - 20px); background: var(--accent); color: var(--ink); font-size: 10px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
.fab { position: fixed; bottom: calc(86px + env(safe-area-inset-bottom)); right: 18px; width: 56px; height: 56px; border-radius: 18px; background: var(--ink); color: var(--bg); font-size: 28px; display: grid; place-items: center; box-shadow: 0 10px 30px -8px rgba(0,0,0,.4); z-index: 9; }

/* ---------- Sheet (task detail, forms) ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(13,13,12,.45); z-index: 20; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto; background: var(--bg); border-radius: 22px 22px 0 0; z-index: 21; padding: 10px 18px calc(28px + env(safe-area-inset-bottom)); }
.grab { width: 40px; height: 5px; border-radius: 3px; background: #cfcdc4; margin: 0 auto 14px; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.title-input { font-size: 21px; font-weight: 700; letter-spacing: -0.03em; border: 0; background: transparent; padding: 4px 0; border-radius: 6px; }
.title-input:focus { background: var(--surface); padding: 4px 8px; }
.cl-item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; }
.cl-item span { flex: 1; overflow-wrap: anywhere; }
.cl-item.done span { text-decoration: line-through; color: var(--muted); }
.cl-item .check { width: 20px; height: 20px; }
.comment { padding: 12px 14px; }
.comment b { font-size: 13px; } .comment small { color: var(--muted); font-size: 12px; margin-left: 6px; }
.comment p { margin-top: 4px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.add-row { display: flex; gap: 8px; padding: 10px 12px; }
.add-row input { padding: 8px 10px; font-size: 15px; }

.toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 40; max-width: calc(100vw - 32px); }
.toast.bad { background: #b42318; color: #fff; }

/* ---------- Computer: side navigation and a side panel for details ---------- */
@media (min-width: 900px) {
  .shell { padding-bottom: 0; padding-left: 220px; }
  .nav { top: 0; bottom: 0; right: auto; width: 220px; grid-template-columns: 1fr; align-content: start; gap: 4px; padding: 76px 12px 12px; border-top: 0; border-right: 1px solid var(--line); background: var(--surface); }
  .nav a { flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 15px; padding: 10px 12px; }
  .nav a.on { background: var(--surface-2); }
  .badge { position: static; margin-left: auto; }
  .top { position: fixed; left: 0; right: 0; z-index: 11; }
  main { padding: 92px 32px 40px; max-width: 980px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .fab { bottom: 28px; right: 28px; }
  .sheet { left: auto; top: 0; width: 520px; max-height: none; border-radius: 0; border-left: 1px solid var(--line); padding: 24px 24px 40px; }
  .sheet .grab { display: none; }
  .toast { bottom: 28px; }
}
