/* ============ Tokens ============ */
:root {
  --bg: #f6f2ea;
  --surface: #ffffff;
  --surface-2: #efe9de;
  --ink: #1d2523;
  --ink-2: #56615d;
  --ink-3: #7b8581;
  --line: #e3dccf;
  --accent: #1d5c50;
  --accent-ink: #ffffff;
  --accent-soft: #dcebe5;
  --done: #23735f;
  --done-soft: #e2f1ea;
  --warn: #a4552a;
  --warn-soft: #f8e6da;
  --danger: #b03a3a;
  --sun: #f2c36b;
  --shadow-1: 0 1px 2px rgb(40 32 20 / .06), 0 2px 8px rgb(40 32 20 / .05);
  --shadow-2: 0 -2px 6px rgb(40 32 20 / .04), 0 -12px 40px rgb(40 32 20 / .14);

  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --radius: 16px;
  --font: "Atkinson Hyperlegible Next", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
  --tabbar-h: 68px;

  /* Colores de clientes: [suave, fuerte] */
  --c-rose: #f4d3d6;   --c-rose-ink: #a33c4f;
  --c-amber: #f6e2b1;  --c-amber-ink: #8a5d00;
  --c-sky: #d3e6f5;    --c-sky-ink: #2b638f;
  --c-violet: #e1d9f5; --c-violet-ink: #5b43a3;
  --c-sage: #dcead6;   --c-sage-ink: #3c7234;
  --c-peach: #f8dcc8;  --c-peach-ink: #a04f22;
  --c-teal: #d2ece6;   --c-teal-ink: #1d6b5b;
  --c-slate: #dfe4ea;  --c-slate-ink: #445468;
  --c-lilac: #efd8f0;  --c-lilac-ink: #864089;
  --c-olive: #e8e8c8;  --c-olive-ink: #656515;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181a;
    --surface: #1d2326;
    --surface-2: #262d30;
    --ink: #eef0ec;
    --ink-2: #b4bcb8;
    --ink-3: #8d9692;
    --line: #2f383b;
    --accent: #7fcbb6;
    --accent-ink: #0f2a24;
    --accent-soft: #1f3a34;
    --done: #7fcbb6;
    --done-soft: #1c3530;
    --warn: #f0a77c;
    --warn-soft: #3a2a20;
    --danger: #f08a8a;
    --shadow-1: 0 1px 2px rgb(0 0 0 / .3);
    --shadow-2: 0 -12px 40px rgb(0 0 0 / .5);
    --c-rose: #4a2a30;   --c-rose-ink: #f2a9b6;
    --c-amber: #463a1c;  --c-amber-ink: #f2cf7a;
    --c-sky: #213847;    --c-sky-ink: #9ccbf0;
    --c-violet: #332b4a; --c-violet-ink: #c6b6f4;
    --c-sage: #2a3a27;   --c-sage-ink: #a9d49e;
    --c-peach: #4a3021;  --c-peach-ink: #f5b48b;
    --c-teal: #1f3a35;   --c-teal-ink: #8fd6c6;
    --c-slate: #2c343e;  --c-slate-ink: #b5c3d4;
    --c-lilac: #42294a;  --c-lilac-ink: #e6aee8;
    --c-olive: #38381f;  --c-olive-ink: #d6d68c;
  }
}

/* ============ Base / móvil nativo ============ */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  background: var(--bg);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.45 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-soft); color: var(--ink); }
input, textarea, select { font: inherit; font-size: 17px; color: inherit; caret-color: var(--accent); }
button, a, [role="button"], label.toggle {
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }

.app {
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 24px);
}
.view { outline: none; padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px 0; }
.view.enter { animation: view-in 260ms var(--ease-out); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }

