/* WeSea Tasks — sistema visual
 *
 * Tokens extraídos del diseño de pantallas (Marea, sep 2026): papel cálido
 * #ECEAE4, tinta casi negra, azul #2E45E6 como único acento de marca, y las
 * tipografías Bricolage Grotesque (títulos) / Schibsted Grotesk (texto) /
 * Spline Sans Mono (datos y etiquetas).
 *
 * Se conservan TODOS los nombres de clase que ya usan las plantillas
 * (.card, .btn, .task-card, .column, .cal-*, .badge…), así que el rediseño
 * entra sin reescribir el markup — misma estrategia que se usó en
 * WeSeaListing.
 */

:root {
  /* ── Papel y tinta ──────────────────────────────────────────────── */
  --paper:      #ECEAE4;   /* lienzo de la app */
  --paper-2:    #FBFAF7;   /* barra lateral y zonas de contenido */
  --paper-3:    #F6F5F1;
  --paper-4:    #EBE9E3;
  --surface:    #FFFFFF;   /* tarjetas */

  --ink:        #16181D;   /* texto fuerte y botones sólidos */
  --ink-2:      #494D55;
  --ink-3:      #6C7078;
  --ink-4:      #8A8F98;   /* texto tenue */
  --ink-5:      #9A9C9F;

  --line:       #E6E4DE;   /* borde por defecto */
  --line-2:     #DDD9D0;
  --line-3:     #C9CBCF;

  /* ── Acento ─────────────────────────────────────────────────────── */
  --accent:     #2E45E6;
  --accent-2:   #D8E0FF;   /* tinte */
  --accent-ink: #1B2AA8;

  /* ── Estados ────────────────────────────────────────────────────── */
  --ok:        #2E7D4F;
  --ok-bg:     #DCEFE7;
  --warn:      #E0A428;
  --warn-bg:   #F7EDDC;
  --warn-ink:  #8A6420;
  --danger:    #D6453B;
  --danger-bg: #F8E3E1;
  --violet:    #8B5CF6;
  --violet-bg: #EFE9FE;

  /* ── Tipografía ─────────────────────────────────────────────────── */
  --font-display: "Bricolage Grotesque", "Schibsted Grotesk", system-ui, sans-serif;
  --font-text:    "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "Spline Sans Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* ── Formas ─────────────────────────────────────────────────────── */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 12px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* Sombras muy contenidas: el diseño se apoya en el borde, no en la
     profundidad. Solo el drawer y los modales levantan de verdad. */
  --shadow-card: 0 1px 2px rgba(22, 24, 29, .04);
  --shadow-hover: 0 2px 8px rgba(22, 24, 29, .07);
  --shadow-pop: 0 18px 48px rgba(22, 24, 29, .16);
  --ring: 0 0 0 3px rgba(46, 69, 230, .16);

  --sidebar-w: 232px;
  --topbar-h: 60px;

  /* Compatibilidad con nombres antiguos que aún aparecen en plantillas. */
  --border: var(--line);
  --text-strong: var(--ink);
  --text-body: var(--ink-2);
  --text-muted: var(--ink-4);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--font-text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0 0 .4em;
  letter-spacing: -.015em;
  font-weight: 700;
}
h1 { font-size: 1.5rem; }
h2 { font-size: 1.06rem; }
h3 { font-size: .94rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono, .num { font-family: var(--font-mono); font-size: .86em; }

/* Rótulo pequeño en versalitas: el patrón del diseño para encabezar
   secciones ("VENCIDAS 2", "SÁBADO 5 SEP · 3 SALIDAS"). */
.eyebrow, .side-label, .stat .k, table.list th, .group-row td {
  font-family: var(--font-mono);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-4);
  font-weight: 500;
}

/* ── Estructura ───────────────────────────────────────────────────── */

.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  background: var(--paper-2);
  border-right: 1px solid var(--line);
  padding: 16px 12px 22px;
  position: sticky; top: 0; height: 100vh;
  overflow-y: auto; display: flex; flex-direction: column; gap: 16px;
}

.brand {
  display: flex; align-items: center; gap: 9px;
  padding: 2px 6px 12px;
  font-family: var(--font-display);
  font-weight: 700; font-size: 1.06rem; color: var(--ink);
  letter-spacing: -.02em;
}
/* Marca: cuadrado azul con la onda y el check. Clase suelta (no anidada en
   .brand) porque también se usa en la pantalla de acceso. */
.mark {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: var(--accent); display: inline-grid; place-items: center;
}
.mark svg { display: block; }
.login-card .mark { width: 30px; height: 30px; border-radius: 9px; }

.side-group { display: flex; flex-direction: column; gap: 2px; }
.side-label { padding: 14px 10px 6px; }

