/* ============================================================
   RELEVAMIENTOS — estilos mobile-first para iPhone
   Paleta: misma que la app principal (dorado + dark sidebar)
   ============================================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  /* Base (se mantiene compat con nombres legacy) */
  --bg: #f0f2f7;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --dark-from: #161625;
  --dark-to: #111120;
  --accent-from: #d4952e;
  --accent-to: #c48b28;
  --accent: #d4952e;
  --accent-2: #e8a838;
  --accent-dark: #c48b28;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --card-bg: rgba(255, 255, 255, 0.95);
  --border: rgba(0, 0, 0, 0.08);
  --border-soft: rgba(0, 0, 0, 0.05);
  --danger: #dc2626;
  --warning: #f59e0b;
  --success: #16a34a;
  --info: #0891b2;
  /* Radios */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius: 14px;
  --radius-lg: 20px;
  /* Sombras unificadas con Index.html */
  --shadow-xs: 0 1px 2px rgba(17, 24, 39, .04);
  --shadow-card: 0 1px 3px rgba(17, 24, 39, .04), 0 4px 12px rgba(17, 24, 39, .04);
  --shadow-hover: 0 2px 6px rgba(17, 24, 39, .06), 0 10px 24px rgba(17, 24, 39, .07);
  --shadow-modal: 0 24px 60px rgba(17, 24, 39, .22), 0 2px 8px rgba(17, 24, 39, .08);
  /* Movimiento */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --duration-fast: .15s;
  --duration-med: .22s;
  /* Safe areas iOS */
  --safe-top: env(safe-area-inset-top, 0);
  --safe-bottom: env(safe-area-inset-bottom, 0);
  --safe-left: env(safe-area-inset-left, 0);
  --safe-right: env(safe-area-inset-right, 0);
}

html, body {
  height: 100%;
  overscroll-behavior-y: none;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  /* Degradado muy sutil: da profundidad sin restar contraste al contenido (se usa al sol). */
  background: linear-gradient(180deg, #eef1f7 0%, var(--bg) 220px);
  background-attachment: fixed;
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
}

/* ============================================================
   LOGIN
   ============================================================ */

.login-screen {
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(135deg, var(--dark-from) 0%, var(--dark-to) 100%);
  padding: calc(var(--safe-top) + 40px) 24px calc(var(--safe-bottom) + 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.login-brand {
  text-align: center;
  margin-bottom: 40px;
}

.login-brand h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.login-brand p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
}

.login-divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(212, 149, 46, 0.5), transparent);
  margin: 0 auto 24px;
  border: none;
}

.login-prompt {
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  text-align: center;
  margin-bottom: 20px;
  letter-spacing: 0.3px;
}

.login-error {
  max-width: 340px;
  margin: 16px auto 0;
}

/* Operator grid (tarjetas) */
.operator-grid {
  /* Grilla de 2 columnas parejas (26/9/2026): con flex-wrap quedaban 2-1-2-2, una sola centrada y anchos distintos. */
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 auto 12px;
  max-width: 420px;
  animation: fadeInUp 0.4s ease-out 0.1s both;
  padding: 0 8px;
}

.operator-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 180ms, border-color 180ms, transform 120ms;
  min-width: 0;
  text-align: left;
}

.operator-btn:active {
  background: rgba(212, 149, 46, 0.15);
  border-color: rgba(212, 149, 46, 0.4);
  transform: scale(0.97);
}

@media (hover: hover) {
  .operator-btn:hover {
    background: rgba(212, 149, 46, 0.12);
    border-color: rgba(212, 149, 46, 0.35);
  }
}

.op-avatar {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  flex-shrink: 0;
}

