/* RutaPerruna: estilos de la aplicación
   Estilo cálido y alegre (la base de diseño de UI UX Pro Max recomienda para apps de mascotas colores cálidos,
   bordes redondeados y bloques de color). Letras: Fredoka en títulos y Nunito en texto, ambas con licencia OFL
   y servidas desde /static/fonts. Paleta: Tinta, Naranja collar, Verde parque, Sol, Cielo y Fondo tibio. */
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/static/fonts/fredoka-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/static/fonts/fredoka-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/static/fonts/fredoka-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/fonts/nunito-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/static/fonts/nunito-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/static/fonts/nunito-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("/static/fonts/nunito-latin-800-normal.woff2") format("woff2"); }

:root {
  --tinta: #2B2A33; --naranja: #FF8A3D; --naranja-hondo: #E86F1F; --naranja-2: #FFE3CF; --verde: #17784F; --verde-hondo: #0F5E3D;
  --sol: #FFC94A; --sol-2: #FFF1C9; --cielo: #DCEFFA; --fondo: #FFFBF6;
  --bg: var(--fondo); --surface: #FFFFFF; --surface-2: #FFF6EE; --ink: var(--tinta); --muted: #5E5A66; --line: #EFE6DC;
  --accent: var(--verde); --accent-ink: #FFFFFF; --accent-soft: #DDF1E5; --accent-deep: var(--verde-hondo);
  --placa: var(--sol); --placa-soft: var(--sol-2); --placa-ink: #7A5200;
  --signal: #8A5300; --signal-soft: #FFF1C9;
  --ok: #17784F; --ok-soft: #DDF1E5; --warn: #C23B22; --warn-soft: #FDE4DD; --info: #1F5E8C; --info-soft: #DCEFFA;
  --ok-ink: #FFFFFF; --warn-ink: #FFFFFF; --info-ink: #FFFFFF;
  --topbar-h: 59px;
  --f-display: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --f-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 18px; --radius-sm: 12px; --radius-tag: 999px;
  --shadow: 0 18px 40px -16px rgba(60, 40, 20, .32);
  --lift: 0 2px 0 var(--line);
  color-scheme: light;
}
/* Modo oscuro: sigue al sistema, salvo que la persona elija claro u oscuro con el botón (data-theme) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1D1B21; --surface: #26242B; --surface-2: #211F26; --ink: #F3EEE8; --muted: #B6AFA8; --line: #3A363F;
    --accent: #4FBF8A; --accent-ink: #10231A; --accent-soft: #1F3A2D; --accent-deep: #2F8F63;
    --naranja-2: #3D2A1C; --sol-2: #3A3018; --cielo: #1D3140; --placa-soft: #3A3018; --placa-ink: #FFD36B;
    --signal: #FFC94A; --signal-soft: #3A3018; --ok: #6CD3A0; --ok-soft: #1F3A2D; --warn: #FF8F78; --warn-soft: #43261F;
    --info: #8DC3EA; --info-soft: #1D3140; --shadow: 0 18px 40px -16px rgba(0, 0, 0, .6);
    /* En oscuro los tonos "soft" se vuelven claros sobre fondo oscuro: la tinta tiene que ser oscura */
    --ok-ink: #10231A; --warn-ink: #43261F; --info-ink: #0B2235;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #1D1B21; --surface: #26242B; --surface-2: #211F26; --ink: #F3EEE8; --muted: #B6AFA8; --line: #3A363F;
    --accent: #4FBF8A; --accent-ink: #10231A; --accent-soft: #1F3A2D; --accent-deep: #2F8F63;
    --naranja-2: #3D2A1C; --sol-2: #3A3018; --cielo: #1D3140; --placa-soft: #3A3018; --placa-ink: #FFD36B;
    --signal: #FFC94A; --signal-soft: #3A3018; --ok: #6CD3A0; --ok-soft: #1F3A2D; --warn: #FF8F78; --warn-soft: #43261F;
    --info: #8DC3EA; --info-soft: #1D3140; --shadow: 0 18px 40px -16px rgba(0, 0, 0, .6);
    --ok-ink: #10231A; --warn-ink: #43261F; --info-ink: #0B2235;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.55 var(--f-body); -webkit-font-smoothing: antialiased; accent-color: var(--accent); }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 600; line-height: 1.12; margin: 0; text-wrap: balance; letter-spacing: -.005em; }
h1 { font-weight: 700; }
h1 { font-size: clamp(26px, 4vw, 34px); }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0; }
a { color: var(--accent); }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 14px; color: var(--muted); }
.stack { display: grid; gap: 16px; }
.stack-sm { display: grid; gap: 8px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-2.grid-wide { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
@media (max-width: 1100px) { .grid-2.grid-wide { grid-template-columns: 1fr; } }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 860px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- Estructura */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); min-height: var(--topbar-h);
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  padding-top: max(10px, env(safe-area-inset-top)); }
.topbar-inner { display: flex; align-items: center; gap: 12px; max-width: 1240px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 700; font-size: 21px;
  color: var(--ink); text-decoration: none; }
/* Logo: cuadro naranja redondeado con la huella */
.brand-mark { width: 34px; height: 34px; border-radius: 11px; background: var(--naranja); color: var(--tinta); display: grid; place-items: center;
  box-shadow: 0 3px 0 var(--naranja-hondo); }
.brand-mark svg { width: 20px; height: 20px; fill: var(--tinta); }
.brand .school-name { font-family: var(--f-body); font-weight: 400; font-size: 14px; color: var(--muted); margin-left: 4px; padding-left: 10px; border-left: 1px solid var(--line); }
.topbar .spacer { flex: 1; }
/* Tamaño táctil: 38×38 visual, pero el objetivo táctil sube a 44×44 en móvil para no errar el toque. */
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: var(--radius-sm);
  color: var(--ink); text-decoration: none; border: 1px solid var(--line); background: var(--surface); }
@media (pointer: coarse) {
  .icon-btn, .act { min-width: 44px; min-height: 44px; }
}
.icon-btn svg { width: 20px; height: 20px; }
.badge-dot { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
  background: var(--warn); color: var(--warn-ink); font-size: 11px; font-weight: 700; display: grid; place-items: center; }

.layout { display: grid; grid-template-columns: 228px minmax(0, 1fr); max-width: 1240px; margin: 0 auto; }
.sidenav { position: sticky; top: 59px; align-self: start; align-content: start; padding: 20px 12px; display: grid; gap: 2px; height: calc(100vh - 59px); overflow-y: auto; }
.sidenav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--muted);
  text-decoration: none; font-weight: 700; font-size: 15px; }
.sidenav a svg { width: 18px; height: 18px; flex: none; }
.sidenav a:hover { background: var(--accent-soft); color: var(--ink); }
.sidenav a.active { background: var(--accent); color: var(--accent-ink); }
.sidenav .sep { height: 1px; background: var(--line); margin: 10px 12px; }
.sidenav .count { margin-left: auto; font-size: 12px; background: var(--warn); color: var(--warn-ink); border-radius: 99px; padding: 0 7px; }
.main { padding: 24px max(16px, env(safe-area-inset-right)) 48px max(16px, env(safe-area-inset-left)); min-width: 0; }
.main.narrow { max-width: 560px; margin: 0 auto; width: 100%; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidenav { position: static; height: auto; display: flex; overflow-x: auto; padding: 8px 12px; gap: 4px;
    border-bottom: 1px solid var(--line); background: var(--surface); }
  .sidenav a { white-space: nowrap; padding: 8px 12px; }
  .sidenav .sep { display: none; }
}

/* App móvil (cliente y conductor) */
.app { max-width: 560px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-right)) 96px max(16px, env(safe-area-inset-left)); }
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line);
  display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); }
.tabbar-inner { display: flex; width: 100%; max-width: 560px; }
.tabbar a { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 8px 4px 9px; color: var(--muted); text-decoration: none;
  font-size: 11px; font-weight: 600; position: relative; }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.active { color: var(--accent); }
.tabbar .badge-dot { top: 2px; right: calc(50% - 22px); }

.page-head { display: flex; gap: 12px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }

/* ---------- Componentes */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; box-shadow: var(--lift); }
.card.flush { padding: 0; overflow: hidden; }
.card.soft { background: var(--accent-soft); border-color: transparent; }
.card.alert { border-color: var(--warn); background: var(--warn-soft); }
/* Botones dentro de banners soft/alert: el "ghost" pierde contraste porque los dos usan --surface como fondo.
   Los re-pintamos como primarios (sólidos) para que se lean nítidos sobre la tarjeta de color. */