.side-link {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: var(--r-sm);
  color: var(--ink-2); font-size: .875rem; font-weight: 500;
  text-decoration: none; transition: background .12s, color .12s;
}
.side-link:hover { background: var(--paper-4); color: var(--ink); text-decoration: none; }
/* El activo es una píldora sólida de tinta — la firma del diseño. */
.side-link.active { background: var(--ink); color: #fff; font-weight: 600; }
.side-link.active:hover { background: var(--ink); color: #fff; }
/* Punto de color reutilizable. Vivía anidado en .side-link, así que en Leads
   y en el Cronograma salía sin tamaño — invisible. */
.swatch {
  width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block;
}
.side-link .swatch { width: 8px; height: 8px; }
.ic { flex: none; color: var(--ink-4); }
.side-link .ic { color: var(--ink-3); }
.side-link:hover .ic { color: var(--ink); }
.side-link.active .ic { color: #fff; }
.btn .ic { color: currentColor; }
.side-link .count {
  margin-left: auto; font-family: var(--font-mono);
  font-size: .72rem; color: var(--ink-5);
}
.side-link.active .count { color: rgba(255,255,255,.65); }

.side-foot {
  margin-top: auto; padding: 0 10px;
  font-family: var(--font-mono); font-size: .68rem; color: var(--ink-5);
}

.main { display: flex; flex-direction: column; min-width: 0; background: var(--paper-2); }

.topbar {
  height: var(--topbar-h); background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; padding: 0 22px;
  position: sticky; top: 0; z-index: 40;
}
.topbar h1 { margin: 0; font-size: 1.12rem; }
.topbar .spacer { flex: 1; }

.content { padding: 22px 24px 64px; min-width: 0; }
.content.flush { padding: 0; }

/* Saludo de "Mi día": rótulo en versalitas + titular grande. */
.greeting { margin: 4px 0 22px; }
.greeting .date {
  font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase;
  letter-spacing: .12em; color: var(--ink-4); margin-bottom: 8px;
}
.greeting h1 {
  font-size: 2.1rem; letter-spacing: -.035em; margin: 0 0 4px; line-height: 1.1;
}
.greeting p { margin: 0; color: var(--ink-3); font-size: .95rem; }
.greeting strong { color: var(--ink); font-weight: 600; }
.greeting .bad { color: var(--danger); font-weight: 600; }

/* ── Botones ──────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font-family: var(--font-text); font-size: .85rem; font-weight: 500;
  padding: 7px 14px; border-radius: var(--r-pill);
  cursor: pointer; transition: .12s; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--paper-3); border-color: var(--line-3); text-decoration: none; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #000; border-color: #000; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-3); }
.btn.ghost:hover { background: var(--paper-4); color: var(--ink); }
.btn.danger { color: var(--danger); border-color: #EFCDCA; background: var(--surface); }
.btn.danger:hover { background: var(--danger-bg); }
.btn.sm { padding: 4px 11px; font-size: .78rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── Formularios ──────────────────────────────────────────────────── */

label {
  display: block; font-size: .78rem; font-weight: 500;
  color: var(--ink-3); margin-bottom: 5px;
}
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=time], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 8px 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  font-family: var(--font-text); font-size: .875rem;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--ring);
}
input::placeholder, textarea::placeholder { color: var(--ink-5); }
textarea { min-height: 84px; resize: vertical; line-height: 1.55; }
input[type=color] {
  width: 40px; height: 32px; padding: 2px; border: 1px solid var(--line-2);
  border-radius: var(--r-xs); background: var(--surface);
}
.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }
.check {
  display: flex; align-items: center; gap: 7px; font-size: .85rem;
  color: var(--ink-2); font-weight: 400; margin: 0;
}
.check input { width: auto; accent-color: var(--accent); }

/* ── Superficies ──────────────────────────────────────────────────── */

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-card);
}
.card.pad { padding: 18px 20px; }
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.card-head h2, .card-head h3 { margin: 0; }
.card-head .spacer { flex: 1; }

.grid { display: grid; gap: 14px; }
.grid.k2 { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.grid.k3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.k4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
/* Tabla ancha + panel estrecho. `minmax(0, …)` es obligatorio: sin él la
   columna coge el min-content de la tabla y esta desborda su tarjeta. */
.grid.wide-first { grid-template-columns: minmax(0, 1.75fr) minmax(270px, 1fr); }
@media (max-width: 1080px) { .grid.wide-first { grid-template-columns: 1fr; } }

/* Cualquier tabla que no quepa hace scroll dentro de su tarjeta, nunca
   empuja el layout. */
.table-wrap { overflow-x: auto; }

.stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 14px 16px;
}
.stat .v {
  font-family: var(--font-display); font-size: 1.9rem; font-weight: 700;
  color: var(--ink); line-height: 1.1; letter-spacing: -.03em; margin-top: 2px;
}
.stat .v.warn { color: var(--warn-ink); }
.stat .v.bad { color: var(--danger); }
.stat .v.good { color: var(--ok); }

.empty { text-align: center; padding: 36px 18px; color: var(--ink-4); font-size: .875rem; }
.empty .big { font-size: 1.7rem; margin-bottom: 6px; }

/* ── Distintivos y avatares ───────────────────────────────────────── */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: var(--r-pill);
  font-family: var(--font-mono); font-size: .69rem; font-weight: 500;
  background: var(--paper-4); color: var(--ink-3); white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.p3 { background: var(--danger-bg); color: var(--danger); }
.badge.p2 { background: var(--warn-bg); color: var(--warn-ink); }
.badge.p1 { background: var(--paper-4); color: var(--ink-4); }
.badge.p0 { background: var(--paper-3); color: var(--ink-5); }
.badge.done { background: var(--ok-bg); color: var(--ok); }
.badge.overdue { background: var(--danger-bg); color: var(--danger); }

.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-text); font-size: .68rem; font-weight: 600;
  color: #fff; flex: none; box-shadow: 0 0 0 2px var(--surface);
  letter-spacing: .01em;
}
.avatar.lg { width: 38px; height: 38px; font-size: .82rem; }
.avatar.sm { width: 22px; height: 22px; font-size: .6rem; }
.avatars { display: inline-flex; }
.avatars .avatar + .avatar { margin-left: -7px; }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .7rem; font-weight: 500; padding: 2px 8px;
  border-radius: var(--r-xs); border: 1px solid transparent;
}

