/* CREA · estilos de la app
   Tokens de docs/BRAND.md (--crea-*) y de presentacion/src/maqueta.css; los
   componentes salen de las cinco maquetas sin las clases de diapositiva. */

:root {
  /* Marca (docs/BRAND.md) */
  --crea-sage: #afc4bd;
  --crea-sage-soft: #eff4f2;
  --crea-sage-medium: #8da39b;
  --crea-green-dark: #455e4d;
  --crea-pink: #dba39f;
  --crea-text: #4f4f4f;
  --crea-heading: #1d1d1b;
  --crea-bg: #ffffff;
  --crea-bg-alt: #f6f6f6;
  --crea-radius-card: 12px;
  --crea-radius-btn: 999px;
  --crea-font: "Montserrat", Helvetica, Arial, Verdana, sans-serif;

  /* Maquetas (presentacion/src/maqueta.css) */
  --sage: var(--crea-sage);
  --sage-soft: var(--crea-sage-soft);
  --sage-2: #e2ebe7;
  --sage-medium: var(--crea-sage-medium);
  --green: var(--crea-green-dark);
  --pink: var(--crea-pink);
  --pink-deep: #c98680;
  --pink-soft: #f8e9e7;
  --text: var(--crea-text);
  --heading: var(--crea-heading);
  /* Gris secundario: 5:1 sobre blanco y sobre --bg-alt (el anterior, #8b908d, daba 3:1). */
  --muted: #646b67;
  --line: #e3e7e5;
  /* Borde de campos y controles: se distingue del fondo sin parecer una caja dura. */
  --line-strong: #c9d1cd;
  --bg-alt: #f3f5f4;
  /* Rellenos de botón con texto blanco legible (rosa y salvia de la marca, un tono más hondos). */
  --pink-btn: #b9736d;
  --sage-btn: #5e7a70;

  /* Escala tipográfica: 11 · 12 · 13 · 14 · 15 · 16-18 · 20-22 · 28+ px.
     Cuerpo a 15; ningún texto de lectura por debajo de 12. */

  --ok-bg: #e1ede6;   --ok-ink: #2f6a48;
  --warn-bg: #fbefd9; --warn-ink: #8a6420;
  --bad-bg: #f8e1df;  --bad-ink: #a2463f;
  --lila-bg: #ebe7f4; --lila-ink: #5d5285;
  --info-bg: #e2edf5; --info-ink: #3f6683;

  /* Servicios */
  --s-len-bg: #e4eee9;  --s-len: #8da39b;
  --s-ped-bg: #f8e9e7;  --s-ped: #dba39f;
  --s-psi-bg: #ebe7f4;  --s-psi: #a397c9;
  --s-fis-bg: #e2edf5;  --s-fis: #8fb1cb;
  --s-spa-bg: #f7efdc;  --s-spa: #d4b47a;

  /* Fichaje: excepción aprobada a la paleta pastel */
  --fichaje-in: #17a34a;
  --fichaje-out: #e23b3b;

  --side-w: 236px;
  --top-h: 70px;
  --tab-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);

  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: var(--crea-font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-alt);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
svg { display: block; }
.ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--sage-medium); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Login ---------- */
.login {
  position: relative; min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; overflow: hidden;
  background: linear-gradient(135deg, #f1f6f4 0%, #f7f5f3 55%, #fbf1ef 100%);
}
.login::before, .login::after { content: ""; position: absolute; border-radius: 50%; filter: blur(10px); z-index: 0; }
.login::before { width: 520px; height: 520px; background: rgba(175,196,189,.28); top: -200px; right: -120px; }
.login::after { width: 420px; height: 420px; background: rgba(219,163,159,.18); bottom: -160px; left: -140px; }
.login-card {
  position: relative; z-index: 1; width: 100%; max-width: 400px; background: #fff; border-radius: 20px; padding: 34px 32px 28px;
  box-shadow: 0 34px 70px -24px rgba(69,94,77,.35), 0 0 0 1px rgba(69,94,77,.07);
}
.login-card .logo { display: block; width: 150px; margin: 0 auto 26px; }
.login-card h1 { font-size: 18px; font-weight: 400; letter-spacing: .07em; text-transform: uppercase; color: var(--heading); text-align: center; margin-bottom: 18px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; }
.login-card .btn { height: 44px; margin-top: 6px; }
.login-card .fine { margin-top: 18px; font-size: 13px; color: var(--muted); text-align: center; }
.form-error { font-size: 14px; color: var(--bad-ink); background: var(--bad-bg); border-radius: 10px; padding: 8px 12px; }

/* ---------- Estructura ---------- */
.app { display: flex; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; width: var(--side-w); flex: none; border-right: 1px solid var(--line);
  padding: 22px 14px 16px; display: flex; flex-direction: column; background: #fff; overflow-y: auto;
}
.brand { padding-left: 6px; text-decoration: none; display: block; }
.brand .lockup, .lockup { display: flex; align-items: center; gap: 8px; }
.brand .icon { width: 46px; height: auto; }
.brand .word { width: 104px; height: auto; }
.brand small { display: block; font-size: 10px; letter-spacing: .2em; color: var(--muted); margin-top: 9px; font-weight: 500; text-transform: uppercase; }
.nav { margin-top: 28px; display: flex; flex-direction: column; gap: 3px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--text); text-decoration: none; }
.nav a:hover { background: var(--bg-alt); }
.nav a .ic { width: 18px; height: 18px; color: var(--sage-medium); }
.nav a.on { background: var(--sage-soft); color: var(--green); font-weight: 600; }
.nav a.on .ic { color: var(--green); }
.nav .badge { margin-left: auto; background: var(--pink-btn); color: #fff; font-size: 12px; border-radius: 999px; padding: 1px 7px; font-weight: 700; }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--bg-alt); text-align: left; width: 100%; }
.me:hover { background: var(--sage-2); }
.me b { display: block; font-size: 14px; color: var(--heading); font-weight: 600; }
.me div span { font-size: 13px; color: var(--muted); }

.avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: #fff; background: var(--sage-medium); }
.avatar.lg { width: 64px; height: 64px; font-size: 21px; }
.avatar.sm { width: 24px; height: 24px; font-size: 9.5px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg-alt); }
.top {
  position: sticky; top: 0; z-index: 20; height: var(--top-h); flex: none; display: flex; align-items: center; gap: 14px;
  padding: 0 32px; background: #fff; border-bottom: 1px solid var(--line);
}
.top h1 { font-size: 20px; font-weight: 400; text-transform: uppercase; letter-spacing: .07em; color: var(--heading); white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.top .lbl-short { display: none; }
.top .sub { font-size: 14px; color: var(--muted); margin-left: 4px; white-space: nowrap; }
.top .spacer { flex: 1; }
.top .appbar-brand, .top .appbar-avatar { display: none; }
.search { display: flex; align-items: center; gap: 8px; width: 280px; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--bg-alt); font-size: 14px; color: var(--muted); }
.search input { flex: 1; min-width: 0; border: none; background: none; outline: none; font-size: 14px; color: var(--heading); }
.search input::placeholder { color: var(--muted); }
.search:focus-within { box-shadow: inset 0 0 0 1.5px var(--sage); }
.iconbtn { position: relative; display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--bg-alt); color: var(--green); }
.iconbtn:hover { background: var(--sage-soft); }
.iconbtn .ic { width: 17px; height: 17px; }
.iconbtn .dotn { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--pink-deep); border: 2px solid #fff; }