.op-avatar.admin {
  background: linear-gradient(135deg, #d4952e, #e8a838);
  color: #1a1a2e;
}

.op-avatar.operador {
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: #fff;
}

.op-avatar.informes {
  background: linear-gradient(135deg, #0891b2, #06b6d4);
  color: #fff;
}

.op-avatar-lg {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  font-size: 22px;
  margin: 0 auto;
}

.op-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.op-name {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.op-role {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 2px;
  text-transform: lowercase;
}

/* Password box (cuando elegiste operador) */
.pw-selected-op {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  animation: fadeInUp 0.3s ease-out;
}

.pw-op-name {
  color: #fff;
  font-size: 17px;
  font-weight: 600;
}

.pw-box {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  animation: fadeInUp 0.3s ease-out 0.05s both;
}

.login-pw-input {
  text-align: center;
  letter-spacing: 4px;
  font-size: 17px;
}

.pw-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.pw-actions .btn-ghost {
  flex: 1;
  padding: 14px;
  font-size: 14px;
}

.pw-actions .btn-primary {
  flex: 2;
  margin-top: 0;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.form-label {
  display: block;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  margin-top: 16px;
}

.form-label:first-child {
  margin-top: 0;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  border-radius: var(--radius);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.form-input:focus {
  border-color: var(--accent-from);
}

select.form-input {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='white' d='M6 8L0 0h12z' opacity='.7'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.btn-primary {
  width: 100%;
  padding: 15px 20px;
  margin-top: 24px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(196, 139, 40, 0.35);
  transition: transform 120ms, box-shadow 120ms;
}

.btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 3px 8px rgba(196, 139, 40, 0.35);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.error-msg {
  margin-top: 16px;
  padding: 12px 14px;
  background: rgba(220, 38, 38, 0.18);
  border: 1px solid rgba(220, 38, 38, 0.4);
  border-radius: var(--radius);
  color: #fecaca;
  font-size: 14px;
  text-align: center;
}

/* ============================================================
   HOME (screen general post-login)
   ============================================================ */

.screen {
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(135deg, var(--dark-from), var(--dark-to));
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(17, 17, 32, .18);
}
/* Hilo dorado inferior: firma de marca, igual que el acento de la app principal. */
.topbar::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .75;
}
.topbar-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.topbar-logo {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
  color: #fff;
  font-size: 14px; font-weight: 800; letter-spacing: .5px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(196, 139, 40, .38);
}
.topbar-brand-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.topbar-title { font-size: 16px; font-weight: 700; letter-spacing: -.2px; }
.topbar-sub { font-size: 11.5px; color: rgba(255, 255, 255, .55); letter-spacing: .3px; }
/* Compat: la clase vieja sigue existiendo por si queda algún render antiguo. */
.topbar-user { font-weight: 600; font-size: 16px; }

.btn-ghost {
  padding: 9px 15px;
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease);
}
.btn-ghost:active { transform: scale(.96); }

.btn-ghost:active {
  background: rgba(255, 255, 255, 0.15);
}

/* Saludo del día: ubica al relevador y le da calidez a la pantalla de inicio. */
.home-hero {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px 20px 4px;
}
.home-hero-avatar {
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--dark-from), var(--dark-to));
  color: #fff;
  font-size: 19px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-card);
}
.home-hero-txt { min-width: 0; }
.home-hero-hi { font-size: 19px; font-weight: 800; letter-spacing: -.3px; color: var(--text); }
.home-hero-date { font-size: 13px; color: var(--text-muted); }
.home-hero-date::first-letter { text-transform: uppercase; } /* sólo la primera: capitalize ponía "26 De Septiembre" */

.home-actions {
  flex: 1;
  padding: 16px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

/* Botón/ítem: ícono en cápsula + texto + chevron. Alto mínimo cómodo para el dedo. */
.home-btn {
  width: 100%;
  min-height: 76px;
  padding: 16px 16px 16px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 13px;
  transition: transform var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease);
}

.home-btn:active {
  transform: scale(0.985);
  box-shadow: var(--shadow-xs);
}

.home-btn-ico {
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 14px;
  background: rgba(212, 149, 46, .12);
  font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.home-btn-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.home-btn-go {
  flex-shrink: 0;
  font-size: 26px;
  line-height: 1;
  color: #c7cbd4;
  font-weight: 300;
  padding-left: 2px;
}

.home-btn-title {
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -.2px;
  color: var(--text);
}

.home-btn-sub {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-muted);
}

/* Acción principal: bloque dorado, con el ícono en vidrio y más presencia. */
.home-btn-primary {
  background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
  border: none;
  color: #fff;
  min-height: 88px;
  box-shadow: 0 8px 22px rgba(196, 139, 40, 0.32);
}
.home-btn-primary .home-btn-ico { background: rgba(255, 255, 255, .22); }
.home-btn-primary .home-btn-go { color: rgba(255, 255, 255, .8); }
.home-btn-primary .home-btn-title { color: #fff; font-size: 18px; }
.home-btn-primary .home-btn-sub { color: rgba(255, 255, 255, 0.88); }

/* Estados: algo para sincronizar (rojo) o algo incompleto (ámbar). Borde izquierdo grueso
   para que se distinga de un vistazo incluso con el sol de frente. */
.home-btn-alert { border-left: 4px solid var(--danger); }
.home-btn-alert .home-btn-ico { background: rgba(220, 38, 38, .10); }
.home-btn-warn { border-left: 4px solid var(--warning); }
.home-btn-warn .home-btn-ico { background: rgba(245, 158, 11, .14); }

/* Ítems de lista (consorcios / relevamientos): más compactos que las acciones del home. */
.home-btn-item { min-height: 68px; padding: 13px 14px; border-radius: var(--radius); }
.home-btn-item .home-btn-ico { width: 40px; height: 40px; border-radius: 12px; font-size: 19px; }
.home-btn-item .home-btn-title { font-size: 15px; }
.home-btn-ico-bld { background: rgba(22, 22, 37, .07); }
.home-btn-ico-doc { background: rgba(8, 145, 178, .10); }

.home-btn-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 9px;
  background: var(--danger);
  color: #fff;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  vertical-align: 2px;
}

/* Chips de estado (Borrador / Finalizado / Sin resumen) */
.chip {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: 2px;
  white-space: nowrap;
}
.chip-ok { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.chip-warn { background: #f3f4f6; color: #4b5563; border: 1px solid #e5e7eb; }
.chip-alert { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }

/* ============================================================
   OFFLINE BANNER (fixed top, above todo)
   ============================================================ */

.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 6px 12px;
  padding-top: calc(var(--safe-top) + 6px);
  background: #b45309;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.offline-banner[hidden] {
  display: none !important;
}

.offline-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fbbf24;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Cuando el banner está visible, correr el contenido hacia abajo */
body.is-offline .screen-header,
body.is-offline .login-screen,
body.is-offline .topbar {
  margin-top: 32px;
}

/* ============================================================
   SCREEN HEADER (back + title)
   ============================================================ */

.screen-header {
  position: sticky;
  top: 0;
  z-index: 15;
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(135deg, var(--dark-from), var(--dark-to));
  color: #fff;
  padding: 14px 16px;
  padding-top: calc(var(--safe-top) + 14px);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.back-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  font-family: inherit;
  padding: 0;
}

.back-btn:active {
  background: rgba(255, 255, 255, 0.18);
}

.screen-title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ============================================================
   FORM (Nuevo relevamiento)
   ============================================================ */

.form-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: calc(var(--safe-bottom) + 150px); /* barra de Guardar + aviso + estado del borrador */
  background: var(--bg);
}

.form-header-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 18px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
}