/* ── Tablero ──────────────────────────────────────────────────────── */
/* Las columnas no tienen fondo: en el diseño flotan sobre el papel y solo
   las tarjetas son blancas. */

.board {
  display: flex; gap: 16px; padding: 20px 24px 48px; overflow-x: auto;
  align-items: flex-start; min-height: calc(100vh - var(--topbar-h));
}
.column { flex: 0 0 292px; display: flex; flex-direction: column; max-height: 100%; }
.column.drop-target { background: rgba(46, 69, 230, .05); border-radius: var(--r-lg); }
.column-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 12px; }
/* En Leads la etapa lleva color elegido por el equipo: se pinta como barra
   sobre la cabecera para que se lea de un vistazo, no solo como puntito. */
#leads-board .column-head, #leads-board .stage-edit {
  border-top: 3px solid var(--stage-color, var(--line-2));
  border-radius: 3px 3px 0 0; padding-top: 9px; margin-top: 2px;
}
.column-head .name {
  font-family: var(--font-text); font-weight: 600; font-size: .875rem; color: var(--ink);
}
.column-head .n { font-family: var(--font-mono); font-size: .72rem; color: var(--ink-5); }
.column-head .wip { font-family: var(--font-mono); color: var(--danger); font-size: .72rem; }
.column-body { display: flex; flex-direction: column; gap: 9px; min-height: 24px; }
.column-foot { padding: 9px 0 0; }
.column-foot .btn {
  border-style: dashed; border-color: var(--line-2); background: transparent;
  color: var(--ink-4);
}
.column-foot .btn:hover { background: var(--paper-3); color: var(--ink-2); }

.task-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 12px 13px; cursor: pointer;
  box-shadow: var(--shadow-card); transition: box-shadow .12s, border-color .12s;
}
.task-card:hover { box-shadow: var(--shadow-hover); border-color: var(--line-2); }
.task-card.dragging { opacity: .4; }
.task-card .t {
  color: var(--ink); font-weight: 600; font-size: .875rem;
  line-height: 1.35; letter-spacing: -.005em;
}
.task-card.is-done { background: var(--paper-3); }
.task-card.is-done .t { text-decoration: line-through; color: var(--ink-4); font-weight: 500; }
.task-card .meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: .68rem; color: var(--ink-4);
  text-transform: uppercase; letter-spacing: .05em; margin-top: 9px;
}
.task-card .tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 8px; }
.task-card .bar {
  height: 3px; background: var(--paper-4); border-radius: 2px;
  margin-top: 10px; overflow: hidden;
}
.task-card .bar > i { display: block; height: 100%; background: var(--accent); }

/* ── Listas ───────────────────────────────────────────────────────── */

table.list { width: 100%; border-collapse: collapse; background: var(--surface); }
table.list th {
  text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line);
  position: sticky; top: var(--topbar-h); background: var(--surface); z-index: 5;
}
/* `.table-wrap` lleva overflow, así que es su propio contenedor de scroll y
   el `top` de la cabecera se mide desde ahí, no desde la ventana. Con el
   offset de la barra superior, la cabecera se plantaba 56px hacia dentro y
   tapaba la primera fila — que es lo que hacía que el primer usuario
   apareciese cortado por encima del encabezado. */
.table-wrap table.list th { top: 0; }
table.list td {
  padding: 11px 14px; border-bottom: 1px solid var(--paper-4);
  vertical-align: middle; font-size: .875rem;
}
table.list tbody tr:hover { background: var(--paper-3); cursor: pointer; }
table.list tr.done td { color: var(--ink-4); }
table.list tr.done .title { text-decoration: line-through; }
.title { color: var(--ink); font-weight: 600; letter-spacing: -.005em; }
.group-row td { background: var(--paper-3); }

/* Casilla circular: vacía con borde, marcada en azul de marca. */
.tick {
  width: 18px; height: 18px; border: 1.5px solid var(--line-3);
  border-radius: 50%; display: inline-block; cursor: pointer; flex: none;
  transition: .12s; position: relative; background: var(--surface);
}
.tick:hover { border-color: var(--accent); }
.tick.on { background: var(--accent); border-color: var(--accent); }
.tick.on::after {
  content: ""; position: absolute; left: 5.4px; top: 2.4px;
  width: 5px; height: 9px; border: solid #fff; border-width: 0 1.8px 1.8px 0;
  transform: rotate(42deg);
}

/* Plegar las tareas de una reserva. Antes el bloque salía siempre y en casi
   todas ponía "0/0 · Todavía no hay tareas": la misma frase repetida sesenta
   veces tapaba las reservas, que es a lo que se entra. */
.rsv-toggle {
  flex: none; width: 30px; height: 30px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-4); display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: .15s; padding: 0; align-self: center;
}
.rsv-toggle:hover { border-color: var(--ink-5); color: var(--ink); }
.rsv-toggle.open { transform: rotate(180deg); color: var(--accent); border-color: var(--accent); }

/* ── Fila de tarea (lista continua de "Mi día") ────────────────────────
   El spec no separa el día en cajas: es una sola columna agrupada por
   VENCIDAS / HOY / … Las cajas dejaban la pantalla llena de estados vacíos
   cuando hay poco trabajo, que es justo cuando peor sienta. */
