/* Clientela v2.0 · diseño "Cristal" (prototipo 5)
   Morado ciruela + musgo + sol discreto. Claro, nocturno y escritorio. */
@font-face { font-family: "Serif"; src: url("fonts/InstrumentSerif-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Serif"; font-style: italic; src: url("fonts/InstrumentSerif-Italic.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Sans"; font-weight: 400; src: url("fonts/InstrumentSans-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Sans"; font-weight: 700; src: url("fonts/InstrumentSans-Bold.ttf") format("truetype"); font-display: swap; }

:root {
  --tinta: #241A33; --medio: #4F4363; --suave: #685C7D;
  --morado: #53388A; --morado-2: #7E5FBC; --morado-t: #EBE3F8;
  --musgo: #3A6447; --musgo-t: #D9E8DC; --sol: #8F6210; --sol-t: #F6E8C9;
  --rosa: #95304C; --rosa-t: #F7DEE4; --wa: #2B7650;
  --cristal: rgba(255,255,255,.68); --cristal-2: rgba(255,255,255,.9); --borde: rgba(255,255,255,.85);
  --sombra: rgba(60,38,100,.13); --linea: rgba(83,56,138,.14); --campo: rgba(255,255,255,.85);
  --fondo:
    radial-gradient(118% 52% at 6% -2%, #DACDF2 0%, rgba(218,205,242,0) 60%),
    radial-gradient(86% 42% at 102% 30%, #F8E6CE 0%, rgba(248,230,206,0) 64%),
    radial-gradient(92% 46% at -6% 96%, #D2E7D6 0%, rgba(210,231,214,0) 60%), #F6F2FA;
  --serif: "Serif", Georgia, "Times New Roman", serif;
  --sans: "Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --nav-alto: 66px;
  color-scheme: light;
}
:root[data-tema="oscuro"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-tema="claro"]) { color-scheme: dark; } }

/* Variables del modo nocturno (se repiten para la regla automática y la manual) */
:root[data-tema="oscuro"] {
  --tinta: #F6F2FB; --medio: #D2C7E4; --suave: #B3A6CB;
  --morado: #C2A9F7; --morado-2: #D3BEFB; --morado-t: rgba(194,169,247,.2);
  --musgo: #A6D0AE; --musgo-t: rgba(166,208,174,.18); --sol: #EFC77E; --sol-t: rgba(239,199,126,.18);
  --rosa: #F2A3B8; --rosa-t: rgba(242,163,184,.18); --wa: #2F7F58;
  --cristal: rgba(255,255,255,.08); --cristal-2: rgba(255,255,255,.12); --borde: rgba(255,255,255,.15);
  --sombra: rgba(0,0,0,.4); --linea: rgba(255,255,255,.12); --campo: rgba(255,255,255,.07);
  --fondo:
    radial-gradient(112% 48% at 12% -2%, #4C3485 0%, rgba(76,52,133,0) 62%),
    radial-gradient(78% 38% at 104% 34%, #5B4326 0%, rgba(91,67,38,0) 64%),
    radial-gradient(88% 44% at -4% 98%, #23402E 0%, rgba(35,64,46,0) 60%), #140E1C;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) {
    --tinta: #F6F2FB; --medio: #D2C7E4; --suave: #B3A6CB;
    --morado: #C2A9F7; --morado-2: #D3BEFB; --morado-t: rgba(194,169,247,.2);
    --musgo: #A6D0AE; --musgo-t: rgba(166,208,174,.18); --sol: #EFC77E; --sol-t: rgba(239,199,126,.18);
    --rosa: #F2A3B8; --rosa-t: rgba(242,163,184,.18); --wa: #2F7F58;
    --cristal: rgba(255,255,255,.08); --cristal-2: rgba(255,255,255,.12); --borde: rgba(255,255,255,.15);
    --sombra: rgba(0,0,0,.4); --linea: rgba(255,255,255,.12); --campo: rgba(255,255,255,.07);
    --fondo:
      radial-gradient(112% 48% at 12% -2%, #4C3485 0%, rgba(76,52,133,0) 62%),
      radial-gradient(78% 38% at 104% 34%, #5B4326 0%, rgba(91,67,38,0) 64%),
      radial-gradient(88% 44% at -4% 98%, #23402E 0%, rgba(35,64,46,0) 60%), #140E1C;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: #F6F2FA; }
html[data-tema="oscuro"] { background: #140E1C; }
@media (prefers-color-scheme: dark) { html:not([data-tema="claro"]) { background: #140E1C; } }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--tinta); background: var(--fondo); background-attachment: fixed;
  font: 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
a { color: var(--morado); text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--morado-2); outline-offset: 2px; border-radius: 10px; }
.suave { color: var(--suave); } .medio { color: var(--medio); } .chico { font-size: 13px; } .xs { font-size: 12px; }
.espacio { flex: 1; } .centro { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Tipografía ─────────────────────────────── */
.t1 { font: 400 38px/1.04 var(--serif); letter-spacing: -.012em; }
.t2 { font: 400 25px/1.1 var(--serif); }
h2.sec-t { font: 400 23px/1.15 var(--serif); }
.cab { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cab-t { min-width: 0; } .cab-t .suave { margin-top: 5px; font-size: 14px; }
.sec { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 2px 10px; gap: 10px; }
.sec > a, .sec > button { color: var(--morado); font-size: 13px; font-weight: 700; padding: 6px 2px; }

/* ── Marco y navegación ─────────────────────── */
.marco { max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 18px) 18px calc(var(--nav-alto) + 46px + env(safe-area-inset-bottom)); }
main { min-height: 60vh; animation: entra .25s ease both; }
@keyframes entra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.nav {
  position: fixed; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); height: var(--nav-alto); z-index: 30;
  max-width: 536px; margin: 0 auto; display: flex; justify-content: space-around; align-items: center; padding: 0 5px;
  background: var(--cristal-2); border: 1px solid var(--borde); border-radius: 33px; box-shadow: 0 14px 34px var(--sombra);
  -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px);
}
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--suave); font-size: 10.5px; padding: 7px 8px; border-radius: 24px; min-width: 58px; min-height: 52px; }
.nav a svg { width: 22px; height: 22px; }
.nav a[aria-current="page"] { background: var(--morado-t); color: var(--morado); font-weight: 700; }
.nav .solo-escritorio, .rail-marca { display: none; }
.pill-aviso { position: fixed; top: calc(env(safe-area-inset-top) + 8px); left: 50%; transform: translateX(-50%); z-index: 70; background: var(--sol-t); color: var(--sol); border: 1px solid var(--sol); font-weight: 700; padding: 8px 16px; border-radius: 999px; font-size: 13px; box-shadow: 0 8px 22px var(--sombra); }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

@media (min-width: 900px) {
  .marco { max-width: none; padding: 28px 40px 60px 300px; }
  main { max-width: 900px; }
  main.ancho { max-width: none; }
  .nav {
    top: 0; bottom: 0; left: 0; right: auto; width: 260px; max-width: none; height: auto; margin: 0; border-radius: 0 28px 28px 0;
    flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 4px; padding: 26px 14px;
  }
  .rail-marca { display: flex; align-items: center; gap: 10px; font: 400 30px var(--serif); color: var(--morado); padding: 0 12px 22px; }
  .nav a { flex-direction: row; justify-content: flex-start; gap: 12px; font-size: 15px; padding: 11px 14px; border-radius: 16px; }
  .nav .solo-escritorio { display: flex; }
  .nav .sep { height: 1px; background: var(--linea); margin: 10px 8px; }
  .fab { right: 44px !important; bottom: 36px !important; }
}
.nav .sep { display: none; } @media (min-width: 900px) { .nav .sep { display: block; } }

/* ── Cristal ─────────────────────────────────── */
.cristal { background: var(--cristal); border: 1px solid var(--borde); border-radius: 24px; box-shadow: 0 12px 30px var(--sombra), inset 0 1px 0 rgba(255,255,255,.35); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); }
.lista { display: flex; flex-direction: column; gap: 9px; }
.bloque { padding: 14px 16px; }

/* ── Botones, etiquetas, chips ──────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 20px; border-radius: 999px; font-weight: 700; font-size: 15px; background: var(--cristal-2); border: 1px solid var(--borde); color: var(--tinta); box-shadow: 0 6px 16px var(--sombra); text-decoration: none; }
.btn svg { width: 19px; height: 19px; }
.btn.principal { background: var(--morado); border-color: var(--morado); color: #fff; box-shadow: 0 10px 22px rgba(83,56,138,.35); }
:root[data-tema="oscuro"] .btn.principal { color: #1C1230; }
@media (prefers-color-scheme: dark) { :root:not([data-tema="claro"]) .btn.principal { color: #1C1230; } }
.btn.oscuro { background: #241A33; border-color: #241A33; color: #fff; }
.btn.peligro { color: var(--rosa); background: var(--rosa-t); border-color: transparent; box-shadow: none; }
.btn.chico { min-height: 38px; padding: 6px 14px; font-size: 13.5px; }
.btn.ancho { width: 100%; }
.btn.wa { background: var(--wa); border-color: var(--wa); color: #fff; box-shadow: 0 8px 18px rgba(43,118,80,.3); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 14px; border-radius: 999px; font-size: 13.5px; background: var(--cristal); border: 1px solid var(--borde); color: var(--medio); white-space: nowrap; }
.chip[aria-pressed="true"], .chip.on { background: var(--morado); border-color: var(--morado); color: #fff; font-weight: 700; }
:root[data-tema="oscuro"] .chip[aria-pressed="true"], :root[data-tema="oscuro"] .chip.on { color: #1C1230; }
@media (prefers-color-scheme: dark) { :root:not([data-tema="claro"]) .chip[aria-pressed="true"], :root:not([data-tema="claro"]) .chip.on { color: #1C1230; } }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 6px; margin: 0 -18px; padding-left: 18px; padding-right: 18px; }
.chips::-webkit-scrollbar { display: none; }
.eti { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.eti.v { background: var(--musgo-t); color: var(--musgo); } .eti.s { background: var(--sol-t); color: var(--sol); }
.eti.r { background: var(--rosa-t); color: var(--rosa); } .eti.m { background: var(--morado-t); color: var(--morado); }
.circ { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--morado); background: var(--cristal-2); border: 1px solid var(--borde); box-shadow: 0 6px 16px var(--sombra); }
.fab { position: fixed; right: 20px; bottom: calc(var(--nav-alto) + 34px + env(safe-area-inset-bottom)); z-index: 25; width: 58px; height: 58px; border-radius: 50%; background: var(--morado); color: #fff; display: grid; place-items: center; box-shadow: 0 14px 28px rgba(83,56,138,.42); }
:root[data-tema="oscuro"] .fab { color: #1C1230; }
.fab svg { width: 26px; height: 26px; stroke-width: 2.2; }
@media (min-width: 560px) and (max-width: 899px) { .fab { right: calc(50% - 258px); } }

/* ── Avatares ────────────────────────────────── */
.av { border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; width: 44px; height: 44px; font-size: 15px; letter-spacing: .02em; }
.av.c0 { background: linear-gradient(145deg, #8A6DC2, #53388A); } .av.c1 { background: linear-gradient(145deg, #DCA953, #94660F); }
.av.c2 { background: linear-gradient(145deg, #79AD86, #3A6447); } .av.c3 { background: linear-gradient(145deg, #C07E97, #8A3C57); }
.av.c4 { background: linear-gradient(145deg, #7596CC, #3F5E95); }
.anillo { position: relative; width: 52px; height: 52px; flex: none; }
.anillo svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.anillo .av { position: absolute; inset: 5px; width: auto; height: auto; font-size: 15px; }

/* ── Campos de formulario ───────────────────── */
.campo { display: block; margin-bottom: 14px; }
.campo > span { display: block; font-size: 13px; font-weight: 700; color: var(--medio); margin-bottom: 6px; }
.campo small { display: block; margin-top: 5px; color: var(--suave); font-size: 12.5px; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--tinta); background: var(--campo); border: 1px solid var(--linea); border-radius: 14px; padding: 11px 14px; min-height: 46px; appearance: none; -webkit-appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23685C7D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
textarea { resize: vertical; min-height: 90px; line-height: 1.45; }
input::placeholder, textarea::placeholder { color: var(--suave); opacity: .8; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--morado-2); outline-offset: 0; border-color: transparent; }
input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; padding: 0; border-radius: 7px; flex: none; accent-color: var(--morado); appearance: auto; -webkit-appearance: checkbox; }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.casilla { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; font-size: 14px; color: var(--medio); }
.casilla input { margin-top: 1px; }
.busca { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-radius: 999px; background: var(--cristal); border: 1px solid var(--borde); box-shadow: 0 8px 20px var(--sombra); }
.busca svg { color: var(--suave); }
.busca input { border: 0; background: transparent; padding-left: 0; min-height: 48px; }
.busca input:focus { outline: none; }
.busca:focus-within { outline: 2px solid var(--morado-2); }
.error-texto { color: var(--rosa); font-weight: 700; font-size: 14px; margin: 6px 0 10px; }

/* Interruptor */
.sw { position: relative; width: 48px; height: 28px; flex: none; display: inline-block; }
.sw input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.sw i { position: absolute; inset: 0; border-radius: 999px; background: var(--linea); border: 1px solid var(--suave); transition: .2s; }
.sw i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--suave); transition: .2s; }
.sw input:checked + i { background: var(--morado); border-color: var(--morado); }
.sw input:checked + i::after { left: 23px; background: #fff; }
.sw input:focus-visible + i { outline: 3px solid var(--morado-2); outline-offset: 2px; }

/* ── Entrada ─────────────────────────────────── */
.entrada { position: fixed; inset: 0; overflow-y: auto; background: linear-gradient(177deg, #F9F6FC 0%, #E9DFF7 28%, #B197DC 56%, #5B4291 78%, #2A1D3D 100%); color: #241A33; }
.entrada .flare { position: absolute; inset: 0; background: radial-gradient(54% 24% at 86% 58%, rgba(250,214,140,.7) 0, rgba(250,214,140,0) 70%); pointer-events: none; }
.entrada .ondas { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 40%; min-height: 240px; pointer-events: none; }
.entrada .caja { position: relative; max-width: 400px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 64px) 28px 110px; text-align: center; min-height: 100%; }
.logo { display: flex; align-items: center; justify-content: center; gap: 11px; }
.logo span { font: 400 42px/1 var(--serif); color: #4A2F82; }
.entrada h1 { font: 400 36px/1.08 var(--serif); margin: 34px 0 6px; }
.entrada .lema { color: rgba(36,26,51,.7); }
.entrada form { margin-top: 30px; text-align: left; }
.entrada .campo > span { color: rgba(36,26,51,.78); }
.entrada input { background: rgba(255,255,255,.82); border-color: rgba(36,26,51,.16); color: #241A33; }
.entrada .clave { position: relative; }
.entrada .clave button { position: absolute; right: 6px; top: 4px; width: 44px; height: 44px; display: grid; place-items: center; color: #4F4363; }
.entrada .btn.principal { width: 100%; height: 54px; background: #241A33; border-color: #241A33; color: #fff; box-shadow: 0 12px 26px rgba(36,26,51,.34); margin-top: 6px; }
.entrada .nota { margin-top: 28px; color: #fff; font-size: 14px; text-shadow: 0 1px 8px rgba(36,26,51,.55); }
.entrada .error-texto { background: #fff; border-radius: 12px; padding: 10px 12px; }
.entrada .pie-seg { position: fixed; left: 0; right: 0; bottom: calc(18px + env(safe-area-inset-bottom)); display: flex; justify-content: center; gap: 7px; color: rgba(255,255,255,.92); font-size: 12.5px; text-shadow: 0 1px 6px rgba(36,26,51,.55); pointer-events: none; }
.arranque { display: grid; place-items: center; min-height: 60vh; text-align: center; color: var(--suave); gap: 12px; }

/* ── Inicio ──────────────────────────────────── */
.selneg { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 8px 14px; border-radius: 999px; font-size: 14px; }
.pulso { margin-top: 14px; padding: 16px 16px 12px; }
.pulso .enc { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.pulso .cifra { font: 400 36px/1.04 var(--serif); margin-top: 1px; }
.pulso svg.g { display: block; width: 100%; height: 78px; margin-top: 6px; }
.pulso .ejes { display: flex; justify-content: space-between; font-size: 11px; color: var(--suave); margin-top: 2px; }
.tres { display: flex; margin-top: 12px; border-top: 1px solid var(--linea); padding-top: 11px; }
.tres a, .tres div { flex: 1; text-align: center; border-left: 1px solid var(--linea); color: inherit; }
.tres > :first-child { border-left: 0; }
.tres b { display: block; font: 400 24px/1.1 var(--serif); }
.tres span { font-size: 11.5px; color: var(--suave); }
.fila { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; color: inherit; width: 100%; text-align: left; }
.fila.sin-av { grid-template-columns: 1fr auto; }
.fila .nombre { font-weight: 700; font-size: 15.5px; overflow-wrap: anywhere; }
.fila .detalle { font-size: 13px; color: var(--suave); margin-top: 1px; overflow-wrap: anywhere; }
.fila .detalle.alerta { color: var(--rosa); font-weight: 700; } .fila .detalle.sol { color: var(--sol); font-weight: 700; } .fila .detalle.ok { color: var(--musgo); font-weight: 700; }
.bw, .bm { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.bw { background: var(--wa); color: #fff; } .bm { background: var(--morado-t); color: var(--morado); }
.bw svg, .bm svg { width: 19px; height: 19px; }
.vacio { padding: 22px 18px; text-align: center; color: var(--suave); border: 1.4px dashed var(--linea); border-radius: 20px; }
.check { width: 26px; height: 26px; border-radius: 50%; border: 1.8px solid var(--morado); display: grid; place-items: center; flex: none; color: #fff; }
.check:hover { background: var(--morado-t); }
.check.hecho { background: var(--morado); }
.check svg { width: 14px; height: 14px; stroke-width: 3; }
.tarea-txt.hecha { text-decoration: line-through; color: var(--suave); }

/* ── Agenda ──────────────────────────────────── */
.semana { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 14px; }
.dia { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 9px; border-radius: 18px; font-size: 11.5px; color: var(--suave); min-height: 64px; }
.dia b { font: 400 21px/1 var(--serif); color: var(--tinta); }
.dia[aria-pressed="true"] { background: var(--morado); color: #E8DEF8; box-shadow: 0 10px 22px rgba(83,56,138,.35); }
.dia[aria-pressed="true"] b { color: #fff; }
:root[data-tema="oscuro"] .dia[aria-pressed="true"] { color: #2A1D3D; } :root[data-tema="oscuro"] .dia[aria-pressed="true"] b { color: #1C1230; }
.dia i { width: 5px; height: 5px; border-radius: 50%; background: var(--morado); }
.dia[aria-pressed="true"] i { background: currentColor; } .dia i.v { opacity: 0; }
.cita { display: grid; grid-template-columns: 50px 1fr; gap: 10px; margin-top: 11px; }
.cita .h { font: 400 20px/1 var(--serif); padding-top: 15px; text-align: right; }
.cita .h small { display: block; font: 400 11px var(--sans); color: var(--suave); margin-top: 3px; white-space: nowrap; } .cita .h small + small { margin-top: 0; }
.cita .cd { padding: 13px 14px 12px 16px; position: relative; border-radius: 20px; display: block; width: 100%; text-align: left; }
.cita .cd::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 4px; background: var(--morado); }
.cita .cd.s::before { background: var(--sol); } .cita .cd.m::before { background: var(--musgo); } .cita .cd.x::before { background: var(--suave); }
.cita .nm { font-weight: 700; font-size: 15.5px; } .cita .pie { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.hueco { display: grid; grid-template-columns: 50px 1fr; gap: 10px; margin-top: 11px; }
.hueco .c { border: 1.4px dashed var(--linea); border-radius: 16px; padding: 10px 13px; color: var(--suave); font-size: 13px; display: flex; justify-content: space-between; }
.hueco .c b { color: var(--morado); }
.bwa { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 12px; border-radius: 999px; background: var(--wa); color: #fff; font-weight: 700; font-size: 12.5px; }
.bwa svg { width: 15px; height: 15px; }

/* ── Clientes ────────────────────────────────── */
.cli { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; padding: 12px 14px; align-items: center; color: inherit; width: 100%; text-align: left; }
.cli .nm { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.cli .l1 { color: var(--suave); font-size: 13px; margin-top: 1px; }
.cli .l2 { font-size: 12.5px; font-weight: 700; margin-top: 4px; }
.cli .der { text-align: right; } .cli .val { font: 400 19px/1 var(--serif); } .cli .der small { display: block; font-size: 10.5px; color: var(--suave); margin-top: 3px; }
.mas-tarde { margin-top: 22px; text-align: center; }

/* ── Ficha ───────────────────────────────────── */
.volver { display: inline-flex; align-items: center; gap: 4px; color: var(--morado); font-weight: 700; font-size: 15px; min-height: 40px; padding-right: 10px; }
.volver svg { width: 18px; height: 18px; }
.heroe { text-align: center; margin-top: 4px; }
.heroe .av { width: 80px; height: 80px; margin: 0 auto; font: 400 32px var(--serif); box-shadow: 0 0 0 4px rgba(255,255,255,.6), 0 0 0 5.6px #C08A2E; }
.heroe h1 { font: 400 31px/1.05 var(--serif); margin: 13px 0 3px; overflow-wrap: anywhere; }
.heroe p { color: var(--suave); font-size: 13.5px; }
.heroe .etis { display: flex; justify-content: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.acciones { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.a4 { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 11.5px; color: var(--medio); min-width: 0; flex: 1 1 0; max-width: 64px; }
.a4 span { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--cristal-2); border: 1px solid var(--borde); color: var(--morado); box-shadow: 0 8px 18px var(--sombra); }
.a4 span svg { width: 22px; height: 22px; }
.a4.w span { background: var(--wa); color: #fff; border-color: var(--wa); }
.a4[aria-disabled="true"], .a4:disabled { opacity: .45; pointer-events: none; }
.est4 { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 16px; padding: 12px 2px; }
.est4 div { text-align: center; border-left: 1px solid var(--linea); padding: 0 2px; } .est4 div:first-child { border-left: 0; }
.est4 b { display: block; font: 400 22px/1.15 var(--serif); } .est4 span { font-size: 10.5px; color: var(--suave); }
.seg { display: flex; padding: 4px; border-radius: 999px; margin-top: 16px; gap: 2px; }
.seg button { flex: 1; text-align: center; padding: 8px 4px; border-radius: 999px; font-size: 13px; color: var(--medio); min-height: 38px; }
.seg button[aria-selected="true"] { background: var(--morado); color: #fff; font-weight: 700; }
:root[data-tema="oscuro"] .seg button[aria-selected="true"] { color: #1C1230; }
.tl { margin-top: 16px; padding-left: 20px; position: relative; list-style: none; margin-bottom: 0; }
.tl::before { content: ""; position: absolute; left: 4.5px; top: 7px; bottom: 4px; width: 1px; background: var(--linea); }
.ev { position: relative; padding-bottom: 14px; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.ev::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; border: 1.6px solid var(--morado); }
.ev.v::before { background: var(--morado); } .ev.p::before { border-color: var(--sol); }
.ev .m { font-size: 12px; color: var(--suave); } .ev p { margin-top: 2px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.borrar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--suave); }
.borrar:hover { color: var(--rosa); background: var(--rosa-t); }
.priv { display: flex; align-items: center; gap: 9px; padding: 11px 13px; margin-top: 8px; border-radius: 18px; background: var(--musgo-t); color: var(--musgo); font-size: 12.5px; font-weight: 700; }
.priv.aviso-s { background: var(--sol-t); color: var(--sol); }
.dato { display: flex; justify-content: space-between; gap: 14px; padding: 11px 16px; border-top: 1px solid var(--linea); font-size: 14px; }
.dato:first-child { border-top: 0; } .dato .k { color: var(--suave); flex: none; } .dato .v { text-align: right; overflow-wrap: anywhere; white-space: pre-wrap; }

/* ── Embudo ──────────────────────────────────── */
.kan { display: flex; gap: 12px; margin: 14px -18px 0; padding: 0 18px 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.col { width: 232px; flex: none; scroll-snap-align: start; }
.col .ch { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 8px; font-size: 13px; font-weight: 700; gap: 8px; }
.col .ch em { font-style: normal; color: var(--suave); font-weight: 400; }
.col .lin { height: 3px; border-radius: 3px; margin-bottom: 10px; background: var(--morado); }
.col.ganada .lin { background: var(--musgo); } .col.perdida .lin { background: var(--rosa); }
.tar { display: block; width: 100%; text-align: left; padding: 12px 13px; border-radius: 18px; margin-bottom: 9px; }
.tar .t { font-weight: 700; font-size: 14.5px; overflow-wrap: anywhere; } .tar .c { color: var(--suave); font-size: 12.5px; margin-top: 1px; }
.tar .b { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; gap: 6px; }
.tar .mn { font: 400 19px var(--serif); }
.tar .sig { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--morado-t); color: var(--morado); flex: none; }
.tar .sig svg { width: 16px; height: 16px; }
.col .vacia { color: var(--suave); font-size: 13px; padding: 10px 4px; border: 1.4px dashed var(--linea); border-radius: 16px; text-align: center; }
@media (min-width: 900px) { .kan { margin: 14px 0 0; padding: 0 0 12px; } .col { width: 260px; } }

/* ── Automático y reportes ──────────────────── */
.aut { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; }
.aut .si { font-size: 14.5px; line-height: 1.55; } .aut .si b { color: var(--morado); font-weight: 700; }
.aut .meta { font-size: 12px; color: var(--suave); margin-top: 6px; }
.aut input.dias { display: inline-block; width: 64px; min-height: 34px; padding: 4px 8px; text-align: center; border-radius: 10px; font-weight: 700; color: var(--morado); }
.barras { display: flex; align-items: flex-end; gap: 9px; height: 120px; margin-top: 14px; padding: 0 2px; }
.barras div { flex: 1; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, var(--morado-2), var(--morado)); min-height: 3px; position: relative; }
.barras div.x { background: linear-gradient(180deg, #DCA953, #B8832A); }
.barras div span { position: absolute; top: -17px; left: 50%; transform: translateX(-50%); font-size: 10.5px; color: var(--suave); white-space: nowrap; }
.leyx { display: flex; gap: 9px; margin-top: 6px; padding: 0 2px; } .leyx span { flex: 1; text-align: center; font-size: 10.5px; color: var(--suave); }
.dos-c { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 11px; }
.mini { padding: 13px 14px; } .mini .k { font: 400 27px/1 var(--serif); margin: 5px 0 6px; } .mini .q { font-size: 12px; color: var(--suave); }
.lr { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--linea); font-size: 13.5px; }
.lr:first-child { border-top: 0; } .lr .bar { flex: 1; height: 7px; border-radius: 7px; background: var(--morado-t); overflow: hidden; }
.lr .bar i { display: block; height: 100%; border-radius: 7px; background: var(--morado); } .lr .bar i.s { background: var(--sol); }
.lr .pc { font-size: 12.5px; color: var(--suave); min-width: 40px; text-align: right; } .lr .nm { width: 104px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rango { display: flex; gap: 8px; margin: 12px 0 0; }

/* ── Seguridad / equipo ─────────────────────── */
.escudo { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding: 16px; margin-top: 14px; }
.escudo .ani { position: relative; width: 72px; height: 72px; } .escudo .ani svg { width: 72px; height: 72px; transform: rotate(-90deg); }
.escudo .ani b { position: absolute; inset: 0; display: grid; place-items: center; font: 400 24px var(--serif); }
.escudo h3 { font-weight: 700; font-size: 15.5px; } .escudo p { margin-top: 3px; font-size: 12.5px; color: var(--suave); line-height: 1.4; }
.sg { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 13px 14px; width: 100%; text-align: left; color: inherit; }
.sg .ico { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; background: var(--morado-t); color: var(--morado); }
.sg .ico.v { background: var(--musgo-t); color: var(--musgo); } .sg .ico.s { background: var(--sol-t); color: var(--sol); } .sg .ico.r { background: var(--rosa-t); color: var(--rosa); }
.sg b { display: block; font-size: 14.5px; } .sg small { color: var(--suave); font-size: 12px; }
.bit { padding: 4px 14px 10px; }
.bl { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--linea); }
.bl:first-child { border-top: 0; } .bl .p { width: 8px; height: 8px; border-radius: 50%; background: var(--morado); } .bl .p.r { background: var(--rosa); } .bl .p.v { background: var(--musgo); } .bl .p.s { background: var(--sol); }
.bl b { font-size: 13.5px; } .bl small { display: block; color: var(--suave); font-size: 11.5px; overflow-wrap: anywhere; } .bl .t { font-size: 11.5px; color: var(--suave); text-align: right; }
.perm { padding: 6px 14px; } .pr { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--linea); font-size: 14px; }
.pr:first-child { border-top: 0; } .pr .si { color: var(--musgo); font-weight: 700; } .pr .no { color: var(--suave); }
.envuelve { overflow-x: auto; } table.vista { border-collapse: collapse; width: 100%; font-size: 13px; }
table.vista th, table.vista td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--linea); white-space: nowrap; } table.vista th { color: var(--suave); }
.barra-progreso { height: 10px; border-radius: 10px; background: var(--morado-t); overflow: hidden; } .barra-progreso div { height: 100%; width: 0; background: var(--morado); transition: width .2s; }
.editable { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; } .editable > input, .editable > select { flex: 1; min-width: 0; }
.menu-g .fila { grid-template-columns: auto 1fr auto; }

/* ── Hoja (ventana) ──────────────────────────── */
#capa, #capa2 { position: fixed; inset: 0; z-index: 50; background: rgba(20,12,30,.5); display: flex; align-items: flex-end; justify-content: center; animation: vela .2s ease; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
#capa2 { z-index: 60; }
@keyframes vela { from { opacity: 0; } to { opacity: 1; } }
.hoja { width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column; border: 1px solid var(--borde); border-radius: 28px 28px 0 0; box-shadow: 0 -20px 50px rgba(20,12,30,.35); animation: sube .28s cubic-bezier(.2,.8,.2,1); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); }
.hoja { background: var(--hoja-bg, #fff); }
:root { --hoja-bg: #FBF9FE; } :root[data-tema="oscuro"] { --hoja-bg: #221933; }
@media (prefers-color-scheme: dark) { :root:not([data-tema="claro"]) { --hoja-bg: #221933; } }
@keyframes sube { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.hoja .agarre { padding: 10px 0 2px; cursor: grab; touch-action: none; } .hoja .agarre i { display: block; width: 42px; height: 5px; border-radius: 5px; background: var(--linea); margin: 0 auto; }
.hoja .cabeza { display: flex; align-items: center; gap: 10px; padding: 6px 20px 8px; touch-action: none; }
.hoja .cabeza h2 { font: 400 26px/1.1 var(--serif); flex: 1; }
.hoja .cerrar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--suave); background: var(--morado-t); }
.hoja .cuerpo-h { padding: 8px 20px 14px; overflow-y: auto; overscroll-behavior: contain; }
.hoja .pie { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--linea); }
.hoja .pie .btn { flex: 1 1 auto; }
.hoja.chica { max-width: 440px; }
@media (min-width: 640px) { #capa, #capa2 { align-items: center; } .hoja { border-radius: 28px; max-height: 88vh; } .hoja .agarre { display: none; } }

/* ── Avisos y esqueletos ─────────────────────── */
#aviso { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-alto) + 38px + env(safe-area-inset-bottom)); z-index: 80; max-width: min(92vw, 460px); background: #241A33; color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.3); text-align: center; animation: entra .2s ease; }
#aviso.error { background: #8E2A47; }
#capa:not([hidden]) ~ #aviso, #capa2:not([hidden]) ~ #aviso { bottom: 90px; }
.esq { border-radius: 20px; background: linear-gradient(90deg, var(--linea), rgba(255,255,255,.3), var(--linea)); background-size: 200% 100%; animation: brilla 1.4s infinite linear; }
@keyframes brilla { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } }
@media print { .nav, .fab, #aviso { display: none !important; } .marco { padding: 0; } }