/* ============ Barra inferior ============ */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  display: grid; grid-template-columns: repeat(3, 1fr);
  max-width: 560px; margin: 0 auto;
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
}
.tab {
  display: grid; justify-items: center; gap: 2px;
  min-height: 56px; padding: 6px 0; border-radius: 14px;
  color: var(--ink-3); font-size: 14px; font-weight: 600;
  transition: color 160ms, background-color 160ms, transform 120ms var(--ease-out);
}
.tab svg { width: 26px; height: 26px; }
.tab[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.tab:active { transform: scale(.96); }

/* ============ Cabecera ============ */
.head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.head h1 { font: 700 30px/1.1 var(--display); letter-spacing: -0.02em; flex: 1; min-width: 0; }
.head h1 small { display: block; font: 600 15px/1.3 var(--font); color: var(--ink-3); letter-spacing: 0; margin-top: 2px; }
.icon-btn {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px;
  background: var(--surface); box-shadow: var(--shadow-1); color: var(--ink);
  transition: transform 120ms var(--ease-out), background-color 160ms;
}
.icon-btn:active { transform: scale(.94); background: var(--surface-2); }
.pill {
  height: 48px; padding: 0 16px; border-radius: 14px;
  background: var(--accent-soft); color: var(--accent); font-weight: 700;
  transition: transform 120ms var(--ease-out), opacity 160ms;
}
.pill:active { transform: scale(.96); }
.pill[hidden] { display: none; }

/* ============ Calendario mensual ============ */
.month {
  background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-1);
  padding: 10px 8px 12px;
  touch-action: pan-y;
}
.weekdays, .grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.weekdays span { text-align: center; font-size: 14px; font-weight: 700; color: var(--ink-3); padding: 4px 0 8px; }
.weekdays span:nth-child(n+6) { color: var(--warn); }
.grid { row-gap: 4px; }
.grid.slide-next { animation: slide-next 280ms var(--ease-out); }
.grid.slide-prev { animation: slide-prev 280ms var(--ease-out); }
@keyframes slide-next { from { opacity: 0; transform: translateX(18px); } }
@keyframes slide-prev { from { opacity: 0; transform: translateX(-18px); } }

.day {
  position: relative; display: grid; justify-items: center; align-content: start; gap: 4px;
  height: 58px; padding-top: 7px; margin: 0 2px; border-radius: 14px;
  transition: background-color 160ms, transform 120ms var(--ease-out);
}
.day:active { transform: scale(.94); }
.day .n { font-size: 18px; font-weight: 600; line-height: 1; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; }
.day.out { visibility: hidden; }
.day.today .n { background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.day.selected { background: var(--accent-soft); }
.day.selected:not(.today) .n { color: var(--accent); font-weight: 800; }
.day.all-done::after {
  content: ""; position: absolute; top: 4px; right: 5px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--done); box-shadow: 0 0 0 2px var(--surface);
}
.dots { display: flex; gap: 3px; height: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--dot); }
.dot.done { background: var(--dot); }
.dot.skipped { opacity: .3; }
.more { font-size: 11px; line-height: 8px; font-weight: 800; color: var(--ink-3); }

/* ============ Panel del día ============ */
.day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 2px 12px; }
.day-head h2 { font: 700 23px/1.2 var(--display); letter-spacing: -0.01em; }
.day-head .count { color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.list { display: grid; gap: 10px; }
.list.swap { animation: view-in 240ms var(--ease-out); }

.visit {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px;
  padding: 12px 12px 12px 14px; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-1);
  transition: background-color 220ms, opacity 220ms;
}
.visit-main { display: flex; align-items: center; gap: 12px; min-width: 0; text-align: left; padding: 4px 0; }
.avatar {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; flex: none;
  background: var(--soft); color: var(--strong); font: 800 20px/1 var(--font);
}
.visit-text { min-width: 0; }
.visit-name { font-size: 20px; font-weight: 700; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visit-time { color: var(--ink-2); font-size: 16px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); }
.tag.extra { background: var(--accent-soft); color: var(--accent); }
.tag.skip { background: var(--warn-soft); color: var(--warn); }