.day-group { margin-bottom: 22px; }
.day-group > .head {
  display: flex; align-items: center; gap: 9px; margin: 0 0 9px 2px;
}
.day-group > .head .lbl {
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .14em;
  color: var(--ink-4); font-weight: 600; text-transform: uppercase;
}
.day-group > .head .lbl.bad { color: var(--danger); }
.day-group > .head .n { font-family: var(--font-mono); font-size: .62rem; color: var(--ink-4); }
.day-group > .list { display: flex; flex-direction: column; gap: 7px; }

.task-row {
  display: flex; align-items: center; gap: 11px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 13px; padding: 11px 14px; transition: .12s;
}
.task-row:hover { border-color: var(--ink-5); }
.task-row .body { flex: 1; min-width: 0; }
.task-row .t {
  font-weight: 600; font-size: .9rem; color: var(--ink);
  letter-spacing: -.005em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.task-row .sub {
  display: flex; align-items: center; gap: 10px; margin-top: 3px;
  font-size: .72rem; color: var(--ink-4);
}
.task-row .sub .proj { display: flex; align-items: center; gap: 5px; }
.task-row .sub .dot { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.task-row .sub .bad { color: var(--danger); font-weight: 600; }
.task-row .chips { display: flex; gap: 5px; flex: none; }
.task-row.is-done .t { color: var(--ink-4); text-decoration: line-through; }

@media (max-width: 720px) {
  .task-row .chips { display: none; }
  .task-row .t { white-space: normal; }
}

/* ── Calendario ───────────────────────────────────────────────────── */

.cal-toolbar {
  display: flex; align-items: center; gap: 10px; padding: 14px 24px;
  border-bottom: 1px solid var(--line); background: var(--paper-2);
}
.cal-toolbar .title {
  font-family: var(--font-display); font-weight: 700; font-size: 1.06rem;
  color: var(--ink); min-width: 190px; text-transform: capitalize;
  letter-spacing: -.02em;
}
.seg {
  display: inline-flex; border: 1px solid var(--line-2);
  border-radius: var(--r-pill); overflow: hidden; background: var(--surface);
}
.seg button {
  border: none; background: transparent; padding: 5px 14px; font-size: .8rem;
  font-weight: 500; color: var(--ink-3); cursor: pointer; font-family: var(--font-text);
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--ink); color: #fff; font-weight: 600; }
.seg a { text-decoration: none; }

.cal-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}
.cal-dow {
  padding: 8px 10px; min-width: 0; background: var(--paper-2);
  border-bottom: 1px solid var(--line); border-right: 1px solid var(--line);
  font-family: var(--font-mono); font-size: .66rem; text-transform: uppercase;
  letter-spacing: .1em; color: var(--ink-4); font-weight: 500;
}
.cal-cell {
  min-height: 120px; min-width: 0; overflow: hidden;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 6px 7px; background: var(--surface);
  display: flex; flex-direction: column; gap: 3px;
}
.cal-cell.other { background: var(--paper-3); }
.cal-cell.today { background: #F4F6FF; }
.cal-cell.drop-target { background: var(--accent-2); box-shadow: inset 0 0 0 2px var(--accent); }
.cal-cell .d {
  font-family: var(--font-mono); font-size: .72rem; color: var(--ink-4);
  display: flex; align-items: center; justify-content: space-between;
}
.cal-cell.today .d { color: var(--accent); font-weight: 500; }
.cal-cell .add {
  opacity: 0; border: none; background: transparent; cursor: pointer;
  color: var(--accent); font-size: .95rem; line-height: 1;
}
.cal-cell:hover .add { opacity: 1; }

.chip {
  border-radius: var(--r-xs); padding: 3px 7px; font-size: .73rem; cursor: pointer;
  display: block; background: var(--paper-3); color: var(--ink);
  border-left: 3px solid var(--accent); overflow: hidden; flex: none;
  white-space: nowrap; text-overflow: ellipsis; font-weight: 500;
}
.chip.busy {
  background: var(--paper-4); color: var(--ink-4);
  border-left-color: var(--line-3); font-style: italic; font-weight: 400;
}
.chip.done { opacity: .5; text-decoration: line-through; }
.chip.overdue { background: var(--danger-bg); border-left-color: var(--danger); }
.chip .hh { font-family: var(--font-mono); font-size: .66rem; color: var(--ink-4); }
.chip.dragging { opacity: .4; }

.cal-week { display: grid; grid-template-columns: 58px repeat(7, minmax(0, 1fr)); }
.cal-week .hour {
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--paper-4);
  height: 44px; font-family: var(--font-mono); font-size: .66rem;
  color: var(--ink-5); padding: 2px 6px; text-align: right;
}
.cal-week .slot {
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--paper-4);
  height: 44px; min-width: 0; overflow: hidden; position: relative;
  background: var(--surface);
}
.cal-week .slot.drop-target { background: var(--accent-2); }

/* ── Leads ────────────────────────────────────────────────────────── */

.lead-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 12px 13px; cursor: pointer;
  box-shadow: var(--shadow-card); transition: box-shadow .12s, border-color .12s;
}
.lead-card:hover { box-shadow: var(--shadow-hover); border-color: var(--line-2); }
.lead-card.dragging { opacity: .4; }
/* Medidas tomadas del spec: nombre 13.5px/700, píldora 11px, descripción
   11.5px, importe en Bricolage 800 a 14px. Son deliberadamente pequeñas —
   la tarjeta tiene que dejar ver muchos leads a la vez. */