/* Título de bloque con marca dorada a la izquierda: ordena la lectura en pantallas largas. */
.form-header-card h3 {
  position: relative;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 14px;
  padding-left: 11px;
}
.form-header-card h3::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 13px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent-from), var(--accent-to));
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-group {
  margin-bottom: 12px;
}

.form-group[hidden] {
  display: none !important;
}

.form-label-field {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 5px;
}

.form-input-light {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  color: var(--text);
  border-radius: 10px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.form-input-light:focus {
  border-color: var(--accent-from);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(212, 149, 46, .16);
}

textarea.form-input-light {
  min-height: 60px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.4;
}

select.form-input-light {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%236b7280' d='M6 8L0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* ACCORDION (checklist sections) */

.acc-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--duration-fast) var(--ease);
}
/* La sección abierta se despega del resto: ayuda a no perderse en un formulario largo. */
.acc-section.open {
  box-shadow: var(--shadow-hover);
  border-color: rgba(212, 149, 46, .35);
}

.acc-header {
  width: 100%;
  padding: 16px;
  background: #fff;
  border: none;
  border-bottom: 1px solid transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

.acc-header.open {
  border-bottom-color: var(--border);
  background: #fafbfd;
}

.acc-chevron {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  transition: transform 160ms cubic-bezier(0.4, 0, 0.2, 1);
}

.acc-section.open > .acc-header .acc-chevron {
  transform: rotate(90deg);
}
/* Progreso y "Siguiente sección" (26/9/2026) */
.acc-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: #15803d;
  background: #dcfce7;
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}
.acc-count:not([hidden]) + .acc-chevron { margin-left: 8px; } /* un contador oculto no le quita la flecha a la derecha */
.acc-next {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 14px 0 4px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  text-align: center;
  cursor: pointer;
}
.acc-next:active { background: #f3f4f6; }
/* Opciones cerradas como botones grandes (26/9/2026) */
.opc-chips { display: flex; gap: 6px; } /* todas en UNA fila: las opciones se reparten el ancho y "—" queda angosto */
.opc-chip { position: relative; flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; text-align: center; line-height: 1.2; min-height: 46px; padding: 6px 6px; border: 1.5px solid var(--border); border-radius: 12px; background: #fff; color: var(--text); font-size: 15px; font-weight: 600; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent; }
.opc-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.opc-chip.on { background: #1a1a2e; border-color: #1a1a2e; color: #fff; }
.opc-chip-nada { color: var(--text-muted); flex: 0 0 44px; }
.opc-chips-muchas { flex-wrap: wrap; }
.opc-chips-muchas .opc-chip { flex: 1 1 auto; padding: 6px 12px; }
.opc-chips-muchas .opc-chip-nada { flex: 0 0 44px; }
.opc-chip-nada.on { background: #f3f4f6; border-color: var(--border); color: var(--text-muted); }
.opc-chip:focus-within { outline: 2px solid var(--accent-dark, #c48b28); outline-offset: 2px; }
.save-bar-error { margin: 0 0 8px; background: #fef2f2; border-color: #fca5a5; color: #b91c1c; font-weight: 600; } /* .error-msg es para el fondo oscuro del login: sobre la barra clara no se leía */
.draft-estado {
  font-size: 12.5px;
  color: #15803d;
  font-weight: 600;
  text-align: center;
  margin: 0 0 8px;
}
.draft-estado.draft-error { color: #b91c1c; }
.screen:has(.save-bar-error) .foto-fab { bottom: calc(var(--safe-bottom, 0px) + 196px); } /* con el aviso de error la barra crece */

.acc-body {
  padding: 14px 16px 4px;
}

.acc-body[hidden] {
  display: none;
}

.acc-sub {
  border-left: 2px solid #eef2f7;
  padding: 8px 0 2px 12px;
  margin: 10px 0 14px;
}

.acc-sub-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  padding: 8px 0 6px;
  border-bottom: 2px solid #e5e7eb;
}

/* Subtítulos profundos (depth 2): tanques, calderas, accesos, etc. */
.acc-sub .acc-sub > .acc-sub-title {
  font-size: 12px;
  letter-spacing: 0.4px;
  border-bottom: 1px dashed #e5e7eb;
  border-left: 3px solid var(--accent-from);
  padding-left: 8px;
  margin-top: 6px;
}

/* Checkbox styling — switch grande tipo iOS para tablet */
.form-group-checkbox {
  margin-bottom: 10px;
}
.form-checkbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 10px 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  user-select: none;
  -webkit-user-select: none;
  min-height: 44px;
}
.form-checkbox-row:hover {
  background: #f3f4f6;
}
.form-checkbox-row input.form-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid #9ca3af;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
  position: relative;
  transition: background 120ms, border-color 120ms;
}
.form-checkbox-row input.form-checkbox:checked {
  background: var(--accent-from);
  border-color: var(--accent-from);
}
.form-checkbox-row input.form-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 12px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}
.form-checkbox-row .form-checkbox-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
}

/* Prefijo dinámico de label (Sala 1 — vs Sala —) */
.form-label-prefix {
  font-weight: 600;
  color: var(--text-muted);
}
.form-label-prefix[hidden] {
  display: none;
}

/* FOTOS GRID */

.foto-counter {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 12px;
  margin-left: 6px;
  text-transform: none;
  letter-spacing: 0;
}

.foto-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

@media (min-width: 480px) {
  .foto-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Celda foto + input "¿Dónde es?" debajo (pedido de Facu: saber de dónde es cada foto) */
.foto-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.foto-lugar {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-family: inherit;
  font-size: 16px; /* <16px hace zoom-in en iOS al enfocar */
  background: #fff;
  color: #111827;
}
.foto-lugar:focus {
  outline: none;
  border-color: #c48b28;
  box-shadow: 0 0 0 2px rgba(196, 139, 40, 0.15);
}
.foto-lugar::placeholder { color: #9ca3af; font-size: 13px; }

.foto-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}

.foto-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.foto-thumb-loading {
  display: flex;
  align-items: center;
  justify-content: center;
}

.foto-thumb-loading .spinner {
  border-color: rgba(0, 0, 0, 0.1);
  border-top-color: var(--accent-from);
}

.foto-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
/* Área táctil de 44px (recomendado para mobile / uso con guantes) sin agrandar el círculo
   visible de 24px: pseudo-elemento transparente centrado sobre el botón. */
.foto-del::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}

.foto-del:active {
  background: rgba(0, 0, 0, 0.8);
}

/* Clases usadas en el render de pendientes/acordeón que no tenían estilo definido:
   se veían como texto plano y un pendiente de otro operador era indistinguible del propio. */
.acc-badge {
  display: inline-block;
  margin-left: auto;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(212, 149, 46, 0.15);
  color: #b45309;
  white-space: nowrap;
}
.pending-owner {
  margin: 6px 0 0;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.35;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #92400e;
}
.pending-card-others {
  opacity: 0.72;
  border-left: 3px solid #cbd5e1;
}

.foto-size {
  position: absolute;
  bottom: 4px;
  left: 4px;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 500;
}

.foto-add-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: #f9fafb;
  border: 2px dashed #d1d5db;
  border-radius: 10px;
  text-align: center;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.foto-add-btn:active {
  background: #f3f4f6;
}

.foto-add-btn.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  color: var(--text-muted);
}

.foto-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.foto-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 10px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  transition: transform 120ms, background 120ms;
}

.foto-action-btn:active {
  transform: scale(0.97);
}

.foto-action-camera {
  background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(196, 139, 40, 0.28);
}

.foto-action-camera:active {
  box-shadow: 0 2px 8px rgba(196, 139, 40, 0.28);
}

.foto-action-gallery {
  background: #f9fafb;
  color: var(--text);
}

.foto-action-gallery:active {
  background: #f3f4f6;
}

.foto-action-icon {
  font-size: 22px;
  line-height: 1;
}

/* FAB de cámara — botón flotante visible siempre durante el form para sacar fotos
   sin tener que scrollear hasta el acordeón de Fotos. Posicionado fixed bien arriba
   de form-save-bar (que tiene height ~68px + safe-bottom) con buen espacio de respiro. */
.foto-fab {
  position: fixed;
  right: 18px;
  bottom: calc(var(--safe-bottom, 0px) + 136px); /* arriba de la barra de Guardar con el estado del borrador */
  z-index: 60;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #d4952e 0%, #c48b28 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(196, 139, 40, 0.45), 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.15s, opacity 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}
.foto-fab:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 26px rgba(196, 139, 40, 0.55), 0 4px 10px rgba(0, 0, 0, 0.2);
}
.foto-fab:active {
  transform: translateY(0) scale(0.96);
}
.foto-fab.foto-fab-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.foto-fab-icon {
  font-size: 28px;
  line-height: 1;
}
.foto-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
@media (max-width: 600px) {
  .foto-fab {
    right: 14px;
    bottom: calc(var(--safe-bottom, 0px) + 108px);
    width: 56px;
    height: 56px;
  }
  .foto-fab-icon {
    font-size: 24px;
  }
}

/* PENDIENTES / SYNC */

.sync-banner {
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sync-banner-active {
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}

.sync-banner-ok {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.sync-banner-err {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.sync-banner-info {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.sync-banner .spinner {
  border-color: rgba(55, 48, 163, 0.2);
  border-top-color: #3730a3;
  width: 16px;
  height: 16px;
}

.pending-card {
  padding: 14px 16px;
}

.pending-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 8px;
}

.pending-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.pending-badge-pending {
  background: #fef3c7;
  color: #92400e;
}

.pending-badge-syncing {
  background: #e0e7ff;
  color: #3730a3;
}

.pending-badge-error {
  background: #fee2e2;
  color: #b91c1c;
}

.pending-badge-partial {
  background: #fef3c7;
  color: #92400e;
}

.pending-created {
  color: var(--text-muted);
  font-size: 12px;
}

.pending-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.pending-sub {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.pending-error {
  margin-top: 8px;
  padding: 8px 10px;
  background: #fef2f2;
  color: #b91c1c;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
}

/* Bloque de fotos falladas dentro de una card de pendiente */
.fotos-failed-block {
  margin-top: 10px;
  padding: 10px;
  background: rgba(239, 68, 68, .06);
  border: 1px solid rgba(239, 68, 68, .18);
  border-radius: 10px;
}
.fotos-failed-title {
  font-size: 12px;
  font-weight: 600;
  color: #b91c1c;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.foto-failed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid rgba(239, 68, 68, .12);
}
.foto-failed-row:first-of-type {
  border-top: 0;
}
.foto-failed-meta {
  flex: 1 1 auto;
  min-width: 0;
}
.foto-failed-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.foto-failed-err {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.foto-failed-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}
.foto-failed-actions button {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
}
.foto-failed-skip {
  color: #b91c1c !important;
}

/* ============================================================
   FIRMA DEL ENCARGADO — radios + canvas
   ============================================================ */
.firma-help {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 12px;
}
.firma-radios {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.firma-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 10px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
  font-size: 14px;
}
.firma-radio input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: #c48b28;
  flex: 0 0 auto;
}
.firma-radio:has(input:checked) {
  background: rgba(212, 149, 46, .08);
  border-color: rgba(212, 149, 46, .35);
}
.firma-radio-label {
  flex: 1;
  color: var(--text);
  font-weight: 500;
}
.firma-detalle {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.firma-canvas-wrap {
  position: relative;
  background: #fff;
  border: 1px dashed rgba(0, 0, 0, .25);
  border-radius: 12px;
  overflow: hidden;
}
.firma-canvas {
  display: block;
  width: 100%;
  height: 200px;
  touch-action: none;
  background: #fff;
  border-radius: 12px;
  cursor: crosshair;
}
.firma-canvas-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: rgba(0, 0, 0, .35);
  font-style: italic;
  pointer-events: none;
}
.firma-canvas-actions {
  display: flex;
  justify-content: flex-end;
  padding: 6px 8px;
  border-top: 1px solid rgba(0, 0, 0, .06);
}
.firma-canvas-actions .btn-ghost-dark {
  font-size: 12px;
  padding: 6px 12px;
}

/* Bloque de firma en el detalle */
.firma-detalle-img {
  display: block;
  max-width: 100%;
  max-height: 220px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 10px;
  padding: 8px;
}
.firma-detalle-meta {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
}
.firma-detalle-fecha {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.firma-detalle-noFirma {
  padding: 12px 14px;
  background: #f1f5f9;
  border-radius: 10px;
  color: var(--text);
  font-style: italic;
  font-size: 13px;
}

/* Badge de borrador en el botón "Nuevo relevamiento" del home */
.home-btn-badge-draft {
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  margin-left: 8px;
  text-transform: lowercase;
  letter-spacing: 0;
}

/* SAVE FAB (fixed bottom) */

.form-save-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px;
  padding-bottom: calc(var(--safe-bottom) + 12px);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  z-index: 20;
}

.form-save-bar .btn-primary {
  margin-top: 0;
}

/* ============================================================
   DETAIL (read-only de relevamiento)
   ============================================================ */

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  color: var(--text-muted);
  font-size: 13px;
  flex-shrink: 0;
  max-width: 55%;
}

.detail-value {
  color: var(--text);
  text-align: right;
  font-weight: 500;
  word-break: break-word;
}

.detail-block {
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
}

.detail-block:last-child {
  border-bottom: none;
}

.detail-block .detail-label {
  display: block;
  margin-bottom: 4px;
  max-width: none;
}

.detail-block-value {
  color: var(--text);
  font-size: 14px;
  white-space: pre-wrap;
  line-height: 1.5;
}

.detail-sec {
  background: #fafbfd;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
}

.detail-sec summary {
  padding: 12px 14px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-sec summary::-webkit-details-marker {
  display: none;
}

.detail-sec summary::after {
  content: '▶';
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  transition: transform 160ms;
}

.detail-sec[open] summary::after {
  transform: rotate(90deg);
}

.detail-sec-count {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 12px;
}

.detail-sec-body {
  padding: 4px 14px 10px;
  background: #fff;
  border-top: 1px solid var(--border);
}

.detail-adj {
  display: block;
  padding: 10px 12px;
  margin-bottom: 6px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}

.detail-adj:active {
  background: #f3f4f6;
}

.detail-adj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.detail-adj-img {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  text-decoration: none;
  color: var(--text);
}

.detail-adj-img img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

/* Visor de fotos: se pasa de una a otra sin abrir y cerrar cada una (Ma, 1/9/2026) */
.lb-overlay { position: fixed; inset: 0; z-index: 20000; background: rgba(10, 10, 12, .94); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 56px 12px 14px; box-sizing: border-box; touch-action: pan-y; }
.lb-img { max-width: 100%; min-width: 0; max-height: calc(100vh - 140px); object-fit: contain; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); background: #111; user-select: none; }
.lb-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25); background: rgba(0, 0, 0, .45); color: #fff; font-size: 30px; line-height: 1; padding: 0 0 4px; display: flex; align-items: center; justify-content: center; }
.lb-btn:active { background: rgba(255, 255, 255, .32); }
.lb-prev { left: 8px; }
.lb-next { right: 8px; }
.lb-close { position: absolute; top: 12px; right: 12px; width: 42px; height: 42px; border-radius: 50%; border: none; background: rgba(255, 255, 255, .16); color: #fff; font-size: 20px; }
.lb-cap { text-align: center; color: #fff; font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); padding: 0 12px; }
.lb-cnt { background: rgba(255, 255, 255, .16); padding: 3px 12px; border-radius: 999px; font-weight: 800; font-size: 12.5px; letter-spacing: .04em; }
.lb-cap a { color: #fbbf24; font-size: 12.5px; text-decoration: none; }
.detail-adj-img { cursor: zoom-in; }

.detail-adj-img .detail-adj-name {
  display: block;
  padding: 6px 8px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   iOS ONBOARDING MODAL
   ============================================================ */

.onboard-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(var(--safe-bottom) + 16px);
}

.onboard-modal {
  background: #fff;
  width: 100%;
  max-width: 420px;
  border-radius: 22px;
  padding: 24px 22px 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  animation: slideUp 280ms cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.onboard-icon {
  font-size: 42px;
  text-align: center;
  margin-bottom: 8px;
}

.onboard-modal h2 {
  font-size: 20px;
  text-align: center;
  margin-bottom: 6px;
  color: var(--text);
}

.onboard-intro {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  margin-bottom: 18px;
  line-height: 1.5;
}

.onboard-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 18px 0;
}

.onboard-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  border-bottom: 1px solid #f3f4f6;
}

.onboard-steps li:last-child {
  border-bottom: none;
}

.onboard-step-n {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.onboard-share-icon {
  display: inline-block;
  padding: 1px 6px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  vertical-align: 1px;
}

.onboard-warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 16px;
}

.onboard-actions {
  display: flex;
  gap: 10px;
}

.onboard-actions .btn-primary {
  margin-top: 0;
  flex: 1;
}

.btn-ghost-dark {
  flex: 1;
  padding: 15px 20px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-muted);
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  cursor: pointer;
}

.btn-ghost-dark:active {
  background: #e5e7eb;
}

/* ============================================================
   UTIL
   ============================================================ */

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   REFINAMIENTO v2 — focus visible, reduced-motion, sombras
   y radios unificados con Index.html
   ============================================================ */

/* Foco visible consistente en interactivos (teclado). Con mouse no aparece
   gracias a :focus-visible. */
button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
.btn-primary:focus-visible,
.btn-ghost:focus-visible,
.btn-ghost-dark:focus-visible,
.home-btn:focus-visible,
.operator-btn:focus-visible,
.back-btn:focus-visible,
.acc-header:focus-visible,
.foto-action-btn:focus-visible {
  outline: 3px solid rgba(196, 139, 40, .55);
  outline-offset: 2px;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.form-input:focus-visible,
.form-input-light:focus-visible,
.login-pw-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

/* Escala unificada en tarjetas de home, pendientes y "ver anteriores" */
.home-btn,
.form-header-card,
.pending-card {
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform var(--duration-med) var(--ease),
              box-shadow var(--duration-med) var(--ease),
              border-color var(--duration-med) var(--ease);
}

/* Override para el botón primario "Nuevo relevamiento": tiene que ganar a la
   regla genérica de arriba (que pone background blanco). Necesitamos esta
   redeclaración después porque la regla anterior aparece DESPUÉS de la
   declaración original de .home-btn-primary y la pisa con background:white. */
.home-btn.home-btn-primary {
  background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
  border: none;
  color: #fff;
  box-shadow: 0 6px 20px rgba(196, 139, 40, 0.3);
}
.home-btn.home-btn-primary .home-btn-title {
  color: #fff;
}
.home-btn.home-btn-primary .home-btn-sub {
  color: rgba(255, 255, 255, 0.85);
}

.home-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(196, 139, 40, .22);
}
.home-btn.home-btn-primary:hover {
  border-color: transparent;
}

.home-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-card);
}

/* Accordion headers: hover más sutil, active con acento dorado sin glow exagerado */
.acc-header {
  transition: background var(--duration-fast) var(--ease),
              color var(--duration-fast) var(--ease),
              border-color var(--duration-fast) var(--ease);
}

.acc-header:hover {
  background: var(--surface-soft);
}

.acc-section.open > .acc-header {
  border-left: 3px solid var(--accent);
}

/* Photo thumbnails: radio consistente + sombra suave */
.foto-thumb {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: transform var(--duration-med) var(--ease),
              box-shadow var(--duration-med) var(--ease);
}

.foto-thumb:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}

/* Sync banners: border-left semántico pero sombra más suave */
.sync-banner {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  font-variant-numeric: tabular-nums;
}

.sync-banner-ok {
  border-left: 3px solid var(--success);
}

.sync-banner-err {
  border-left: 3px solid var(--danger);
}

.sync-banner-info {
  border-left: 3px solid var(--info);
}

.sync-banner-active {
  border-left: 3px solid var(--accent);
}

/* Save bar pegada abajo: sombra superior sutil, respeta safe-area */
.form-save-bar {
  box-shadow: 0 -1px 0 var(--border), 0 -6px 20px rgba(17, 24, 39, .06);
  padding-bottom: calc(var(--safe-bottom) + 16px);
}

/* Botón primario grande (Guardar, Entrar) — texto oscuro para contraste */
.btn-primary {
  color: var(--text);
  background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent-dark) 100%);
  box-shadow: 0 1px 2px rgba(17, 24, 39, .08), 0 4px 12px rgba(196, 139, 40, .22);
  border: 1px solid rgba(26, 26, 46, .08);
  transition: transform var(--duration-fast) var(--ease),
              box-shadow var(--duration-fast) var(--ease),
              filter var(--duration-fast) var(--ease);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(17, 24, 39, .08), 0 8px 20px rgba(196, 139, 40, .28);
  filter: brightness(1.02);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(17, 24, 39, .1);
}