.check {
  display: grid; place-items: center; gap: 2px; width: 74px; height: 64px; border-radius: 16px;
  border: 2.5px solid var(--line); color: var(--ink-3); font-size: 13px; font-weight: 800;
  transition: background-color 200ms, border-color 200ms, color 200ms, transform 140ms var(--ease-out);
}
.check svg { width: 28px; height: 28px; stroke-width: 3; }
.check svg { opacity: .45; transition: opacity 200ms; }
.check svg path { stroke-dasharray: 24; }
.check:active { transform: scale(.92); }
.visit.done { background: var(--done-soft); }
.visit.done .check { background: var(--done); border-color: var(--done); color: var(--accent-ink); }
.visit.done .check svg { opacity: 1; }
.visit.done .check.pop { animation: pop 380ms var(--ease-out); }
.visit.done .check.pop svg path { animation: draw 320ms var(--ease-out) 60ms backwards; }
@keyframes draw { from { stroke-dashoffset: 24; } }
@keyframes pop { 0% { transform: scale(.85); } 45% { transform: scale(1.08); } 100% { transform: scale(1); } }
.visit.skipped { opacity: .62; }
.visit.skipped .visit-name { text-decoration: line-through; text-decoration-thickness: 2px; }

.empty {
  padding: 22px 18px; border-radius: var(--radius); background: var(--surface-2);
  color: var(--ink-2); text-align: center;
}
.empty strong { display: block; color: var(--ink); font-size: 18px; margin-bottom: 2px; }

/* Carril de clientes para añadir */
.rail-title { margin: 26px 2px 10px; font-weight: 700; font-size: 17px; color: var(--ink-2); }
.rail {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity;
  margin: 0 -16px; padding: 4px 16px 10px; overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.chip {
  display: flex; align-items: center; gap: 10px; flex: none; scroll-snap-align: start;
  height: 56px; padding: 0 18px 0 8px; border-radius: 16px;
  background: var(--surface); box-shadow: var(--shadow-1); font-weight: 700; font-size: 17px;
  transition: transform 120ms var(--ease-out);
}
.chip .avatar { width: 40px; height: 40px; border-radius: 12px; font-size: 17px; }
.chip:active { transform: scale(.95); }
.chip.new { background: var(--accent-soft); color: var(--accent); padding-left: 14px; box-shadow: none; }

/* ============ Clientes ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; padding: 0 22px; border-radius: 16px;
  font-weight: 800; font-size: 18px;
  transition: transform 120ms var(--ease-out), background-color 160ms, opacity 160ms;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.ghost { background: var(--surface-2); color: var(--ink); }
.btn.danger { background: transparent; color: var(--danger); }
.btn.wa { background: #1f8f4e; color: #fff; }
.btn.block { width: 100%; }
.btn.small { min-height: 46px; padding: 0 14px; font-size: 16px; border-radius: 13px; }

.client-row {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 12px 14px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-1);
  transition: transform 120ms var(--ease-out);
}
.client-row:active { transform: scale(.985); }
.client-row .info { flex: 1; min-width: 0; }
.client-row .name { font-size: 19px; font-weight: 700; }
.client-row .meta { color: var(--ink-2); font-size: 15px; }
.client-row .chev { color: var(--ink-3); }
.days-mini { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.days-mini span {
  font-size: 13px; font-weight: 800; width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 8px; background: var(--surface-2); color: var(--ink-3);
}
.days-mini span.on { background: var(--soft); color: var(--strong); }
.section-gap { height: 18px; }
.muted-link { display: block; margin: 28px auto 0; color: var(--ink-2); font-weight: 600; text-decoration: underline; text-underline-offset: 4px; padding: 12px; }

/* ============ Recuento ============ */
.total {
  padding: 18px; border-radius: 20px; background: var(--accent); color: var(--accent-ink);
  display: grid; gap: 4px;
}
.total .big { font: 700 34px/1.1 var(--display); letter-spacing: -0.02em; }
.total .line { font-size: 17px; opacity: .92; }
.total .bar { height: 10px; border-radius: 99px; background: color-mix(in srgb, var(--accent-ink) 25%, transparent); overflow: hidden; margin-top: 10px; }
.total .bar i { display: block; height: 100%; background: var(--sun); border-radius: inherit; transition: width 600ms var(--ease-out); }

.bill {
  padding: 14px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-1);
  display: grid; gap: 12px;
}
.bill-top { display: flex; align-items: center; gap: 12px; }
.bill-top .info { flex: 1; min-width: 0; }
.bill-top .name { font-size: 19px; font-weight: 700; }
.bill-top .meta { color: var(--ink-2); font-size: 15px; }
.bill-top .amount { font: 700 24px/1 var(--display); white-space: nowrap; }
.bill-dates { display: flex; flex-wrap: wrap; gap: 6px; }
.bill-dates span {
  min-width: 34px; height: 30px; padding: 0 6px; display: grid; place-items: center; border-radius: 9px;
  background: var(--soft); color: var(--strong); font-weight: 800; font-size: 15px;
}
.bill-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bill.paid { background: var(--done-soft); }
.paid-btn[aria-pressed="true"] { background: var(--done); color: var(--accent-ink); }
.note-warn { font-size: 15px; color: var(--warn); font-weight: 600; }
.note-warn button { color: inherit; text-decoration: underline; text-underline-offset: 3px; font-weight: 800; }