.card.soft .btn.ghost, .card.soft .btn { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 2px 0 var(--accent-deep); }
.card.soft .btn:hover, .card.soft .btn.ghost:hover { background: var(--accent-deep); border-color: transparent; }
.card.alert .btn.ghost, .card.alert .btn { background: var(--warn); color: var(--warn-ink); border-color: transparent; box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.card.alert .btn:hover, .card.alert .btn.ghost:hover { filter: brightness(.95); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { font-size: 16px; }

/* Cifras: sin cajita. Una franja arriba, como la línea de un carril; amarilla o roja cuando hay que atender algo */
.kpi { background: transparent; border: 0; border-top: 3px solid var(--line); border-radius: 0; padding: 10px 2px 4px;
  text-decoration: none; color: var(--ink); display: block; }
.kpi .label { font-size: 14px; color: var(--muted); }
.kpi .note { font-size: 13px; color: var(--muted); margin-top: 2px; }
.kpi .value { font-family: var(--f-display); font-size: 32px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 4px; }
.kpi.signal { border-top-color: var(--placa); }
.kpi.signal .value { color: var(--signal); }
.kpi.warn { border-top-color: var(--warn); }
.kpi.warn .value { color: var(--warn); }
a.kpi:hover { border-top-color: var(--accent); }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; padding: 3px 10px; border-radius: var(--radius-tag);
  white-space: nowrap; background: var(--accent-soft); color: var(--muted); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.signal { background: var(--signal-soft); color: var(--signal); }
.pill.info { background: var(--info-soft); color: var(--info); }

/* Sin foto: la inicial sobre un color cálido distinto para cada perro (cuando hay foto, la foto la tapa) */
.avatar { width: 44px; height: 44px; border-radius: 14px; flex: none; background: var(--sol-2); color: var(--tinta); display: grid;
  place-items: center; font-family: var(--f-display); font-weight: 600; font-size: 18px; overflow: hidden; position: relative; }
/* La foto va encima de la inicial: si el archivo no carga, app.js la quita y queda la inicial. */
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; color: transparent; font-size: 0; }
.avatar.c1 { background: var(--cielo); } .avatar.c2 { background: var(--naranja-2); } .avatar.c3 { background: var(--accent-soft); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar { color: var(--ink); } }
:root[data-theme="dark"] .avatar { color: var(--ink); }
.avatar.lg { width: 72px; height: 72px; font-size: 28px; border-radius: 16px; }
.avatar.xl { width: 112px; height: 112px; font-size: 40px; border-radius: 24px; }
.avatar.sm { width: 34px; height: 34px; font-size: 14px; border-radius: 9px; }

.list { display: grid; }
.list-item { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--ink);
  text-decoration: none; min-width: 0; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: var(--surface-2); }
.list-item .title { font-weight: 600; }
/* La meta puede ser larga ("Juan Pérez, Ruta Norte, 3 perros"); si cabe se muestra entera,
   si no se recorta con ellipsis. El atributo title del padre deja verla completa al pasar el cursor. */
.list-item .meta { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.table-wrap { overflow-x: auto; }
table.wide { min-width: 720px; }
@media (max-width: 560px) { .brand .school-name { display: none; } }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 13px; color: var(--muted); font-weight: 700; background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px 16px; }
.kv div span { display: block; font-size: 12px; color: var(--muted); }
.kv div { min-width: 0; overflow-wrap: anywhere; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 20px 1fr auto; gap: 12px; padding-bottom: 14px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 9px; top: 20px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); position: relative; z-index: 1; }
.timeline .done .dot { background: var(--ok); border-color: var(--ok); }
.timeline .now .dot { background: var(--signal); border-color: var(--signal); box-shadow: 0 0 0 4px var(--signal-soft); }
.timeline .alert .dot { background: var(--warn); border-color: var(--warn); }
.timeline .todo { color: var(--muted); }
.timeline .time { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); }

.msg { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.msg:last-child { border-bottom: 0; }
.msg.unread { background: linear-gradient(90deg, var(--signal-soft), transparent 70%); margin: 0 -16px; padding: 12px 16px; }

.flash { padding: 12px 14px; border-radius: var(--radius-sm); font-weight: 500; margin-bottom: 14px; background: var(--ok-soft); color: var(--ok); overflow-wrap: anywhere; }
.flash.error { background: var(--warn-soft); color: var(--warn); }
.flash[data-flash] { display: flex; align-items: flex-start; gap: 10px; transition: opacity .35s ease, transform .35s ease; }
.flash[data-flash] .flash-text { flex: 1; min-width: 0; }
.flash-close { flex: none; border: 0; background: transparent; color: inherit; opacity: .7; cursor: pointer; font-size: 15px; line-height: 1;
  width: 28px; height: 28px; margin: -4px -6px -4px 0; border-radius: 8px; }
.flash-close:hover { opacity: 1; background: rgba(0, 0, 0, .06); }
.flash.leaving { opacity: 0; transform: translateY(-6px); }
@media (prefers-reduced-motion: reduce) { .flash[data-flash] { transition: none; } }
.banner { padding: 10px 16px; text-align: center; font-weight: 600; background: var(--signal-soft); color: var(--signal); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; font-family: var(--f-display); font-size: 16px; }

/* ---------- Formularios */
form { margin: 0; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 700; color: var(--muted); }
label.check { display: flex; gap: 8px; align-items: center; color: var(--ink); font-weight: 500; font-size: 14px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=time],
input[type=search], input[type=url], select, textarea {
  width: 100%; font: 16px var(--f-body); color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 12px; min-height: 44px; }
input[type=file] { font: 14px var(--f-body); color: var(--muted); max-width: 100%; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
/* Hora y fecha: el ícono del navegador se ve enorme y descolgado (sobre todo en Chrome). Lo quitamos
   (el click en el campo abre igual el selector) y en modo oscuro invertimos para que no quede negro
   sobre negro cuando por alguna razón vuelva a aparecer. */
input[type=time], input[type=date] { font-variant-numeric: tabular-nums; }
input[type=time]::-webkit-calendar-picker-indicator,
input[type=date]::-webkit-calendar-picker-indicator {
  opacity: .35; cursor: pointer; filter: var(--picker-icon-filter, none);
}
input[type=time]::-webkit-calendar-picker-indicator:hover,
input[type=date]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --picker-icon-filter: invert(1); } }
:root[data-theme="dark"] { --picker-icon-filter: invert(1); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
/* Rango de horas (Abre → Cierra): se ve como un bloque con identidad, no como dos inputs básicos sueltos.
   La hora entra con fuente de títulos y tamaño generoso para que se lea de lejos; los chips llenan los
   dos campos de un click para los casos típicos (mañana, tarde, media jornada). */
.hours-range { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--surface-2); display: grid; gap: 14px; }
.hours-range-head { display: flex; gap: 12px; align-items: flex-start; }
.hours-range-icon { width: 24px; height: 24px; color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.hours-range-head b { display: block; color: var(--ink); font-weight: 700; font-size: 15px; }
.hours-range-body { display: flex; align-items: flex-end; gap: 12px; }
.hours-range-field { display: grid; gap: 6px; flex: 1; min-width: 0; margin: 0; color: var(--muted); }
.hours-range-cap { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.hours-range-field input[type=time] {
  font-family: var(--f-display); font-size: 22px; font-weight: 600; color: var(--ink);
  text-align: center; padding: 10px 12px; min-height: 56px; background: var(--surface);
}
.hours-range-field input[type=time]:focus { background: var(--surface); }
.hours-range-sep { color: var(--muted); font-size: 22px; font-weight: 700; padding-bottom: 14px; flex-shrink: 0; }
@media (max-width: 420px) { .hours-range-sep { display: none; } .hours-range-body { flex-wrap: wrap; } }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 0; display: grid; gap: 12px; min-width: 0; }
legend { font-weight: 700; font-family: var(--f-display); padding: 0 6px; }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: var(--radius-sm); padding: 10px 18px;
  min-height: 46px; font: 800 15px var(--f-body); background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none;
  white-space: nowrap; box-shadow: 0 3px 0 var(--accent-deep); transition: transform .12s, box-shadow .12s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--accent-deep); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--accent-deep); }