.lead-card .top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.lead-card .nm { font-weight: 700; font-size: 13.5px; color: var(--ink); letter-spacing: -.01em; }
.lead-card .desc {
  font-size: 11.5px; color: var(--ink-3); margin-top: 6px; line-height: 1.45;
}
.lead-card .foot {
  display: flex; align-items: center; gap: 8px; margin-top: 11px; min-height: 22px;
}
.lead-card .val {
  font-family: var(--font-display); font-weight: 800; font-size: 14px;
  color: var(--ink); margin-left: auto; letter-spacing: -.02em;
}
/* Aviso de que toca actuar: rojo, en versalitas, sin fondo. Grita lo justo. */
.lead-card .urgent {
  display: flex; align-items: center; gap: 5px; font-family: var(--font-mono);
  font-size: 10px; font-weight: 600; color: var(--danger);
  text-transform: uppercase; letter-spacing: .06em;
}
.lead-card .urgent::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor;
}
.lead-card .soon { color: var(--warn-ink); }
.lead-card .avatar { width: 22px; height: 22px; font-size: .62rem; box-shadow: none; }
/* Píldora de canal: el color dice de dónde viene sin tener que leerlo. */
.chan {
  font-size: 11px; font-weight: 600; border-radius: var(--r-pill);
  padding: 2px 8px; white-space: nowrap;
}
/* Tarea de seguimiento dentro de la tarjeta: casilla cuadrada, como el spec. */
.lead-task {
  display: flex; align-items: center; gap: 8px; margin-top: 9px;
  padding-top: 9px; border-top: 1px solid var(--paper-4);
  font-size: .78rem; color: var(--ink-2);
}
.lead-task .box {
  width: 16px; height: 16px; border-radius: 5px; border: 2px solid var(--line-3);
  box-sizing: border-box; flex: none; cursor: pointer; position: relative;
}
.lead-task .box:hover { border-color: var(--accent); }
.lead-task .box.on { background: var(--accent); border-color: var(--accent); }
.lead-task .box.on::after {
  content: ""; position: absolute; left: 3.6px; top: 1px; width: 4px; height: 7px;
  border: solid #fff; border-width: 0 1.7px 1.7px 0; transform: rotate(42deg);
}
.lead-task .txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: 11.5px; font-weight: 500; }
.lead-task.is-done .txt { text-decoration: line-through; color: var(--ink-4); }
.lead-task .due {
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; color: var(--ink-4);
  text-transform: uppercase; letter-spacing: .05em;
}
.lead-task .due.urgent { color: var(--danger); }

/* Edición de etapas en la propia cabecera de columna. */
.stage-edit { display: flex; align-items: center; gap: 5px; padding: 2px 0 10px; }
.stage-edit input[type=text] { padding: 4px 8px; font-size: .82rem; font-weight: 600; }
.stage-edit input[type=color] { width: 26px; height: 26px; padding: 1px; }
.stage-edit .btn { padding: 2px 7px; font-size: .74rem; }
.column.new-stage {
  border: 1px dashed var(--line-2); border-radius: var(--r-lg);
  padding: 12px; min-height: 90px;
}

/* ── Mi día: columna principal + rail ─────────────────────────────── */

.with-rail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .with-rail { grid-template-columns: 1fr; } }
.rail { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 82px; }

