:root {
  --bg:      #ffffff;
  --bg2:     #ffffff;
  --bg3:     #e5e7eb;
  --bg-odd:  #fafafa;
  --fg:      #111827;
  --fg2:     #6b7280;
  --fg3:     #9ca3af;
  --white:   #ffffff;
  --accent:  #111827;
  --accent2: #000000;
  --red:     #dc2626;
  --green:   #16a34a;
  --green2:  #15803d;
  --yellow:  #d97706;
  --side-bg: #0f172a;
  --side-w:  232px;
  --radius:  10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--fg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h2 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 18px; }
h3 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }

.ico { width: 17px; height: 17px; flex: none; }

/* ---------- Estructura: menu lateral + contenido ---------- */
.app-shell { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.sidebar {
  width: var(--side-w); flex: none;
  background: var(--side-bg); color: #cbd5e1;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
  padding: 14px 10px 10px;
}
body.sidebar-collapsed .sidebar { display: none; }

.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 18px; }
.side-logo { height: 34px; width: auto; background: #fff; border-radius: 7px; padding: 3px 8px; display: block; }
.side-brand-txt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.side-brand-title { color: #fff; font-weight: 700; font-size: 13.5px; }
.side-brand-sub { color: #94a3b8; font-size: 11px; }

.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-label { font-size: 11px; font-weight: 500; color: #64748b; padding: 4px 10px 6px; }

.side-link {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border-radius: 8px;
  color: #cbd5e1; text-decoration: none; font-size: 13.5px; font-weight: 500;
  background: none; border: none; font-family: inherit; text-align: left; cursor: pointer;
}
.side-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-link.active { background: rgba(255,255,255,.13); color: #fff; }
.side-link span { min-width: 0; }
.side-chev { margin-left: auto; display: flex; opacity: .7; transition: transform .15s; }
.side-chev .ico { width: 15px; height: 15px; }
.side-group.open > .side-group-btn .side-chev { transform: rotate(180deg); }
.side-group.active > .side-group-btn { color: #fff; }

.side-sub { display: none; flex-direction: column; gap: 1px; padding: 2px 0 6px 20px; margin-left: 18px; border-left: 1px solid rgba(255,255,255,.12); }
.side-group.open > .side-sub { display: flex; }
.side-sub a {
  padding: 7px 10px; border-radius: 7px; color: #94a3b8; text-decoration: none; font-size: 13px; font-weight: 500;
}
.side-sub a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-sub a.active { background: rgba(255,255,255,.13); color: #fff; }
.side-sub a.side-sub2 { padding-left: 20px; }
.side-sublabel { font-size: 11px; color: #64748b; padding: 8px 10px 3px; font-weight: 500; }
.side-disabled { padding: 7px 10px; font-size: 12.5px; color: #64748b; }
.side-disabled small { font-size: 11px; }

.side-avisos-n { margin-left: auto; background: #dc2626; color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 8px; min-width: 20px; text-align: center; }
.side-avisos-n[hidden] { display: none; }
.side-avisos.hay { background: rgba(220,38,38,.22); color: #fff; animation: avisoParpadeo 1.3s ease-in-out infinite; }
@keyframes avisoParpadeo { 0%, 100% { box-shadow: inset 0 0 0 0 rgba(248,113,113,0); } 50% { box-shadow: inset 0 0 0 2px rgba(248,113,113,.9); background: rgba(220,38,38,.45); } }
@media (prefers-reduced-motion: reduce) { .side-avisos.hay { animation: none; box-shadow: inset 0 0 0 2px rgba(248,113,113,.9); } }
.side-alertas.hay { background: rgba(217,119,6,.22); animation: none; }
.side-alertas .side-avisos-n { background: #d97706; }
.side-alertas.active { background: rgba(255,255,255,.13); }
.side-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 10px; padding-top: 8px; display: flex; flex-direction: column; gap: 2px; }

.side-overlay { display: none; }

.topbar {
  height: 48px; flex: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; border-bottom: 1px solid var(--bg3); background: var(--bg);
}
.topbar-toggle {
  background: none; border: none; cursor: pointer; color: var(--fg);
  padding: 6px; border-radius: 6px; display: flex; line-height: 1;
}
.topbar-toggle:hover { background: #f4f4f5; }
.topbar-toggle .ico { width: 18px; height: 18px; }
.topbar-empresa { margin: 0 auto 0 14px; }
.topbar-empresa select { padding: 6px 28px 6px 10px; font-size: 13px; font-weight: 500; border-radius: 8px; max-width: 280px; }
.topbar-user { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--fg2); }
.topbar-user strong { color: var(--fg); font-weight: 600; }
.topbar-rol {
  font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  background: #f4f4f5; color: #52525b; padding: 3px 9px; border-radius: 999px; border: 1px solid #e4e4e7;
}

.container { padding: 26px 30px 40px; max-width: none; width: 100%; margin: 0 auto; position: relative; }

@media (max-width: 899px) {
  .sidebar {
    position: fixed; left: -260px; top: 0; z-index: 400; transition: left .2s;
    width: 250px; box-shadow: 0 0 30px rgba(0,0,0,.35);
  }
  body.sidebar-open .sidebar { left: 0; }
  body.sidebar-open .side-overlay { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 390; }
  body.sidebar-collapsed .sidebar { display: flex; }
  .container { padding: 18px 14px 32px; }
  .topbar { padding: 0 12px; }
  .topbar-hola { display: none; }
}

/* ---------- Login ---------- */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 80px); }
.login-box {
  background: var(--bg2); padding: 34px 36px; border-radius: 14px; width: 380px; max-width: 100%;
  border: 1px solid var(--bg3); box-shadow: 0 4px 24px rgba(0,0,0,.06);
}
.login-box h1 { color: var(--fg); font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 6px; }
.login-logo { height: 44px; width: auto; display: block; margin-bottom: 18px; }
.login-box label { display: block; font-size: 13px; font-weight: 500; color: var(--fg); margin: 14px 0 6px; }
.login-box input { width: 100%; padding: 10px 12px; font-size: 14px; }
.form-error { background: #fef2f2; color: var(--red); border: 1px solid #fecaca; padding: 10px 12px; border-radius: 8px; font-size: 13px; margin: 10px 0 4px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  box-sizing: border-box; vertical-align: middle;
  padding: 9px 16px; border: 1px solid transparent; border-radius: 8px;
  font-family: inherit; font-weight: 600; font-size: 13.5px; line-height: 1;
  cursor: pointer; color: var(--white);
  background: #111827; text-decoration: none;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: #27272a; }
.btn-green { background: #111827; }
.btn-green:hover { background: #27272a; }
.btn-red { background: var(--red); }
.btn-red:hover { background: #b91c1c; }
.btn-gray { background: #fff; color: var(--fg); border-color: var(--bg3); }
.btn-gray:hover { background: #f4f4f5; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 7px; }

/* ---------- Tablas ---------- */
.table-wrap { width: 100%; overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--bg3); background: var(--bg2); }
.table-wrap table { width: 100%; min-width: 640px; border-collapse: collapse; background: var(--bg2); }
.table-wrap th, .table-wrap td { padding: 11px 14px; text-align: left; border-bottom: 1px solid #f1f1f3; font-size: 13px; white-space: nowrap; }
.table-wrap th { background: var(--bg2); font-weight: 500; font-size: 12.5px; color: var(--fg2); border-bottom: 1px solid var(--bg3); }
.table-wrap tbody tr:hover td { background: #fafafa; }
.table-wrap tr:last-child td { border-bottom: none; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.badge-super { background: #ede9fe; color: #6d28d9; }
.badge-admin { background: #f4f4f5; color: #3f3f46; border: 1px solid #e4e4e7; }
.badge-inactivo { background: #fee2e2; color: var(--red); }
.badge-activo { background: #dcfce7; color: var(--green2); }

/* ---------- Tarjetas y formularios ---------- */
.card { background: var(--bg2); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; border: 1px solid var(--bg3); box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.card h3 { margin-top: 0; }

input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not([type=color]),
select, textarea {
  font-family: inherit; color: var(--fg); background: #fff;
  border: 1px solid var(--bg3); border-radius: 8px;
}
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not([type=color]):focus,
select:focus, textarea:focus {
  outline: none; border-color: #111827; box-shadow: 0 0 0 3px rgba(17,24,39,.08);
}
input[type=checkbox], input[type=radio] { accent-color: #111827; }

.form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.form-row .field { display: flex; flex-direction: column; gap: 5px; }
.form-row label { font-size: 12.5px; font-weight: 500; color: var(--fg); }
.form-row input, .form-row select, .form-row textarea { padding: 8px 10px; font-size: 13.5px; }
.form-row textarea { resize: vertical; }

.campo-password { position: relative; display: flex; }
.campo-password input { flex: 1; padding-right: 34px !important; }
.btn-ver-password {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 15px; padding: 4px; line-height: 1;
}

/* ---------- Empresas (entidades legales) ---------- */
.empresa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 56px 28px; }
.empresa-card {
  position: relative; background: var(--bg2); border: 1px solid var(--bg3); border-radius: var(--radius);
  padding: 46px 16px 0; text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.empresa-icono {
  position: absolute; top: -34px; left: 50%; transform: translateX(-50%);
  width: 68px; height: 68px; border-radius: 50%; background: #fff; border: 1px solid var(--bg3);
  display: flex; align-items: center; justify-content: center; color: #111827;
}
.empresa-icono .ico { width: 28px; height: 28px; }
.empresa-ajustes {
  position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--bg3); display: flex; align-items: center; justify-content: center; color: var(--fg2);
}
.empresa-ajustes:hover { background: #f4f4f5; color: var(--fg); }
.empresa-nombre { font-size: 17px; font-weight: 600; letter-spacing: -.01em; margin-bottom: 4px; }
.empresa-cuenta { font-size: 13px; color: var(--fg2); padding-bottom: 20px; }
.empresa-ver {
  display: block; border-top: 1px solid var(--bg3); padding: 13px 0; font-size: 13px; font-weight: 500;
  color: var(--fg); text-decoration: underline;
}

.seccion-config { display: grid; grid-template-columns: minmax(200px, 1fr) 2fr; gap: 32px; margin-bottom: 44px; align-items: start; }
.seccion-config-txt h3 { margin: 0 0 6px; }
.seccion-config-txt p { margin: 0; color: var(--fg2); font-size: 13.5px; line-height: 1.5; }
.panel-gris { background: #f4f4f5; border-radius: 12px; padding: 22px; min-width: 0; }
.panel-gris label { display: block; font-size: 13px; font-weight: 500; margin: 0 0 6px; }
.panel-gris input:not([type=checkbox]), .panel-gris select { width: 100%; padding: 10px 12px; margin-bottom: 14px; font-size: 14px; }
.lista-asignar { max-height: 300px; overflow-y: auto; background: #fff; border: 1px solid var(--bg3); border-radius: 8px; }
.fila-asignar { display: flex !important; align-items: center; gap: 10px; padding: 9px 12px; margin: 0 !important; border-bottom: 1px solid #f1f1f3; cursor: pointer; font-weight: 400 !important; }
.fila-asignar:last-child { border-bottom: none; }
.fila-asignar:hover { background: #fafafa; }
.fila-asignar small { margin-left: auto; color: var(--fg3); font-size: 12px; }
.pestanas { display: flex; gap: 4px; border-bottom: 1px solid var(--bg3); margin-bottom: 30px; }
.pestanas a {
  padding: 8px 14px; margin-bottom: -1px; font-size: 13px; font-weight: 500; color: var(--fg2);
  text-decoration: none; border-radius: 8px 8px 0 0; border-bottom: 2px solid transparent;
}
.pestanas a:hover { color: var(--fg); }
.pestanas a.activa { color: var(--fg); background: #f4f4f5; border-bottom-color: var(--fg); }
.grupo-empleados { display: grid; grid-template-columns: 1fr 1.25fr; gap: 26px; align-items: start; }
.grupo-tarjeta { background: #4b4a5e; color: #fff; border-radius: 10px; padding: 26px 28px; }
.miembro-fila { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-bottom: 1px solid #f1f1f3; font-size: 13.5px; }
.miembro-fila:last-child { border-bottom: none; }
@media (max-width: 899px) { .seccion-config, .grupo-empleados { grid-template-columns: 1fr; gap: 14px; } }

/* ---------- Ventanas modales ---------- */
dialog.modal {
  border: none; border-radius: 14px; padding: 0;
  width: 460px; max-width: 92vw;
  max-height: 88vh;
  overflow: hidden;
  background: #fff; color: var(--fg);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
dialog.modal[open] { display: flex; flex-direction: column; }
dialog.modal::backdrop { background: rgba(15, 23, 42, .45); }
dialog.modal .modal-header {
  background: #fff; color: var(--fg); border-bottom: 1px solid var(--bg3);
  padding: 16px 24px; font-weight: 600; font-size: 16px; letter-spacing: -.01em;
  flex: none;
}
dialog.modal .modal-body {
  padding: 22px 24px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px;
  overflow-y: auto;
}
dialog.modal .modal-body label { display: block; color: var(--fg); font-weight: 500; font-size: 13px; margin-bottom: 5px; }
dialog.modal .modal-body input,
dialog.modal .modal-body select,
dialog.modal .modal-body textarea {
  width: 100%; padding: 9px 10px; font-size: 14px; margin-bottom: 14px; resize: vertical;
}
dialog.modal .modal-body .campo-ancho { grid-column: 1 / -1; }
dialog.modal.modal-ancho { width: 900px; }
dialog.modal.modal-ancho .modal-body { grid-template-columns: 1fr 1fr 1fr; }
dialog.modal .modal-actions {
  grid-column: 1 / -1;
  display: flex; gap: 10px; margin-top: 6px;
}

.toast-mensaje {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: #111827; color: #fff; font-size: 14px; font-weight: 600;
  padding: 12px 26px; border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.25);
  z-index: 9999; text-align: center; min-width: 240px; max-width: 90vw;
}
.toast-mensaje.toast-error { background: var(--red); }

/* ---------- Impresion (incidencias) ---------- */
.print-only { display: none; }
.incidencia-print-bloque { margin-bottom: 14px; }
.incidencia-print-cab { font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.incidencia-print-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--fg2); font-weight: 700; margin: 10px 0 3px;
}
.incidencia-print-bloque p { margin: 0; font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; }
.incidencia-print-sep { border: none; border-top: 1px solid var(--bg3); margin: 18px 0; }

/* ---------- Calendario de cuadrantes ---------- */
.calendario-pagina { display: flex; flex-direction: column; min-height: calc(100vh - 230px); }
.calendario-cabecera, .calendario-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendario-cabecera {
  background: #fafafa; border: 1px solid var(--bg3); border-bottom: none; border-radius: var(--radius) var(--radius) 0 0;
}
.calendario-cabecera div { text-align: center; padding: 9px 4px; font-size: 12.5px; font-weight: 500; color: var(--fg2); }
.calendario-grid {
  flex: 1; grid-auto-rows: 1fr;
  background: var(--bg2); border: 1px solid var(--bg3); border-radius: 0 0 var(--radius) var(--radius); overflow: hidden;
}
.celda-dia { border-right: 1px solid var(--bg3); border-bottom: 1px solid var(--bg3); min-height: 92px; }
.calendario-grid .celda-dia:nth-child(7n) { border-right: none; }
.celda-dia.fuera-mes { background: var(--bg-odd); }
.celda-dia.fuera-mes .celda-dia-num { color: var(--fg3); }
.celda-dia.es-hoy { background: #fef9c3; }
.celda-dia-link {
  display: flex; flex-direction: column; height: 100%; padding: 8px;
  color: inherit; text-decoration: none; overflow: hidden;
}
.celda-dia-link:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.celda-dia-num { font-size: 14px; font-weight: 700; margin-bottom: 6px; flex: none; }
.celda-dia-turnos { display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.turno-chip {
  color: #fff; font-size: 11.5px; font-weight: 600; padding: 3px 7px; border-radius: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none;
}
.turno-chip-mas { font-size: 11px; color: var(--fg2); font-weight: 700; padding: 2px 7px; flex: none; }

@media print {
  @page { size: landscape; margin: 10mm; }
  .no-print { display: none !important; }
  .print-only { display: block; }
  body { background: #fff; font-size: 11px; }
  .app-shell { display: block; }
  .container { padding: 0; }
  .card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; padding: 10px 14px; }
  .table-wrap { overflow: visible; border: none; }
  .table-wrap table { min-width: 0; width: 100%; }
  .table-wrap th, .table-wrap td { padding: 4px 6px; font-size: 10px; white-space: normal; }
  h2 { font-size: 18px; margin: 4px 0; }
  h3 { font-size: 13px; margin: 6px 0; }
  .turno-chip, .celda-dia.es-hoy {
    -webkit-print-color-adjust: exact; print-color-adjust: exact; color-adjust: exact;
  }
  .calendario-pagina { min-height: 0; }
  .calendario-cabecera div { padding: 3px 2px; font-size: 9.5px; }
  .calendario-grid { flex: none; height: 148mm; }
  .celda-dia { min-height: 0; }
  .celda-dia-link { padding: 3px; }
  .celda-dia-num { font-size: 9.5px; margin-bottom: 1px; }
  .celda-dia-turnos { gap: 1px; }
  .turno-chip { font-size: 7px; padding: 1px 3px; border-radius: 2px; }
  .turno-chip-mas { font-size: 7px; padding: 0 3px; }
}

/* =====================================================================
   Especifico de Control de Piscinas
   ===================================================================== */

/* Marca del menu lateral (icono de olas en la caja blanca) */
.side-logo-ico { display: flex; align-items: center; justify-content: center; width: 42px; color: #0f172a; }
.side-logo-ico .ico { width: 22px; height: 22px; }

/* Barra superior: reloj, selector de idioma y usuario */
.topbar-reloj { margin-left: 14px; font-size: 12px; color: var(--fg2); font-variant-numeric: tabular-nums; }
.topbar-derecha { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.idioma-selector { display: flex; border: 1px solid var(--bg3); border-radius: 8px; overflow: hidden; }
.idioma-selector form { margin: 0; display: flex; }
.btn-idioma {
  background: #fff; border: none; border-right: 1px solid var(--bg3); color: var(--fg2);
  font-family: inherit; font-size: 11.5px; font-weight: 600; padding: 5px 10px; cursor: pointer;
}
.idioma-selector form:last-child .btn-idioma { border-right: none; }
.btn-idioma:hover { background: #f4f4f5; color: var(--fg); }
.btn-idioma.activo { background: #111827; color: #fff; cursor: default; }
.topbar-user { text-align: right; }
@media (max-width: 899px) { .topbar-reloj { display: none; } .topbar-derecha { gap: 10px; } }

/* Ayuda flotante */
.btn-ayuda-flotante {
  position: fixed; bottom: 22px; right: 22px; z-index: 300;
  background: var(--bg2); color: var(--fg); border: 1px solid var(--bg3); border-radius: 999px;
  padding: 8px 16px; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.1);
}
.btn-ayuda-flotante:hover { background: #111827; color: #fff; border-color: #111827; }
dialog.modal .modal-body.modal-body-ayuda { display: block; line-height: 1.6; color: var(--fg2); }
.modal-body-ayuda h4 { margin: 16px 0 6px; color: var(--fg); font-size: 14px; border-left: 3px solid #111827; padding-left: 8px; }
.modal-body-ayuda h4:first-child { margin-top: 0; }
.modal-body-ayuda ul { margin: 4px 0 12px; padding-left: 20px; }
.modal-body-ayuda li { margin-bottom: 4px; }
.modal-body-ayuda p { margin: 0 0 12px; }
.modal-body-ayuda a { color: var(--fg); }

/* Formularios en ventanas: los de dos columnas (las de una anchura normal) */
dialog.modal[open] { display: flex; flex-direction: column; }

.proximamente { text-align: center; padding: 60px 20px; color: var(--fg3); }
summary.btn { list-style: none; }
summary.btn::-webkit-details-marker { display: none; }
summary.btn::marker { content: ""; }

/* Panel Calendario/Agenda: una clase y no un style="" en linea, porque un display
   puesto en linea gana al "hidden" nativo con el que se alternan las pestanas. */
.panel-calendario-grid { display: flex; flex-direction: column; }

/* FullCalendar con la paleta de la aplicacion */
#fullcalendar-contenedor {
  --fc-border-color: var(--bg3); --fc-page-bg-color: #fff; --fc-neutral-bg-color: #fafafa;
  --fc-today-bg-color: #fef9c3; --fc-event-border-color: transparent;
  --fc-button-bg-color: #111827; --fc-button-border-color: #111827; --fc-button-text-color: #fff;
  --fc-button-hover-bg-color: #27272a; --fc-button-hover-border-color: #27272a;
  --fc-button-active-bg-color: #000; --fc-button-active-border-color: #000;
  font-size: 13px;
}
#fullcalendar-contenedor .fc-toolbar-title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
#fullcalendar-contenedor .fc-button { font-family: inherit; font-weight: 600; font-size: 13px; text-transform: capitalize; border-radius: 8px; }
#fullcalendar-contenedor .fc-button-group > .fc-button { border-radius: 0; }
#fullcalendar-contenedor .fc-button-group > .fc-button:first-child { border-radius: 8px 0 0 8px; }
#fullcalendar-contenedor .fc-button-group > .fc-button:last-child { border-radius: 0 8px 8px 0; }
#fullcalendar-contenedor .fc-col-header-cell-cushion { font-size: 12.5px; font-weight: 500; color: var(--fg2); padding: 8px 4px; }
#fullcalendar-contenedor .fc-daygrid-day-number { font-size: 13px; font-weight: 600; padding: 6px 8px; color: var(--fg); }
#fullcalendar-contenedor .fc-daygrid-day-frame { min-height: 90px; }
#fullcalendar-contenedor .fc-daygrid-day-events { min-height: 46px; }
#fullcalendar-contenedor .fc-event { font-size: 12.5px; font-weight: 600; padding: 3px 7px; border-radius: 5px; }
#fullcalendar-contenedor .fc-daygrid-event { margin-bottom: 3px; }
#fullcalendar-contenedor a { color: inherit; text-decoration: none; }

/* Mensajes: tarjetas de KPI del Dashboard */
.card > h3:first-child { margin-top: 0; }

/* Pantalla de entrada */
.login-marca { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.login-logo-ico { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: #0f172a; color: #fff; }
.login-logo-ico .ico { width: 22px; height: 22px; }
.login-marca-txt { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }

/* Enlaces y leyenda del calendario */
a { color: var(--fg); }
.leyenda-calendario { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; font-size: 12.5px; color: var(--fg2); margin: 0 0 14px; }
.leyenda-calendario i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.leyenda-calendario .leyenda-nota { color: var(--fg3); margin-left: auto; }

/* Movil */
@media (max-width: 899px) {
  .sidebar { box-shadow: none; }
  body.sidebar-open .sidebar { box-shadow: 0 0 30px rgba(0,0,0,.35); }
  .form-row .field { flex: 1 1 100% !important; min-width: 0 !important; }
  .form-row .field input, .form-row .field select, .form-row .field textarea { width: 100%; }
  dialog.modal .modal-body, dialog.modal.modal-ancho .modal-body { grid-template-columns: 1fr; }
  dialog.modal .modal-body .campo-ancho { grid-column: 1; }
  .btn-ayuda-flotante { bottom: 14px; right: 14px; }
}

/* Logo de Sanitize en el menu lateral y en la pantalla de entrada */
.side-brand { padding: 4px 2px 18px; }
.side-logo-caja { display: block; width: 100%; background: #fff; border-radius: 10px; padding: 8px 10px; }
.side-logo-caja img { display: block; width: 100%; height: auto; }
.login-box .login-logo { display: block; width: 100%; max-width: 300px; height: auto; margin: 0 auto 22px; }

/* =====================================================================
   Dashboard: dos pantallas paginadas, cada una entera en la ventana (sin barra de desplazamiento)
   ===================================================================== */
.container.container-dash { padding: 12px 20px 14px; }
.dash { height: calc(100vh - 48px - 26px); min-height: 620px; display: flex; flex-direction: column; gap: 10px; }
.dash-barra-paginas { display: flex; justify-content: space-between; align-items: center; flex: none; }
.dash-barra-paginas h2 { margin: 0; font-size: 20px; }
.dash-pager { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--bg3); border-radius: 10px; padding: 3px; background: #fff; }
.dash-pager-tab { border: none; background: none; font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--fg2); padding: 6px 14px; border-radius: 7px; cursor: pointer; }
.dash-pager-tab:hover { background: #f4f4f5; color: var(--fg); }
.dash-pager-tab.activa { background: #111827; color: #fff; }
.dash-pager-flecha { border: none; background: none; color: var(--fg2); padding: 5px; border-radius: 7px; cursor: pointer; display: flex; }
.dash-pager-flecha:hover { background: #f4f4f5; color: var(--fg); }
.dash-pager-flecha .ico { width: 16px; height: 16px; }

.dash-pagina { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.dash-pagina[hidden] { display: none; }
.dash-hero {
  position: relative; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex: none;
  padding: 18px 26px; border-radius: 12px; overflow: hidden; color: #fff;
  background-size: cover; background-position: center 55%;
}
.dash-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,28,60,.85) 0%, rgba(8,28,60,.6) 50%, rgba(8,28,60,.1) 100%); }
.dash-hero > * { position: relative; }
.dash-eyebrow { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; opacity: .9; margin-bottom: 8px; }
.dash-eyebrow::before { content: ""; display: inline-block; width: 20px; height: 1px; background: #fff; vertical-align: middle; margin-right: 8px; }
.dash-hero h1 { margin: 0 0 4px; font-size: 26px; line-height: 1.15; letter-spacing: -.02em; font-weight: 700; }
.dash-hero p { margin: 0; font-size: 13.5px; opacity: .92; }
.dash-tiempo { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.93); color: #0f172a; border-radius: 10px; padding: 9px 18px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.dash-tiempo[hidden] { display: none; }
.dash-tiempo-icono { color: #f59e0b; }
.dash-tiempo-icono .ico { width: 34px; height: 34px; }
.dash-tiempo-temp { font-size: 26px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.dash-tiempo-lugar { font-weight: 600; font-size: 12px; margin-top: 2px; }
.dash-tiempo-desc { font-size: 11px; color: #64748b; }

.dash-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; flex: none; }
.dash-kpi {
  display: flex; gap: 12px; align-items: center; background: var(--bg2); border: 1px solid var(--bg3); border-radius: 12px;
  padding: 11px 14px; text-decoration: none; color: inherit; box-shadow: 0 1px 2px rgba(0,0,0,.03); min-width: 0;
}
.dash-kpi:hover { box-shadow: 0 6px 18px rgba(15,23,42,.08); }
.dash-kpi-ico { flex: none; width: 42px; height: 42px; border-radius: 10px; background: #e8f1fc; color: #0b6bcb; display: flex; align-items: center; justify-content: center; }
.dash-kpi-ico .ico { width: 22px; height: 22px; }
.dash-kpi-cuerpo { display: flex; flex-direction: column; min-width: 0; }
.dash-kpi-etq { font-size: 12px; color: var(--fg2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-kpi-valor { font-size: 23px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; white-space: nowrap; overflow: hidden; }
.dash-kpi-sub { font-size: 11px; color: var(--fg2); display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.punto { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: none; }
.punto-verde { background: #16a34a; } .punto-azul { background: #0b6bcb; } .punto-amarillo { background: #f59e0b; }

.dash-fila { display: grid; gap: 12px; min-height: 0; }
.dash-fila-resumen { grid-template-columns: repeat(4, minmax(0, 1fr)); flex: 1; }
.dash-fila-listas { grid-template-columns: repeat(3, minmax(0, 1fr)); flex: 1; }
.dash-card { background: var(--bg2); border: 1px solid var(--bg3); border-radius: 12px; padding: 14px 16px; box-shadow: 0 1px 2px rgba(0,0,0,.03); min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.dash-card h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.dash-card-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 10px; flex: none; }
.dash-cab-txt { min-width: 0; }
.dash-cab-txt h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-card-sub { font-size: 12px; color: var(--fg2); margin-top: 1px; }
.dash-card-pie { font-size: 11px; color: var(--fg3); margin-top: auto; padding-top: 6px; flex: none; }
.dash-vacio { align-items: center; justify-content: center; color: var(--fg3); text-align: center; }
.dash-doble { grid-column: span 2; }
.dash-vacio-txt { color: var(--fg3); font-size: 12.5px; margin: 6px 0; }
.dash-con-grafico h3 { flex: none; }
.dash-grafico { position: relative; flex: 1; min-height: 0; margin-top: 8px; }
.dash-enlace { font-size: 11.5px; font-weight: 600; color: #0b6bcb; text-decoration: none; display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.dash-enlace .ico { width: 13px; height: 13px; }

.dash-estado { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 3px 9px; font-size: 11px; font-weight: 600; white-space: nowrap; flex: none; }
.dash-estado .ico { width: 12px; height: 12px; }
.dash-estado-ok { background: #dcfce7; color: #15803d; }
.dash-estado-aviso { background: #fef3c7; color: #b45309; }
.dash-estado-neutro { background: #f1f5f9; color: #64748b; }
.dash-piscina-cuerpo { display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0; }
.dash-piscina-foto { width: 100%; height: 34%; min-height: 90px; border-radius: 8px; object-fit: cover; flex: none; }
.dash-datos { margin: 0; flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; }
.dash-datos > div { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid #f1f1f3; font-size: 12.5px; }
.dash-datos > div:last-child { border-bottom: none; }
.dash-datos dt { display: flex; align-items: center; gap: 6px; color: var(--fg2); min-width: 0; }
.dash-datos dt .ico { width: 14px; height: 14px; color: #0b6bcb; flex: none; }
.dash-datos dd { margin: 0; font-weight: 600; white-space: nowrap; }
.dash-datos .fuera dd { color: #dc2626; }

.dash-lista { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.dash-lista li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f1f1f3; }
.dash-lista li:last-child { border-bottom: none; }
.dash-lista-ico { flex: none; width: 30px; height: 30px; border-radius: 8px; background: #e8f1fc; color: #0b6bcb; display: flex; align-items: center; justify-content: center; }
.dash-lista-ico .ico { width: 16px; height: 16px; }
.dash-lista-ico.ok { background: #dcfce7; color: #15803d; }
.dash-lista-ico.aviso { background: #fef3c7; color: #b45309; }
.dash-lista-ico.rojo { background: #fee2e2; color: #dc2626; }
.dash-lista-txt { flex: 1; min-width: 0; font-size: 12.5px; display: flex; flex-direction: column; }
.dash-lista-txt strong, .dash-lista-txt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-lista-txt small, .dash-lista-fecha small { display: block; color: var(--fg3); font-size: 11.5px; }
.dash-lista-fecha { flex: none; font-size: 12px; color: var(--fg2); text-align: right; font-variant-numeric: tabular-nums; }
.dash-equipos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; flex: none; }
.dash-equipo { border-radius: 10px; padding: 12px 8px; text-align: center; display: flex; flex-direction: column; }
.dash-equipo strong { font-size: 28px; line-height: 1.1; }
.dash-equipo span { font-size: 12px; }
.dash-equipo.ok { background: #dcfce7; color: #15803d; } .dash-equipo.aviso { background: #fef3c7; color: #b45309; } .dash-equipo.rojo { background: #fee2e2; color: #dc2626; }
.dash-barra { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: #f1f5f9; margin-bottom: 8px; flex: none; }
.dash-barra .ok { background: #16a34a; } .dash-barra .aviso { background: #f59e0b; } .dash-barra .rojo { background: #dc2626; }

/* Pantallas estrechas: sin foto en las tarjetas; en movil y tablet las pantallas se apilan y se puede desplazar */
@media (max-width: 1250px) { .dash-piscina-foto { display: none; } .dash-fila-resumen { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 899px) {
  .container.container-dash { padding: 12px; }
  .dash { height: auto; }
  .dash-kpis, .dash-fila-resumen, .dash-fila-listas { grid-template-columns: 1fr; }
  .dash-con-grafico { min-height: 260px; }
  .dash-hero { flex-direction: column; align-items: flex-start; }
  .dash-piscina-foto { display: block; height: 140px; }
}

/* Puestos de trabajo: los textos largos se parten en varias lineas para que la tabla quepa */
.table-wrap td.celda-texto { white-space: normal; min-width: 200px; max-width: 290px; line-height: 1.4; }
.table-wrap td.celda-fuerte { font-weight: 600; }
.tabla-puestos { min-width: 0 !important; }

/* Pantallas en construccion */
.en-construccion { max-width: 640px; text-align: center; padding: 40px 30px; margin: 30px auto; }
.pastilla-construccion { display: inline-block; background: #fef3c7; color: #b45309; border-radius: 999px; padding: 4px 14px; font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.en-construccion-txt { margin: 16px 0 6px; font-size: 15px; font-weight: 600; }
.en-construccion-desc { margin: 0; color: var(--fg2); font-size: 13.5px; line-height: 1.55; }

/* Albaranes de producto */
.zona-albaran { text-align: center; padding: 26px 20px; border-style: dashed; border-width: 2px; }
.zona-albaran-txt { color: var(--fg2); margin: 4px 0 16px; }
.zona-albaran-botones { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; align-items: center; }
.zona-albaran-estado { color: #b45309; font-weight: 600; font-size: 13px; }
.zona-albaran-nota { color: var(--fg3); font-size: 12px; margin: 12px 0 0; }
.enlace-boton { background: none; border: none; color: var(--fg2); text-decoration: underline; font-family: inherit; font-size: 12.5px; cursor: pointer; padding: 0; }
.revision-grid { display: grid; grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.4fr); gap: 16px; align-items: start; }
.revision-vista { position: sticky; top: 12px; }
.revision-img { width: 100%; max-height: 78vh; object-fit: contain; border-radius: 8px; border: 1px solid var(--bg3); display: block; }
.revision-pdf { width: 100%; height: 78vh; border: 1px solid var(--bg3); border-radius: 8px; }
.aviso-ia { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-bottom: 12px; }
.tabla-fluida { min-width: 0 !important; }
.table-wrap .tabla-fluida th, .table-wrap .tabla-fluida td { padding: 10px 9px; white-space: normal; }
.table-wrap .tabla-fluida td.nowrap { white-space: nowrap; }
.linea-doc { display: grid; grid-template-columns: 105px minmax(0, 1fr) 62px 78px 78px 34px; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--bg3); align-items: center; }
.linea-doc:last-child { border-bottom: none; }
.linea-doc input, .linea-doc select { margin: 0; width: 100%; min-width: 0; box-sizing: border-box; padding: 8px 10px; font-size: 13.5px; }
.linea-doc .ld-desc { grid-column: 1 / -1; }
.linea-doc .ld-quitar { padding: 6px 0; }
@media (max-width: 899px) { .revision-grid { grid-template-columns: 1fr; } .revision-vista { position: static; } }
.revision-grid > * { min-width: 0; }
@media (max-width: 599px) {
  .linea-doc { grid-template-columns: 1fr 1fr 1fr 34px; }
  .linea-doc .ld-cod, .linea-doc .ld-prod { grid-column: 1 / -1; }
  .revision-datos .form-row .field { width: 100% !important; }
}
/* Formularios largos en paginas */
.fp-barra { margin-bottom: 14px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.fp-acciones { display: flex; gap: 8px; flex-wrap: wrap; }
.resumen-linea { display: flex; gap: 22px; flex-wrap: wrap; margin: -6px 0 14px; font-size: 13px; color: var(--fg2); }
.resumen-linea strong { color: var(--fg); font-size: 14px; }
.fp-barra .dash-pager { display: inline-flex; }
.fp-tab { border: none; background: none; font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--fg2); padding: 6px 14px; border-radius: 7px; cursor: pointer; }
.fp-tab:hover { background: #f4f4f5; color: var(--fg); }
.fp-tab.activa { background: #111827; color: #fff; }
.fp-flecha { border: none; background: none; color: var(--fg2); padding: 5px; border-radius: 7px; cursor: pointer; display: flex; }
.fp-flecha:hover { background: #f4f4f5; color: var(--fg); }
.fp-flecha .ico { width: 16px; height: 16px; }
.form-pagina[hidden] { display: none; }
@media (max-width: 599px) { .fp-tab { padding: 6px 8px; font-size: 12px; } }


/* ---------- Menu desplegable "Mas" de las filas de las tablas ---------- */
.menu-acc { display: inline-block; vertical-align: middle; }
.menu-acc > summary { list-style: none; cursor: pointer; user-select: none; }
.menu-acc > summary::-webkit-details-marker { display: none; }
.menu-acc-panel {
  position: fixed; z-index: 600; min-width: 180px; padding: 5px;
  background: #fff; border: 1px solid var(--bg3); border-radius: 10px; box-shadow: 0 10px 28px rgba(15, 23, 42, .18);
  display: flex; flex-direction: column; gap: 1px; white-space: normal;
}
.menu-acc-panel a, .menu-acc-panel button {
  display: block; width: 100%; text-align: left; padding: 8px 12px; border: none; background: none; border-radius: 6px;
  font: inherit; font-size: 13px; font-weight: 500; color: var(--fg); text-decoration: none; cursor: pointer;
}
.menu-acc-panel a:hover, .menu-acc-panel button:hover { background: #f4f4f5; }
.menu-acc-panel form { margin: 0; }
.menu-acc-panel .menu-acc-peligro { color: var(--red); }
.menu-acc-panel .menu-acc-peligro:hover { background: #fef2f2; }

/* Clientes: segun el ancho de pantalla se ocultan columnas poco usadas para que la tabla entre sin desplazar
   (siguen en Modificar y en las exportaciones). 1=Indice 5=Email 6=N piscinas 7=Tamano 13=Inicio contrato 14=Productos */
@media (max-width: 1700px) {
  .tabla-clientes th:nth-child(1), .tabla-clientes td:nth-child(1):not([colspan]),
  .tabla-clientes th:nth-child(7), .tabla-clientes td:nth-child(7):not([colspan]),
  .tabla-clientes th:nth-child(14), .tabla-clientes td:nth-child(14):not([colspan]) { display: none; }
}
@media (max-width: 1560px) {
  .tabla-clientes th:nth-child(5), .tabla-clientes td:nth-child(5):not([colspan]) { display: none; }
}
@media (max-width: 1320px) {
  .tabla-clientes th:nth-child(6), .tabla-clientes td:nth-child(6):not([colspan]),
  .tabla-clientes th:nth-child(13), .tabla-clientes td:nth-child(13):not([colspan]) { display: none; }
}


/* ---------- Formularios del movil (QR: mantenimiento y control del agua) ---------- */
.qr-acciones { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.qr-acciones .btn { font-size: 16px; padding: 14px 22px; display: inline-block; }
.mv-volver { display: inline-block; font-size: 14px; color: var(--fg2); text-decoration: none; margin-bottom: 2px; }
.mv-ficha { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; background: var(--bg2); border: 1px solid var(--bg3); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.mv-ficha span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--fg3); }
.mv-ficha strong { display: block; font-size: 15px; }
.mv-ficha em { display: block; font-size: 12px; color: var(--fg2); font-style: normal; }
.mv-ultima { font-size: 12.5px; color: var(--fg2); margin: 0 0 10px; }
.mv-form { display: flex; flex-direction: column; gap: 12px; padding-bottom: 86px; }
.mv-bloque { background: var(--bg2); border: 1px solid var(--bg3); border-radius: 12px; padding: 14px; }
.mv-bloque h3 { margin: 0 0 10px; font-size: 15px; }
.mv-bloque label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.mv-bloque input[type=number], .mv-bloque input[type=date], .mv-bloque input[type=time], .mv-bloque select, .mv-bloque textarea, .mv-select {
  width: 100%; font-size: 18px; padding: 12px 12px; min-height: 48px; border: 1px solid var(--bg3); border-radius: 10px; background: #fff; color: var(--fg); box-sizing: border-box; }
.mv-bloque textarea { font-size: 16px; min-height: 80px; }
.mv-dos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mv-lectura { margin-bottom: 12px; }
.mv-lectura:last-child { margin-bottom: 0; }
.mv-ideal { font-weight: 400; font-size: 12px; color: var(--fg3); }
.mv-lectura-fila { display: flex; align-items: center; gap: 10px; }
.mv-lectura-fila input { flex: 1; min-width: 0; font-weight: 600; }
.mv-estado { min-width: 92px; font-size: 13px; font-weight: 700; text-align: right; }
.mv-lectura.ok input { border-color: #16a34a; background: #f0fdf4; } .mv-lectura.ok .mv-estado { color: #166534; }
.mv-lectura.bajo input { border-color: #d97706; background: #fffbeb; } .mv-lectura.bajo .mv-estado { color: #b45309; }
.mv-lectura.alto input { border-color: #dc2626; background: #fef2f2; } .mv-lectura.alto .mv-estado { color: #b91c1c; }
.mv-mas > summary { cursor: pointer; font-weight: 700; font-size: 15px; padding: 4px 0; }
.mv-mas[open] > summary { margin-bottom: 12px; }
.mv-chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mv-chip { margin: 0 !important; }
.mv-chip input { position: absolute; opacity: 0; pointer-events: none; }
.mv-chip span { display: block; text-align: center; padding: 14px 8px; border: 2px solid var(--bg3); border-radius: 12px; font-size: 16px; font-weight: 600; background: #fff; }
.mv-chip input:checked + span { border-color: #0891b2; background: #ecfeff; color: #155e75; }
.mv-foto-boton { display: block; text-align: center; padding: 16px 10px; border: 2px dashed #0891b2; border-radius: 12px; color: #0e7490; font-size: 16px; font-weight: 700; cursor: pointer; background: #ecfeff; }
.mv-foto-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.mv-miniaturas { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.mv-miniaturas img { width: 78px; height: 78px; object-fit: cover; border-radius: 8px; border: 1px solid var(--bg3); }
.mv-nota { margin: 8px 0 0; font-size: 12px; color: var(--fg3); }
.mv-check { display: flex !important; align-items: center; gap: 10px; font-weight: 400 !important; margin-top: 10px; }
.mv-check input { width: 22px; height: 22px; flex: none; }
.mv-producto { display: grid; grid-template-columns: minmax(0, 1fr) 96px 44px; gap: 8px; margin-bottom: 8px; }
.mv-aviso-stock { grid-column: 1 / -1; color: #991b1b; font-size: 13px; line-height: 1.35; margin: -2px 0 2px; }
.mv-quitar { border: 1px solid var(--bg3); background: #fff; border-radius: 10px; font-size: 22px; cursor: pointer; }
.mv-barra { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); border-top: 1px solid var(--bg3); z-index: 20; }
.mv-barra .btn { width: 100%; font-size: 18px; padding: 15px; }
@media (min-width: 900px) { .mv-barra { left: 240px; } .mv-form { max-width: 640px; } }
@media (max-width: 520px) { .mv-ficha { grid-template-columns: 1fr; } .mv-estado { min-width: 80px; } }

/* =====================================================================
   Dashboard en pestanas (Resumen · Actividad · Piscinas · Gestion), siguiendo la maqueta
   ===================================================================== */
.dash-titulo-pagina { display: flex; flex-direction: column; }
.dash-lema { font-size: 12.5px; color: var(--fg2); margin-top: 1px; }
.dash-fila-pisc { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, 1fr); flex: 1; }
.dash-piscina-h .dash-piscina-cuerpo { flex-direction: row; gap: 14px; align-items: stretch; }
.dash-piscina-h .dash-piscina-foto { display: block; width: 42%; height: auto; min-height: 120px; max-height: none; flex: none; align-self: stretch; object-fit: cover; border-radius: 10px; }
.dash-piscina-h .dash-datos { justify-content: space-evenly; }
.dash-piscina[hidden] { display: none; }
.dash-fila-trio { grid-template-columns: repeat(3, minmax(0, 1fr)); flex: 1.3; }
.dash-fila-pie { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); flex: 1; }
.dash-fila-baja { flex: 0 0 auto; }
.dash-fila-baja .dash-card { min-height: 210px; }
.dash-donut { display: flex; align-items: center; gap: 14px; flex: 1; min-height: 0; margin-top: 6px; }
.dash-donut-grafico { flex: 0 0 52%; max-width: 52%; height: 100%; margin-top: 0; }
.dash-leyenda { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dash-leyenda li { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; }
.dash-leyenda i { flex: none; width: 11px; height: 11px; border-radius: 50%; margin-top: 3px; }
.dash-leyenda small { display: block; color: var(--fg3); font-size: 11.5px; }
.dash-fotos h3 { flex: none; margin-bottom: 8px; }
.dash-fotos-fila { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; flex: 1; min-height: 0; }
.dash-foto { position: relative; display: block; border-radius: 10px; overflow: hidden; min-height: 70px; background: #e2e8f0; }
.dash-foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.dash-foto span { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 5px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .65)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-informe { flex-direction: row; align-items: center; gap: 16px; background: #eaf2ff; border-color: #cfe0fb; }
.dash-informe-ico { flex: none; width: 52px; height: 52px; border-radius: 12px; background: #fff; color: #0b6bcb; display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(11, 61, 145, .15); }
.dash-informe-ico .ico { width: 28px; height: 28px; }
.dash-informe-txt { flex: 1; min-width: 0; }
.dash-informe-txt p { margin: 3px 0 0; font-size: 12.5px; color: var(--fg2); }
.dash-informe-btn { flex: none; display: inline-flex; align-items: center; gap: 8px; background: #0f2a5c; color: #fff; text-decoration: none; font-weight: 600; font-size: 13.5px; padding: 12px 18px; border-radius: 10px; }
.dash-informe-btn:hover { background: #0b3d91; }
.dash-informe-btn .ico { width: 17px; height: 17px; }
.dash-pagina-lista { overflow: hidden; }
.dash-filtros { display: flex; gap: 8px; flex: none; flex-wrap: wrap; }
.dash-filtro { border: 1px solid var(--bg3); background: #fff; font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--fg2); padding: 7px 14px; border-radius: 999px; cursor: pointer; }
.dash-filtro b { margin-left: 6px; font-weight: 700; color: var(--fg); }
.dash-filtro.activa { background: #111827; color: #fff; border-color: #111827; }
.dash-filtro.activa b { color: #fff; }
.dash-grid-piscinas { display: grid; grid-template-columns: repeat(auto-fill, minmax(390px, 1fr)); gap: 12px; align-content: start; flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 4px; }
.dash-grid-piscinas .dash-piscina { min-height: 230px; }
@media (max-width: 1250px) { .dash-fila-pisc { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-fila-pisc .dash-con-grafico { grid-column: span 2; min-height: 240px; } .dash-fila-trio { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-fila-trio > :last-child { grid-column: span 2; } }
@media (max-width: 899px) {
  .dash-fila-pisc, .dash-fila-trio, .dash-fila-pie { grid-template-columns: 1fr; }
  .dash-fila-pisc .dash-con-grafico, .dash-fila-trio > :last-child { grid-column: auto; }
  .dash-piscina-h .dash-piscina-cuerpo { flex-direction: column; }
  .dash-piscina-h .dash-piscina-foto { width: 100%; height: 150px; }
  .dash-fotos-fila { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 110px; }
  .dash-informe { flex-wrap: wrap; }
  .dash-grid-piscinas { grid-template-columns: 1fr; }
  .dash-pager { flex-wrap: wrap; }
}

/* Version en pantalla larga: el resumen sigue el orden de la maqueta y se desplaza (en vez de caber en una sola pantalla) */
.container.container-dash { padding-bottom: 28px; }
.dash { height: auto; min-height: 0; }
.dash-pagina { flex: none; }
.dash-fila-pisc, .dash-fila-trio, .dash-fila-pie { flex: none; }
.dash-fila-pisc .dash-grafico { flex: none; height: 262px; }
.dash-fila-trio .dash-grafico { flex: none; height: 210px; }
.dash-fila-trio .dash-donut { flex: none; height: 214px; }
.dash-fila-pie { height: 168px; }
.dash-fila-pie .dash-card { min-height: 0; }
.dash-piscina-h .dash-piscina-cuerpo { flex: none; }
.dash-piscina-h .dash-piscina-foto { width: 46%; height: auto; aspect-ratio: 4 / 3; min-height: 0; align-self: flex-start; }
.dash-piscina-h .dash-datos { justify-content: space-between; align-self: stretch; }
.dash-piscina-h .dash-datos > div { padding: 5px 0; }
.dash-pagina-lista { overflow: visible; }
.dash-grid-piscinas { overflow: visible; flex: none; }
.dash-fila-listas { flex: none; }
.dash-fila-listas .dash-card { min-height: 300px; }
.dash-fila-baja .dash-card { min-height: 210px; }
@media (max-width: 1250px) { .dash-fila-pisc .dash-con-grafico { grid-column: span 2; } .dash-fila-pisc .dash-grafico { height: 240px; } }
@media (max-width: 899px) { .dash-fila-pie { height: auto; } .dash-fotos-fila { grid-auto-rows: 120px; } .dash-fila-trio .dash-donut { height: auto; flex-direction: column; } .dash-donut-grafico { max-width: none; flex: none; width: 100%; height: 200px; } }
.dash-fila-trio .dash-donut-grafico { flex: 0 0 52%; width: 52%; max-width: 52%; height: 200px; }
@media (max-width: 899px) { .dash-fila-trio .dash-donut-grafico { flex: none; width: 100%; max-width: none; height: 200px; } }


/* Calidad del agua: boton en cada tarjeta de piscina y ventana con la curva */
.dash-card-pie-fila { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dash-btn-calidad { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #bfdbfe; background: #eff6ff; color: #1d4ed8; font-family: inherit; font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.dash-btn-calidad:hover { background: #dbeafe; }
.dash-btn-calidad .ico { width: 14px; height: 14px; }
dialog.dash-modal-calidad { width: min(920px, 96vw); max-width: 96vw; padding: 0; }
.dash-calidad-cuerpo { padding: 14px 18px 8px; }
.dash-calidad-barra { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.dash-calidad-barra select { padding: 7px 10px; border: 1px solid var(--bg3); border-radius: 8px; font-size: 13px; background: #fff; }
.dash-calidad-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dash-chip { border: 1px solid var(--bg3); background: #fff; font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--fg2); padding: 6px 13px; border-radius: 999px; cursor: pointer; }
.dash-chip.activa { background: #0b6bcb; border-color: #0b6bcb; color: #fff; }
.dash-chip.alerta:not(.activa) { border-color: #fca5a5; color: #b91c1c; background: #fef2f2; }
.dash-calidad-grafico { position: relative; height: 320px; }
.dash-calidad-vacio { color: var(--fg3); text-align: center; padding: 60px 0; }
.dash-calidad-datos { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 12px; }
.dash-calidad-dato { border: 1px solid var(--bg3); border-radius: 10px; padding: 9px 12px; background: var(--bg2); }
.dash-calidad-dato strong { display: block; font-size: 19px; line-height: 1.15; }
.dash-calidad-dato span { font-size: 11.5px; color: var(--fg2); }
.dash-calidad-dato.ok strong { color: #15803d; } .dash-calidad-dato.aviso strong { color: #b45309; } .dash-calidad-dato.rojo strong { color: #dc2626; }
.dash-calidad-nota { font-size: 11.5px; color: var(--fg3); margin: 10px 0 0; }
@media (max-width: 899px) { .dash-calidad-grafico { height: 260px; } }

.dash-calidad-alerta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: #fef2f2; border: 1px solid #fecaca; border-left: 5px solid #dc2626; border-radius: 10px; padding: 9px 12px; margin-bottom: 10px; font-size: 13px; }
.dash-calidad-alerta[hidden] { display: none; }
.dash-calidad-alerta strong { display: block; color: #991b1b; }
.dash-calidad-alerta span { color: #7f1d1d; }
.dash-btn-calidad.alerta { border-color: #fca5a5; background: #fef2f2; color: #b91c1c; }
.dash-btn-calidad.alerta:hover { background: #fee2e2; }

/* Portal del cliente: tarjetas de piscina con su estado (como las del panel) */
.p-grid.p-grid-piscinas { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.p-grid-piscinas .dash-piscina { min-height: 0; }
.p-grid-piscinas .dash-piscina-foto { width: 46%; aspect-ratio: 4 / 3; height: auto; }
@media (max-width: 640px) { .p-grid.p-grid-piscinas { grid-template-columns: 1fr; } .p-grid-piscinas .dash-piscina-h .dash-piscina-cuerpo { flex-direction: column; } .p-grid-piscinas .dash-piscina-foto { width: 100%; } }

/* Formularios de incidencias de la aplicacion: etiqueta encima y campo de texto a todo el ancho */
.campo-ancho { display: flex; flex-direction: column; gap: 6px; max-width: 900px; }
.campo-ancho label { font-size: 13px; font-weight: 600; }
.campo-ancho textarea { width: 100%; box-sizing: border-box; min-height: 150px; padding: 10px 12px; font-family: inherit; font-size: 14px; resize: vertical; }

.dash-estado-rojo { background: #fee2e2; color: #b91c1c; }

.dash-calidad-inline { padding: 16px 18px; }
.dash-calidad-inline .dash-calidad-grafico { height: 360px; }
@media (max-width: 899px) { .dash-calidad-inline .dash-calidad-grafico { height: 280px; } }

/* Ventana de calidad del agua en pantallas grandes pero poco altas (tablet): el contenido se desplaza y Cerrar siempre se ve */
dialog.dash-modal-calidad { max-height: 94vh; max-height: 94dvh; }
dialog.dash-modal-calidad .dash-calidad-cuerpo { overflow-y: auto; flex: 1 1 auto; min-height: 0; }
dialog.dash-modal-calidad .modal-actions { flex: none; border-top: 1px solid var(--bg3); padding: 10px 18px 12px !important; background: #fff; }
.dash-calidad-cabecera { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dash-calidad-cerrar { border: none; background: transparent; font-size: 28px; line-height: 1; color: var(--fg2); cursor: pointer; padding: 0 4px; }
.dash-calidad-cerrar:hover { color: var(--fg); }
.dash-calidad-grafico { height: clamp(200px, 38vh, 340px); }
.dash-calidad-inline .dash-calidad-grafico { height: clamp(240px, 45vh, 400px); }

/* Fotos del movil: hacer la foto o elegirla de la galeria, lado a lado */
.mv-foto-dos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mv-foto-dos .mv-foto-boton { position: relative; padding: 14px 8px; font-size: 15px; }
.mv-foto-dos .mv-foto-galeria { border-style: solid; background: #fff; color: #475569; border-color: #cbd5e1; }
.mv-subtitulo { margin: 4px 0 6px; font-weight: 700; font-size: 14px; }
@media (max-width: 420px) { .mv-foto-dos { grid-template-columns: 1fr; } }

.dash-estado-azul { background: #dbeafe; color: #1d4ed8; }
.tec-tarjeta { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; background: var(--bg2); border: 1px solid var(--bg3); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.tec-tarjeta h3 { margin: 0 0 3px; font-size: 15.5px; }
.tec-tarjeta .tec-datos { font-size: 13px; color: var(--fg2); line-height: 1.55; }
.tec-linea { border-left: 3px solid #0891b2; padding: 4px 0 4px 12px; margin: 0 0 14px; }
.tec-linea .tec-cuando { font-size: 12px; color: var(--fg3); }
.tec-fotos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.tec-fotos figure { margin: 0; width: 120px; }
.tec-fotos img { width: 120px; height: 84px; object-fit: cover; border-radius: 6px; border: 1px solid var(--bg3); display: block; }
.tec-fotos figcaption { font-size: 10.5px; font-weight: 700; color: var(--fg2); margin-top: 2px; }

/* Menu del tecnico de campo: la piscina del QR activo */
.side-piscina { margin: 4px 10px 8px; padding: 9px 12px; border-radius: 10px; background: rgba(8, 145, 178, .18); color: #fff; line-height: 1.3; }
.side-piscina strong { display: block; font-size: 14px; }
.side-piscina span { font-size: 11.5px; opacity: .8; }


/* ---------- Ficha del tecnico: guia por pasos ---------- */
.pasos-cab { font-size: 20px; margin: 18px 0 4px; }
.paso-dia { margin: -4px 0 12px; color: var(--fg2); font-size: 14px; }
.paso { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 2px solid var(--bg3); border-radius: 14px; padding: 14px; margin: 12px 0; }
.paso-num { flex: none; width: 44px; height: 44px; border-radius: 50%; background: #e2e8f0; color: #475569; font-weight: 800; font-size: 22px; display: flex; align-items: center; justify-content: center; }
.paso-cuerpo { flex: 1; min-width: 0; }
.paso h3 { margin: 0 0 4px; font-size: 18px; line-height: 1.25; }
.paso h3 .opc { font-size: 13px; font-weight: 600; color: #64748b; }
.paso p { margin: 0 0 10px; font-size: 15px; color: var(--fg2); line-height: 1.4; }
.paso .btn { display: block; width: 100%; box-sizing: border-box; text-align: center; font-size: 17px; padding: 14px; }
.paso .btn-azul { background: #0891b2; color: #fff; }
.paso .btn-gris { background: #e2e8f0; color: #334155; }
.paso .paso-pie { font-size: 13px; margin: 10px 0 0; }
.paso.hecho { border-color: #16a34a; background: #f0fdf4; }
.paso.hecho .paso-num { background: #16a34a; color: #fff; }
.paso.siguiente { border-color: #2563eb; box-shadow: 0 0 0 4px rgba(37, 99, 235, .14); }
.paso.siguiente .paso-num { background: #2563eb; color: #fff; }
.paso .hecho-txt { color: #166534; font-weight: 600; }

/* ───────── Vista movil del tecnico de campo (body.modo-movil) ───────── */
body.modo-movil { background: #f4f4f5; -webkit-text-size-adjust: 100%; }
body.modo-movil .app-shell { display: block; }
body.modo-movil .main { min-height: 100vh; }
body.modo-movil .container { max-width: 560px; padding: 14px 14px calc(92px + env(safe-area-inset-bottom)); }
body.modo-movil input, body.modo-movil select, body.modo-movil textarea { font-size: 16px; }  /* 16px: el iPhone no hace zoom al tocar el campo */
body.modo-movil .btn { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; }
body.modo-movil .btn-sm { min-height: 38px; }
body.modo-movil .btn-ayuda-flotante { bottom: calc(80px + env(safe-area-inset-bottom)); right: 14px; }
body.modo-movil .toast-mensaje { bottom: calc(86px + env(safe-area-inset-bottom)); }

.m-cab { position: sticky; top: 0; z-index: 300; display: flex; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top)) 14px 8px; background: rgba(244,244,245,.94); backdrop-filter: blur(8px); border-bottom: 1px solid #e4e4e7; }
.m-cab-logo img { height: 30px; display: block; }
.m-cab-piscina { flex: 1; min-width: 0; line-height: 1.2; text-align: right; }
.m-cab-piscina strong, .m-cab-piscina span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-cab-piscina strong { font-size: 14px; } .m-cab-piscina span { font-size: 12px; color: var(--fg2); }
.m-cab-reg { margin-left: auto; font-size: 11px; font-weight: 600; color: #92400e; background: #fef3c7; padding: 3px 9px; border-radius: 10px; white-space: nowrap; }
.m-cab-piscina + .m-cab-reg { display: none; }

.m-titulo { font-size: 26px; margin: 6px 0 12px; }
.m-seccion { font-size: 15px; margin: 20px 0 8px; color: #18181b; }
.m-tarjeta { background: #fff; border: 1px solid #e4e4e7; border-radius: 16px; padding: 14px 16px; margin: 0 0 10px; display: flex; flex-direction: column; gap: 6px; }
.m-tarjeta strong { font-size: 16px; } .m-tarjeta > span, .m-trabajo span { color: var(--fg2); font-size: 13px; display: block; }
.m-nota { color: var(--fg2); font-size: 13.5px; margin: 0; line-height: 1.45; }
.m-destacada { border-color: #0891b2; border-width: 2px; background: #ecfeff; }
.m-usuario { flex-direction: row; align-items: center; gap: 14px; }
.m-usuario strong { display: block; font-size: 17px; } .m-usuario span { font-size: 13px; color: var(--fg2); text-transform: uppercase; letter-spacing: .02em; }
.m-avatar { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: #0f172a; color: #fff; font-size: 10px; font-weight: 700; }
.m-avatar-grande { width: 52px; height: 52px; font-size: 18px; flex: none; }
.m-video { display: none; width: 100%; border-radius: 12px; background: #000; margin-top: 6px; }
.m-trabajo { gap: 8px; } .m-acciones { display: flex; gap: 8px; flex-wrap: wrap; }
.m-rejilla { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-baldosa { background: #fff; border: 1px solid #e4e4e7; border-radius: 16px; padding: 14px; text-decoration: none; color: var(--fg); display: flex; flex-direction: column; gap: 14px; min-height: 92px; font-weight: 600; font-size: 15px; }
.m-baldosa i { width: 38px; height: 38px; border-radius: 10px; background: #e2e8f0; display: inline-flex; align-items: center; justify-content: center; font-style: normal; }
.m-baldosa i svg { width: 20px; height: 20px; }
.m-idiomas { flex-direction: row; gap: 8px; flex-wrap: wrap; } .m-idiomas form { margin: 0; flex: 1; } .m-idiomas .btn { width: 100%; }
.m-lista { background: #fff; border: 1px solid #e4e4e7; border-radius: 16px; overflow: hidden; }
.m-lista form { margin: 0; }
.m-fila { display: flex; align-items: center; gap: 12px; width: 100%; padding: 15px 16px; background: none; border: 0; border-bottom: 1px solid #f1f1f3; font: inherit; font-size: 15.5px; color: var(--fg); text-decoration: none; text-align: left; cursor: pointer; }
.m-lista > :last-child .m-fila, .m-lista > .m-fila:last-child { border-bottom: 0; }
.m-fila svg { width: 20px; height: 20px; flex: none; color: #52525b; }
.m-fila-roja, .m-fila-roja svg { color: #dc2626; }

.m-barra { position: fixed; left: 0; right: 0; bottom: 0; z-index: 350; display: flex; justify-content: space-around; align-items: stretch; gap: 2px; background: #fff; border-top: 1px solid #e4e4e7; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -2px 10px rgba(15,23,42,.06); }
.m-barra a { flex: 1; max-width: 120px; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 2px; border-radius: 24px; text-decoration: none; color: #3f3f46; font-size: 10.5px; font-weight: 600; }
.m-barra a svg { width: 22px; height: 22px; }
.m-barra a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-barra a.on { background: #e2e8f0; color: #0f172a; }
.m-barra .m-barra-centro { background: #0f172a; color: #fff; }
.m-barra .m-barra-centro svg { color: #fff; }

/* Pasos de la visita: solo el que toca esta abierto; los demas se abren al tocar su titulo */
body.modo-movil .paso { flex-direction: column; gap: 6px; padding: 12px 14px; }
body.modo-movil .paso > .paso-num { width: 34px; height: 34px; font-size: 17px; position: absolute; left: 14px; top: 12px; }
body.modo-movil .paso { position: relative; }
body.modo-movil .paso-cuerpo { width: 100%; }
body.modo-movil .paso h3 { font-size: 16.5px; line-height: 1.3; padding: 6px 0 0 44px; min-height: 34px; cursor: pointer; margin: 0; }
body.modo-movil .paso:not(.abierto) .paso-cuerpo > :not(h3) { display: none !important; }
body.modo-movil .paso.abierto h3 { margin-bottom: 8px; }
body.modo-movil .paso .btn { min-height: 52px; }
body.modo-movil .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Vista movil: el boton "Guardar y volver" de los formularios (agua, productos) va justo encima de la barra inferior, no debajo */
body.modo-movil .mv-barra { left: 0; bottom: calc(66px + env(safe-area-inset-bottom)); padding: 8px 16px; z-index: 360; }
body.modo-movil .mv-barra .btn { padding: 13px; font-size: 17px; }
body.modo-movil .mv-form { padding-bottom: 80px; }
/* En pantallas anchas las barras inferiores tienen el mismo ancho que las tarjetas (en el movil ocupan todo el ancho) */
@media (min-width: 600px) {
  body.modo-movil .m-barra, body.modo-movil .mv-barra { left: 0; right: 0; margin: 0 auto; max-width: 532px; border-left: 1px solid #e4e4e7; border-right: 1px solid #e4e4e7; }
  body.modo-movil .m-barra { border-radius: 14px 14px 0 0; }
}
/* Las tarjetas de una misma lista (tareas de la visita, claridad...) miden todas lo mismo: la de texto mas largo marca la altura */
.mv-chips { grid-auto-rows: 1fr; }
.mv-chip { display: flex; }
.mv-chip span { flex: 1; display: flex; align-items: center; justify-content: center; }

/* ---------------- vista movil del administrador (/m) */
.m-cifras { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 8px; }
.m-cifra { background: #fff; border: 1px solid #e4e4e7; border-radius: 16px; padding: 12px 6px; text-align: center; text-decoration: none; color: var(--fg); display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.m-cifra b { font-size: 26px; line-height: 1; } .m-cifra span { font-size: 12px; color: var(--fg2); font-weight: 600; }
.m-cifra.m-mal { border-color: #fca5a5; background: #fef2f2; } .m-cifra.m-mal b { color: #b91c1c; }
.m-cifra.m-ok b { color: #15803d; }
.m-enlace { text-decoration: none; color: var(--fg); }
.m-pestanas { display: flex; gap: 6px; margin: 0 0 12px; }
.m-pestanas a { flex: 1; text-align: center; padding: 9px 6px; border-radius: 999px; background: #fff; border: 1px solid #e4e4e7; text-decoration: none; color: var(--fg); font-weight: 600; font-size: 13.5px; }
.m-pestanas a.on { background: #0f172a; border-color: #0f172a; color: #fff; }
.m-ancho { display: block; width: 100%; text-align: center; margin: 0 0 10px; }
.m-estado { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: #f4f4f5; color: #52525b; align-self: center; }
.m-estado-en_curso { background: #cffafe; color: #155e75; } .m-estado-resuelto { background: #dcfce7; color: #166534; }
.m-alerta { border-left: 5px solid #dc2626; }
.m-form label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 13.5px; margin: 0 0 8px; }
.m-form input, .m-form select, .m-form textarea { width: 100%; padding: 11px 10px; font-size: 16px; }
.m-buscar { display: flex; gap: 8px; margin: 0 0 12px; } .m-buscar input { flex: 1; min-width: 0; padding: 11px 12px; font-size: 16px; }
.m-sublinea { display: flex; justify-content: space-between; padding: 10px 2px 2px; border-top: 1px solid #f1f1f3; text-decoration: none; color: var(--fg); font-weight: 600; font-size: 14px; }
.m-lecturas { display: flex; flex-wrap: wrap; gap: 6px; }
.m-tarjeta .m-lecturas span { display: inline-block; background: #f4f4f5; border-radius: 8px; padding: 4px 8px; font-size: 12.5px; color: var(--fg); }
.m-tarjeta .m-lecturas span.mal { background: #fee2e2; color: #991b1b; }
.m-fotos { display: flex; gap: 6px; overflow-x: auto; } .m-fotos img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; }
.m-detalle summary { list-style: none; display: inline-block; cursor: pointer; } .m-detalle summary::-webkit-details-marker { display: none; }
.m-detalle form { margin-top: 10px; display: flex; flex-direction: column; }