@media (prefers-reduced-motion: reduce) { .btn, .btn:hover, .btn:active { transition: none; transform: none; } }
.btn svg { width: 18px; height: 18px; }
.btn.ghost { background: var(--surface); color: var(--ink); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line); }
.btn.ghost:hover { border-color: var(--accent); box-shadow: 0 4px 0 var(--line); }
/* Llamado principal de la parte pública: naranja con texto oscuro */
.btn.cta { background: var(--naranja); color: var(--tinta); box-shadow: 0 3px 0 var(--naranja-hondo); }
.btn.cta:hover { box-shadow: 0 4px 0 var(--naranja-hondo); }
.btn.cta:active { box-shadow: 0 1px 0 var(--naranja-hondo); }
.btn.danger { background: var(--warn); color: var(--warn-ink); box-shadow: 0 3px 0 #8E2A18; }
.btn.signal { background: var(--sol); color: var(--tinta); box-shadow: 0 3px 0 #D9A425; }
.btn.sm { min-height: 36px; padding: 6px 13px; font-size: 14px; box-shadow: 0 2px 0 var(--accent-deep); }
.btn.sm.ghost { box-shadow: 0 2px 0 var(--line); }
.btn.sm.cta { box-shadow: 0 2px 0 var(--naranja-hondo); }
.btn.block { width: 100%; }
.btn.xl { min-height: 58px; font-size: 18px; padding: 14px 26px; border-radius: 16px; }
.btn[disabled] { opacity: 1; cursor: not-allowed; background: var(--line); color: var(--muted); border-color: transparent; box-shadow: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--radius-sm); padding: 7px 13px;
  font: 700 14px var(--f-body); cursor: pointer; }
.chip.on, .chip:has(input:checked) { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.inline-form { display: inline; }

/* ---------- Placas */
.plates { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.plate { border: 2px dashed var(--line); border-radius: 18px; padding: 14px; text-align: center; background: #fff; color: #14231E; break-inside: avoid; }
.plate svg { width: 100%; max-width: 150px; height: auto; display: block; margin: 0 auto; }
.plate svg path { fill: #14231E; }
.plate .code { font-family: var(--f-display); font-size: 22px; font-weight: 700; letter-spacing: .08em; margin-top: 6px; }
.plate .name { font-weight: 600; }
.plate .tel { font-size: 11px; color: #4a5a53; }
@media print {
  .topbar, .sidenav, .no-print, .tabbar { display: none !important; }
  .layout { display: block; } .main { padding: 0; }
  body { background: #fff; }
  .plate { border-color: #999; }
}

/* ---------- Conductor */
/* top debe ser mayor que la topbar (que también es sticky con top:0) para no quedar oculto detrás */
.run-head { position: sticky; top: var(--topbar-h); z-index: 15; background: var(--bg); padding: 12px 0; margin-top: -16px; }
.progress { display: flex; gap: 4px; }
.progress i { flex: 1; height: 6px; border-radius: 99px; background: var(--line); }
.progress i.d { background: var(--ok); }
/* Visitas del mes del perro (home del cliente): se ve de un vistazo "2/8 — le quedan 6". */
.visits { margin-top: 10px; display: grid; gap: 4px; }
.visits-cap { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.visits-num { font-size: 15px; color: var(--muted); }
.visits-num b { color: var(--ink); font-size: 17px; font-family: var(--f-display); }
.visits-bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.visits-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-deep)); border-radius: 99px; transition: width .4s ease; }
.visits-foot { margin-top: 2px; }
.gps { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; }
.gps::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.gps.on { color: var(--ok); } .gps.on::before { background: var(--ok); animation: pulse 1.6s infinite; }
.gps.off { color: var(--warn); } .gps.off::before { background: var(--warn); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(46,125,79,.5); } 100% { box-shadow: 0 0 0 10px rgba(46,125,79,0); } }
@media (prefers-reduced-motion: reduce) { .gps.on::before { animation: none; } }
.stop { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stop.done { opacity: .7; }
.stop-head { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.stop-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 13px; flex: none; }
.stop.done .stop-num { background: var(--ok); }
.stop-dog { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.stop-dog:last-child { border-bottom: 0; }

.sheet-backdrop { position: fixed; inset: 0; background: rgba(10, 20, 15, .55); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); width: 100%; max-width: 560px; border-radius: 22px 22px 0 0; padding: 18px 16px;
  padding-bottom: max(18px, env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto; display: grid; gap: 14px; }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto; }
#reader { width: 100%; border-radius: 14px; overflow: hidden; background: #000; min-height: 240px; }
#reader video { border-radius: 14px; }

/* ---------- Mapa */
.map { height: 520px; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; z-index: 0; }
.map.short { height: 280px; }
@media (max-width: 560px) { .map { height: 380px; } }
.leaflet-container { font: 13px var(--f-body); }

/* ---------- Público: portada cálida con ilustraciones propias */
.landing .topbar, .public-top { background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); }
.hero { max-width: 1160px; margin: 0 auto; padding: 56px 20px 44px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(38px, 4.6vw, 56px); font-weight: 700; line-height: 1.06; max-width: 12em; }
.hero p.lead { font-size: 20px; line-height: 1.55; color: var(--muted); margin-top: 20px; max-width: 30em; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 30px 0 14px; }
.hero-fine { display: flex; gap: 16px; flex-wrap: wrap; font-size: 15px; color: var(--muted); }
.hero-fine span { display: inline-flex; align-items: center; gap: 6px; }
.hero-fine svg { width: 18px; height: 18px; color: var(--ok); }
.scene { position: relative; }
.scene svg.ill { width: 100%; height: auto; display: block; }
.notice { position: absolute; left: -5%; top: 9%; width: min(310px, 72%); background: var(--surface); color: var(--ink); border-radius: 20px;
  padding: 14px 16px; display: flex; gap: 12px; align-items: center; box-shadow: var(--shadow), 0 2px 0 var(--line);
  animation: rp-pop .5s cubic-bezier(.34, 1.56, .64, 1) 1.9s both; }
.notice .av { width: 46px; height: 46px; border-radius: 14px; background: var(--cielo); flex: none; display: grid; place-items: center; overflow: hidden; }
.notice .av svg { width: 44px; height: 44px; }
.notice b { display: block; font: 600 17px var(--f-display); }
.notice small { color: var(--muted); font-size: 14px; }
.ill .van { animation: rp-drive 1.8s cubic-bezier(.22, .9, .3, 1.05) .2s both; }
.ill .wheel { transform-box: fill-box; transform-origin: center; animation: rp-spin .45s linear .2s 4; }
.ill .bob { transform-box: fill-box; transform-origin: center bottom; animation: rp-bob .9s ease-in-out 2s 3; }
@keyframes rp-drive { from { transform: translateX(-230px); } to { transform: translateX(0); } }
@keyframes rp-spin { to { transform: rotate(360deg); } }
@keyframes rp-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px) rotate(-3deg); } }
@keyframes rp-pop { from { opacity: 0; transform: translateY(16px) scale(.92); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ill .van, .ill .wheel, .ill .bob, .notice { animation: none; } }

.band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section { max-width: 1160px; margin: 0 auto; padding: 64px 20px; }
.section > h2 { font-size: clamp(30px, 3.6vw, 42px); font-weight: 700; max-width: 18em; }
.section .intro { color: var(--muted); font-size: 19px; margin-top: 10px; max-width: 36em; }
.day { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 34px; }
.moment { border-radius: 28px; padding: 22px 22px 26px; }
.moment.m1 { background: var(--sol-2); } .moment.m2 { background: var(--accent-soft); } .moment.m3 { background: var(--naranja-2); }
.moment .hour { display: inline-block; font: 800 15px var(--f-body); background: var(--surface); border-radius: 999px; padding: 4px 12px; margin-bottom: 12px; }
.moment svg { width: 100%; height: 150px; display: block; margin: 4px 0 14px; }
.moment h3 { font-size: 24px; }
.moment p { margin-top: 8px; color: var(--muted); }

.roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 36px; align-items: end; }
.role h3 { font-size: 22px; margin-top: 18px; }
.role p { color: var(--muted); margin-top: 6px; }
.phone { width: min(250px, 100%); margin: 0 auto; border-radius: 34px; background: #2B2A33; padding: 10px; box-shadow: 0 24px 50px -24px rgba(40, 30, 20, .5); }
.screen { border-radius: 26px; background: #FFFBF6; color: #2B2A33; overflow: hidden; height: 440px; padding: 16px 14px; display: grid; align-content: start; gap: 10px; font-size: 13px; }
.screen .hi { font: 600 18px var(--f-display); }
.screen .mut { color: #5E5A66; font-size: 12px; }
.screen .s-card { background: #fff; border-radius: 18px; padding: 12px; box-shadow: 0 2px 0 #EFE6DC; }
.screen .tl { display: grid; gap: 8px; margin-top: 8px; }
.screen .tl div { display: flex; gap: 8px; align-items: center; }
.screen .tl i { width: 14px; height: 14px; border-radius: 50%; background: #17784F; flex: none; }
.screen .tl i.no { background: #EFE6DC; }
.screen .tl span { flex: 1; } .screen .tl em { font-style: normal; color: #5E5A66; }
.screen .dogrow { display: flex; gap: 10px; align-items: center; }
.screen .ph { width: 54px; height: 54px; border-radius: 16px; background: #DCEFFA; display: grid; place-items: center; flex: none; overflow: hidden; }
.screen .ph svg { width: 52px; height: 52px; }
.screen .dogrow b { font: 600 16px var(--f-display); display: block; }
.screen .mini-btn { margin-top: 8px; display: block; text-align: center; background: #17784F; color: #fff; border-radius: 12px; padding: 9px; font-weight: 800; }
.screen .stat { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px dashed #EFE6DC; }
.screen .stat:last-child { border: 0; }
.screen .stat b { font: 600 22px var(--f-display); }
.screen .tg { display: inline-block; border-radius: 8px; padding: 2px 8px; font-weight: 800; font-size: 11px; }
.screen .tg.ok { background: #DDF1E5; color: #17784F; } .screen .tg.warn { background: #FFE3CF; color: #A6420A; }
.screen .thumbs { display: flex; gap: 6px; margin-top: 8px; }
.screen .thumbs span { flex: 1; height: 58px; border-radius: 12px; }

.more { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 32px; margin-top: 36px; }
.more-item { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: start; }
.bubble { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; }
.bubble svg { width: 28px; height: 28px; }
.b1 { background: var(--accent-soft); color: var(--ok); } .b2 { background: var(--sol-2); color: var(--placa-ink); }
.b3 { background: var(--cielo); color: var(--info); } .b4 { background: var(--naranja-2); color: #B4500F; }
.more-item h3 { font-size: 20px; }
.more-item p { color: var(--muted); margin-top: 4px; font-size: 16px; }
.final { margin: 0 auto 64px; max-width: 1120px; border-radius: 36px; background: var(--verde); color: #fff; padding: 52px 28px; text-align: center;
  position: relative; overflow: hidden; }
.final h2 { font-size: clamp(28px, 3.4vw, 40px); color: #fff; }
.final p { opacity: .92; margin: 10px auto 24px; max-width: 32em; font-size: 18px; }
.final .paws { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .12; pointer-events: none; color: #fff; }
.final .btn { position: relative; }
#planes > h2 { text-align: left; }
.plans-sub { margin: 6px 0 18px; color: var(--muted); }
.site-foot { max-width: 1160px; margin: 0 auto; padding: 24px 20px 40px; display: flex; gap: 20px; flex-wrap: wrap; color: var(--muted);
  border-top: 1px solid var(--line); font-size: 15px; }
.site-foot span { font-family: var(--f-display); font-weight: 600; color: var(--ink); margin-right: auto; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 28px; }
  .day, .roles, .more { grid-template-columns: 1fr; }
  .notice { position: relative; left: auto; top: auto; width: auto; margin: -18px 12px 0; }
  .final { margin: 0 16px 48px; }
}
@media (max-width: 420px) {
  .hero-cta .btn { flex: 1 1 100%; }
  .public-top .brand { font-size: 19px; gap: 8px; } .public-top .brand-mark { width: 32px; height: 32px; }
  .public-top .topbar-inner { gap: 8px; } .public-top .btn.sm { padding: 6px 10px; font-size: 14px; }
}
.auth-card { max-width: 440px; margin: 40px auto; }
.auth-dogs { display: flex; gap: 4px; margin-bottom: 4px; }
.auth-dogs svg { width: 46px; height: 50px; }
.price { font-family: var(--f-display); font-size: 34px; font-weight: 600; }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.feature-list li { display: flex; gap: 8px; }
.feature-list li::before { content: "✓"; color: var(--ok); font-weight: 700; }
.feature-list li.no { color: var(--muted); }
.feature-list li.no::before { content: "—"; color: var(--muted); }
.auth-card { max-width: 420px; margin: 40px auto; }
.install-card { margin-bottom: 16px; }

/* ---------- Planes con selector de periodo */
.pricing { display: grid; gap: 18px; }
.period-switch { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--line); justify-self: center; max-width: 100%; }
.period-switch button { border: 0; background: none; color: var(--muted); font: 600 14px var(--f-body); padding: 9px 16px;
  border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.period-switch button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); }
.period-switch .save { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 99px; background: var(--ok-soft); color: var(--ok); }
.period-switch button[aria-checked="true"] .save { background: rgba(255,255,255,.22); color: inherit; }
.plan-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.plan-card [data-price] { transition: opacity .15s; }
@media (prefers-reduced-motion: reduce) { .plan-card [data-price] { transition: none; } }
@media (max-width: 560px) {
  .period-switch { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; border-radius: 16px; }
  .period-switch button { flex-direction: column; gap: 2px; padding: 8px 4px; font-size: 13px; border-radius: 12px; }
  .period-switch .save { font-size: 10px; }
  .hide-mobile { display: none !important; }
}

/* ---------- Tablas en celular: se deslizan de lado a lado */
.table-wrap { -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; position: relative; }
@media (max-width: 760px) {
  .table-wrap > table { min-width: 620px; }
  .table-wrap th, .table-wrap td { white-space: nowrap; }
  .table-wrap td .meta, .table-wrap td .small { white-space: nowrap; }
  /* Sombra en el borde que indica que hay más columnas */
  .table-wrap {
    background:
      linear-gradient(to right, var(--surface) 30%, transparent) left / 24px 100% no-repeat local,
      linear-gradient(to left, var(--surface) 30%, transparent) right / 24px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.18), transparent) left / 12px 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.18), transparent) right / 12px 100% no-repeat scroll,
      var(--surface);
  }
  .table-wrap > table th, .table-wrap > table td { background-clip: padding-box; }
  .table-wrap > table th { background: var(--surface-2); }
  .table-wrap > table td { background: transparent; }
  .swipe-hint { display: flex; }
}
.swipe-hint { display: none; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 6px 12px 0; }

.site-switch select { min-height: 38px; padding: 6px 30px 6px 10px; font-weight: 600; font-size: 14px; max-width: 200px; }
@media (max-width: 560px) {
  .site-switch { min-width: 0; flex: 0 1 auto; }
  .site-switch select { width: 100%; max-width: 170px; min-width: 0; }
  .brand-text-hide { display: none; }   /* con selector de sede, en el celular queda solo el logo */
  .topbar-inner { gap: 6px; }
  .topbar .brand.has-toggle-sites { display: none; }   /* con menú y selector de sede no cabe el logo: el menú lo reemplaza */
}

/* Días según el plan */
.days-picker { display: grid; gap: 6px; }
.days-count { font-weight: 600; color: var(--muted); min-height: 1em; }
.days-count.ok { color: var(--ok, #2f7a55); }
.days-count.warn { color: var(--warn); }
.chip.off { opacity: .4; }

/* Historial del perro */
.log-list { list-style: none; margin: 0; padding: 0; display: grid; }
.log-list li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line); }
.log-list li:first-child { border-top: 0; }
.log-kind { flex: none; width: 112px; font-size: 13px; font-weight: 700; color: var(--muted); padding-top: 1px; }
.log-kind.k-movimiento { color: var(--ok); }
.log-kind.k-novedad { color: var(--warn); }
.log-kind.k-mensaje { color: var(--info); }
.log-kind.k-pago { color: var(--signal); }
@media (max-width: 560px) { .log-list li { flex-direction: column; gap: 2px; } .log-kind { width: auto; } }
.chip-link { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 600; }
.chip-link .num { color: var(--muted); font-weight: 500; }
.chip-link.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip-link.on .num { color: inherit; opacity: .8; }

/* Gráficos de reportes */
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.chart-card.wide { grid-column: 1 / -1; }
@media (max-width: 860px) { .chart-grid { grid-template-columns: minmax(0, 1fr); } }
svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
svg.chart .grid { stroke: var(--line); stroke-width: 1; }
svg.chart .grid.base { stroke: var(--muted); stroke-opacity: .5; }
svg.chart .axis { fill: var(--muted); font-size: 14px; font-family: var(--f-body); }
svg.chart .label { fill: var(--ink); font-size: 16px; font-family: var(--f-body); }
svg.chart .value { fill: var(--ink); font-size: 16px; font-weight: 700; font-family: var(--f-body); font-variant-numeric: tabular-nums; }
svg.chart .bar { fill: var(--accent); }
svg.chart .bar.now { fill: var(--placa); }
svg.chart .track { fill: var(--accent-soft); }
svg.chart .hit { cursor: pointer; outline: none; }
svg.chart .hit:hover .bar, svg.chart .hit:focus .bar { filter: brightness(1.15); }
svg.chart .hit:focus-visible rect[fill="transparent"] { stroke: var(--accent); stroke-width: 1.5; }
.st-al_dia { fill: var(--ok); background: var(--ok); }
.st-por_vencer { fill: var(--placa); background: var(--placa); }
.st-vencida { fill: var(--warn); background: var(--warn); }
.st-sin_plan { fill: #9AA79F; background: #9AA79F; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-item .sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-tip { position: fixed; z-index: 60; pointer-events: none; background: var(--ink); color: var(--surface); font-size: 13px;
  font-weight: 600; padding: 6px 10px; border-radius: 8px; box-shadow: var(--shadow); white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); }
.muted-row td { opacity: .55; }

/* Conductor: lista de perros con foto */
.dog-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: start; }
.dog-photo { width: 112px; height: 112px; border-radius: 22px; overflow: hidden; border: 0; padding: 0; cursor: zoom-in;
  background: var(--sol-2); color: var(--tinta); display: grid; place-items: center; font: 600 44px var(--f-display); }
.dog-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dog-info { display: grid; gap: 2px; min-width: 0; }
.dog-name { font-family: var(--f-display); font-size: 22px; font-weight: 600; line-height: 1.15; }
.dog-home { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.dog-home a { margin-left: 4px; white-space: nowrap; }
.dog-actions { grid-column: 1 / -1; display: grid; gap: 8px; }
.dog-photo-big { width: 100%; max-height: 52vh; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 18px; display: block; background: var(--surface-2); }
.dog-photo-big.empty { display: grid; place-items: center; align-content: center; gap: 6px; background: var(--sol-2); color: var(--tinta);
  font: 600 64px var(--f-display); aspect-ratio: 16 / 7; }
.dog-photo-big.empty span { font: 600 14px var(--f-body); opacity: .9; }


.chart-scroll { overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
@media (max-width: 560px) { .chart-scroll svg.chart { min-width: 760px; } }

/* Dos direcciones */
.addr-box { display: grid; gap: 8px; }
.addr2 { display: grid; gap: 10px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; background: var(--surface-2); }
.addr-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.addr-choice > div { display: grid; gap: 4px; }

.calendar-note { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-radius: 12px; margin-bottom: 14px;
  background: var(--info-soft); color: var(--info); font-weight: 600; font-size: 14px; }
.calendar-note svg { width: 18px; height: 18px; flex: none; }

/* Fotos del día */
.photo-drop { display: grid; place-items: center; text-align: center; padding: 22px; border: 2px dashed var(--line); border-radius: var(--radius);
  background: var(--surface-2); cursor: pointer; }
.photo-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.photo-drop > span { display: grid; justify-items: center; gap: 4px; }
.photo-drop svg { width: 30px; height: 30px; color: var(--accent); }
.photo-preview { display: flex; gap: 6px; flex-wrap: wrap; }
.photo-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.dog-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dog-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 99px;
  background: var(--surface); cursor: pointer; font-size: 14px; font-weight: 600; }
.dog-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dog-chip .avatar.sm { width: 30px; height: 30px; font-size: 13px; }
.dog-chip:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.dog-chip:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.photo-item { position: relative; margin: 0; display: block; }
.photo-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; background: var(--surface-2); }
.photo-item figcaption { margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo-del { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(0,0,0,.55); color: #fff; font-size: 13px; line-height: 1; }
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(10,16,13,.92); display: grid; place-items: center; align-content: center;
  gap: 10px; padding: 16px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 72vh; border-radius: 12px; }
.lb-cap { color: #fff; margin: 0; text-align: center; }
.lb-close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.15);
  color: #fff; font-size: 18px; cursor: pointer; }
.lb-actions { display: flex; gap: 8px; }
.photo-strip { display: flex; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.photo-strip img { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; flex: none; display: block; }

/* Acciones en tablas */
.row-actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: nowrap; }
.row-actions .btn svg { width: 14px; height: 14px; }
.btn.ghost.danger { background: transparent; color: var(--warn); border-color: var(--line); box-shadow: none; }
.bulk-bar { position: sticky; top: 8px; z-index: 6; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px;
  margin-bottom: 10px; border-radius: 12px; background: var(--ink); color: var(--surface); box-shadow: var(--shadow); }
.bulk-bar .btn.ghost { color: var(--surface); border-color: rgba(255,255,255,.35); background: transparent; }

/* Aviso de confirmación */
.ask-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(15, 25, 20, .55); display: grid; place-items: center; padding: 16px; }
.ask-backdrop[hidden] { display: none; }
.ask { width: min(440px, 100%); background: var(--surface); border-radius: 18px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.25);
  display: grid; gap: 10px; animation: ask-in .14s ease-out; }
@keyframes ask-in { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.ask h2 { margin: 0; font-size: 20px; }
.ask p { margin: 0; color: var(--muted); }
.ask-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font: 800 20px var(--f-display);
  background: var(--signal-soft); color: var(--signal); }
.ask.is-danger .ask-icon { background: var(--warn-soft); color: var(--warn); }
.ask-type { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.ask-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.btn.danger:disabled { opacity: .45; }

/* Explicación paso a paso */
.how-photos { margin-bottom: 16px; }
.how-photos summary { cursor: pointer; }
.steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.steps li { display: flex; gap: 10px; align-items: flex-start; }
.steps p { margin: 2px 0 0; }
.step-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent);
  color: var(--accent-ink); font-weight: 700; font-size: 14px; }
.how-note { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); }

.map-follow { border: 2px solid rgba(0,0,0,.2); border-radius: 10px; background: #fff; color: #2B2A33; font: 700 12px var(--f-body);
  padding: 6px 10px; cursor: pointer; }
.map-follow.on { background: #17784F; color: #fff; border-color: #17784F; }

/* Botón para volver */
.back-btn { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 8px; padding: 6px 12px 6px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; text-decoration: none; }
.back-btn svg { width: 16px; height: 16px; }
.back-btn:hover { border-color: var(--accent); color: var(--accent); }
.back-btn { justify-self: start; width: fit-content; }

/* Barra superior: menús */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon-btn.labeled { display: inline-flex; flex-direction: row; align-items: center; width: auto; padding: 0 12px; gap: 6px; white-space: nowrap; font-weight: 600; font-size: 14px; color: var(--ink); text-decoration: none; }
@media (max-width: 1000px) { .icon-btn.labeled { width: 40px; padding: 0; } .icon-btn.labeled .lbl { display: none; } }
.pop { position: relative; }
.pop-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; width: min(340px, calc(100vw - 24px)); background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.14); overflow: hidden; }
.pop-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.pop-note-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.pop-note-row:hover { background: var(--surface-2); }
.pop-note-row.unread { background: var(--accent-soft); }
.pop-note-row.unread .pn-title { font-weight: 700; }
.pop-note { flex: 1; display: grid; gap: 2px; padding: 10px 14px; color: var(--ink); text-decoration: none; min-width: 0; }
.pop-note-del { display: flex; align-items: center; padding: 0 10px; }
.pop-note-del .act { opacity: .5; }
.pop-note-del .act:hover { opacity: 1; }
.pn-title { font-size: 14px; }
.pn-body { font-size: 13px; color: var(--muted); }
.pn-time { font-size: 12px; color: var(--muted); }
.pop-foot { display: block; padding: 10px 14px; text-align: center; font-weight: 600; font-size: 14px; }
.pop-user { display: flex; gap: 10px; align-items: center; padding: 14px; border-bottom: 1px solid var(--line); }
.pu-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--naranja); color: var(--tinta); display: grid; place-items: center;
  font: 600 18px var(--f-display); flex: none; }
.pop-item { display: block; padding: 11px 14px; color: var(--ink); text-decoration: none; font-size: 14px; border-bottom: 1px solid var(--line); }
.pop-item:last-child { border-bottom: 0; }
.pop-item:hover { background: var(--surface-2); }
.live-status { min-width: 70px; }

/* ---------- Panel del colegio: cómo va el día */
.day-board { background: var(--verde); color: #fff; border-radius: 24px; padding: 20px 24px 18px; margin-bottom: 16px; box-shadow: 0 4px 0 var(--verde-hondo); }
.db-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.db-head h2 { font-size: 22px; color: #fff; }
.db-map { color: #fff; font-weight: 700; font-size: 15px; }
.db-stops { list-style: none; margin: 16px 0 4px; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: relative; }
.db-stops::before { content: ""; position: absolute; left: 10%; right: 10%; top: 11px; height: 2px; background: rgba(255,255,255,.6); }
.db-stops li { position: relative; text-align: center; }
.db-stops a { color: #fff; text-decoration: none; display: grid; justify-items: center; gap: 2px; padding-top: 32px; position: relative; border-radius: 8px; }
.db-stops a::before { content: ""; position: absolute; top: 4px; left: 50%; margin-left: -8px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--verde); border: 3px solid #fff; box-sizing: border-box; }
.db-stops li.is-live a::before { background: var(--sol); border-color: var(--sol); box-shadow: 0 0 0 4px rgba(255,201,74,.35); }
.db-stops a:hover .db-l { text-decoration: underline; }
.db-stops a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.db-n { font: 600 36px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.db-l { font-size: 14px; opacity: .92; }
.db-runs { list-style: none; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid rgba(255,255,255,.35); display: grid; gap: 4px; font-size: 15px; }
@media (max-width: 700px) {
  .day-board { padding: 16px 14px 14px; }
  .db-stops { grid-template-columns: 1fr; gap: 0; margin-top: 10px; }
  .db-stops::before { left: 15px; right: auto; top: 12px; bottom: 12px; width: 2px; height: auto; }
  .db-stops li { text-align: left; }
  .db-stops a { grid-template-columns: 56px 1fr; justify-items: start; align-items: baseline; padding: 6px 0 6px 40px; }
  .db-stops a::before { top: 12px; left: 8px; margin-left: 0; }
  .db-n { font-size: 26px; }
}

/* Para atender: filas que llevan directo a lo pendiente */
/* "Para atender" se diferencia visualmente de las demás tarjetas del dashboard: franja izquierda amarilla
   que la hace leer como una lista de pendientes en vez de "otra tarjeta más". No es alerta roja, es
   un recordatorio accionable. */
.card.attend { border-left: 4px solid var(--sol); padding-left: 16px; }
.attend .card-head { margin-bottom: 4px; }
.attend .card-head h2::before { content: "!"; display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; background: var(--sol); color: var(--placa-ink); border-radius: 50%; font-family: var(--f-display); font-weight: 700; font-size: 14px; vertical-align: -3px; }
.attend-row { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line);
  color: var(--ink); text-decoration: none; }
.attend-row:hover b { text-decoration: underline; }
.attend-n { min-width: 44px; height: 34px; display: grid; place-items: center; border-radius: 12px; background: var(--placa-soft); color: var(--placa-ink);
  font: 600 18px var(--f-display); font-variant-numeric: tabular-nums; }
.attend-names { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.attend-chip { font-size: 13px; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.attend-chip.warn { color: var(--warn); border-color: var(--warn-soft); background: var(--warn-soft); }

/* ---------- Tablas: columnas que no se aplastan, estados apilados y acciones con ícono */
table { font-size: 14px; }
th { white-space: nowrap; }
td { line-height: 1.35; }
.cell-title { font-weight: 800; white-space: nowrap; }
.cell-sub { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.cell-wrap { min-width: 150px; max-width: 240px; }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }
td.actions, th.actions { width: 1%; white-space: nowrap; text-align: right; }
.pill-stack { display: grid; gap: 5px; justify-items: start; }
.row-actions { gap: 6px; align-items: center; }
.row-actions form { display: inline-flex; margin: 0; }
.act { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; border: 2px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer; padding: 0; box-shadow: 0 2px 0 var(--line); text-decoration: none; }
.act svg { width: 18px; height: 18px; }
.act:hover { border-color: var(--accent); color: var(--accent); }
.act:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.act.danger { color: var(--warn); }
.act.danger:hover { border-color: var(--warn); color: var(--warn); }
.dog-cell { display: flex; gap: 10px; align-items: center; color: inherit; text-decoration: none; min-width: 170px; }
.dog-cell:hover .cell-title { text-decoration: underline; }
td .pill { white-space: nowrap; }
form[role=search] > input[type=search] { flex: 2 1 220px; min-width: 200px; }
@media (max-width: 760px) {
  /* En el celular las tablas se deslizan de lado; las de texto largo sí parten la línea */
  .table-wrap table.prose td { white-space: normal; min-width: 190px; }
  .table-wrap table.prose td:first-child { min-width: 0; }
}

/* ---------- Formularios: etiquetas sueltas, casillas que abren campos y foto con cámara */
.field-label { font-size: 14px; font-weight: 700; color: var(--muted); }
.yes-list { display: grid; gap: 8px; }
.yes-item { border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface); }
.yes-item.on { border-color: var(--accent); }
.yes-item > label.check { font-weight: 700; min-height: 32px; cursor: pointer; flex-wrap: nowrap; line-height: 1.35; }
.yes-item > label.check .pill { margin-left: 4px; vertical-align: 1px; }
.yes-item > label.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.yes-body { margin-top: 10px; }
.yes-body[hidden] { display: none; }
.photo-pick { display: grid; gap: 8px; }
.photo-pick-row { display: flex; gap: 12px; align-items: center; }
.photo-thumb { width: 72px; height: 72px; border-radius: 14px; flex: none; display: grid; place-items: center; overflow: hidden;
  border: 2px dashed var(--line); color: var(--muted); background: var(--surface); }
.photo-thumb.has { border-style: solid; }
.photo-thumb svg { width: 26px; height: 26px; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-pick-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.photo-pick-btns[hidden] { display: none; }
.photo-input-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.act.copied { border-color: var(--accent); color: var(--accent); }

/* ---------- Invitaciones */
.invite-live { padding: 14px; border-radius: var(--radius-sm); background: var(--accent-soft); }
.invite-link input { font-size: 15px; font-weight: 700; background: var(--surface); }
.invite-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.invite-facts > div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface); }
.invite-facts span { font-size: 12px; color: var(--muted); font-weight: 700; }
.invite-facts b { font-size: 16px; }
.invite-facts em { font-style: normal; font-size: 13px; color: var(--muted); }
.invite-new summary { cursor: pointer; font-weight: 700; font-size: 14px; }

/* ---------- Ajustes: lista de vacunas */
.vac-types { display: grid; gap: 8px; }
.vac-type { display: flex; gap: 8px; align-items: flex-end; padding: 10px 0; border-top: 1px solid var(--line); }
.vac-type-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr) auto auto; gap: 10px; align-items: end; flex: 1; }
.vac-type-form .vt-req { min-height: 44px; }
.vac-type-new { padding-top: 12px; border-top: 2px dashed var(--line); }
@media (max-width: 640px) {
  .vac-type-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .vac-type-form .vt-name { grid-column: 1 / -1; }
  .invite-facts { grid-template-columns: 1fr; }
}

/* ---------- Familia: tocar la foto para actualizar, y lo pendiente con su botón */
.avatar-edit { position: relative; display: inline-flex; flex: none; border-radius: 16px; }
.avatar-edit:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.avatar-edit-badge { position: absolute; right: -6px; bottom: -6px; width: 28px; height: 28px; border-radius: 999px; display: grid;
  place-items: center; background: var(--accent); color: var(--accent-ink); border: 3px solid var(--surface); }
.avatar-edit-badge svg { width: 14px; height: 14px; }
.todo-link { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--signal-soft); color: var(--ink); text-decoration: none; font-size: 14px; }
.todo-link .btn { flex: none; }

/* ---------- Avisos: sin leer resaltados; deslizar a la izquierda para borrar (celular) o ícono (computador) */
.note-row { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.note-row:last-child { border-bottom: 0; }
.note-front { position: relative; display: flex; align-items: center; background: var(--surface); transition: transform .2s ease;
  touch-action: pan-y; }
.note-front.dragging { transition: none; }
.note-front .list-item { flex: 1; border-bottom: 0; min-width: 0; }
.note-front .list-item.unread { background: var(--signal-soft); }
.note-front .list-item.unread .title { font-weight: 800; }
.note-dot { width: 9px; height: 9px; border-radius: 99px; flex: none; background: transparent; }
.list-item.unread .note-dot { background: var(--naranja); }
.note-x { padding-right: 10px; }
.note-del { position: absolute; inset: 0 0 0 auto; width: 96px; display: flex; }
.note-del button { flex: 1; border: 0; background: var(--warn); color: var(--warn-ink); font: inherit; font-weight: 800; font-size: 13px;
  display: grid; place-items: center; gap: 2px; cursor: pointer; padding: 6px; }
.note-del svg { width: 20px; height: 20px; }
.note-row.gone { transition: opacity .2s ease, max-height .25s ease; opacity: 0; max-height: 0 !important; }
.swipe-hint { display: none; text-align: center; margin-top: 8px; }
@media (hover: none) and (pointer: coarse) {
  .note-x { display: none; }       /* en el celular se borra deslizando */
  .swipe-hint { display: block; }
}
@media (hover: hover) { .note-del { display: none; } }
.note-front:has(.list-item.unread) { background: var(--signal-soft); }

/* ---------- Pestañas (Ajustes) */
.tabs { display: flex; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; margin-bottom: 16px; padding-bottom: 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding: 9px 16px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 800; font-size: 14px; text-decoration: none; white-space: nowrap; }
.tabs a:hover { border-color: var(--accent); }
.tabs a.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.settings-pane { max-width: 760px; }
/* ---------- Horario: dos listas y una barra del día */
.hours-pick { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.hours-pick label { flex: 1 1 140px; }
.hours-pick select { font-size: 17px; font-weight: 700; }
.hours-to { padding-bottom: 12px; font-weight: 800; color: var(--muted); }
.hours-bar { position: relative; height: 14px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.hours-bar span { position: absolute; top: 0; bottom: 0; background: var(--accent); border-radius: 99px; }
.hours-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }

/* ---------- Panel de la plataforma: gráfica de columnas, estados y "para atender" */
:root { --chart-mark: #17784F; --chart-grid: #EFE6DC; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --chart-mark: #3BA572; --chart-grid: #3A363F; } }
:root[data-theme="dark"] { --chart-mark: #3BA572; --chart-grid: #3A363F; }
.col-chart { width: 100%; height: auto; display: block; overflow: visible; }
.col-chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
.col-chart .axis { stroke: var(--muted); stroke-width: 1; opacity: .5; }
.col-chart .tick, .col-chart .xlab { fill: var(--muted); font-size: 12px; font-family: var(--f-body); }
.col-chart .mark { fill: var(--chart-mark); }
.col-chart .hit { fill: transparent; }
.col-chart .val { fill: var(--ink); font-size: 13px; font-weight: 800; font-family: var(--f-body); opacity: 0; }
.col-chart .bar.show .val, .col-chart .bar:hover .val, .col-chart .bar:focus .val { opacity: 1; }
.col-chart .bar:hover .hit, .col-chart .bar:focus .hit { fill: var(--surface-2); }
.col-chart .bar:focus { outline: none; }
.col-chart .bar:focus-visible .hit { stroke: var(--accent); stroke-width: 2; }
.state-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.state-strip .chip-link { gap: 8px; }
.state-strip .chip-link.on { background: var(--surface); border-color: var(--warn); color: var(--ink); }
.todo-group { display: grid; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.todo-group h3 { font-size: 15px; }
.todo-row { display: flex; gap: 8px; align-items: center; }
.todo-row form { margin: 0; }
.kpis .kpi .value { font-size: 28px; }
@media (max-width: 860px) { .kpis.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* ---------- Estado del sistema */
.check-row { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.check-row:last-child { border-bottom: 0; }
.check-dot { width: 26px; height: 26px; border-radius: 99px; display: grid; place-items: center; font-weight: 900; flex: none; font-size: 14px; }
.check-dot.ok { background: var(--ok-soft); color: var(--ok); }
.check-dot.bad { background: var(--warn-soft); color: var(--warn); }
.check-dot.local { background: var(--info-soft); color: var(--info); }
.follow-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.follow-row form { margin: 0; }
.wa-preview { background: var(--ok-soft); border-radius: 12px 12px 12px 4px; padding: 10px 12px; white-space: pre-line; }
.msg-links { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Verificación en dos pasos */
.code-input { font-family: var(--f-display); font-size: 24px; letter-spacing: .18em; text-align: center; }
.code-input::placeholder { letter-spacing: .18em; opacity: .35; }
.setup-steps { margin: 0; padding-left: 22px; display: grid; gap: 16px; }
.setup-steps li { padding-left: 4px; }
.setup-steps li::marker { font-family: var(--f-display); font-weight: 600; color: var(--accent); }
.qr-box { width: 196px; height: 196px; margin: 10px 0 6px; padding: 10px; background: #fff; border-radius: 14px; border: 1px solid var(--line); }
.qr-box svg { width: 100%; height: 100%; display: block; }
.secret-key { font-size: 17px; font-weight: 700; letter-spacing: .06em; word-break: break-all; background: var(--surface-2);
  padding: 8px 10px; border-radius: 10px; margin-top: 6px; user-select: all; }
.recovery-codes { list-style: none; margin: 0; padding: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px;
  border: 1px dashed var(--muted); border-radius: 14px; font-size: 18px; font-weight: 700; letter-spacing: .05em; }
.two-step { display: flex; gap: 12px; align-items: flex-start; }
.two-step .check-dot { flex: none; }
@media print {
  .recovery-codes { border-color: #000; }
}
.error-row { border-top: 1px solid var(--line); padding: 10px 0 4px; display: grid; gap: 6px; }
.trace { white-space: pre-wrap; word-break: break-word; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; max-height: 320px; overflow: auto; margin-top: 6px; }
.erase-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 15px; }
.check-inline { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.check-inline input { width: 18px; height: 18px; margin: 0; }

/* ---------- Soporte (tickets) */
.nav-count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--warn); color: var(--warn-ink);
  font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; }
.sidenav a.active .nav-count { background: #fff; color: var(--warn); }
.ticket-row.unseen .title { font-weight: 800; }
.dot-new { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--warn); margin-right: 7px; vertical-align: middle; }
.ticket-wrap { display: grid; gap: 14px; max-width: 760px; min-width: 0; }
.ticket-thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tmsg { max-width: 88%; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.tmsg.mine { justify-self: end; background: var(--accent-soft); border-color: transparent; border-bottom-right-radius: 6px; }
.tmsg.theirs { justify-self: start; border-bottom-left-radius: 6px; }
.tmsg-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 4px; font-size: 14px; }
.tmsg-body { white-space: pre-wrap; word-break: break-word; }
.tmsg-img { display: block; margin-top: 8px; }
.tmsg-img img { max-width: 100%; max-height: 260px; border-radius: 10px; border: 1px solid var(--line); display: block; }
.ticket-closed { text-align: center; }
.ticket-layout { grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); }
@media (max-width: 900px) { .ticket-layout { grid-template-columns: 1fr; } }

/* ---------- Menú de la izquierda que se puede esconder */
.nav-toggle { flex: none; }
@media (min-width: 901px) {
  :root[data-nav="off"] .sidenav { display: none; }
  :root[data-nav="off"] .layout { grid-template-columns: minmax(0, 1fr); }
  :root[data-nav="off"] .nav-toggle { background: var(--accent-soft); color: var(--accent); }
  .only-mobile, .drawer-head, .nav-backdrop { display: none !important; }
}
/* En el celular (o ventana angosta) el menú sale desde la izquierda, con cada sección hacia abajo */
@media (max-width: 900px) {
  .only-desktop { display: none !important; }
  .sidenav { position: fixed; z-index: 60; top: 0; left: 0; bottom: 0; width: min(292px, 84vw); height: auto; display: grid;
    align-content: start; gap: 2px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
    padding: calc(12px + env(safe-area-inset-top)) 12px calc(24px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
    background: var(--surface); border-right: 1px solid var(--line); border-bottom: 0; transform: translateX(-105%);
    visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; }
  :root[data-drawer="open"] .sidenav { transform: none; visibility: visible; box-shadow: var(--shadow); transition: transform .22s ease, visibility 0s; }
  .sidenav a { white-space: normal; padding: 11px 12px; font-size: 16px; }
  .sidenav .sep { display: block; }
  .drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 10px 12px;
    font-family: var(--f-display); font-size: 18px; }
  .nav-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(20, 16, 12, .45); }
  :root[data-drawer="open"] body { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .sidenav { transition: none !important; } }

/* ---------- Modo claro / oscuro */
.theme-btn .i-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .i-moon { display: none; }
}
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
.theme-float { position: fixed; z-index: 30; top: calc(12px + env(safe-area-inset-top)); right: calc(12px + env(safe-area-inset-right));
  background: var(--surface); border: 1px solid var(--line); }
@media print { .theme-btn { display: none !important; } }
@media print { .nav-toggle { display: none !important; } }

/* ---------- Registrar perro: familia nueva o ya registrada / familia fija */
.family-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
@media (max-width: 560px) { .family-choice { grid-template-columns: 1fr; } }
.choice-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; font-weight: 400; }
.choice-card input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.choice-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice-card.is-disabled { opacity: .55; cursor: not-allowed; }
.family-locked { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line); }
.family-locked > svg { width: 22px; height: 22px; flex: none; color: var(--muted); }
label.consent-check { align-items: flex-start; font-size: 14px; line-height: 1.45; padding: 12px 14px; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
label.consent-check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
label.consent-check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }

/* ---------- Datos solo para ver (los de la familia) */
.info-list { margin: 0; display: grid; gap: 0; }
.info-list > div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.info-list > div:first-child { border-top: 0; }
.info-list dt { color: var(--muted); font-size: 14px; }
.info-list dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .info-list > div { grid-template-columns: 1fr; gap: 2px; } }
.another-dog { border: 2px solid var(--accent); background: var(--accent-soft); }
.more-dogs-note { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); margin-bottom: 12px; }

/* ---------- Marcar la casa en el mapa */
.pin-box { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.pin-ways { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pin-way { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.pin-way:hover { border-color: var(--accent); }
.pin-way:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pin-way-icon { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-deep); }
.pin-way-icon svg { width: 18px; height: 18px; }
.pin-way-text { display: grid; gap: 2px; min-width: 0; }
.pin-way-text b { font-size: 15px; }
.pin-way-text span { font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.pin-tip { margin: 0; }
@media (max-width: 520px) { .pin-ways { grid-template-columns: 1fr; } }
.pin-map { height: 260px; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; background: var(--surface);
  position: relative; z-index: 0; }   /* las capas del mapa no tapan las sugerencias */
.pin-status { color: var(--muted); }
.pin-status.ok { color: var(--ok); font-weight: 700; }
.pin-status.warn { color: var(--signal); font-weight: 700; }
.pin-suggest { list-style: none; margin: 0; padding: 4px; display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.pin-option { display: flex; gap: 8px; align-items: flex-start; width: 100%; text-align: left; border: 0; background: transparent; color: var(--ink);
  font: 500 14px/1.35 var(--f-body); padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.pin-option:hover, .pin-option:focus-visible { background: var(--accent-soft); }
.pin-option svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--accent); }

/* Registro con el enlace: una ficha plegable por perro */
.dog-blocks { display: grid; gap: 12px; }
.dog-block { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.dog-block-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 6px; background: var(--surface-2); }
.dog-block.closed .dog-block-head { background: var(--surface); }
.dog-block-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; color: var(--ink);
  text-align: left; padding: 8px; border-radius: 12px; cursor: pointer; font: inherit; }
.dog-block-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dog-block-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent);
  color: var(--accent-ink); font: 700 14px/1 var(--f-display); }
.dog-block-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.dog-block-text b { font-family: var(--f-display); font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dog-block-sum { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.dog-block-sum.ok { color: var(--ok); }
.dog-block-sum.warn { color: var(--warn); }
.dog-block-chev { flex: none; width: 20px; height: 20px; color: var(--muted); transition: transform .2s; }
.dog-block.closed .dog-block-chev { transform: rotate(-90deg); }
.dog-block-remove { flex: none; }
.dog-block-body { border: 0; border-radius: 0; padding: 14px; border-top: 1px solid var(--line); }
.dog-block-body[disabled] { display: none; }
.dog-block-vac { padding-top: 12px; border-top: 1px dashed var(--line); }
.dog-block-sub { font-family: var(--f-display); font-size: 15px; }
.dog-add { border-style: dashed; }
@media (max-width: 480px) { .dog-block-body { padding: 12px 10px; } .dog-block-remove { padding-inline: 10px; } }
.dog-block-num svg { width: 16px; height: 16px; }
.form-part { display: grid; gap: 10px; min-width: 0; }
.form-part-title { margin: 0; font-size: 19px; }
.geo-trace { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.pin-option > span { display: grid; gap: 1px; min-width: 0; }
.pin-option small { font-weight: 500; font-size: 12.5px; color: var(--muted); }
.pin-attrib { font-size: 11px; color: var(--muted); text-align: right; padding: 2px 8px 4px; }
label.has-suggest { position: relative; }
.addr-input-wrap { position: relative; display: block; }
.addr-suggest { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; z-index: 50; font-weight: 400; }
/* Dirección y barrio en una fila (la dirección más ancha); los campos alineados arriba aunque debajo de la
   dirección vaya "Usar mi ubicación" */
.addr-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 560px) { .addr-row { grid-template-columns: 1fr; } }
.addr-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 2px; }
.addr-tool-hint { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.pin-box > .addr-tools { margin-top: 0; }
.addr-tool { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 2px 0; cursor: pointer;
  color: var(--ok); font: 700 13.5px/1.2 var(--f-body); }
.addr-tool-hint + .addr-tool { margin-left: 12px; }
.addr-tool:hover { text-decoration: underline; }
.addr-tool svg { width: 16px; height: 16px; flex: none; }
.geo-groups { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.pin-ways.one { grid-template-columns: 1fr; }
.pin-how { margin: 0; color: var(--muted); }
.pin-empty { font-size: 13px; color: var(--muted); padding: 8px 10px; }

/* Revisión de registros nuevos */
.reg-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .reg-layout { grid-template-columns: 1fr; } }
.reg-dog-head { display: flex; gap: 14px; align-items: flex-start; }
.reg-photo { flex: none; width: 120px; height: 120px; border-radius: 16px; overflow: hidden; background: var(--surface-2);
  border: 1px solid var(--line); display: grid; place-items: center; }
.reg-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reg-photo.empty { color: var(--muted); font-size: 12px; align-content: center; justify-items: center; gap: 4px; }
.reg-photo.empty svg { width: 28px; height: 28px; }
.reg-sub { font-size: 15px; margin: 0; }
.reg-vac { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.reg-card { flex: none; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line);
  display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.reg-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reg-card svg { width: 24px; height: 24px; }
.reg-actions { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.reg-approve { padding: 12px; border-radius: var(--radius-sm); background: var(--accent-soft); }
.reg-paid { max-width: 280px; }
.reg-more { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.reg-more summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.reg-row .reg-avatars { display: flex; flex: none; }
.reg-row .reg-avatars > * + * { margin-left: -10px; }
@media (max-width: 480px) { .reg-photo { width: 92px; height: 92px; } }
/* Familia: ficha en revisión */
.review-box { display: grid; gap: 8px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--info-soft); color: var(--ink); }
.review-box.fix { background: var(--signal-soft); }
.review-box .row { gap: 6px; }
.reg-plan { display: grid; gap: 12px; padding: 4px 0 4px 28px; }
.reg-plan .check span .muted { display: block; font-size: 13px; font-weight: 500; }
.reg-plan label.check { align-items: flex-start; }
.reg-plan label.check input { margin-top: 3px; }