.mini-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mini-cal .dow {
  font-family: var(--font-mono); font-size: .6rem; color: var(--ink-5);
  text-align: center; padding-bottom: 4px; text-transform: uppercase;
}
.mini-cal .day {
  aspect-ratio: 1; display: grid; place-items: center; position: relative;
  font-family: var(--font-mono); font-size: .72rem; color: var(--ink-2);
  border-radius: var(--r-xs); text-decoration: none;
}
.mini-cal .day:hover { background: var(--paper-4); text-decoration: none; }
.mini-cal .day.other { color: var(--line-3); }
.mini-cal .day.today { background: var(--accent); color: #fff; font-weight: 500; }
/* Punto bajo el número = ese día tiene algo. Se ve la forma del mes de un
   vistazo sin leer ni una cifra. */
.mini-cal .day .dot {
  position: absolute; bottom: 3px; width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent);
}
.mini-cal .day.today .dot { background: #fff; }

.agenda-item {
  display: flex; gap: 10px; align-items: flex-start; padding: 9px 0;
  border-bottom: 1px solid var(--paper-4); cursor: pointer;
}
.agenda-item:last-child { border-bottom: none; }
.agenda-item .at {
  font-family: var(--font-mono); font-size: .7rem; color: var(--ink-4);
  width: 42px; flex: none; padding-top: 2px;
}
.agenda-item .t { font-size: .84rem; color: var(--ink); font-weight: 500; line-height: 1.35; }
.agenda-item .s { font-size: .72rem; color: var(--ink-4); margin-top: 1px; }
.agenda-item .stripe { width: 3px; border-radius: 2px; align-self: stretch; flex: none; }
.agenda-item.done .t { text-decoration: line-through; color: var(--ink-4); }

/* Carga del equipo: tarjeta oscura, como en el spec. */
.load-card { background: var(--ink); border-radius: var(--r-lg); padding: 15px 16px; }
.load-card .eyebrow { color: rgba(255,255,255,.5); margin-bottom: 12px; }
.load-row { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.load-row:last-child { margin-bottom: 0; }
.load-row .who { font-size: .78rem; color: #fff; width: 34px; flex: none; }
.load-row .track { flex: 1; height: 7px; background: rgba(255,255,255,.12); border-radius: 4px; }
.load-row .track > i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.load-row .track > i.hot { background: var(--warn); }
.load-row .n { font-family: var(--font-mono); font-size: .72rem; color: rgba(255,255,255,.65); }

/* ── Cronograma ───────────────────────────────────────────────────── */

.tl { min-width: 760px; }
.tl-head {
  display: grid; align-items: center;
  border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 6px;
}
.tl-col {
  font-family: var(--font-mono); font-size: .66rem; color: var(--ink-4);
  text-align: center; text-transform: uppercase; letter-spacing: .06em;
}
.tl-col.today { color: #fff; background: var(--ink); border-radius: var(--r-xs); padding: 2px 0; }
.tl-col.weekend { color: var(--line-3); }

.tl-group { margin-bottom: 6px; }
.tl-group > .eyebrow { display: flex; align-items: center; gap: 7px; padding: 14px 0 8px; }
.tl-group > .eyebrow .swatch { width: 8px; height: 8px; border-radius: 50%; }

.tl-row { display: grid; align-items: center; height: 34px; }
.tl-row .label {
  font-size: .84rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; padding-right: 14px; cursor: pointer;
}
.tl-track { position: relative; height: 100%; }
/* Rejilla de fondo: una línea por día, para poder leer dónde cae cada barra. */
.tl-track::before {
  content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(to right,
    var(--paper-4) 0 1px, transparent 1px var(--tl-step));
}
.tl-bar {
  position: absolute; top: 50%; transform: translateY(-50%); height: 20px;
  border-radius: var(--r-pill); display: flex; align-items: center;
  justify-content: flex-end; padding: 0 3px; cursor: pointer;
  font-size: .7rem; min-width: 26px;
}
.tl-bar.done { opacity: .45; }
.tl-bar .avatar { box-shadow: none; }

/* ── Chips del calendario ─────────────────────────────────────────── */
/* En el spec las tareas son píldoras SÓLIDAS de color y los eventos de
   Google van en contorno: se distingue de un vistazo qué es tuyo y qué
   viene de fuera, sin leer. */
.chip {
  border-radius: var(--r-xs); padding: 3px 8px; font-size: .73rem; cursor: pointer;
  display: block; overflow: hidden; flex: none; white-space: nowrap;
  text-overflow: ellipsis; font-weight: 500;
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
}
.chip .hh { font-family: var(--font-mono); font-size: .66rem; opacity: .75; }
.chip.busy {
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--warn); font-weight: 500;
}
.chip.busy .hh { color: var(--warn-ink); opacity: 1; }
.chip.done { background: var(--paper-4); border-color: var(--line-2); color: var(--ink-4);
  text-decoration: line-through; }
.chip.overdue { background: var(--danger); border-color: var(--danger); }
.chip.dragging { opacity: .4; }

/* La celda de hoy va enmarcada y con el número en píldora. */
.cal-cell.today { background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent); }
.cal-cell.today .d > span:first-child {
  background: var(--accent); color: #fff; border-radius: var(--r-xs);
  padding: 0 6px; font-weight: 500;
}

/* ── Panel de avisos ──────────────────────────────────────────────── */

.filter-pills { display: flex; gap: 7px; flex-wrap: wrap; }
.filter-pills a {
  padding: 5px 13px; border-radius: var(--r-pill); font-size: .8rem;
  font-weight: 500; color: var(--ink-3); border: 1px solid var(--line-2);
  background: var(--surface); text-decoration: none;
}
.filter-pills a:hover { background: var(--paper-3); color: var(--ink); text-decoration: none; }
.filter-pills a.on { background: var(--ink); border-color: var(--ink); color: #fff; }

.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 18px; border-bottom: 1px solid var(--paper-4); cursor: pointer;
}
.notice:hover { background: var(--paper-3); }
.notice.read { opacity: .55; }
.notice .body { flex: 1; min-width: 0; }
.notice .txt { color: var(--ink); font-size: .875rem; line-height: 1.45; }
.notice .txt strong { font-weight: 600; }
.notice .meta {
  font-family: var(--font-mono); font-size: .66rem; text-transform: uppercase;
  letter-spacing: .09em; color: var(--ink-5); margin-top: 4px;
}
.notice .unread-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  flex: none; margin-top: 6px;
}
.notice .kind-icon {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--paper-4); color: var(--ink-3);
}
.notice .kind-icon.date { background: var(--danger-bg); color: var(--danger); }
.notice .kind-icon.digest { background: var(--accent-2); color: var(--accent); }

/* ── Reservas ─────────────────────────────────────────────────────── */

.day-head {
  font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase;
  letter-spacing: .12em; color: var(--ink-4); margin: 24px 0 10px;
}
.day-head:first-child { margin-top: 0; }

