/* Hub — estilos. Sin JavaScript. */
@font-face {
  font-family: "Geist"; src: url("fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
:root {
  --bg: #e5eaed;
  --side: #f4f6f5;
  --card: #ffffff;
  --ink: #16181b;
  --ink-2: #4b5157;
  --muted: #7b8288;
  --line: #e4e7ea;
  --line-2: #d6dbdf;
  --brand: #1f5eff;
  --accent: #16181b;
  --ok: #16a34a;
  --danger: #dc2626;
  --warn: #d97706;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 20px 50px rgba(16, 24, 40, .18);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.inline { display: inline; margin: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.grow { flex: 1; }
.spacer { height: 16px; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky; top: 10px; align-self: flex-start;
  width: 232px; flex: 0 0 232px; height: calc(100vh - 20px);
  margin: 10px 0 10px 10px; padding: 12px 10px;
  background: var(--side); border-radius: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow-y: auto;
}
.brand { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 12px; }
.brand-link { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.logo {
  width: 26px; height: 26px; border-radius: 7px; background: var(--brand); color: #fff;
  display: inline-grid; place-items: center; font-weight: 700; font-style: italic; font-size: 15px;
}
.logo.sm { width: 22px; height: 22px; font-size: 13px; }
.logo.lg { width: 44px; height: 44px; font-size: 24px; border-radius: 11px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-group { font-size: 11.5px; color: var(--muted); padding: 14px 10px 4px; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink);
  font-weight: 500;
}
.nav-link i { width: 16px; text-align: center; font-size: 13px; color: var(--ink-2); }
.nav-link:hover { background: rgba(0, 0, 0, .04); }
.nav-link.is-on { background: #fff; box-shadow: var(--shadow); }
.nav-link .count {
  margin-left: auto; font-style: normal; font-size: 11px; color: var(--muted);
  background: rgba(0, 0, 0, .06); border-radius: 999px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 5px;
}
.nav-sub { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 30px; border-radius: 8px; font-size: 13px; color: var(--ink-2); }
.nav-sub:hover { background: rgba(0, 0, 0, .04); }
.nav-sub.is-on { background: #fff; color: var(--ink); }
.sq { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex: none; }
.side-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 4px 0; }
.icon-btn {
  position: relative; width: 32px; height: 32px; border-radius: 8px; display: inline-grid; place-items: center;
  color: var(--ink-2); background: transparent; border: 0; cursor: pointer; font-size: 14px;
}
.icon-btn:hover { background: rgba(0, 0, 0, .06); color: var(--ink); }
.icon-btn.is-rec { color: var(--danger); }
.bubble {
  position: absolute; top: 1px; right: 0; font-style: normal; font-size: 10px; background: var(--danger); color: #fff;
  border-radius: 999px; min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 4px;
}
.avatar {
  width: 30px; height: 30px; border-radius: 8px; background: #8a5a44; color: #fff; display: grid; place-items: center;
  font-weight: 600; text-transform: lowercase;
}
.timer-pill {
  display: flex; gap: 10px; align-items: center; margin: 10px 2px 0; padding: 10px; border-radius: 10px;
  background: #fff; box-shadow: var(--shadow); font-size: 12.5px;
}
.timer-pill b { display: block; font-weight: 600; }
.timer-pill small { color: var(--muted); }
.rec { color: var(--danger); font-size: 9px; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .25; } }

.main { flex: 1; min-width: 0; padding: 26px 34px 60px; }
.mobile-bar { display: none; }
.only-mobile { display: none; }
.scrim { display: none; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head h1 { font-size: 20px; font-weight: 600; }
.page-head p { color: var(--ink-2); margin-top: 3px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- Botones ---------- */
.btn, .btn-ghost, .btn-light {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 8px; font: inherit;
  font-weight: 500; cursor: pointer; border: 1px solid transparent; white-space: nowrap;
}
.btn { background: var(--accent); color: #fff; }
.btn:hover { background: #33373c; }
.btn-light { background: #fff; border-color: var(--line-2); color: var(--ink); }
.btn-light:hover { background: #f7f8f9; }
.btn-ghost { background: transparent; color: var(--ink-2); height: 30px; padding: 0 9px; }
.btn-ghost:hover { background: rgba(0, 0, 0, .05); color: var(--ink); }
.btn.sm, .btn-light.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.block { width: 100%; justify-content: center; height: 40px; }
.btn.danger { background: var(--danger); }
.btn-ghost.danger { color: var(--danger); }
.btn.ok { background: var(--ok); }

.seg { display: inline-flex; background: rgba(0, 0, 0, .05); border-radius: 8px; padding: 2px; }
.seg-btn { width: 30px; height: 28px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); }
.seg-btn.is-on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }

/* ---------- Tarjetas ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.card h3 { font-size: 14px; font-weight: 600; padding-bottom: 10px; margin-bottom: 6px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.card h3 a { font-weight: 500; font-size: 12.5px; color: var(--muted); }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 14px 16px 16px; }
.stat span { color: var(--ink-2); font-size: 12.5px; display: flex; gap: 7px; align-items: center; }
.stat b { display: block; font-size: 26px; font-weight: 600; margin-top: 10px; letter-spacing: -.02em; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .muted { font-size: 12.5px; }

.welcome { text-align: center; margin: 12px 0 26px; }
.welcome .avatar { width: 52px; height: 52px; border-radius: 12px; font-size: 24px; margin: 0 auto 10px; }
.welcome h1 { font-size: 20px; font-weight: 600; }
.welcome p { color: var(--ink-2); margin-top: 2px; }
.narrow { max-width: 900px; margin: 0 auto; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 8px; border-radius: 999px;
  background: #f1f3f5; color: var(--ink-2); white-space: nowrap;
}
.dot { width: 7px; height: 7px; border-radius: 999px; display: inline-block; }
.chip { font-size: 11px; background: #f1f3f5; color: var(--ink-2); padding: 2px 7px; border-radius: 6px; }
.over { color: var(--danger) !important; }

/* ---------- Tablas ---------- */
.table-wrap { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tr:hover td { background: #fafbfb; }
.t td a.name { font-weight: 500; }
.t tfoot td { font-weight: 600; background: #fafbfb; }

/* ---------- Formularios ---------- */
.form { display: grid; gap: 12px; }
.form .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .cols3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=time],
input[type=datetime-local], input[type=password], input[type=search], input:not([type]), select, textarea {
  font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: 8px;
  padding: 8px 10px; width: 100%; min-height: 36px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(31, 94, 255, .25); border-color: var(--brand); }
.check { display: flex; align-items: center; gap: 8px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.mini-form { display: flex; gap: 6px; align-items: center; }
.mini-form select, .mini-form input { min-height: 30px; padding: 4px 8px; font-size: 12.5px; width: auto; }
.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.colors label { cursor: pointer; }
.colors input { position: absolute; opacity: 0; }
.colors i { display: block; width: 26px; height: 26px; border-radius: 7px; border: 2px solid transparent; }
.colors input:checked + i { border-color: var(--ink); box-shadow: inset 0 0 0 2px #fff; }

/* ---------- Modal (sin JS: se abre por URL) ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; overflow-y: auto; }
.modal-bg { position: fixed; inset: 0; background: rgba(20, 24, 28, .38); }
.modal { position: relative; background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; }
.modal.wide { width: min(820px, 100%); }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 12px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.modal header h2 { font-size: 16px; font-weight: 600; }
.modal-body { padding: 18px 20px 20px; }

/* Confirmación de borrado sin JS */
details.confirm { position: relative; display: inline-block; }
details.confirm summary { list-style: none; display: inline-flex; }
details.confirm summary::-webkit-details-marker { display: none; }
.confirm-box { position: absolute; right: 0; top: 36px; z-index: 5; width: 240px; background: #fff; border-radius: 10px; box-shadow: var(--shadow-lg); padding: 12px; }
.confirm-box p { font-size: 13px; margin-bottom: 10px; }
.modal .confirm-box, .form-actions .confirm-box { top: auto; bottom: 38px; left: 0; right: auto; }

/* Menú desplegable sin JS */
details.menu { position: relative; }
details.menu summary { list-style: none; }
details.menu summary::-webkit-details-marker { display: none; }
.menu-box { position: absolute; right: 0; top: 36px; z-index: 6; min-width: 200px; background: #fff; border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; display: flex; flex-direction: column; }
.menu-box a, .menu-box button { text-align: left; padding: 8px 10px; border-radius: 6px; font: inherit; border: 0; background: none; cursor: pointer; display: flex; gap: 8px; align-items: center; width: 100%; }
.menu-box a:hover, .menu-box button:hover { background: #f3f4f6; }

/* ---------- Flash ---------- */
.flash { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 10px; margin-bottom: 18px; background: #ecfdf3; color: #166534; font-weight: 500; }
.flash-error { background: #fef2f2; color: #991b1b; }

/* ---------- Vacío ---------- */
.empty { max-width: 420px; margin: 9vh auto 0; }
.empty-icon { width: 46px; height: 46px; border-radius: 12px; background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; font-size: 18px; margin-bottom: 18px; }
.empty h2 { font-size: 18px; font-weight: 600; margin-bottom: 10px; }
.empty ul { margin: 0 0 18px; padding-left: 16px; color: var(--ink-2); font-size: 13px; line-height: 1.8; }
.empty-inline { color: var(--muted); padding: 12px 0; font-size: 13px; }

/* ---------- Kanban ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input[type=search] { max-width: 260px; min-height: 34px; }
.toolbar select { width: auto; min-height: 34px; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(205px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: rgba(255, 255, 255, .45); border-radius: 12px; padding: 10px; min-height: 120px; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 10px; font-weight: 600; font-size: 13px; }
.col-head .muted { font-weight: 400; font-size: 12px; }
.kcard { background: #fff; border-radius: 10px; box-shadow: var(--shadow); padding: 11px 12px; margin-bottom: 8px; display: block; }
.kcard .t1 { font-weight: 600; display: block; }
.kcard .t2 { color: var(--muted); font-size: 12.5px; }
.kcard .foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 10px; }
.kcard .val { font-weight: 600; font-size: 12.5px; }
.kmove { display: flex; gap: 4px; }
.kmove button { border: 0; background: #f1f3f5; border-radius: 6px; width: 26px; height: 24px; cursor: pointer; color: var(--ink-2); font-size: 11px; }
.kmove button:hover { background: #e3e6e9; color: var(--ink); }
.col-add { display: flex; align-items: center; gap: 6px; color: var(--muted); padding: 6px 4px; font-size: 13px; }
.col-add:hover { color: var(--ink); }

/* ---------- Proyectos ---------- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.pcard { position: relative; background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 14px; min-height: 170px; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.pcard::after { content: ""; position: absolute; top: 0; right: 0; width: 8px; height: 100%; background: linear-gradient(var(--c), transparent); }
.pcard .ini { width: 28px; height: 28px; border-radius: 7px; background: #f1f3f5; display: grid; place-items: center; font-size: 11px; font-weight: 600; margin-bottom: 10px; }
.pcard b { font-size: 15px; }
.pcard .muted { font-size: 12.5px; }
.pcard .bar { height: 4px; background: #eef0f2; border-radius: 99px; margin-top: 10px; overflow: hidden; }
.pcard .bar i { display: block; height: 100%; background: var(--ink); }
.pnew { border: 1.5px dashed var(--line-2); background: transparent; box-shadow: none; align-items: center; justify-content: center; text-align: center; }
.pnew::after { display: none; }
.pnew .plus { width: 26px; height: 26px; border-radius: 99px; background: var(--ink); color: #fff; display: grid; place-items: center; margin-bottom: 8px; font-size: 12px; }
.color-strip { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-2); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 8px 12px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; white-space: nowrap; }
.tabs a.is-on { color: var(--ink); border-color: var(--ink); }

.task { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #fff; border-radius: 9px; box-shadow: var(--shadow); margin-bottom: 6px; }
.task .ttl { flex: 1; min-width: 0; }
.task .ttl b { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; }
.task.done .ttl b { text-decoration: line-through; color: var(--muted); }
.tick { border: 1.5px solid var(--line-2); background: #fff; width: 20px; height: 20px; border-radius: 6px; cursor: pointer; display: grid; place-items: center; color: #fff; font-size: 10px; padding: 0; }
.tick:hover { border-color: var(--ink); }
.task.done .tick { background: var(--ok); border-color: var(--ok); }

/* ---------- Planner ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); gap: 8px; overflow-x: auto; }
.day { background: rgba(255, 255, 255, .5); border-radius: 12px; padding: 8px; min-height: 260px; }
.day.today { background: #fff; box-shadow: var(--shadow); }
.day-head { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 4px 8px; }
.day-head b { font-size: 18px; font-weight: 600; }
.day-head span { color: var(--muted); font-size: 12px; text-transform: capitalize; }
.day.today .day-head b { color: var(--brand); }
.ptask { display: block; background: #fff; border-radius: 8px; padding: 7px 8px; margin-bottom: 6px; font-size: 12.5px; box-shadow: var(--shadow); border-left: 3px solid var(--c, #ccc); }
.ptask small { display: block; color: var(--muted); font-size: 11px; }
.ptask.done { opacity: .5; text-decoration: line-through; }
.day-add { display: flex; gap: 4px; margin-top: 4px; }
.day-add input { min-height: 28px; padding: 3px 7px; font-size: 12px; }
.day-add button { border: 0; background: transparent; cursor: pointer; color: var(--muted); }

/* ---------- Timer ---------- */
.timer-card { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.timer-card .field { flex: 1; min-width: 160px; }
.running { display: flex; align-items: center; gap: 14px; background: #fff; border-radius: 12px; padding: 14px 18px; box-shadow: var(--shadow); border-left: 4px solid var(--danger); }
.running b { font-size: 15px; }

/* ---------- Factura imprimible ---------- */
.doc { background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 40px; max-width: 820px; margin: 0 auto; }
.doc-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.doc h1 { font-size: 26px; }
.doc .t td, .doc .t th { padding: 10px 8px; }
.totals { margin-left: auto; width: 280px; margin-top: 14px; }
.totals div { display: flex; justify-content: space-between; padding: 5px 0; }
.totals .grand { border-top: 1px solid var(--ink); font-weight: 700; font-size: 16px; padding-top: 8px; margin-top: 4px; }
.print-body { background: #fff; }
.print-body .doc { box-shadow: none; }
.print-bar { max-width: 820px; margin: 20px auto; display: flex; gap: 8px; justify-content: space-between; align-items: center; }
@media print {
  .print-bar, .sidebar, .mobile-bar { display: none !important; }
  body { background: #fff; }
  .doc { padding: 0; }
}

/* ---------- Login ---------- */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); padding: 30px; width: min(380px, 100%); display: grid; gap: 14px; }
.login-card h1 { font-size: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .main { padding: 14px 16px 60px; }
  .mobile-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
  .only-mobile { display: inline-grid; }
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; margin: 0; height: 100vh; border-radius: 0 16px 16px 0; transform: translateX(-105%); transition: transform .2s; }
  .nav-toggle:checked ~ .app .sidebar { transform: none; }
  .nav-toggle:checked ~ .app .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .3); }
  .g2, .g3 { grid-template-columns: 1fr; }
  .form .cols, .form .cols3 { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; }
  .week { grid-template-columns: 1fr; }
  .day { min-height: 0; }
  .doc { padding: 20px; }
  .doc-head { flex-direction: column; }
}
@media (max-width: 520px) { .g4 { grid-template-columns: 1fr 1fr; } .stat b { font-size: 21px; } }