/* Números tabulares en contextos densos */
.pending-created,
.pending-title,
.pending-sub,
.home-btn-badge,
.home-btn-sub,
.foto-size,
.foto-counter,
.detail-row,
.detail-value {
  font-variant-numeric: tabular-nums;
}

/* Text balance en títulos clave */
.screen-title,
.home-btn-title,
.login-brand h1,
.onboard-modal h2,
.pending-title {
  text-wrap: balance;
  letter-spacing: 0;
}

.login-brand h1,
.screen-title {
  letter-spacing: -0.01em;
}

/* Reduced motion global — corta animaciones decorativas pero mantiene spinner */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
  /* Spinner: feedback funcional, lo dejamos girar */
  .spinner {
    animation: spin 0.7s linear infinite !important;
  }
}

/* ============================================================
   READINESS / DURABILIDAD UI
   ============================================================ */
.topbar-aux {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #fff;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}
.topbar-aux:active { background: rgba(255, 255, 255, 0.18); }

.home-btn-meta {
  border: 1px dashed rgba(0, 0, 0, 0.18);
  background: rgba(255, 255, 255, 0.85);
}

.readiness-card {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.readiness-status {
  font-size: 14px;
  font-weight: 600;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
}
.readiness-status-ok { background: #ecfdf5; color: #15803d; border: 1px solid #a7f3d0; }
.readiness-status-warn { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }

.readiness-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.readiness-row:first-of-type { border-top: 0; }
.readiness-icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  margin-top: 2px;
}
.readiness-row-ok .readiness-icon { background: #d1fae5; color: #15803d; }
.readiness-row-pending .readiness-icon { background: #fef3c7; color: #b45309; }
.readiness-text { flex: 1; }
.readiness-label { font-size: 14px; font-weight: 600; color: var(--text); }
.readiness-detail { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
.readiness-pending {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fffbeb;
  border-radius: 10px;
  font-size: 13px;
  color: #92400e;
}
.readiness-meta {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* Acciones por pendiente (descartar / reabrir) */
.pending-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.pending-actions button {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 8px;
}
.pending-actions .pending-discard { color: #b91c1c !important; }

/* Loading state para firma lazy */
.firma-detalle-loading {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px dashed rgba(0, 0, 0, 0.1);
}


.readiness-version {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0;
  opacity: 0.7;
}


/* ============================================================
   PULIDO VISUAL (auditoría 16/8) — detalle y bloques de lectura
   ============================================================ */

/* Filas del detalle: etiqueta apagada, valor con peso. Separador finito entre filas. */
.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-soft);
}
.detail-row:last-child { border-bottom: none; }
.detail-label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; flex-shrink: 0; }
.detail-value { font-size: 14px; color: var(--text); font-weight: 600; text-align: right; word-break: break-word; }

.detail-block { padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.detail-block:last-child { border-bottom: none; }
.detail-block .detail-label { display: block; margin-bottom: 4px; }
.detail-block-value {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

/* Grilla de fotos del detalle */
.detail-adj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.detail-adj-img {
  display: block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-xs);
}
.detail-adj-img img { width: 100%; height: 110px; object-fit: cover; display: block; }
.detail-adj-name {
  display: block;
  padding: 6px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Estado vacío general (listas sin datos) */
.empty-hint {
  text-align: center;
  padding: 34px 20px;
  color: var(--text-muted);
  font-size: 14px;
}
.empty-hint-ico { font-size: 34px; display: block; margin-bottom: 8px; opacity: .55; }

/* Respeta a quien prefiere menos movimiento (accesibilidad del sistema). */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ============================================================
   PLAN DEL MES (16/8) — qué edificios hay que relevar
   ============================================================ */

/* Navegador de mes: pastilla fija arriba del listado. */
.plan-mes-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-xs);
}
.plan-mes-btn {
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  border-radius: 11px;
  font-size: 20px; line-height: 1;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
}
.plan-mes-btn:active { transform: scale(.94); }
.plan-mes-lbl { flex: 1; text-align: center; font-weight: 800; font-size: 14.5px; color: var(--text); }
.plan-mes-hoy {
  padding: 9px 13px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  border-radius: 11px;
  font-size: 12.5px; font-weight: 700;
  color: var(--text-muted);
  font-family: inherit;
  cursor: pointer;
}

.plan-resumen { font-size: 13px; color: var(--text-muted); margin: 0 2px 12px; }
.plan-resumen-pend { color: var(--danger); font-weight: 800; }
.plan-resumen-ok { color: #15803d; font-weight: 700; }

/* Ficha de edificio del plan. La franja izquierda dice el estado sin leer nada. */
.plan-card {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid #cbd5e1;
  border-radius: var(--radius);
  padding: 13px 14px;
  margin-bottom: 11px;
  box-shadow: var(--shadow-card);
}
.plan-card.plan-alert { border-left-color: var(--danger); }
.plan-card.plan-warn { border-left-color: var(--warning); }
.plan-card.plan-ok { border-left-color: #22c55e; }
.plan-card.plan-na { border-left-color: #94a3b8; }

.plan-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan-cons { font-weight: 800; font-size: 15px; color: var(--text); letter-spacing: -.2px; }
.plan-meta { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }
.plan-notas { font-size: 12.5px; color: #b45309; margin-top: 5px; }

/* Datos del encargado: con quién coordinar para entrar al edificio. */
.plan-enc {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text);
}
.plan-enc-nom { font-weight: 700; }
.plan-enc-rol { font-weight: 500; color: var(--text-muted); font-size: 11.5px; }
.plan-enc-hor { color: var(--text-muted); }
.plan-enc-vacio { color: var(--text-muted); font-style: italic; }
/* El teléfono es un target táctil: se llama con el pulgar, caminando. */
.plan-tel {
  margin-left: auto;
  padding: 7px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.plan-acciones { margin-top: 10px; }
.plan-btn-relevar {
  width: 100%;
  min-height: 44px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(196, 139, 40, .26);
}
.plan-btn-relevar:active { transform: scale(.985); }

/* Los que no tocan este mes: lista comprimida, no compite con la del mes. */
.plan-otros-tit { margin-top: 18px; font-weight: 700; font-size: 13px; color: var(--text-muted); }
.plan-otros { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.plan-chip {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 11px;
  font-size: 12px;
  color: var(--text-muted);
}
.plan-chip strong { color: var(--text); font-weight: 700; }

/* Chips de estado que faltaban para el plan (los otros ya existen arriba). */
.chip-na { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