.content { flex: 1; min-width: 0; padding: 26px 32px 40px; }
.page-hello { display: none; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: var(--crea-radius-btn); padding: 10px 20px; min-height: 40px;
  font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; border: none; white-space: nowrap; text-decoration: none;
  transition: filter .15s, background .15s;
}
.btn .ic { width: 14px; height: 14px; stroke-width: 2.2; }
.btn:hover { filter: brightness(.96); }
.btn:disabled { opacity: .55; cursor: default; filter: none; }
.btn-pink { background: var(--pink-btn); color: #fff; }
.btn-pink:hover { filter: none; background: #a9655f; }
.btn-sage { background: var(--sage-btn); color: #fff; }
.btn-sage:hover { filter: none; background: #516b62; }
.btn-ghost { background: #fff; color: var(--green); box-shadow: inset 0 0 0 1px var(--sage); }
.btn-danger { background: #fff; color: var(--bad-ink); box-shadow: inset 0 0 0 1px #dfaaa4; }
.btn-sm { min-height: 32px; padding: 6px 14px; font-size: 12px; }
.btn-block { width: 100%; }

/* ---------- Tarjetas y estados ---------- */
.card { background: #fff; border-radius: 14px; padding: 22px 24px; box-shadow: 0 1px 2px rgba(29,29,27,.05), 0 8px 22px -12px rgba(69,94,77,.22); }
.card + .card { margin-top: 20px; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.card-h h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--heading); }
.card-h .count { font-size: 13px; font-weight: 600; color: var(--muted); }
.card-h .link, .card-h .end { margin-left: auto; }
.card-h .link { font-size: 13px; font-weight: 600; color: var(--green); text-decoration: none; }

.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill .ic { width: 11px; height: 11px; stroke-width: 2.4; }
.pill.ok { background: var(--ok-bg); color: var(--ok-ink); }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); }
.pill.bad { background: var(--bad-bg); color: var(--bad-ink); }
.pill.lila { background: var(--lila-bg); color: var(--lila-ink); }
.pill.info { background: var(--info-bg); color: var(--info-ink); }
.pill.neutral { background: var(--bg-alt); color: var(--muted); }
.pill.sage { background: var(--sage-soft); color: var(--green); }

.svc { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.svc::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--sage)); }
.svc.len { --c: var(--s-len); } .svc.ped { --c: var(--s-ped); } .svc.psi { --c: var(--s-psi); } .svc.fis { --c: var(--s-fis); } .svc.spa { --c: var(--s-spa); }

.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* KPIs (maqueta 01) */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 20px; }
.kpis .card + .card { margin-top: 0; }
.kpi { display: flex; gap: 14px; align-items: center; padding: 18px 20px; }
.kpi .ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.kpi .ico .ic { width: 20px; height: 20px; }
.kpi .lbl { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.kpi .val { font-size: 28px; font-weight: 500; color: var(--heading); margin-top: 2px; line-height: 1.2; }
.kpi .hint { font-size: 12px; line-height: 1.4; color: var(--muted); margin-top: 1px; }

/* Estado vacío de las vistas aún no construidas */
.empty { text-align: center; padding: 48px 24px 44px; }
.empty .ico { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 20px; display: grid; place-items: center; background: var(--sage-soft); color: var(--green); }
.empty .ico .ic { width: 28px; height: 28px; stroke-width: 1.6; }
.empty h2 { font-size: 17px; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; color: var(--heading); }
.empty p { max-width: 520px; margin: 8px auto 0; font-size: 15px; }
.empty .chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px; }
.empty .chips .pill { font-size: 13px; padding: 5px 12px; }

.hello-card { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.hello-card h2 { font-size: 20px; font-weight: 500; color: var(--heading); }
.hello-card p { font-size: 14px; color: var(--muted); margin-top: 2px; }

/* Tablas (maqueta 04) */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 12px 10px; white-space: nowrap; }
td { font-size: 14px; padding: 13px 12px; border-top: 1px solid var(--line); color: var(--text); vertical-align: middle; }
td b { color: var(--heading); font-weight: 600; }
td.r, th.r { text-align: right; }
.who { display: flex; align-items: center; gap: 10px; }
.who small { display: block; font-size: 13px; color: var(--muted); }

/* Formularios (maquetas 04 y 05) */
.field label, .lbl { display: block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.field label em { color: var(--pink-deep); font-style: normal; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.inp {
  width: 100%; height: 44px; border-radius: 12px; background: #fff; border: none; box-shadow: inset 0 0 0 1px var(--line-strong);
  padding: 0 13px; font-size: 15px; color: var(--heading); font-weight: 500; outline: none;
}
select.inp { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238da39b' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 15px; padding-right: 34px; }
.inp:focus { box-shadow: inset 0 0 0 2px var(--sage-medium); }
.inp::placeholder { color: var(--muted); font-weight: 400; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.fields .full { grid-column: 1 / -1; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: #e9edeb; border-radius: 12px; padding: 3px; }
.seg button { text-align: center; padding: 9px 0; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--muted); }
.seg button.on { background: #fff; color: var(--green); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.checks { display: flex; flex-direction: column; gap: 8px; }
.check, .field label.check { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 14px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text); cursor: pointer; }
.check input { appearance: none; width: 18px; height: 18px; flex: none; border-radius: 6px; box-shadow: inset 0 0 0 2px #a9b3ae; display: grid; place-items: center; cursor: pointer; }
.check input:checked { background: var(--sage-medium) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") no-repeat center / 12px; box-shadow: none; }
.banner { display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; background: var(--lila-bg); color: var(--lila-ink); padding: 12px 16px; font-size: 13px; line-height: 1.5; }
.banner .ic { width: 16px; height: 16px; margin-top: 1px; }
.banner.info { background: var(--info-bg); color: var(--info-ink); }

/* Modal (maqueta 04) */
.overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(29,29,27,.32); backdrop-filter: blur(1.5px);
  display: grid; place-items: center; padding: 16px; animation: fade .15s ease-out;
}
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: #fff; border-radius: 20px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.35); overflow: hidden; }
.mh { display: flex; align-items: flex-start; gap: 14px; padding: 22px 26px 18px; border-bottom: 1px solid var(--line); }
.mh .ico { width: 42px; height: 42px; flex: none; border-radius: 13px; background: var(--pink-soft); color: var(--pink-deep); display: grid; place-items: center; }
.mh .ico .ic { width: 20px; height: 20px; }
.mh h2 { font-size: 17px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--heading); }
.mh p { font-size: 14px; color: var(--muted); margin-top: 3px; }
.mh .close { margin-left: auto; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: none; color: var(--muted); }
.mh .close:hover { background: var(--bg-alt); }
.mb { padding: 20px 26px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.mf { display: flex; align-items: center; gap: 10px; padding: 8px 26px 24px; flex-wrap: wrap; }
.mf .spacer { flex: 1; }

/* Hoja inferior (maqueta 05) */
.sheet-dim { position: fixed; inset: 0; z-index: 70; background: rgba(29,29,27,.38); animation: fade .15s ease-out; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 71; background: #fff; border-radius: 28px 28px 0 0;
  padding: 10px 18px calc(22px + var(--safe-b)); max-height: 85vh; overflow-y: auto; animation: up .2s ease-out;
}
.sheet .handle { width: 40px; height: 5px; border-radius: 3px; background: #dcdfdd; margin: 0 auto 14px; }
.sheet h3 { font-size: 17px; font-weight: 600; color: var(--heading); }
.sheet .sub { font-size: 13px; color: var(--muted); margin: 3px 0 12px; }
.sheet-list { display: flex; flex-direction: column; gap: 2px; }
.sheet-list a, .sheet-list button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: 12px; font-size: 15px; font-weight: 500; color: var(--text); text-decoration: none; text-align: left; }
.sheet-list a .ic, .sheet-list button .ic { width: 19px; height: 19px; color: var(--sage-medium); }
.sheet-list a.on { background: var(--sage-soft); color: var(--green); font-weight: 600; }
.sheet-list hr { border: none; border-top: 1px solid var(--line); margin: 8px 0; }
.sheet-me { display: flex; align-items: center; gap: 12px; padding: 4px 4px 12px; }
.sheet-me b { display: block; font-size: 15px; color: var(--heading); }
.sheet-me > div { min-width: 0; }
/* Un correo largo se recorta en vez de ensanchar el menú. */
.sheet-me div span { display: block; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* En escritorio, el menú de la cuenta flota sobre el avatar de la barra lateral. */
.sheet-dim.sheet-pop { background: transparent; }
.sheet.sheet-pop {
  right: auto; width: 270px; max-width: calc(100vw - 32px); overflow-x: hidden; border-radius: 16px; padding: 12px 10px 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 18px 40px -16px rgba(69,94,77,.35), 0 0 0 1px rgba(69,94,77,.07);
}
.sheet.sheet-pop .handle { display: none; }
.sheet.sheet-pop .sheet-me { padding: 4px 6px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.sheet.sheet-pop .sheet-list a, .sheet.sheet-pop .sheet-list button { padding: 10px; font-size: 15px; }
.sheet.sheet-pop .sheet-list button:hover { background: var(--bg-alt); }

/* Barra inferior (maqueta 05) */
.tabbar { display: none; }

/* Aviso flotante */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 9px; background: var(--green); color: #fff; border-radius: 999px; padding: 10px 18px; font-size: 14px; font-weight: 500; box-shadow: 0 12px 30px -10px rgba(29,29,27,.45); animation: up .2s ease-out; }
.toast .ic { width: 15px; height: 15px; }
.toast.error { background: var(--bad-ink); }

.loading { display: grid; place-items: center; min-height: 100vh; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--sage-2); border-top-color: var(--sage-medium); animation: spin .8s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(16px); opacity: 0; } }

/* ---------- Comunes de la fase 1 ---------- */
.top .sub b { color: var(--heading); font-weight: 600; }
.small { font-size: 14px; }
.fine-left { font-size: 13px; color: var(--muted); margin-top: 12px; }
.fine-left a, a.plain { color: inherit; }
a.plain { text-decoration: none; }
a.plain:hover { text-decoration: underline; }
.card-h button.link { display: inline-flex; align-items: center; gap: 4px; }
.card-h .link .ic { width: 13px; height: 13px; stroke-width: 2.2; }
.iconbtn.sm { width: 28px; height: 28px; }
.iconbtn.sm .ic { width: 14px; height: 14px; }
.only-mobile { display: none !important; }
.chips-row { display: flex; gap: 8px; margin-top: 12px; }
.who-t { min-width: 0; }
.who-t b { display: block; font-size: 14px; color: var(--heading); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.who-t small { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.price { font-size: 14px; font-weight: 600; color: var(--heading); text-align: right; white-space: nowrap; }
.price small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.chev { width: 16px; height: 16px; color: #c3c8c5; }
.inp.area { height: auto; padding: 10px 13px; resize: vertical; line-height: 1.45; }
.field label .opt { font-weight: 600; letter-spacing: .08em; }
.banner.warn { background: var(--warn-bg); color: var(--warn-ink); }
.banner ul { margin: 6px 0 8px 16px; }
.banner a { color: inherit; font-weight: 600; }
.banner .check { color: inherit; font-weight: 600; }
.note { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--info-ink); background: var(--info-bg); border-radius: 10px; padding: 7px 12px; }
.note .ic { width: 15px; height: 15px; }
.note.neutral { background: var(--bg-alt); color: var(--text); margin-top: 12px; }
.checks.inline { flex-direction: row; flex-wrap: wrap; gap: 10px 18px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches button { width: 28px; height: 28px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255,255,255,.7); }
.swatches button.on { outline: 2px solid var(--green); outline-offset: 2px; }
.svc-list { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.svc small { font-size: 13px; font-weight: 500; color: var(--muted); }

/* ---------- Alumnos y familias: listado ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.seg.seg-auto { grid-auto-columns: auto; }
.seg.seg-auto button { padding: 7px 14px; }
.search.search-page { width: 320px; height: 42px; background: #fff; box-shadow: inset 0 0 0 1px var(--line-strong); }
.search.search-page:focus-within { box-shadow: inset 0 0 0 2px var(--sage-medium); }
.search .ic { width: 15px; height: 15px; }
.inp.inp-sm { width: auto; height: 42px; font-size: 14px; }
.list-card { padding-bottom: 10px; }
.arow {
  display: grid; grid-template-columns: 32px minmax(170px, 1.2fr) minmax(0, 1.5fr) minmax(130px, auto) 76px 16px;
  align-items: center; gap: 14px; padding: 12px 8px; border-top: 1px solid var(--line); border-radius: 10px; text-decoration: none;
}
.arow:first-child { border-top: none; }
.arow:hover { background: var(--bg-alt); }
.asvcs { display: flex; flex-wrap: wrap; gap: 4px 14px; min-width: 0; }
.asvcs .pill { font-size: 12px; }
.atag { justify-self: start; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.price.muted-price { color: var(--muted); }
.list-empty { text-align: center; padding: 26px 0 18px; font-size: 15px; }
.list-empty p { margin-bottom: 12px; }

/* ---------- Ficha del alumno (maqueta 03) ---------- */
.profile { display: flex; align-items: center; gap: 18px; padding: 13px 22px; }
.avatar.xl { width: 56px; height: 56px; font-size: 19px; }
.pinfo { min-width: 0; }
.profile h2 { font-size: 22px; font-weight: 500; color: var(--heading); display: flex; align-items: center; gap: 10px; }
.profile .tags { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.profile .fam { font-size: 14px; margin-top: 8px; display: flex; gap: 4px 16px; align-items: center; flex-wrap: wrap; }
.profile .fam span { display: inline-flex; align-items: center; gap: 6px; }
.profile .fam .ic { width: 14px; height: 14px; color: var(--sage-medium); }
.profile .acts { margin-left: auto; display: flex; gap: 8px; flex: none; }
.tabs { display: flex; gap: 28px; height: 40px; align-items: flex-end; margin: 0 4px 12px; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding-bottom: 11px; font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--green); border-color: var(--green); }
.fgrid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.stack .card + .card { margin-top: 0; }
.fgrid .card, .alta-side { padding: 20px 22px; }
.fgrid .card-h { margin-bottom: 14px; }

.concept { padding: 2px 0 10px; }
.concept + .concept { border-top: 1px solid var(--line); padding-top: 10px; }
.concept .row1 { display: flex; align-items: center; gap: 10px; }
.concept .row1 .svc { font-size: 14px; color: var(--heading); }
.concept .row1 .who { font-size: 13px; color: var(--muted); }
.concept .row1 .tot { margin-left: auto; font-size: 14px; color: var(--heading); font-weight: 600; white-space: nowrap; }
.concept .row1 .tot small { color: var(--muted); font-weight: 500; }
.cells { display: grid; grid-template-columns: repeat(36, 1fr); gap: 3px; margin: 8px 0 6px; }
.cells i { height: 16px; border-radius: 4px; background: #eef1ef; }
.cells i.d { background: var(--sage-medium); }
.cells i.f { background: var(--pink); }
.cells i.r { background: #fff; box-shadow: inset 0 0 0 2px #b5abd8; }
.concept .stats { display: flex; gap: 16px; font-size: 13px; flex-wrap: wrap; }
.concept .stats span { display: inline-flex; align-items: center; gap: 6px; }
.concept .stats i { width: 9px; height: 9px; border-radius: 3px; }

.months { display: grid; grid-template-columns: repeat(auto-fit, minmax(66px, 1fr)); gap: 7px; }
.m { border-radius: 11px; padding: 8px 6px 7px; text-align: center; background: var(--bg-alt); min-width: 0; }
.m .mm { font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--muted); }
.m .am { font-size: 15px; font-weight: 600; color: var(--heading); margin: 3px 0 5px; white-space: nowrap; }
.m .pill { font-size: 11px; padding: 2px 6px; }
.m .dt { font-size: 11px; color: var(--muted); margin-top: 5px; }
.m.paid { background: var(--ok-bg); }
.m.paid .mm { color: var(--ok-ink); }
.m.ver { background: var(--lila-bg); }
.m.ver .mm { color: var(--lila-ink); }
.summary { display: flex; gap: 6px 18px; margin-top: 9px; font-size: 13px; flex-wrap: wrap; }
.summary b { color: var(--heading); font-weight: 600; }
.summary.col { flex-direction: column; margin: 0 0 12px; font-size: 14px; }
.summary.col span { display: flex; justify-content: space-between; }

.svcrow { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); text-decoration: none; }
.card-h + .svcrow, .side-who + .svcrow { border-top: none; padding-top: 2px; }
.svcrow > div:nth-child(2) { min-width: 0; }
.svcrow .avatar { width: 30px; height: 30px; font-size: 11px; }
.svcrow .t1 { font-size: 14px; font-weight: 600; color: var(--heading); }
.svcrow .t2 { font-size: 13px; color: var(--muted); margin-top: 2px; }
.svcrow .price, .svcrow .end { margin-left: auto; }
.svcrow.clickable { cursor: pointer; border-radius: 8px; }
.svcrow.clickable:hover .t1, .link-row:hover .t1 { color: var(--green); }
.total { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; padding: 11px 14px; border-radius: 11px; background: var(--sage-soft); font-size: 14px; color: var(--green); font-weight: 600; }
.total b { font-size: 16px; white-space: nowrap; }
.prev { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; font-size: 13px; color: var(--muted); }

.grow { flex: 1; }
.mov { display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); }
.card-h + .mov { border-top: none; padding-top: 2px; }
.mov .date { text-align: center; border-radius: 10px; background: var(--bg-alt); padding: 6px 0; }
.mov .date b { display: block; font-size: 16px; color: var(--heading); font-weight: 600; line-height: 1.1; }
.mov .date span { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.mov .t1 { font-size: 14px; font-weight: 600; color: var(--heading); }
.mov .t2 { font-size: 12px; color: var(--muted); margin-top: 2px; }

.contact { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 1.3fr) auto 28px; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.card-h + .contact { border-top: none; padding-top: 2px; }
.contact .cdata { display: flex; flex-direction: column; gap: 2px; font-size: 14px; min-width: 0; }
.contact .cdata span { display: inline-flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; }
.contact .cdata .ic { width: 13px; height: 13px; color: var(--sage-medium); }
.contact .cpills { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.add-sib { margin-top: 12px; }

.hist { display: grid; grid-template-columns: 112px 1fr auto; gap: 14px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.card-h + .hist { border-top: none; padding-top: 2px; }
.hist .when { font-size: 13px; color: var(--muted); padding-top: 1px; }
.hist .t1 { font-size: 14px; font-weight: 600; color: var(--heading); }
.hist .t2 { font-size: 13px; color: var(--muted); margin-top: 2px; }
.hist .by { font-size: 13px; font-weight: 600; color: var(--green); background: var(--sage-soft); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.empty.compact { padding: 30px 20px; }
.empty.compact .ico { width: 52px; height: 52px; margin-bottom: 14px; }

/* ---------- Alta (maqueta 05, tercer móvil) ---------- */
.alta-grid { display: grid; grid-template-columns: minmax(0, 560px) minmax(260px, 340px); gap: 18px; align-items: start; }
.alta-form { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px 18px; }
.alta-title { display: none; font-size: 18px; font-weight: 500; color: var(--heading); }
.alta-form .field label:not(.check), .alta-form .lbl { font-size: 12px; letter-spacing: .09em; margin-bottom: 5px; }
.alta-form .inp { height: 40px; font-size: 15px; }
.alta-form .seg { grid-template-columns: 1fr 1fr; }
.fgroup { display: flex; flex-direction: column; gap: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.inp-ic { position: relative; }
.inp-ic .inp { padding-right: 38px; }
.inp-ic .ic { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.svcs { background: #fff; border-radius: 14px; padding: 4px 12px; box-shadow: inset 0 0 0 1px var(--line); }
.svcs .r { padding: 9px 0; border-top: 1px solid var(--line); }
.svcs .r:first-child { border-top: none; }
.svcs .r1 { display: flex; align-items: center; gap: 10px; min-height: 26px; }
.svcs .check { font-size: 14px; font-weight: 500; color: var(--text); flex: 1; min-width: 0; }
.svcs .r.on .check { color: var(--heading); }
.svcs .sel { position: relative; margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--green); background: var(--sage-soft); border-radius: 999px; padding: 4px 8px 4px 5px; }
.svcs .sel .avatar { width: 18px; height: 18px; font-size: 8px; }
.svcs .sel .ic { width: 12px; height: 12px; pointer-events: none; }
.svcs .sel select { appearance: none; border: none; background: none; font: inherit; color: inherit; padding: 0; margin-right: -2px; outline: none; cursor: pointer; }
.svcs .sel:focus-within { box-shadow: 0 0 0 2px var(--sage-medium); }
.svcs .r2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 7px 0 1px 28px; }
.svcs .mini { appearance: none; border: none; background: var(--bg-alt) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238da39b' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 7px center / 12px; border-radius: 999px; padding: 4px 24px 4px 10px; font-size: 13px; font-weight: 600; color: var(--text); }
.svcs .mprice { font-size: 13px; font-weight: 600; color: var(--heading); }
.svcs .mini-btn { margin-left: auto; background: var(--bg-alt); color: var(--green); }
.alta-form .svcs .mini-inp { width: 96px; height: 28px; margin-left: auto; font-size: 13px; border-radius: 999px; padding: 0 10px; }
.acts2 { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.acts2 .btn { height: 44px; font-size: 13px; padding: 0 10px; }
.fine { font-size: 12px; color: var(--muted); text-align: center; margin-top: -4px; }
.fam-chip { display: flex; align-items: center; gap: 10px; background: var(--sage-soft); border-radius: 12px; padding: 8px 8px 8px 12px; color: var(--green); }
.fam-chip > .ic { width: 16px; height: 16px; }
.fam-chip b { display: block; font-size: 14px; }
.fam-chip small { display: block; font-size: 13px; color: var(--muted); }
.fam-chip .iconbtn { margin-left: auto; background: #fff; }
.pick { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.pick:empty { display: none; }
.pick button { text-align: left; padding: 8px 12px; border-radius: 10px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.pick button:hover { background: var(--sage-soft); }
.pick b { display: block; font-size: 14px; color: var(--heading); }
.pick small { font-size: 13px; color: var(--muted); }
.alta-side { position: sticky; top: calc(var(--top-h) + 20px); }
.alta-side .total { margin-top: 10px; }
.alta-side .note { margin-top: 10px; align-items: flex-start; }
.side-who { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.side-who .avatar .ic { width: 16px; height: 16px; }


/* ---------- Agenda (maqueta 02) ---------- */
.ag-bar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 12px; }
.ag-bar .spacer { flex: 1; }
.seg.ag-seg { grid-auto-columns: auto; background: #e9edeb; border-radius: 999px; }
.seg.ag-seg button { padding: 6px 16px; border-radius: 999px; font-size: 13px; }
.datenav { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--heading); }
.datenav b { font-weight: 600; min-width: 168px; text-align: center; white-space: nowrap; }
.datenav .iconbtn { width: 30px; height: 30px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.datenav .iconbtn .ic { width: 14px; height: 14px; }
.ag-bar .inp-sm { min-width: 150px; }
.legend { display: flex; gap: 6px 18px; align-items: center; flex-wrap: wrap; min-height: 30px; margin-bottom: 10px; }
.legend .svc { font-size: 13px; font-weight: 500; }
.legend .sep { flex: 1; }
.legend .note-t { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.legend .note-t .ic { width: 14px; height: 14px; }

.cal { padding: 0; overflow: hidden; }
.cal-head, .cal-body { display: grid; grid-template-columns: 60px repeat(var(--cols), minmax(0, 1fr)); }
.cal-head { min-height: 58px; border-bottom: 1px solid var(--line); }
.cal-head .p { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-left: 1px solid var(--line); min-width: 0; }
.cal-head .p > div { min-width: 0; }
.cal-head .p b { display: block; font-size: 14px; color: var(--heading); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-head .p > div span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-head .avatar { width: 28px; height: 28px; font-size: 11px; }
.cal-head .dnum { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--bg-alt); font-size: 14px; font-weight: 600; color: var(--heading); }
.cal-head .p.today .dnum { background: var(--pink-deep); color: #fff; }
.cal-head .p.today b { color: var(--green); }
.cal-body { position: relative; }
.hours { position: relative; }
.hours span { position: absolute; right: 10px; transform: translateY(-50%); font-size: 11.5px; color: var(--muted); font-weight: 500; }
.col { position: relative; border-left: 1px solid var(--line); }
.col.today { background: rgba(239,244,242,.5); }
.col.can { cursor: cell; }
.gridline { position: absolute; left: 60px; right: 0; border-top: 1px solid var(--line); pointer-events: none; }
.gridline.half { border-top-style: dashed; border-color: #f0f2f1; }

.ev { position: absolute; z-index: 2; left: 6px; right: 6px; display: block; border-radius: 9px; padding: 6px 9px 5px 11px; overflow: hidden;
      background: var(--bg); box-shadow: inset 3px 0 0 var(--bar); text-align: left; cursor: pointer; transition: filter .15s; }
.ev:hover { filter: brightness(.97); }
/* Estado corto en citas estrechas (agenda.js · textoEstado). */
.ev { container-type: inline-size; line-height: 1.35; }
.st-s { display: none; }
@container (max-width: 130px) {
  .ev .st { padding: 2px 5px; gap: 3px; }
  .st .st-l { display: none; }
  .st .st-s { display: inline; }
}
.ev b { display: block; font-size: 12.5px; font-weight: 600; color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev .meta { display: block; font-size: 11.5px; color: var(--text); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; margin-top: 4px; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st .ic { width: 10px; height: 10px; stroke-width: 2.6; }
.ev.len, .appt.len { --bg: var(--s-len-bg); --bar: var(--s-len); }
.ev.ped, .appt.ped { --bg: var(--s-ped-bg); --bar: var(--s-ped); }
.ev.psi, .appt.psi { --bg: var(--s-psi-bg); --bar: var(--s-psi); }
.ev.fis, .appt.fis { --bg: var(--s-fis-bg); --bar: var(--s-fis); }
.ev.spa, .appt.spa { --bg: var(--s-spa-bg); --bar: var(--s-spa); }
.ev.past { opacity: .78; }
.ev.now { box-shadow: inset 3px 0 0 var(--bar), 0 0 0 2px var(--bar), 0 6px 16px -6px rgba(0,0,0,.18); opacity: 1; }
.ev.cancel { background: repeating-linear-gradient(135deg, #f7f7f7 0 6px, #f0f0f0 6px 12px); box-shadow: inset 0 0 0 1px #dedede; }
.ev.cancel b { text-decoration: line-through; color: var(--muted); }
.st.ok { background: rgba(255,255,255,.75); color: var(--ok-ink); }
.st.warn { background: var(--warn-bg); color: var(--warn-ink); }
.st.bad { background: #fff; color: var(--bad-ink); }
.st.lila { background: #fff; color: var(--lila-ink); }
.st.info { background: #fff; color: var(--info-ink); }
.st.neutral { background: rgba(255,255,255,.8); color: var(--muted); }
.st.cancel { background: #fff; color: var(--bad-ink); }
.pill.cancel { background: var(--bad-bg); color: var(--bad-ink); }
.nowline { position: absolute; left: 54px; right: 0; height: 0; border-top: 2px solid var(--pink-deep); z-index: 3; pointer-events: none; }
.nowline span { position: absolute; left: -50px; top: -10px; font-size: 11px; font-weight: 700; color: #fff; background: var(--pink-deep); border-radius: 999px; padding: 2px 6px; line-height: 1.3; }
.nowline::after { content: ""; position: absolute; left: 4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--pink-deep); }

/* Citas en lista: Mi agenda de hoy (maqueta 05), semana en móvil, pendientes */
.appts { display: flex; flex-direction: column; gap: 8px; }
.appt { display: flex; gap: 14px; align-items: center; width: 100%; background: #fff; border-radius: 14px; padding: 12px 16px; text-align: left;
        box-shadow: inset 3px 0 0 var(--bar, var(--s-len)), 0 1px 2px rgba(0,0,0,.04); }
.card .appt { background: var(--bg-alt); box-shadow: inset 3px 0 0 var(--bar, var(--s-len)); }
.appt:hover { filter: brightness(.98); }
.appt .h { font-size: 14px; font-weight: 600; color: var(--heading); width: 46px; flex: none; }
.appt .h small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.appt { flex-wrap: wrap; row-gap: 6px; }
.appt .who-t { flex: 1 1 110px; }
.appt b { display: block; font-size: 15px; color: var(--heading); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt .ameta { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt .pill { margin-left: auto; flex: none; }
.day-list.today .card-h h3 { color: var(--green); }
.hoy-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }

/* Asistencia: opciones de la hoja (maqueta 05) */
.opts { display: flex; flex-direction: column; gap: 7px; }
.aopt { display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 10px 12px; border-radius: 14px; background: #fff; text-align: left;
        box-shadow: inset 0 0 0 1px var(--line); --o-bg: var(--warn-bg); --o-line: #e4c27f; --o-ink: var(--warn-ink); }
.aopt .radio { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 2px #a9b3ae; flex: none; margin-top: 1px; }
.aopt b { display: block; font-size: 14px; color: var(--heading); font-weight: 600; }
.aopt .d { font-size: 12px; color: var(--muted); }
.aopt:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--sage); }
.aopt.on { background: var(--o-bg); box-shadow: inset 0 0 0 2px var(--o-line); }
.aopt.on .radio { box-shadow: inset 0 0 0 5px var(--o-ink); }
.aopt.on .d { color: var(--o-ink); }
.aopt:disabled { opacity: .5; cursor: not-allowed; }
.aopt[data-estado=realizada] { --o-bg: var(--ok-bg); --o-line: #a9cdb8; --o-ink: var(--ok-ink); }
.aopt[data-estado=no_asistio_no_recupera] { --o-bg: var(--bad-bg); --o-line: #e6b7b2; --o-ink: var(--bad-ink); }
.aopt[data-estado=cancelada_centro] { --o-bg: var(--info-bg); --o-line: #a9c4d9; --o-ink: var(--info-ink); }
.aopt[data-estado=pendiente] { --o-bg: var(--bg-alt); --o-line: #a9b3ae; --o-ink: var(--text); }
.aopt.actual b::after { content: " · ahora"; font-weight: 500; color: var(--muted); }
.manual { display: flex; gap: 7px; align-items: center; font-size: 12px; color: var(--muted); margin: 0 2px; }
.manual .ic { width: 13px; height: 13px; }
.hint-12 { font-size: 12px; color: var(--muted); margin: -6px 2px 0 22px; }
.cita-estado { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.cita-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.cita-hist summary { font-size: 13px; font-weight: 600; color: var(--green); cursor: pointer; }
.cita-hist ul { list-style: none; margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.cita-hist li { display: grid; grid-template-columns: 96px 1fr auto; gap: 8px; align-items: start; font-size: 13px; }
.cita-hist .when { color: var(--muted); }
.cita-hist .by { font-size: 12px; font-weight: 600; color: var(--green); background: var(--sage-soft); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.btn.wide { width: 100%; height: 46px; font-size: 14px; }
.sheet-form { display: flex; flex-direction: column; gap: 11px; }
.sheet-form .sub { margin: -8px 0 2px; }
.sheet-form .fields { grid-template-columns: 1fr 1fr; }
.sheet-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.sheet-foot .spacer { flex: 1; }
.sheet-foot .wide { flex-basis: 100%; }

/* Plan de 36 en lista (Planes y asistencia) */
.cells i.r, .stats i.ring { background: #fff; box-shadow: inset 0 0 0 2px #b5abd8; }
.cells.mini { gap: 2px; margin: 0; }
.cells.mini i { height: 12px; border-radius: 3px; }
.planes-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.plan-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; margin: -4px 0 6px; }
.plan-legend span { display: inline-flex; align-items: center; gap: 6px; }
.plan-legend i { width: 9px; height: 9px; border-radius: 3px; background: #eef1ef; }
.plan-legend i.d { background: var(--sage-medium); }
.plan-legend i.f { background: var(--pink); }
.plan-legend i.r { background: #fff; box-shadow: inset 0 0 0 2px #b5abd8; }
.plan-row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 1.7fr) 56px minmax(0, 150px); gap: 14px; align-items: center;
            padding: 10px 8px; border-top: 1px solid var(--line); border-radius: 10px; text-decoration: none; }
.plan-row:hover { background: var(--bg-alt); }
.plan-row .who-t small .svc { font-size: 13px; font-weight: 600; }
.plan-row .tot { font-size: 14px; font-weight: 600; color: var(--heading); text-align: right; white-space: nowrap; }
.plan-row .tot small { color: var(--muted); font-weight: 500; }
.plan-row .pp { display: flex; flex-wrap: wrap; gap: 4px; }
.planes-grid .note { margin-top: 12px; }
.toolbar > .check { margin-left: 4px; }
.ses-table tr.clickable { cursor: pointer; }
.ses-table td.nowrap { white-space: nowrap; }
.ses-table .ses-nota { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.ses-table tr.clickable:hover td { background: var(--bg-alt); }

/* ---------- Responsive ---------- */
/* ---------- Cobros: modal (maqueta 04), listas y panel (maqueta 01) ---------- */
.avatar.xs { width: 20px; height: 20px; font-size: 9px; }
.owner { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.tagx { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
a.card { text-decoration: none; color: inherit; }
.card.kpi.clickable { cursor: pointer; }
.kpi .val small { font-size: 15px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.kpi .val.val-sm { font-size: 17px; margin-top: 5px; }
.inp.static { display: flex; align-items: center; background: var(--bg-alt); box-shadow: none; font-weight: 600; }
.inp-eur { position: relative; }
.inp-eur .inp { padding-right: 30px; font-weight: 600; }
.inp-eur span { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); font-size: 15px; font-weight: 600; color: var(--heading); pointer-events: none; }
.link-btn { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; font-size: 13px; font-weight: 600; color: var(--green); }
.link-btn .ic { width: 13px; height: 13px; stroke-width: 2.2; }
.search.search-block { width: 100%; }

.modal.modal-cobro { max-width: 780px; }
.modal-cobro .mh, .modal-cobro .mf { padding-left: 26px; padding-right: 26px; }
.modal-cobro .mb { padding: 18px 26px 6px; gap: 12px; }
.modal-cobro .mf { padding-top: 16px; }
.mf .who { font-size: 13px; color: var(--muted); }
.cobro-fields { display: grid; grid-template-columns: 140px 172px minmax(0, 1fr); gap: 16px; margin-bottom: 4px; }
.cobro-fields .field label, .cobro-fields .lbl { white-space: nowrap; }
.cobro-fields .inp { height: 40px; border-radius: 11px; font-size: 15px; font-weight: 600; }
.cobro-fields #c-importe { box-shadow: inset 0 0 0 2px var(--sage-medium); }
.seg.medios { background: none; padding: 0; gap: 6px; }
.seg.medios button { height: 40px; padding: 0 2px; border-radius: 11px; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text); font-size: 14px; }
.seg.medios button.on { background: var(--sage-soft); color: var(--green); box-shadow: inset 0 0 0 2px var(--sage-medium); }
.seg.medios > .motion-ind { background: var(--sage-soft); box-shadow: inset 0 0 0 2px var(--sage-medium); border-radius: 11px; }
.seg.medios.motion-has-ind > button.on { background: transparent; box-shadow: none; }
.sect { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sect h4 { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--heading); }
.sect span { font-size: 13px; color: var(--muted); }
.rep-wrap { margin-top: -4px; }
.rep th { padding: 0 8px 8px; font-size: 11px; }
.rep td { padding: 9px 8px; font-size: 14px; }
.rep td.cbx { width: 30px; }
.rep td.pd { color: var(--text); }
.rep .apl { width: 88px; height: 30px; border: none; border-radius: 8px; background: none; text-align: right; font: inherit; font-size: 14px; font-weight: 700; color: var(--heading); padding: 0 6px; outline: none; }
.rep .apl:disabled { background: none; }
.rep .apl:not(:disabled):hover { box-shadow: inset 0 0 0 1px var(--line-strong); background: #fff; }
.rep .apl:focus { box-shadow: inset 0 0 0 2px var(--sage-medium); background: #fff; }
.rep .apl::placeholder { color: #c3c8c5; font-weight: 500; }
.rep td.ap { white-space: nowrap; }
.rep .apl-eur { font-size: 14px; font-weight: 700; color: var(--heading); }
.rep tr:not(.on) .apl-eur { color: #c3c8c5; }
.rep .apl { width: 76px; padding: 0 4px; }
.rep-empty { padding: 8px 0 4px; }
.totals { display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 10px; }
.tot { border-radius: 12px; background: var(--bg-alt); padding: 10px 14px; }
.tot span { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tot b { display: block; font-size: 18px; color: var(--heading); font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tot.fav { background: var(--sage-soft); }
.tot.fav span, .tot.fav b, .tot.fav small { color: var(--green); }
.tot.fav small { display: block; font-size: 12px; opacity: .85; margin-top: 2px; }
.tot.fav.bad { background: var(--bad-bg); }
.tot.fav.bad span, .tot.fav.bad b, .tot.fav.bad small { color: var(--bad-ink); }
.tot.fav { transition: background-color var(--motion-base) var(--ease-in-out); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.facts > div > span:first-child { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.facts b { font-size: 14px; color: var(--heading); font-weight: 600; }

.cobros-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cuotas-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.panel-cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cobros-grid > .card + .card, .cuotas-grid > .card + .card, .panel-cols > .card + .card { margin-top: 0; }
.ltable td small { display: block; font-size: 12px; margin-top: 2px; }
.ltable td.acts { white-space: nowrap; }
.ltable td.acts .iconbtn { display: inline-grid; vertical-align: middle; margin-left: 2px; }
.ltable tr.flag td { background: rgba(226, 237, 245, .45); }
.ltable tr.clickable { cursor: pointer; }
.ltable tr.clickable:hover td { background: var(--bg-alt); }
.ok-t { color: var(--ok-ink); }
.chips-mini { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.chips-mini .svc { font-weight: 500; }
.avs { display: inline-flex; margin-top: 4px; }
.avs .avatar + .avatar { margin-left: -5px; box-shadow: 0 0 0 2px #fff; }
.plist { display: flex; flex-direction: column; }
.prow { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: center; width: 100%; padding: 11px 0; border-top: 1px solid var(--line); text-align: left; }
.prow:first-child { border-top: none; }
.prow .date, .mov .date { text-align: center; border-radius: 10px; background: var(--bg-alt); padding: 5px 0; }
.prow .date b { display: block; font-size: 15px; color: var(--heading); font-weight: 600; line-height: 1.1; }
.prow .date span { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.prow .who-t small { white-space: normal; }
.prow:hover .who-t b, .mov.clickable:hover .t1 { color: var(--green); }
.mov.clickable { width: 100%; text-align: left; }
.mov .t1, .mov .t2 { display: block; }
.srow { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.card-h + .srow { border-top: none; padding-top: 2px; }
.srow .who-t { flex: 1; }
.saldos { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); column-gap: 28px; }
.saldos .srow { border-top: none; border-bottom: 1px solid var(--line); }
.ptable td.m2 b { white-space: nowrap; }
.ptable td.m4 { max-width: 320px; }
.acts-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.mesnav b { min-width: 132px; }
.mesnav .iconbtn:disabled { opacity: .4; cursor: default; }
.m.late { background: var(--bad-bg); }
.m.late .mm { color: var(--bad-ink); }
.m.part { background: var(--sage-2); }
.qtot { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; align-content: center; }
.qtot span { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.qtot b { font-size: 17px; color: var(--heading); font-weight: 600; }
.qbanner { margin-bottom: 18px; }

.qbar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; gap: 2px; margin: 4px 0 14px; }
.qbar i { min-width: 4px; }
.qlegend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; font-size: 13px; }
.qlegend div { display: flex; align-items: center; gap: 8px; }
.qlegend i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.qlegend b { margin-left: auto; color: var(--heading); font-weight: 600; }
.tray .item { display: flex; align-items: center; gap: 16px; padding: 14px 4px; border-top: 1px solid var(--line); }
.tray .item:first-child { border-top: none; }
.item .tico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.item .tico .ic { width: 17px; height: 17px; }
.item .body { display: block; flex: 1; min-width: 0; text-align: left; }
.item .t1 { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; font-size: 15px; font-weight: 600; color: var(--heading); }
.item .t2 { display: block; font-size: 14px; margin-top: 4px; color: var(--text); }
.item .t3 { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; }
.item .body:hover .t1 { color: var(--green); }
.item .acts { display: flex; gap: 6px; flex: none; }
.tray-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px 0; color: var(--green); font-size: 14px; }
.tray-empty .ic { width: 28px; height: 28px; }
.today .trow { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: center; width: 100%; padding: 11px 0; border-top: 1px solid var(--line); text-align: left; }
.today .card-h + .trow { border-top: none; padding-top: 2px; }
.trow .h { font-size: 14px; font-weight: 600; color: var(--heading); }
.trow .who-t small { display: flex; gap: 10px; align-items: center; }
.trow:hover .who-t b { color: var(--green); }
.mini-list .mrow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.mini-list .mrow:first-child { border-top: none; }


@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .top .sub { display: none; }
  .top .search { width: 252px; } /* cabe «Buscar alumno o familia…» entero */
  .top .lbl-long { display: none; }
  .top .lbl-short { display: inline; }
  .arow { grid-template-columns: 32px minmax(150px, 1.2fr) minmax(0, 1.4fr) 76px 16px; }
  .arow .atag { display: none; }
  .profile .acts { flex-direction: column; }
  .planes-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1023px) {
  .side { display: none; }
  /* Cabecera de la maqueta 05: logo y avatar sobre el fondo, sin barra blanca. */
  .top { height: auto; padding: calc(10px + env(safe-area-inset-top, 0px)) 20px 10px; gap: 10px; background: var(--bg-alt); border-bottom: none; }
  .top h1, .top .sub, .top .search, .top .top-new, .top #bell { display: none; }
  .top .appbar-brand { display: flex; }
  .top .appbar-brand .icon { width: 34px; }
  .top .appbar-brand .word { width: 72px; }
  .top .appbar-avatar { display: grid; }
  .top .appbar-avatar .avatar { width: 30px; height: 30px; font-size: 11px; }
  .content { padding: 4px 16px calc(var(--tab-h) + var(--safe-b) + 28px); }
  .page-hello { display: block; margin-bottom: 12px; padding: 0 4px; }
  .page-hello h2 { font-size: 20px; font-weight: 500; color: var(--heading); }
  .page-hello p { font-size: 14px; color: var(--muted); margin-top: 2px; }
  .card { padding: 18px; border-radius: 16px; }
  .kpis { gap: 12px; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(4, 1fr);
    height: calc(var(--tab-h) + var(--safe-b)); padding: 8px 8px var(--safe-b); background: #fff; border-top: 1px solid var(--line);
  }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; }
  .tabbar .ic { width: 22px; height: 22px; }
  .tabbar .on { color: var(--green); }
  .toasts { bottom: calc(var(--tab-h) + var(--safe-b) + 14px); }
  .hello-card { display: none; }
  .only-mobile { display: inline-flex !important; }
  .fgrid { grid-template-columns: 1fr; }
  .alta-grid { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
  .alta-side { display: none; }
  .profile { flex-wrap: wrap; padding: 14px 16px; }
  .profile .acts { flex-direction: row; margin-left: 0; width: 100%; }
  .profile .acts .btn { flex: 1; }
  .hoy-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .toolbar .search-page { order: -1; width: 100%; }
  .toolbar .inp-sm { flex: 1; min-width: 0; }
  .toolbar .seg-auto[data-seg=vista] { flex: 1; grid-auto-columns: 1fr; }
  .arow { grid-template-columns: 32px minmax(0, 1fr) auto; grid-template-areas: "av who price" ". svcs svcs"; gap: 4px 12px; padding: 10px 2px; }
  .arow > .avatar { grid-area: av; }
  .arow .who-t { grid-area: who; }
  .arow .asvcs { grid-area: svcs; gap: 2px 12px; }
  .arow .price { grid-area: price; }
  .arow .chev { display: none; }
  .profile .avatar.xl { width: 48px; height: 48px; font-size: 16.5px; }
  .profile { align-items: flex-start; }
  .concept .row1 { flex-wrap: wrap; row-gap: 2px; }
  .concept .row1 .svc { flex-basis: 100%; }
  .fgrid .card-h .count { flex-basis: 100%; order: 3; }
  .profile .pinfo { flex: 1; }
  .profile h2 { font-size: 20px; }
  .profile .fam { flex-direction: column; align-items: flex-start; }
  .tabs { gap: 20px; margin: 0 0 12px; }
  .cells { gap: 2px; }
  .cells i { height: 13px; border-radius: 3px; }
  .contact { grid-template-columns: minmax(0, 1fr) 28px; }
  .contact .cdata, .contact .cpills { grid-column: 1; justify-content: flex-start; }
  .contact .iconbtn { grid-column: 2; grid-row: 1; }
  .hist { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
  .hist .when { grid-column: 1 / -1; }
  .ag-bar { gap: 8px; }
  .ag-bar .datenav { order: 5; flex-basis: 100%; justify-content: space-between; background: #fff; border-radius: 999px; padding: 4px; }
  .ag-bar .datenav .iconbtn { box-shadow: none; background: var(--bg-alt); }
  .ag-bar .ag-pro { order: 6; flex: 1 1 100%; }
  .ag-bar .spacer { display: none; }
  .ag-bar [data-nueva] { margin-left: auto; }
  .legend { gap: 4px 12px; }
  .legend .sep { display: none; }
  .legend .note-t { flex-basis: 100%; }
  .cal-head, .cal-body { grid-template-columns: 46px repeat(var(--cols), minmax(0, 1fr)); }
  .gridline { left: 46px; }
  .nowline { left: 40px; }
  .nowline span { left: -38px; }
  /* Mi agenda de hoy como en la maqueta 05: las citas sobre el fondo. */
  .hoy-card.card { background: none; box-shadow: none; padding: 0; }
  .hoy-card .card-h { display: none; }
  .hoy-card .appt { background: #fff; box-shadow: inset 3px 0 0 var(--bar, var(--s-len)), 0 1px 2px rgba(0,0,0,.04); }
  .plan-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who tot" "cells cells" "pp pp"; gap: 6px 12px; padding: 10px 2px; }
  .plan-row .who-t { grid-area: who; }
  .plan-row .cells { grid-area: cells; }
  .plan-row .tot { grid-area: tot; }
  .plan-row .pp { grid-area: pp; }
  .plan-row .pp:empty { display: none; }
  .toolbar > .check { flex-basis: 100%; }
  .cita-hist li { grid-template-columns: 1fr auto; }
  .cita-hist .when { grid-column: 1 / -1; }
  /* Alta como en la maqueta 05: el formulario sobre el fondo, sin tarjeta. */
  .alta-form.card { background: none; box-shadow: none; padding: 0; border-radius: 0; }
  .alta-form .inp { box-shadow: inset 0 0 0 1px var(--line-strong); }
  .svcs { box-shadow: none; }
}

@media (max-width: 600px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi { gap: 10px; padding: 12px; align-items: flex-start; }
  .kpi .ico { width: 34px; height: 34px; border-radius: 11px; }
  .kpi .ico .ic { width: 17px; height: 17px; }
  .kpi .lbl { font-size: 11px; }
  .kpi .val { font-size: 22px; }
  .kpi .hint { font-size: 12px; }
  .fields { grid-template-columns: 1fr; }
  .overlay { place-items: end center; padding: 0; }
  .modal { max-width: none; border-radius: 24px 24px 0 0; max-height: 92vh; animation: up .2s ease-out; }
  .mf { padding-bottom: calc(18px + var(--safe-b)); }
  .mf .btn { flex: 1; }
  .empty { padding: 36px 8px 32px; }
  .login-card { padding: 28px 22px 24px; }
}

/* ---------- Cobros: responsive ---------- */
@media (max-width: 1280px) {
  .cobros-grid, .panel-cols, .fgrid.fgrid-cuotas { grid-template-columns: 1fr; }
  .ptable .m5 { display: none; }
  .ptable th:nth-child(5) { display: none; }
}
@media (max-width: 1023px) {
  .cuotas-grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
}
/* Tablas de cobros en una columna de tarjetas: nada de scroll lateral. */
@media (max-width: 760px) {
  .ltable thead { display: none; }
  .ltable, .ltable tbody { display: block; }
  .ltable tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-auto-flow: row dense; column-gap: 12px; padding: 10px 2px; border-top: 1px solid var(--line); }
  .ltable tbody tr:first-child { border-top: none; }
  .ltable td { display: block; border: none; padding: 1px 0; min-width: 0; }
  .ltable td.m1, .ltable td.m2, .ltable td.m3, .ltable td.m4, .ltable td.m5 { grid-column: 1; }
  .ltable td.s1, .ltable td.s2, .ltable td.s3 { grid-column: 2; text-align: right; }
  .ltable td.s2 small { text-align: right; }
  .ltable td.s2 { grid-row: span 2; }
  .ltable td.m4 { font-size: 13px; }
  .ltable td.m3 { font-size: 13px; color: var(--muted); }
  .ltable td.acts { padding-top: 4px; }
  .ptable td.m3 { display: none; }
  .table-wrap:has(.ltable) { overflow: visible; margin: 0; }
}
@media (max-width: 700px) {
  .cobro-fields { grid-template-columns: 1fr 1fr; gap: 12px; }
  .cobro-fields .field:last-child { grid-column: 1 / -1; }
  .modal-cobro .mh, .modal-cobro .mf { padding-left: 18px; padding-right: 18px; }
  .modal-cobro .mb { padding: 14px 18px 6px; }
  .modal-cobro .mf .who { flex-basis: 100%; order: 3; text-align: center; }
  .rep thead { display: none; }
  .rep, .rep tbody { display: block; }
  .rep tr { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; grid-template-areas: "cb al ap" "cb co pd" "cb pe ow"; column-gap: 10px; row-gap: 1px; padding: 9px 0; border-top: 1px solid var(--line); align-items: center; }
  .rep tbody tr:first-child { border-top: none; }
  .rep tbody tr.on td { background: none; }
  .rep td { display: block; border: none; padding: 0; min-width: 0; }
  .rep td.cbx { grid-area: cb; align-self: start; padding-top: 2px; width: auto; }
  .rep td.al { grid-area: al; }
  .rep td.co { grid-area: co; font-size: 13px; }
  .rep td.pe { grid-area: pe; font-size: 13px; color: var(--muted); }
  .rep td.ow { grid-area: ow; justify-self: end; }
  .rep td.pd { grid-area: pd; font-size: 13px; color: var(--muted); }
  .rep td.pd::before { content: "pend. "; }
  .rep td.ap { grid-area: ap; }
  .rep-ro tr { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "al ap" "co ow" "pe ow"; }
  .rep-ro td:last-child { grid-area: ap; }
  .totals { grid-template-columns: 1fr 1fr; gap: 8px; }
  .totals .fav { grid-column: 1 / -1; }
  .tot b { font-size: 16px; }
  .seg.medios { grid-template-columns: 1fr 1fr; grid-auto-flow: row; }
  .tray .item { flex-wrap: wrap; gap: 10px 12px; padding: 12px 0; }
  .tray .item .body { flex-basis: calc(100% - 48px); }
  .tray .item .acts { margin-left: 48px; }
  .mini-list .mrow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who price" "btn pill"; row-gap: 6px; }
  .mini-list .mrow .who-t { grid-area: who; }
  .mini-list .mrow .price { grid-area: price; }
  .mini-list .mrow .pill { grid-area: pill; justify-self: end; }
  .mini-list .mrow .btn { grid-area: btn; justify-self: start; }
  .qlegend { gap: 6px 12px; }
  .qtot { grid-template-columns: 1fr 1fr; }
  .mesnav { flex: 1; justify-content: space-between; background: #fff; border-radius: 999px; padding: 4px; }
  .mesnav .iconbtn { box-shadow: none; background: var(--bg-alt); }
  .toolbar .seg-auto { flex: 1 1 100%; grid-auto-columns: 1fr; }
  .toolbar .seg-auto button { padding: 7px 4px; font-size: 13px; }
  .srow { flex-wrap: wrap; }
  .srow .who-t { flex-basis: 100%; }
}

/* ---------- Fase 4 · fichaje (maqueta 05, primer móvil) ---------- */
/* Excepción aprobada a la paleta pastel: Entrada en verde y Salida en rojo llamativos. */
.fich-grid { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 18px; align-items: start; }
.fich-main, .fich-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fich-main > .card + .card, .fich-side > .card + .card { margin-top: 0; }
.card.clock { text-align: center; padding: 22px 16px 18px; border-radius: 16px; }
.clock .t { font-size: 52px; font-weight: 300; color: var(--heading); letter-spacing: .02em; line-height: 1; }
.clock .d { font-size: 14px; color: var(--muted); margin: 6px 0 10px; }
.clock .pill { font-size: 13px; padding: 4px 11px; }
.clock .run { font-size: 13px; color: var(--text); margin-top: 8px; }
.clock .run b { color: var(--heading); }
.fbtn { display: flex; align-items: center; gap: 14px; width: 100%; height: 66px; border-radius: 20px; padding: 0 20px; color: #fff; text-align: left; }
.fbtn > .ic { width: 26px; height: 26px; stroke-width: 2.2; flex: none; }
.fbtn b { display: block; font-size: 18px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.fbtn small { display: block; font-size: 13px; opacity: .92; font-weight: 500; }
.fbtn.in { background: var(--fichaje-in); box-shadow: 0 10px 22px -10px rgba(23,163,74,.8); }
.fbtn.out { background: var(--fichaje-out); box-shadow: 0 10px 22px -10px rgba(226,59,59,.8); }
.fbtn .ok { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.25); display: grid; place-items: center; flex: none; }
.fbtn .ok .ic { width: 15px; height: 15px; stroke-width: 3; }
.fbtn:disabled { cursor: default; }
.fbtn:disabled:not(.hecho) { opacity: .42; box-shadow: none; }
.card.week { padding: 14px 16px; border-radius: 16px; }
.week h4 { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--heading); margin-bottom: 6px; }
.week .r { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 7px 0; border-top: 1px solid var(--line); }
.week h4 + .r { border-top: none; }
.week .r > span:last-child { text-align: right; }
.week .r b { color: var(--heading); font-weight: 600; }
.week .r.inc > span:last-child, .week .r.inc b { color: var(--bad-ink); }
.week .r.tot { font-weight: 600; color: var(--heading); }
.week .r .pill { margin-left: 4px; font-size: 11px; padding: 1px 7px; }
.week .foot { font-size: 12px; color: var(--muted); margin-top: 6px; }
.fich-aviso { font-size: 14px; }
.tabbar a.alerta { position: relative; }
.tabbar a.alerta::after { content: ""; position: absolute; top: 2px; left: calc(50% + 7px); width: 8px; height: 8px; border-radius: 50%; background: var(--pink-deep); border: 2px solid #fff; }
.toast.warn { background: var(--warn-ink); }
small.block { display: block; margin-top: 3px; }

/* Fichaje global (administración) y corrección. */
.lbl-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.ltable tr.flag-bad td { background: rgba(249, 226, 223, .45); }
.ftable .who { display: inline-flex; align-items: center; gap: 8px; }
.ftable td.s2 small { margin-top: 3px; }
.marcas { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.marca { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border-radius: 12px; background: var(--bg-alt); font-size: 14px; }
.marca b { font-size: 16px; color: var(--heading); }
.marca small { color: var(--muted); font-size: 13px; }

/* ---------- Fase 4 · bono de fisioterapia (ficha, venta y alta) ---------- */
.bono-card .bono { padding: 12px 0; border-top: 1px solid var(--line); }
.bono-card .bono:first-of-type { border-top: none; padding-top: 0; }
.bono .row1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.bono .row1 b { color: var(--heading); font-weight: 600; }
.bono .row1 .muted { font-size: 13px; }
.bono .row1 .pill { margin-left: auto; }
.bono .brow { display: flex; align-items: center; gap: 12px; margin: 10px 0 8px; flex-wrap: wrap; }
.bcells { display: grid; grid-template-columns: repeat(4, 30px); gap: 6px; }
.bcells i { display: grid; place-items: center; height: 30px; border-radius: 9px; background: #eef1ef; color: var(--muted); font-style: normal; font-size: 13px; font-weight: 700; }
.bcells i.d { background: var(--s-fis); color: #fff; }
.bono .bsaldo { font-size: 14px; color: var(--muted); }
.bono .bsaldo b { color: var(--heading); }
.bono .brow .btn { margin-left: auto; }
.bono.agotado .row1 b { color: var(--muted); }
.usos { display: flex; flex-direction: column; }
.uso { display: grid; grid-template-columns: 22px auto minmax(0, 1fr); gap: 10px; align-items: center; width: 100%; padding: 6px 0; text-align: left; font-size: 14px; border-top: 1px dashed var(--line); }
.uso:first-child { border-top: none; }
.uso .n { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--s-fis-bg); color: var(--info-ink); font-size: 12px; font-weight: 700; }
.uso .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uso.rev .num { text-decoration: line-through; color: var(--muted); }
.uso:hover .num { color: var(--green); }
.bono-card .banner { margin-top: 10px; }
.bono-oferta { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px; border-radius: 14px; background: var(--s-fis-bg); margin-bottom: 12px; text-align: center; }
.bono-oferta b { font-size: 15px; color: var(--heading); text-transform: uppercase; letter-spacing: .08em; }
.bono-oferta span { font-size: 30px; font-weight: 500; color: var(--heading); }
.bono-oferta small { font-size: 13px; color: var(--muted); }
.svcs .r2 .mini-check { order: 9; flex-basis: 100%; font-size: 13px; font-weight: 600; white-space: nowrap; }
.mf .btn + .btn { margin-left: 0; }

@media (max-width: 1023px) {
  .fich-grid { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 700px) {
  .lbl-inline { flex: 1 1 calc(50% - 10px); }
  .lbl-inline .inp { flex: 1; min-width: 0; }
  .ftable td.m3 { font-size: 13px; }
}

/* ---------- Fase 5 · equipo, ausencias, configuración e informes ---------- */
.toolbar .spacer { flex: 1; }
.only-mobile-inline { display: none; }
.warn-t { color: var(--warn-ink); }
.pill-btn { cursor: pointer; border: none; font-family: inherit; }
.pill-btn:hover { filter: brightness(.96); }
.ltable td.s2 small { display: block; margin-top: 3px; }
.aus-table tr.anulada td { opacity: .6; }
.aus-table td.m1 .who small { display: none; }
.motivos { margin-top: 8px; flex-wrap: wrap; gap: 6px; }

/* Ausencia en la agenda: franja suave rayada, como la cita cancelada (maqueta 02). */
/* Más ancha que las citas (que quedan encima) para que se vea su borde; el
   rótulo va abajo, donde no lo tapan las citas que empiezan en la franja. */
.absence { position: absolute; z-index: 1; left: 2px; right: 2px; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 3px;
  padding: 6px 9px; border-radius: 10px; overflow: hidden; text-align: left;
  background: repeating-linear-gradient(135deg, #f7f6f6 0 6px, #eeecec 6px 12px); box-shadow: inset 0 0 0 1px #dcd8d8; }
button.absence { cursor: pointer; transition: filter var(--motion-fast) var(--ease-out); }
button.absence:hover { filter: brightness(.97); }
.absence .st { margin-top: 0; }
.absence small { font-size: 11px; color: var(--muted); line-height: 1.3; }
.cal-head .p.off > div span { color: var(--bad-ink); }
.absence-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; padding: 8px 12px; margin: 4px 0 8px; border-radius: 12px; font-size: 14px;
  background: repeating-linear-gradient(135deg, #f7f7f7 0 6px, #f0f0f0 6px 12px); box-shadow: inset 0 0 0 1px #e3e3e3; color: var(--text); }
.absence-row .ic { width: 14px; height: 14px; color: var(--bad-ink); }
.absence-row b { color: var(--heading); font-weight: 600; }
.absence-row span { color: var(--muted); }

/* Citas afectadas por una ausencia y confirmación con alcance. */
.modal.modal-aus, .modal.modal-cambio { max-width: 640px; }
.sect .check.end { margin-left: auto; font-size: 13px; }
.alist { display: flex; flex-direction: column; }
.acita { display: grid; grid-template-columns: 18px 52px minmax(0, 1fr) auto 28px; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); cursor: pointer; }
.acita:first-child { border-top: none; }
.acita input { width: 16px; height: 16px; accent-color: var(--green); }
.acita .h { text-align: center; border-radius: 10px; background: var(--bg-alt); padding: 4px 0; }
.acita .h b { display: block; font-size: 14px; color: var(--heading); }
.acita .h small { font-size: 12px; color: var(--muted); }
.acita .who-t small { white-space: normal; }
.sust { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.sust .lbl { margin: 0; }
.sust .inp { flex: 1; }
.scope { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 14px; background: var(--bg-alt); }
.scope b { font-size: 16px; font-weight: 600; color: var(--heading); }
.scope span { font-size: 14px; color: var(--text); }
.scope-list { list-style: none; max-height: 230px; overflow-y: auto; margin: 0; padding: 0; }
.scope-list li { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 2px; border-top: 1px dashed var(--line); font-size: 14px; }
.scope-list li:first-child { border-top: none; }
.scope-list li b { color: var(--heading); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scope-list li.muted { display: block; }

/* Cambio de profesional. */
.handoff { display: inline-flex; align-items: center; gap: 5px; }
.handoff .ic { width: 12px; height: 12px; color: var(--muted); }
.handoff b { color: var(--green); }
.chips-row.mens { flex-wrap: wrap; gap: 6px; margin-top: 0; }
.hint-line { font-size: 13px; color: var(--muted); }
.handoff-facts { padding: 12px 14px; border-radius: 14px; background: var(--bg-alt); }
.modal-cambio [data-paso], .modal-cambio [data-previa], .modal-cobro [data-previa], .modal [data-previa] { display: flex; flex-direction: column; gap: 12px; }
.modal [data-previa]:empty { display: none; }
.modal [data-previa] .sect { margin-top: 4px; }
.origenes .aopt { --o-bg: var(--warn-bg); --o-line: #e9cf9d; --o-ink: var(--warn-ink); box-shadow: inset 0 0 0 1px var(--line); }
.prow.static { cursor: default; }

/* Configuración. */
.conf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.conf-grid > .card + .card { margin-top: 0; }
.conf-grid + .card { margin-top: 18px; }
.kv > div { display: grid; grid-template-columns: minmax(110px, 40%) minmax(0, 1fr); column-gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.kv > div:first-child { border-top: none; padding-top: 2px; }
.kv span { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-top: 2px; }
.kv b { font-size: 15px; font-weight: 600; color: var(--heading); }
.kv small { grid-column: 2; font-size: 13px; color: var(--muted); margin-top: 2px; }
.kv small b { font-size: inherit; }
.kv b, .kv small { overflow-wrap: anywhere; }
.tar-hist { margin-top: 12px; }
.tar-hist .table-wrap { margin-top: 8px; }
.hist-list .hist:first-child { border-top: none; }

/* Informes. */
.inf-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.inf-grid > .stack > .card:first-child { margin-top: 0; }
.exports { display: flex; flex-direction: column; }
.exp { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 10px 0; border-top: 1px solid var(--line); text-align: left; }
.exp:first-child { border-top: none; padding-top: 2px; }
.exp .xico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--sage-soft); color: var(--green); }
.exp .xico .ic { width: 17px; height: 17px; }
.exp .who-t small { white-space: normal; }
.exp:hover .who-t b { color: var(--green); }
.exp[aria-busy] { opacity: .6; }
.inf-table td b.neg { color: var(--bad-ink); }
.inf-grid .chips-row { flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.inf-tot { margin-top: 16px; grid-template-columns: 1fr; gap: 6px; }
/* Importes en filas: en la columna estrecha tres casillas no caben con cifras legibles. */
.inf-tot .tot { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.inf-tot .tot b { margin-top: 0; font-size: 16px; }
.plan-table td.m2 { min-width: 150px; }
.plan-table .cells.mini { grid-template-columns: repeat(18, 1fr); }

@media (max-width: 1280px) {
  .inf-grid { grid-template-columns: 1fr; }
  .inf-table .m5, .inf-table th:nth-child(5) { display: none; }
}
@media (max-width: 1023px) {
  .conf-grid { grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
  .conf-grid + .card { margin-top: 12px; }
}
@media (max-width: 760px) {
  .only-mobile-inline { display: inline; }
  .hide-mobile { display: none !important; }
  .aus-table td.m1 .who small { display: block; }
  .ltable td.m3 .pill { margin-top: 2px; }
  .plan-table td.m3, .plan-table td.m4 { text-align: left; font-size: 13px; color: var(--muted); }
  .plan-table td.m2 { min-width: 0; padding: 4px 0; }
  .kv > div { grid-template-columns: 1fr; }
  .kv small { grid-column: 1; }
}
@media (max-width: 700px) {
  .toolbar .spacer { display: none; }
  .toolbar > .btn { flex: 1 1 100%; }
  .acita { grid-template-columns: 18px 46px minmax(0, 1fr) 28px; }
  .acita .pill { display: none; }
  .sust { flex-wrap: wrap; }
  .scope-list li { grid-template-columns: 78px minmax(0, 1fr); }
  .scope-list li > :last-child:not(b) { grid-column: 2; justify-self: start; }
  .hist-list .hist { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
  .hist-list .hist .when { grid-column: 1 / -1; }
  .handoff-facts { grid-template-columns: 1fr 1fr; }
}