/* ============ Hoja inferior (sheet) ============ */
.backdrop {
  position: fixed; inset: 0; z-index: 40; background: rgb(15 20 18 / .42);
  animation: fade-in 240ms var(--ease-out);
}
.backdrop.out { animation: fade-out 200ms ease-in forwards; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  max-width: 560px; margin: 0 auto; max-height: 92dvh;
  display: flex; flex-direction: column;
  background: var(--bg); border-radius: 24px 24px 0 0; box-shadow: var(--shadow-2);
  animation: sheet-in 420ms var(--ease-drawer);
  will-change: transform;
}
.sheet.out { animation: sheet-out 240ms ease-in forwards; }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }
.sheet-grab { padding: 10px 0 4px; touch-action: none; cursor: grab; }
.sheet-grab::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 99px; background: var(--line); margin: 0 auto; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 4px 16px 12px; touch-action: none; }
.sheet-head h2 { flex: 1; font: 700 24px/1.2 var(--display); letter-spacing: -0.01em; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px calc(20px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 16px; }

/* Formularios */
.field { display: grid; gap: 6px; }
.field > span { font-weight: 700; font-size: 16px; color: var(--ink-2); }
.input {
  width: 100%; min-height: 56px; padding: 12px 14px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--surface);
  transition: border-color 160ms;
}
.input:focus { outline: none; border-color: var(--accent); }
textarea.input { min-height: 90px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.seg button { min-height: 48px; border-radius: 11px; font-weight: 700; color: var(--ink-2); transition: background-color 160ms, color 160ms; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch {
  width: 44px; height: 44px; border-radius: 50%; background: var(--soft);
  box-shadow: inset 0 0 0 3px var(--strong); transition: transform 140ms var(--ease-out);
}
.swatch[aria-pressed="true"] { box-shadow: inset 0 0 0 3px var(--strong), 0 0 0 3px var(--bg), 0 0 0 6px var(--strong); }
.swatch:active { transform: scale(.9); }
.weekpick { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.weekpick button {
  height: 52px; border-radius: 14px; font-weight: 800; font-size: 17px;
  background: var(--surface); border: 2px solid var(--line); color: var(--ink-2);
  transition: background-color 160ms, border-color 160ms, color 160ms, transform 120ms var(--ease-out);
}
.weekpick button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.weekpick button:active { transform: scale(.93); }
.slot-row { display: grid; grid-template-columns: 92px 1fr 1fr; gap: 8px; align-items: center; animation: view-in 220ms var(--ease-out); }
.slot-row b { font-size: 16px; }
.slot-row .input { min-height: 50px; padding: 8px 10px; }
.hint { font-size: 15px; color: var(--ink-3); }
.sheet-actions { display: grid; gap: 10px; padding-top: 4px; }
.option {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  min-height: 60px; padding: 0 16px; border-radius: 16px; background: var(--surface); font-weight: 700; font-size: 18px;
  box-shadow: var(--shadow-1); transition: transform 120ms var(--ease-out);
}
.option:active { transform: scale(.98); }
.option.danger { color: var(--danger); }
.contact { display: grid; gap: 8px; }
.contact a { color: var(--accent); font-weight: 700; display: flex; gap: 10px; align-items: center; min-height: 44px; text-decoration: none; }

/* ============ Aviso flotante ============ */
.toast {
  position: fixed; left: 16px; right: 16px; z-index: 60;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 14px);
  max-width: 528px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 12px 12px 18px; border-radius: 16px;
  background: var(--ink); color: var(--bg); font-weight: 700;
  transform: translateY(20px); opacity: 0; pointer-events: none;
  transition: transform 300ms var(--ease-out), opacity 200ms;
}
.toast.show { transform: none; opacity: 1; pointer-events: auto; }
.toast span { flex: 1; }
.toast button { padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--bg) 18%, transparent); font-weight: 800; }