.rsv {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); margin-bottom: 12px; overflow: hidden;
}
.rsv-head { display: flex; gap: 13px; align-items: flex-start; padding: 15px 18px; }
.rsv-icon {
  width: 38px; height: 38px; border-radius: var(--r-sm); flex: none;
  display: grid; place-items: center; background: var(--paper-4); color: var(--ink-3);
}
.rsv-title { font-weight: 600; color: var(--ink); font-size: .95rem; letter-spacing: -.01em; }
.rsv-sub { color: var(--ink-3); font-size: .82rem; margin-top: 3px; }
.rsv-money { text-align: right; flex: none; }
.rsv-money .amount {
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--ink);
}
.rsv-tasks { border-top: 1px solid var(--line); background: var(--paper-3); padding: 12px 18px 14px; }
.rsv-tasks .head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
  font-family: var(--font-mono); font-size: .66rem; text-transform: uppercase;
  letter-spacing: .1em; color: var(--ink-4);
}
.rsv-task-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 8px; }
.rsv-task {
  display: flex; align-items: center; gap: 9px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 11px;
  font-size: .85rem; cursor: pointer;
}
.rsv-task:hover { border-color: var(--line-3); }
.rsv-task .t { flex: 1; min-width: 0; color: var(--ink); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.rsv-task.is-done .t { text-decoration: line-through; color: var(--ink-4); }

/* ── Panel lateral de detalle ─────────────────────────────────────── */

.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(22, 24, 29, .28);
  z-index: 90; opacity: 0; pointer-events: none; transition: opacity .16s;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(690px, 96vw);
  background: var(--paper-2); border-left: 1px solid var(--line); z-index: 91;
  transform: translateX(102%); transition: transform .2s ease; overflow-y: auto;
  box-shadow: var(--shadow-pop);
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px;
  border-bottom: 1px solid var(--line); background: var(--paper-2);
  position: sticky; top: 0; z-index: 3;
}
.drawer-body { padding: 18px; display: flex; flex-direction: column; gap: 16px; }

.detail-grid {
  display: grid; grid-template-columns: 120px 1fr; gap: 10px 14px; align-items: center;
}
.detail-grid > .k { font-size: .78rem; font-weight: 500; color: var(--ink-3); }

/* Estado como pastilla: al quitar el formulario del detalle era el único
   campo sin sitio natural, y en la fila de chips se lee de un vistazo. */
.pill-select {
  appearance: none; -webkit-appearance: none;
  background: var(--ink); color: var(--paper);
  border: none; border-radius: 999px; padding: 3px 24px 3px 11px;
  font-size: .72rem; font-weight: 600; line-height: 1.5; width: auto;
  min-height: 0; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23ECEAE4' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}

/* ── Ficha de tarea: tarjetas de datos ─────────────────────────────────
   El detalle era un formulario de etiqueta+control. El spec lo plantea al
   revés: primero se lee (cuatro tarjetas en 2×2), y solo se edita al tocar
   una. La tarjeta guarda las dos caras y cambia de una a otra. */
.info-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px;
}
.info-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 13px; padding: 10px 12px; cursor: pointer; min-width: 0;
}
.info-card:hover { border-color: var(--ink-5); }
.info-card.editing { cursor: default; border-color: var(--accent); }
.info-card > .k {
  font-family: var(--font-mono); font-size: .53rem; letter-spacing: .14em;
  color: var(--ink-4); text-transform: uppercase;
}
.info-card > .v {
  display: flex; align-items: center; gap: 7px; margin-top: 7px;
  font-weight: 600; font-size: .82rem; color: var(--ink);
  min-height: 20px; flex-wrap: wrap;
}
.info-card > .v.empty { color: var(--ink-4); font-weight: 500; }
.info-card .ed { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
/* `display:flex` de arriba le gana al `[hidden]{display:none}` del navegador,
   que es por especificidad, no por orden. Sin esta línea el editor se ve
   siempre y la tarjeta pierde la cara de lectura. */
.info-card .ed[hidden] { display: none; }
.info-card [data-view][hidden] { display: none; }
.info-card .ed select, .info-card .ed input { font-size: .82rem; }
.info-card .dot { width: 8px; height: 8px; border-radius: 3px; flex: none; }

/* Barra de progreso de los pasos, con su rótulo en versalitas. */
.step-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 18px 0 8px;
}
.step-head .lbl {
  font-family: var(--font-mono); font-size: .62rem; letter-spacing: .14em;
  color: var(--ink-4); font-weight: 600; text-transform: uppercase;
}
.step-head .n { font-family: var(--font-mono); font-size: .62rem; color: var(--accent); font-weight: 600; }
.step-bar { height: 5px; border-radius: 99px; background: var(--line); margin-bottom: 10px; }
.step-bar > i { display: block; height: 5px; border-radius: 99px; background: var(--accent); }
.step-row {
  display: flex; align-items: center; gap: 9px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 11px; padding: 9px 12px;
}
.step-row.done > span:last-child { color: var(--ink-4); text-decoration: line-through; }

@media (max-width: 720px) { .info-cards { grid-template-columns: 1fr; } }

.feed { display: flex; flex-direction: column; gap: 12px; }
.feed-item { display: flex; gap: 10px; }
.feed-item .body { flex: 1; min-width: 0; }
.feed-item .who { font-size: .82rem; font-weight: 600; color: var(--ink); }
.feed-item .when { font-family: var(--font-mono); font-size: .68rem; color: var(--ink-5); }
.feed-item .txt { font-size: .875rem; white-space: pre-wrap; word-break: break-word; }
.feed-item.sys .txt { color: var(--ink-4); font-size: .82rem; }

/* ── Modales y menús ──────────────────────────────────────────────── */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(22, 24, 29, .32);
  display: none; align-items: flex-start; justify-content: center; z-index: 100;
  padding: 8vh 16px; overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--r-xl);
  box-shadow: var(--shadow-pop); width: min(620px, 100%); overflow: hidden;
}
.modal-head { padding: 18px 22px 14px; }
.modal-body { padding: 4px 22px 18px; }
.modal-foot {
  padding: 14px 22px; border-top: 1px solid var(--line);
  display: flex; gap: 9px; justify-content: flex-end; background: var(--paper-3);
}