/* ============ PIN ============ */
.lock { min-height: 100dvh; display: grid; place-content: center; gap: 22px; padding: 24px; text-align: center; }
.lock h1 { font: 700 32px/1.1 var(--display); }
.pin-dots { display: flex; justify-content: center; gap: 14px; }
.pin-dots i { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--ink-3); transition: background-color 120ms, transform 120ms; }
.pin-dots i.on { background: var(--accent); border-color: var(--accent); transform: scale(1.1); }
.pin-dots.shake { animation: shake 360ms; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 14px; justify-content: center; }
.pad button { height: 76px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-1); font-size: 28px; font-weight: 700; transition: transform 100ms var(--ease-out), background-color 120ms; }
.pad button:active { transform: scale(.92); background: var(--surface-2); }

.skeleton { height: 360px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-1); }
.error-box { padding: 18px; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn); font-weight: 600; display: grid; gap: 12px; }

@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover, .chip:hover, .client-row:hover, .option:hover { background: var(--surface-2); }
  .day:hover:not(.selected) { background: var(--surface-2); }
  .check:hover { border-color: var(--done); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

/* Los textos dentro de botones son <span>: que ocupen su propia línea */
.visit-name, .client-row .name, .client-row .meta, .bill-top .name, .bill-top .meta { display: block; }
.client-row .days-mini { display: flex; }

/* Versión sencilla: la tarjeta entera es el botón */
button.visit { width: 100%; text-align: left; transition: background-color 220ms, transform 120ms var(--ease-out); }
button.visit:active { transform: scale(.98); }
.muted-link + .muted-link { margin-top: 0; }

/* Día de hoy debajo del calendario */
.day-head { display: block; }
.day-sub { margin-top: 4px; color: var(--ink-2); font-weight: 600; }
.today-strip {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 16px; padding: 12px 14px;
  border-radius: var(--radius); background: var(--accent-soft); color: var(--ink); text-align: left;
  transition: transform 120ms var(--ease-out);
}
.today-strip:active { transform: scale(.98); }
.today-strip > svg { color: var(--accent); }
.today-num {
  display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 20px;
}
.today-text { flex: 1; min-width: 0; }
.today-text b, .today-text span { display: block; }
.today-text b { font-size: 17px; }
.today-text span { color: var(--ink-2); font-size: 16px; }
.day { height: 54px; }

/* Recuento: por mes / todo, e historial por semanas */
.seg-big button { min-height: 52px; font-size: 18px; }
button.bill-top { width: 100%; text-align: left; transition: transform 120ms var(--ease-out); }
button.bill-top:active { transform: scale(.98); }
.bill-top .chev, .client-row .chev { color: var(--ink-3); }
.client-row .amount { font: 700 21px/1 var(--display); white-space: nowrap; }
.hist-month { display: grid; gap: 10px; margin-top: 8px; }
.hist-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 2px; }
.hist-head h3 { font: 700 21px/1.2 var(--display); }
.hist-head span { color: var(--ink-2); font-weight: 700; white-space: nowrap; }
.weeks { display: grid; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-1); overflow: hidden; }
.week { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 8px 14px; }
.week + .week { border-top: 1px solid var(--line); }
.week-range { font-weight: 700; }
.week-days { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.wd { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 10px; border-radius: 10px; background: var(--done-soft); color: var(--done); font-weight: 800; }
.wd b { font-size: 13px; opacity: .75; }
.week.empty { background: var(--surface-2); }
.week.empty .week-range, .week.empty .week-days { color: var(--ink-3); font-weight: 600; }


/* Agenda de hoy por horas */
.timeline {
  --tl-gutter: 58px;
  position: relative; box-sizing: content-box; padding: 14px 0;
  background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-1);
}
.tl-hour { position: absolute; left: var(--tl-gutter); right: 12px; height: 0; margin-top: 14px; border-top: 1px solid var(--line); }
.tl-hour span {
  position: absolute; left: calc(-1 * var(--tl-gutter) + 4px); top: -11px; width: 44px; text-align: right;
  font-size: 14px; font-weight: 700; color: var(--ink-3);
}
.tl-block {
  position: absolute; margin-top: 14px; margin-left: 2px;
  display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px; text-align: left; overflow: hidden;
  border-radius: 12px; background: var(--soft); color: var(--strong);
  box-shadow: 0 1px 2px rgb(40 32 20 / .08);
  transition: background-color 220ms, color 220ms, transform 120ms var(--ease-out);
}
.tl-block:active { transform: scale(.97); }
.tl-text { flex: 1; min-width: 0; }
.tl-name { display: block; font-size: 18px; font-weight: 800; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-time { display: block; font-size: 15px; font-weight: 600; opacity: .85; }
.tl-check {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%;
  border: 2.5px solid currentColor; opacity: .55;
}
.tl-check svg { width: 20px; height: 20px; stroke-width: 3; opacity: .5; }
.tl-block.done { background: var(--done); color: var(--accent-ink); }
.tl-block.done .tl-check { opacity: 1; background: var(--accent-ink); color: var(--done); border-color: var(--accent-ink); }
.tl-block.done .tl-check svg { opacity: 1; }
.tl-block.pop .tl-check { animation: pop 380ms var(--ease-out); }
.tl-block.pop .tl-check svg path { stroke-dasharray: 24; animation: draw 320ms var(--ease-out) 60ms backwards; }
.tl-now { position: absolute; left: var(--tl-gutter); right: 12px; height: 0; margin-top: 14px; border-top: 2px solid var(--danger); z-index: 2; pointer-events: none; }
.tl-now::before { content: ""; position: absolute; left: -6px; top: -7px; width: 12px; height: 12px; border-radius: 50%; background: var(--danger); }


/* Selector de color: el elegido lleva un check */
.swatches { gap: 12px; }
.swatch { display: grid; place-items: center; width: 48px; height: 48px; color: var(--strong); }
.swatch svg { width: 22px; height: 22px; stroke-width: 3; opacity: 0; transform: scale(.6); transition: opacity 160ms, transform 200ms var(--ease-out); }
.swatch[aria-pressed="true"] svg { opacity: 1; transform: none; }

/* Puntos del calendario algo mayores: el color es la guía */
.dots { height: 10px; gap: 3px; }
.dot { width: 10px; height: 10px; border-width: 2.5px; }

/* En la pantalla del PIN no se ve la barra de abajo */
.tabbar[hidden] { display: none; }