.pop { position: relative; }
.pop-panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 280px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: 7px;
  display: none; z-index: 60;
}
.pop-panel.open { display: block; }
.pop-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  border-radius: var(--r-sm); font-size: .85rem; cursor: pointer; color: var(--ink-2);
}
.pop-item:hover { background: var(--paper-3); }
.pop-sep { height: 1px; background: var(--line); margin: 5px 2px; }

.bell { position: relative; }
.bell .n {
  position: absolute; top: -3px; right: -4px; background: var(--accent);
  color: #fff; font-family: var(--font-mono); font-size: .62rem; font-weight: 500;
  min-width: 17px; height: 17px; border-radius: 9px; display: flex;
  align-items: center; justify-content: center; padding: 0 4px;
  box-shadow: 0 0 0 2px var(--paper-2);
}

/* ── Utilidades ───────────────────────────────────────────────────── */

.flash {
  padding: 11px 15px; border-radius: var(--r-sm); font-size: .85rem;
  margin-bottom: 14px; border: 1px solid;
}
.flash.ok { background: var(--ok-bg); border-color: #BEDFD0; color: var(--ok); }
.flash.err { background: var(--danger-bg); border-color: #EFCDCA; color: #A9312A; }
.flash.warn { background: var(--warn-bg); border-color: #EBD6AC; color: var(--warn-ink); }

.muted { color: var(--ink-4); }
.small { font-size: .8rem; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.sep { height: 1px; background: var(--line); margin: 14px 0; }
.hidden { display: none !important; }
.bar-track { height: 6px; background: var(--paper-4); border-radius: 3px; overflow: hidden; }
.bar-track > i { display: block; height: 100%; border-radius: 3px; }

.filters {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 12px 24px; background: var(--paper-2); border-bottom: 1px solid var(--line);
}
.filters select, .filters input {
  width: auto; min-width: 130px; padding: 5px 10px; font-size: .82rem;
  border-radius: var(--r-pill);
}

/* ── Acceso ───────────────────────────────────────────────────────── */

.login-wrap {
  min-height: 100vh; display: grid; place-items: center;
  background: var(--paper); padding: 20px;
}
.login-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: 34px 32px 28px;
  width: min(400px, 100%); box-shadow: 0 2px 10px rgba(22, 24, 29, .05);
}
.login-card h1 {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px; font-size: 1.35rem;
}

/* ── Móvil ────────────────────────────────────────────────────────── */
/* La barra lateral horizontal con scroll era un mal apaño. En móvil el spec
   usa patrón de app: título grande, barra de pestañas abajo, y el resto de la
   navegación en un panel que se abre desde la cabecera. */

.tabbar { display: none; }
.menu-btn { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }

  /* Lateral fuera de pantalla; se abre con el botón de menú. */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 264px; z-index: 95;
    transform: translateX(-102%); transition: transform .2s ease;
    box-shadow: var(--shadow-pop); border-right: 1px solid var(--line);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim {
    position: fixed; inset: 0; background: rgba(22,24,29,.3); z-index: 94;
    opacity: 0; pointer-events: none; transition: opacity .16s;
  }
  .sidebar-scrim.open { opacity: 1; pointer-events: auto; }

  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 14px; gap: 8px; }
  .topbar h1 { font-size: 1.02rem; }

  .content { padding: 16px 14px 92px; }
  .board { padding: 14px 14px 92px; gap: 12px; }
  .column { flex: 0 0 84vw; }

  .greeting h1 { font-size: 1.7rem; }
  .grid.k4 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
  .stat { padding: 11px 12px; }
  .stat .v { font-size: 1.5rem; }
  .grid.k2, .grid.k3 { grid-template-columns: 1fr; }
  .with-rail { grid-template-columns: 1fr; }
  .rail { position: static; }
  .detail-grid { grid-template-columns: 1fr; }
  .filters { padding: 10px 14px; }
  .cal-toolbar { padding: 10px 14px; flex-wrap: wrap; }
  .cal-toolbar .title { min-width: 0; flex: 1; font-size: .98rem; }
  .cal-cell { min-height: 76px; padding: 4px; }
  .cal-cell .d { font-size: .66rem; }
  .drawer { width: 100vw; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { width: 100%; border-radius: var(--r-xl) var(--r-xl) 0 0; }

  /* Pestañas fijas abajo, con área táctil de 56px. */
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
    background: var(--paper-2); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 9px 0 8px; font-size: .66rem; color: var(--ink-4);
    text-decoration: none; font-weight: 500; position: relative;
  }
  .tabbar a.active { color: var(--accent); }
  .tabbar a.active .ic { color: var(--accent); }
  .tabbar a .n {
    position: absolute; top: 4px; right: 50%; margin-right: -18px;
    background: var(--accent); color: #fff; font-family: var(--font-mono);
    font-size: .58rem; min-width: 15px; height: 15px; border-radius: 8px;
    display: grid; place-items: center; padding: 0 3px;
  }
}

@media (max-width: 560px) {
  .grid.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rsv-head { flex-wrap: wrap; }
  .rsv-money { text-align: left; }
  .rsv-task-grid { grid-template-columns: 1fr; }
}
