/* ==========================================================================
   Locksmith CRM — demo
   Estilo de producto (app), no de web de marketing: el cliente tiene que ver
   una herramienta, no una landing.
   ========================================================================== */

:root {
  --brand: #1f6feb;
  --brand-dark: #1858c4;
  --ink: #0f1720;
  --ink-soft: #35404e;
  --slate: #6b7684;
  --line: #e2e6ec;
  --bg: #f4f6f9;
  --card: #ffffff;
  --ok: #12855a;
  --ok-bg: #e6f6ef;
  --err: #c0392b;
  --err-bg: #fdecea;
  --urgent: #d94f2b;

  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 32, .06);
  --shadow: 0 4px 16px rgba(15, 23, 32, .08);
  --shadow-lg: 0 12px 40px rgba(15, 23, 32, .12);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  /* Nada debe desplazar la página en horizontal en el móvil. Es el cinturón;
     los tirantes son los min-width:0 de más abajo, que atacan la causa. */
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1rem; }

/* ── Chrome de la app ────────────────────────────────────────────────────── */
.app-bar {
  background: linear-gradient(100deg, #0c2019 0%, #123a2b 55%, #0e2c20 100%);
  color: #fff;
  padding: .85rem 0;
  /* El verde sube hasta la barra de estado del iPhone (zona segura). */
  padding-top: calc(.85rem + env(safe-area-inset-top, 0px));
  box-shadow: var(--shadow-sm);
}
/* flex-wrap:nowrap + min-width:0 es lo que impide que esta barra ensanche la
   página. Por defecto un item flex no encoge por debajo de su min-content, así
   que "Locksmith CRM" + los dos enlaces sumaban más que un móvil estrecho y
   desbordaban el body (que es lo que dejaba scroll lateral). */
.app-bar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: nowrap;
  min-width: 0;
}
.logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  font-size: 1.02rem;
  /* Si no cabe, que se recorte la marca antes que romper el layout. */
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.logo .mark {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  color: #3ee6a9;               /* llave esmeralda suelta, sin cuadro de fondo */
  flex: none;
}
.logo .mark svg { width: 26px; height: 26px; }
.logo .mark img { width: 28px; height: 28px; display: block; }
/* flex:none — la navegación no se comprime; lo que cede es la marca. */
.app-bar nav { display: flex; gap: .4rem; flex: none; }
.app-bar nav a {
  color: #ffffff;               /* texto blanco */
  text-decoration: none;
  font-size: .88rem;
  font-weight: 600;
  padding: .4rem .8rem;
  border-radius: 7px;
  white-space: nowrap;          /* nunca partir "Log a job" en dos líneas */
}
.app-bar nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
/* Tab activo: pastilla translúcida clara, texto blanco (para que resalte sin
   perder el blanco sobre el verde). */
.app-bar nav a.active { background: rgba(255,255,255,.18); color: #fff; }

/* En móvil: candado (solo icono) fijado a la izquierda, el menú sale de él, y
   las pestañas Log a job · Jobs · Dashboard quedan CENTRADAS en el header.
   El logo va absolute (fuera del flujo) para que la nav se centre en todo el ancho. */
@media (max-width: 560px) {
  .app-bar .wrap { justify-content: flex-end; }   /* pestañas a la derecha */
  .logo-txt { display: none; }                 /* sin "Locksmith CRM" */
  .logo {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    padding: 0; gap: 3px;
  }
  .logo .mark { width: 30px; height: 30px; }
  .app-bar nav { gap: .25rem; }
  .app-bar nav a { padding: .45rem .6rem; font-size: .86rem; }
  .menu { left: 14px; }
}

.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* ── Cabecera de página ──────────────────────────────────────────────────── */
.page-head { padding: 2.4rem 0 1.4rem; }
.page-head h1 { font-size: 1.6rem; }
.page-head p { color: var(--slate); margin: 0; font-size: .96rem; }

/* ── Tarjeta / formulario ────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.8rem;
  margin-bottom: 2.5rem;
}

fieldset { border: 0; margin: 0 0 1.6rem; padding: 0; }
fieldset:last-of-type { margin-bottom: 1rem; }
legend {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--slate);
  padding: 0 0 .8rem;
  width: 100%;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.1rem;
}

/* minmax(0, 1fr) en vez de 1fr: por defecto una pista de grid no baja de su
   min-content, y el <select> de servicios mide lo que su opción más larga
   ("Car key replacement / programming"). Eso empujaba la página a lo ancho. */
.row { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); margin-bottom: 1rem; }
/* Dentro de una fila, el espacio lo pone el gap (no el margen del campo),
   así el apilado en móvil queda con la misma distancia que los campos sueltos. */
.row .field { margin-bottom: 0; }
@media (min-width: 621px) {
  .row.cols-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
/* City / State / ZIP: siempre en la misma línea (también en móvil). La ciudad
   se lleva el ancho; State y ZIP van estrechos. */
.row.cols-3 { grid-template-columns: minmax(0, 1.6fr) minmax(0, .7fr) minmax(0, 1fr); gap: .6rem; }

.field { margin-bottom: 1rem; }
.field:last-child { margin-bottom: 0; }
.field label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: .35rem;
}
.field .opt { color: var(--slate); font-weight: 400; }
.field .req { color: #12b981; font-weight: 700; margin-left: 1px; }
.field select { text-overflow: ellipsis; }

.field input, .field select, .field textarea {
  width: 100%;
  /* Sin esto, input y select imponen su ancho intrínseco (el select, el de su
     opción más larga) y desbordan el contenedor en pantallas estrechas. */
  min-width: 0;
  max-width: 100%;
  min-height: 46px;
  padding: .6rem .8rem;
  border: 1px solid #ccd3dd;
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { min-height: 92px; resize: vertical; }
/* iOS no respeta el ancho en date/time y usa su tamaño nativo (se salen del
   contenedor). Con appearance:none respetan el width:100% como los demás. */
.field input[type="datetime-local"],
.field input[type="date"],
.field input[type="time"] { -webkit-appearance: none; appearance: none; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, .16);
}
.field.invalid input, .field.invalid select { border-color: var(--err); background: #fff8f7; }
.field .err { display: none; font-size: .8rem; color: var(--err); margin-top: .3rem; }
.field.invalid .err { display: block; }
.field .hint { font-size: .8rem; color: var(--slate); margin-top: .3rem; }

/* Selector de urgencia — botones de radio con pinta de segmented control */
/* position:relative es CLAVE: los radios van con position:absolute+opacity:0;
   sin un ancestro posicionado "flotan" arriba del contenedor y, al enfocarlos
   (dentro de un modal con scroll), el navegador salta al inicio. Anclándolos
   aquí se quedan en su sitio y no hay salto. */
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 46px;
  margin: 0;
  padding: .5rem .4rem;
  border: 1px solid #ccd3dd;
  border-radius: var(--radius);
  background: #fff;
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: center;
  cursor: pointer;
  transition: all .15s ease;
}
.seg label:hover { border-color: var(--brand); }
.seg input:checked + label { background: var(--brand); border-color: var(--brand); color: #fff; }
.seg input:checked + label.is-urgent { background: var(--urgent); border-color: var(--urgent); }
.seg input:focus-visible + label { box-shadow: 0 0 0 3px rgba(31, 111, 235, .3); }

/* Importe cobrado — el $ va dentro del campo, no en el label, para que se lea
   como una cifra de dinero y no como un texto cualquiera. */
.money-input { position: relative; }
.money-sign {
  position: absolute;
  left: .85rem; top: 50%;
  transform: translateY(-50%);
  color: var(--slate);
  font-size: 1.05rem;
  font-weight: 600;
  pointer-events: none;
}
.money-input input {
  padding-left: 1.9rem;
  font-size: 1.1rem;
  font-weight: 700;
}

/* Sugerencias de dirección (Google Places) */
.addr-suggest {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 40;
  margin: 4px 0 0;
  padding: 4px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  max-height: 260px;
  overflow-y: auto;
}
.addr-suggest[hidden] { display: none; }
.addr-item {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  padding: .6rem .6rem;
  border-radius: 7px;
  font-size: .92rem;
  color: var(--ink);
  cursor: pointer;
}
.addr-item svg { flex: none; margin-top: .15rem; color: var(--slate); }
.addr-item.active, .addr-item:hover { background: var(--bg); }
.addr-item.active svg, .addr-item:hover svg { color: var(--brand); }

/* Listado del equipo (Team) */
.team-tip { color: var(--slate); font-size: .85rem; margin: -.4rem 0 1rem; }
.team-rows { display: grid; gap: .6rem; }
.team-item {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  width: 100%; text-align: left; font-family: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: .8rem 1rem; box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.team-item:hover { border-color: var(--brand); }
.team-who { display: flex; flex-direction: column; min-width: 0; }
.team-who strong { font-size: .96rem; }
.team-who small { color: var(--slate); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#role-hint { display: block; }

/* Panel de usuario */
.user-info { margin: 0; }
.user-info > div { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.user-info dt { color: var(--slate); font-size: .86rem; }
.user-info dd { margin: 0; font-weight: 600; font-size: .92rem; text-align: right; word-break: break-word; }
.um-msg { min-height: 1.1em; margin: .7rem 0 0; font-size: .86rem; }
.um-msg.ok { color: var(--ok); }
.um-msg.err { color: var(--err); }
.um-sep { border: 0; border-top: 1px solid var(--line); margin: 1.6rem 0 1.2rem; }
.um-danger-label { font-size: .86rem; color: var(--slate); margin: 0 0 .7rem; }

.btn-danger { background: var(--err); color: #fff; }
.btn-danger:hover { background: #a3271b; }
.btn-danger.armed { background: #a3271b; }

/* Sugerencias de cliente existente (por teléfono) */
.cust-suggest {
  margin: -.3rem 0 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-alt, #f6f7f9);
  padding: .7rem;
}
.cust-suggest[hidden], .cust-using[hidden] { display: none; }
.cust-suggest-head { margin: 0 0 .5rem; font-size: .82rem; font-weight: 700; color: var(--ink-soft); }
.cust-suggest-foot { margin: .5rem 0 0; font-size: .78rem; color: var(--slate); }
.cust-row {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  width: 100%; text-align: left;
  padding: .6rem .7rem; margin-bottom: .35rem;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; cursor: pointer;
  font-family: inherit;
}
.cust-row:last-of-type { margin-bottom: 0; }
.cust-row:hover { border-color: var(--brand); }
.cust-info { display: flex; flex-direction: column; min-width: 0; }
.cust-info strong { font-size: .92rem; }
.cust-info small { color: var(--slate); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cust-use { flex: none; font-size: .82rem; font-weight: 700; color: var(--brand); }

.cust-using { margin: -.3rem 0 1rem; }
.cust-chip {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .4rem .5rem .4rem .7rem;
  background: var(--ok-bg); color: var(--ok);
  border: 1px solid #b9e5d1; border-radius: 999px;
  font-size: .85rem; font-weight: 600;
}
.cust-chip button {
  display: grid; place-items: center;
  width: 22px; height: 22px; margin-left: .1rem;
  border: 0; border-radius: 50%;
  background: rgba(0,0,0,.06); color: inherit;
  font-size: 1rem; line-height: 1; cursor: pointer;
}
.cust-chip button:hover { background: rgba(0,0,0,.12); }

/* Botón de escanear el carnet */
.scan-btn { margin-bottom: 1.2rem; }
.scan-btn svg { color: var(--brand); }

/* Modal de la cámara (pantalla completa) */
.scan-modal {
  position: fixed; inset: 0; z-index: 300;
  background: #000;
  display: flex; flex-direction: column;
}
.scan-modal[hidden] { display: none; }
.scan-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-overlay {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  pointer-events: none;
}
.scan-frame {
  width: min(86vw, 460px);
  aspect-ratio: 5 / 3;
  border: 3px solid rgba(255, 255, 255, .9);
  border-radius: 14px;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45);
}
.scan-top {
  position: relative; z-index: 1;
  padding: calc(env(safe-area-inset-top, 0) + 1.2rem) 1.2rem 0;
  text-align: center;
}
.scan-hint {
  display: inline-block;
  margin: 0;
  padding: .6rem 1rem;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  border-radius: 10px;
  font-size: .92rem;
}
.scan-bottom {
  position: relative; z-index: 1;
  margin-top: auto;
  padding: 1.2rem 1.2rem calc(env(safe-area-inset-bottom, 0) + 1.4rem);
  text-align: center;
}
.scan-status { color: #fff; font-size: .9rem; margin: 0 0 .9rem; min-height: 1.2em; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.scan-bottom .btn { background: #fff; }

/* Honeypot */
/* Honeypot. Nada de left:-9999px: en algunos navegadores móviles eso mismo
   provoca el desplazamiento lateral que estamos intentando quitar. */
.hp {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* ── Botones ─────────────────────────────────────────────────────────────── */
.actions { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 46px;
  padding: .65rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: .96rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s ease, transform .1s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled { background: #9db8e6; cursor: not-allowed; }
.btn-quiet { background: #fff; border-color: #ccd3dd; color: var(--ink-soft); }
.btn-quiet:hover { background: #f7f9fb; }
/* Botón a ancho completo (como los campos del formulario). */
.btn-block { display: flex; width: 100%; }

:focus-visible { outline: 3px solid rgba(31, 111, 235, .5); outline-offset: 2px; }

/* ── Mensajes ────────────────────────────────────────────────────────────── */
.msg {
  display: none;
  align-items: flex-start;
  gap: .7rem;
  margin-top: 1.2rem;
  padding: .9rem 1.1rem;
  border-radius: var(--radius);
  font-size: .93rem;
}
.msg.show { display: flex; }
.msg svg { flex: none; margin-top: .15rem; }
.msg-err { background: var(--err-bg); color: var(--err); border: 1px solid #f3c2bd; }
.msg strong { display: block; }

/* ── Login del formulario ─────────────────────────────────────────────────── */
.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}
.gate[hidden] { display: none; }
.gate-card {
  width: 100%;
  max-width: 340px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 2rem 1.6rem;
  text-align: center;
}
.gate-logo {
  display: grid; place-items: center;
  width: 52px; height: 52px;
  margin: 0 auto 1rem;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
}
.gate-card h1 { font-size: 1.3rem; margin-bottom: .2rem; }
.gate-sub { color: var(--slate); font-size: .9rem; margin-bottom: 1.3rem; }
.gate-card input {
  width: 100%;
  min-height: 48px;
  padding: .7rem .9rem;
  margin-bottom: .8rem;
  border: 1px solid #ccd3dd;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
}
.gate-card input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,111,235,.16); }
.gate-err { min-height: 1.1em; margin: .7rem 0 0; font-size: .85rem; color: var(--err); }
.gate-forgot {
  margin: .9rem auto 0;
  display: block;
  border: 0; background: transparent;
  color: var(--brand); font-family: inherit;
  font-size: .86rem; font-weight: 600; cursor: pointer;
}
.gate-forgot:hover { text-decoration: underline; }
.gate-forgot:disabled { opacity: .6; cursor: default; }
.gate-note { min-height: 1.1em; margin: .7rem 0 0; font-size: .84rem; color: var(--slate); }
.gate-note.ok { color: var(--ok); }
.gate-note.err { color: var(--err); }
.gate-card input[type="password"] { margin-bottom: .8rem; }
.gate.busy .gate-card { opacity: .6; pointer-events: none; }

/* Botón de salir, en el nav. Se apaga hasta que hay sesión. */
.nav-logout {
  border: 1px solid rgba(255,255,255,.24);
  background: transparent;
  color: rgba(255,255,255,.72);
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  padding: .35rem .7rem;
  border-radius: 7px;
  cursor: pointer;
}
.nav-logout:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-logout[hidden] { display: none; }

/* ── Pestaña Jobs ─────────────────────────────────────────────────────────── */
/* Solo la cabecera de Jobs es flex (título + botón Refresh). No tocar el
   .page-head global, que en el formulario lleva h1 y p directos. */
.jobs-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between; }
/* Título + icono de recargar en la misma línea. */
.title-row { display: flex; align-items: center; gap: .55rem; }
.title-row h1 { margin: 0; }
/* Botón alineado a la derecha de la fila del título (p. ej. Google Sheet en Dashboard). */
.dash-sheet { margin-left: auto; }
/* Botón de recargar: solo el icono (círculo con flecha), sin caja. */
.refresh-btn {
  border: 0; background: none; padding: .2rem; margin: 0; cursor: pointer;
  color: var(--slate); display: inline-grid; place-items: center;
  border-radius: 8px; flex: none; -webkit-tap-highlight-color: transparent;
}
.refresh-btn .reload-ico { display: block; transition: transform .15s ease; }
.refresh-btn:hover { color: var(--brand); }
.refresh-btn:hover .reload-ico { transform: rotate(-25deg); }
.refresh-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.refresh-btn.spinning { color: var(--brand); }
.refresh-btn.spinning .reload-ico { animation: spin .7s linear infinite; }
.refresh-btn.spinning:hover .reload-ico { transform: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.dash-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
#sheet-btn svg { color: #188038; }
.jobs-loading, .jobs-empty { color: var(--slate); font-size: .95rem; padding: .6rem 0; }

/* Barra de búsqueda por teléfono */
.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 1.4rem;
}
.search-bar .search-ico {
  position: absolute;
  left: .85rem;
  color: var(--slate);
  pointer-events: none;
}
.search-bar input {
  width: 100%;
  min-height: 48px;
  padding: .7rem 2.6rem;
  border: 1px solid #ccd3dd;
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}
.search-bar input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, .16);
}
.search-clear {
  position: absolute;
  right: .5rem;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--slate);
  cursor: pointer;
}
.search-clear:hover { background: var(--bg); color: var(--ink); }
.search-clear[hidden] { display: none; }
.jobs-empty-card { text-align: center; padding: 3rem 1.4rem; }

.jobs-group {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--slate);
  margin: 2rem 0 1rem;
}
.jobs-group:first-child { margin-top: .5rem; }
.jobs-group span {
  display: inline-block;
  margin-left: .4rem;
  padding: .05rem .5rem;
  border-radius: 999px;
  background: var(--line);
  color: var(--ink-soft);
  font-size: .8rem;
}

.jobs-list { display: grid; gap: .7rem; }
@media (min-width: 1100px) { .jobs-list { grid-template-columns: repeat(2, 1fr); } }

.job {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 10px;
  padding: .85rem .95rem;
  background: #fff;
}
.job-urgent { border-left-color: var(--err); background: var(--err-bg); }
.job-done { border-left-color: var(--ok); opacity: .82; }
/* Completadas: caja más compacta (sin address, menos aire). */
.job-done { gap: .4rem; padding: .65rem .8rem; }
.job-done .job-who strong { font-size: .92rem; }
.job-done .job-service { font-size: .86rem; }
.job-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }
.job-who { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.job-who strong { font-size: .98rem; line-height: 1.25; word-break: break-word; }
.job-tel {
  display: inline-flex; align-items: center; gap: .3rem;
  color: var(--brand); text-decoration: none;
  font-size: .86rem; font-weight: 600; padding: .15rem 0; min-height: 24px;
}
.job-tel:hover { text-decoration: underline; }
.job-body { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.job-service { font-size: .9rem; font-weight: 600; color: var(--ink-soft); word-break: break-word; }
.job-line {
  display: flex; align-items: flex-start; gap: .35rem;
  font-size: .83rem; color: var(--slate); word-break: break-word;
}
.job-line svg { flex: none; margin-top: .2rem; }
.job-sched { color: var(--brand); font-weight: 600; }
/* Dirección clickeable (abre app de mapas). Botón que se ve como una línea. */
.job-addr {
  font-family: inherit; text-align: left; border: 0; background: none;
  cursor: pointer; padding: .1rem 0; width: 100%; color: var(--brand);
  position: relative; z-index: 1;
}
.job-addr .job-addr-txt { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(0,0,0,.18); }
.job-addr .job-addr-nav { margin-top: .18rem; opacity: .7; }
.job-addr:hover .job-addr-txt { text-decoration-color: currentColor; }

/* Hoja inferior para elegir app de mapas. */
.maps-sheet {
  position: fixed; inset: 0; z-index: 320;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 12px; background: rgba(15, 23, 32, .5);
  opacity: 0; transition: opacity .2s ease;
}
.maps-sheet.show { opacity: 1; }
.maps-card {
  background: #fff; width: 100%; max-width: 420px;
  border-radius: 18px; padding: .5rem; padding-bottom: calc(.5rem + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow-lg);
  transform: translateY(14px); transition: transform .2s ease;
}
.maps-sheet.show .maps-card { transform: translateY(0); }
.maps-addr {
  padding: .8rem 1rem .6rem; text-align: center; color: var(--slate);
  font-size: .85rem; line-height: 1.4; border-bottom: 1px solid var(--line); margin-bottom: .35rem;
}
.maps-opt {
  display: block; width: 100%; text-align: center; text-decoration: none;
  font-family: inherit; font-size: 1.02rem; font-weight: 600; color: var(--brand);
  background: none; border: 0; cursor: pointer;
  padding: .95rem 1rem; border-radius: 12px;
}
.maps-opt:hover { background: var(--bg); }
.maps-opt:active { background: var(--line); }
.maps-cancel { color: var(--slate); font-weight: 700; margin-top: .2rem; }
.job-meta {
  display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
  margin-top: auto; padding-top: .5rem; border-top: 1px solid var(--line);
}
.jm { font-size: .78rem; font-weight: 600; color: var(--ink-soft); background: var(--bg); padding: .12rem .5rem; border-radius: 999px; }
.job-urgent .jm { background: rgba(255,255,255,.7); }
.jm-money { color: var(--ok); }

.tag { display: inline-block; padding: .12rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.tag-blue { background: #e8f0fe; color: var(--brand); }
.tag-green { background: var(--ok-bg); color: var(--ok); }
.tag-red { background: var(--err-bg); color: var(--err); }
.tag-amber { background: #fff4d6; color: #9a6700; }
.tag-grey { background: #eceff3; color: var(--slate); }

/* ── Dashboard (KPIs y barras) ───────────────────────────────────────────── */
.card-title {
  font-size: .76rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--slate); margin-bottom: 1.1rem;
}
/* Cabecera del bloque de día con selector de fecha */
.dash-dayhead {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin: .5rem 0 1rem;
}
.dash-daypick { display: flex; align-items: center; gap: .5rem; }
.day-picker {
  min-height: 40px;
  padding: .4rem .7rem;
  border: 1px solid #ccd3dd;
  border-radius: 9px;
  font-size: .92rem;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}
.day-picker:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,111,235,.16); }
.daybtn {
  min-height: 40px;
  padding: .4rem .9rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--brand);
  font-weight: 600;
  font-size: .88rem;
  font-family: inherit;
  cursor: pointer;
}
.daybtn:hover { background: var(--bg); }
.dash-range { flex-wrap: wrap; align-items: flex-end; justify-content: flex-end; gap: .5rem; }
/* Cada fecha lleva su etiqueta encima (From / To) para que se entienda.
   Base fija que puede encoger: así el input acaba antes del guion, sin solaparse. */
.range-field { display: flex; flex-direction: column; gap: 3px; flex: 1 1 135px; min-width: 0; }
.range-field .day-picker { width: 100%; min-width: 0; }
.range-lab { font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--slate); }
.range-dash { color: var(--slate); align-self: flex-end; padding: 0 .1rem .6rem; flex: none; }
/* En móvil el rango ocupa su propia línea y las fechas se ven completas. */
@media (max-width: 560px) {
  .dash-dayhead { flex-wrap: wrap; }
  .dash-section-actions { width: 100%; margin-left: 0; }
  /* Los controles de fecha ocupan la línea completa bajo el título, alineados
     a la izquierda, y pueden envolver para llevar el botón a una línea aparte. */
  .dash-daypick { flex: 1 1 100%; flex-wrap: wrap; justify-content: flex-start; gap: .5rem; }
  .dash-range { justify-content: flex-start; align-items: flex-end; }

  /* Today: fecha a ancho completo; el botón "Today" abajo, a la izquierda. */
  .dash-daypick > .day-picker { flex: 1 1 100%; order: 0; }
  .dash-daypick > .daybtn { order: 1; flex: 0 0 auto; }

  /* All time: From y To en la MISMA línea (base 44% → llenan la fila y se
     reparten); el botón "All time" no cabe y cae solo a la línea de abajo. */
  .dash-range .range-field { flex: 1 1 44%; min-width: 0; }
  .dash-range .range-dash { display: none; }   /* sin el guion, se ve más limpio */

  /* iOS deja el input de fecha vacío en blanco; pintamos el formato dentro. */
  .day-picker.is-empty::before {
    content: attr(data-ph);
    color: var(--slate);
  }
}

/* Secciones del Dashboard: título con barra esmeralda + su bloque. */
.dash-section { margin-bottom: 2rem; }
.dash-section:last-child { margin-bottom: 0; }
.dash-section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .8rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.dash-section-title {
  display: flex; align-items: center; gap: .5rem;
  margin: 0;
  font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em;
  color: var(--ink);
}
.dash-section-title::before {
  content: ""; width: 4px; height: 1.05em; border-radius: 3px;
  background: #12b981; flex: none;
}
.dash-section-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem; margin-bottom: 1.2rem; }
@media (min-width: 760px) { .kpis-4 { grid-template-columns: repeat(4, 1fr); } }
.kpis-2 { grid-template-columns: repeat(2, 1fr); }
.card.kpi { display: flex; flex-direction: column; gap: .15rem; padding: 1.1rem; margin: 0; }
.kpi-value { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.kpis-2 .kpi-value { font-size: 2.1rem; }
.kpi-label { font-size: .78rem; color: var(--slate); font-weight: 600; }
.kpi.blue .kpi-value { color: var(--brand); }
.kpi.red .kpi-value { color: var(--err); }
.kpi.green .kpi-value { color: var(--ok); }

.split { display: grid; gap: 1.2rem; }
@media (min-width: 1100px) { .split { grid-template-columns: 1fr 1fr; } }

/* Las 3 tarjetas de gráficas con la MISMA separación entre todas.
   Money by payment method ocupa toda la fila; service y technician debajo. */
.dash-charts { display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
.dash-charts .card { margin: 0; }
@media (min-width: 1100px) {
  .dash-charts { grid-template-columns: 1fr 1fr; }
  .dash-charts .chart-wide { grid-column: 1 / -1; }
}

.bar-row { display: grid; grid-template-columns: minmax(90px, 1.1fr) 2fr auto; gap: .7rem; align-items: center; margin-bottom: .6rem; }
.bar-label { font-size: .88rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { display: block; height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: #2f80ed; border-radius: 99px; }  /* barras de conteo: azul */
.bar-money { background: var(--ok); }                                                  /* barras de dinero: verde */
.bar-value { font-size: .88rem; font-weight: 700; text-align: right; white-space: nowrap; }
.bar-value small { color: var(--slate); font-weight: 500; margin-left: .35rem; }
@media (max-width: 560px) {
  .bar-row { grid-template-columns: 1fr auto; gap: .2rem .6rem; margin-bottom: .9rem; }
  .bar-label { grid-column: 1; white-space: normal; }
  .bar-value { grid-column: 2; grid-row: 1; }
  .bar-track { grid-column: 1 / -1; grid-row: 2; }
}

/* ── Tarjeta editable + modal ────────────────────────────────────────────── */
.job { cursor: pointer; transition: box-shadow .15s ease, transform .1s ease; }
.job:hover { box-shadow: var(--shadow); }
.job:active { transform: scale(.998); }
/* El teléfono es un enlace: al tocarlo NO se abre el editor (lo para el JS),
   pero visualmente conviene que se note que es su propia acción. */
.job-tel { position: relative; z-index: 1; }

/* Swipe-to-delete (owner/admin): la tarjeta se desliza y revela "Delete". */
.job-swipe { position: relative; overflow: hidden; border-radius: 10px; }
.job-swipe .job { position: relative; z-index: 1; transition: transform .22s ease; touch-action: pan-y; }
.job-swipe.dragging .job { transition: none; }
.job-del {
  position: absolute; top: 0; right: 0; bottom: 0; width: 96px; z-index: 0;
  border: 0; background: #d92d20; color: #fff;
  font-family: inherit; font-weight: 700; font-size: .95rem;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  /* Invisible hasta que se desliza (si no, se transparenta a través de las
     tarjetas completadas, que tienen opacidad). */
  opacity: 0; transition: opacity .12s ease;
}
.job-swipe.dragging .job-del,
.job-swipe.open .job-del { opacity: 1; }
.job-del:hover { background: #c0261a; }
/* Al exponer el delete: el lado derecho del job y el izquierdo del delete se
   vuelven rectos, para que se vean unidos (las esquinas exteriores, redondas). */
.job-swipe.dragging .job,
.job-swipe.open .job { border-top-right-radius: 0; border-bottom-right-radius: 0; }

/* Popup de confirmación (borrar). */
.confirm-modal {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(15, 23, 32, .5);
}
.confirm-card {
  background: #fff; width: 100%; max-width: 380px;
  border-radius: 16px; padding: 1.5rem 1.4rem 1.4rem;
  box-shadow: var(--shadow-lg);
}
.confirm-card h2 { margin: 0 0 .4rem; font-size: 1.15rem; }
.confirm-card p { margin: 0 0 1.3rem; color: var(--slate); font-size: .93rem; line-height: 1.5; white-space: pre-line; }
.confirm-actions { display: flex; gap: .6rem; justify-content: flex-end; }
.confirm-actions .btn { min-width: 96px; }

.modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 32, .5); }
.modal-panel {
  position: relative;
  width: 100%; max-width: 540px;
  max-height: 92vh;
  display: flex; flex-direction: column;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.3rem;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.modal-head h2 { margin: 0; font-size: 1.15rem; }
.modal-close {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border: 0; border-radius: 8px;
  background: transparent; color: var(--slate);
  cursor: pointer;
}
.modal-close:hover { background: var(--bg); color: var(--ink); }
.modal-body { padding: 1.3rem; overflow-y: auto; flex: 1; }
.modal-body fieldset:last-of-type { margin-bottom: .5rem; }
.modal-foot {
  display: flex; gap: .7rem; justify-content: flex-end;
  padding: 1rem 1.3rem;
  border-top: 1px solid var(--line);
  flex: none;
}
.modal-foot .btn { min-width: 96px; }

/* En móvil, el modal ocupa casi toda la pantalla y va pegado abajo. */
@media (max-width: 560px) {
  .modal { padding: 0; align-items: flex-end; }
  .modal-panel { max-width: 100%; max-height: 94vh; border-radius: 16px 16px 0 0; }
}

/* ── Pantalla de "Job saved" ─────────────────────────────────────────────── */
.success-view { padding: 2.5rem 0 3rem; }
.success-view[hidden] { display: none; }

.success-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 2.4rem 1.6rem 2rem;
  text-align: center;
}

.success-check { color: var(--ok); margin-bottom: 1rem; }
.success-check svg { margin: 0 auto; display: block; }

/* El trazo se dibuja solo. Da la sensación de "hecho" sin necesidad de texto. */
.sc-ring { stroke-dasharray: 145; stroke-dashoffset: 145; animation: sc-draw .45s ease-out forwards; }
.sc-tick { stroke-dasharray: 40; stroke-dashoffset: 40; animation: sc-draw .3s .35s ease-out forwards; }
@keyframes sc-draw { to { stroke-dashoffset: 0; } }

.success-card h1 { font-size: 1.6rem; margin-bottom: .2rem; }
.success-sub { color: var(--slate); font-size: .96rem; margin-bottom: 1.6rem; }

/* El importe es el protagonista: es el dato por el que existe el registro. */
.success-amount {
  background: var(--ok-bg);
  border: 1px solid #b9e5d1;
  border-radius: var(--radius);
  padding: 1.1rem;
  margin-bottom: 1.4rem;
}
.success-amount span {
  display: block;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
  color: var(--ok);
}
.success-amount small {
  display: block;
  margin-top: .2rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ok);
  opacity: .8;
}

.success-summary { margin: 0 0 1.6rem; text-align: left; }
.success-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .65rem 0;
  border-bottom: 1px solid var(--line);
}
.success-summary > div:last-child { border-bottom: 0; }
/* Sin esto, el display:flex de arriba tapa el [hidden] y las filas vacías
   (vehículo / negocio / fecha) se verían con un "—". */
.success-summary > div[hidden] { display: none; }
.success-summary dt { color: var(--slate); font-size: .86rem; flex: none; }
.success-summary dd {
  margin: 0;
  font-weight: 600;
  font-size: .92rem;
  text-align: right;
  min-width: 0;
  word-break: break-word;
}

.success-actions { display: grid; gap: .6rem; }

footer.foot {
  margin-top: 2.6rem;               /* aire entre el contenido y la línea del footer */
  border-top: 1px solid var(--line);
  padding: 1.6rem 0 2.4rem;
  color: var(--slate);
  font-size: .84rem;
  text-align: center;
}

/* ══════════════════════════════════════════════════════════════════════════
   LOGIN — "Trade craft" en esmeralda. Pantalla completa (sin caja), contenido
   a la izquierda, separador antes de "Forgot". Solo el gate; resto de la app igual.
   ══════════════════════════════════════════════════════════════════════════ */
.gate {
  background:
    radial-gradient(75% 48% at 50% -6%, rgba(18,185,129,.16), transparent 62%),
    radial-gradient(55% 42% at 14% 14%, rgba(52,230,169,.10), transparent 60%),
    linear-gradient(180deg, #0f1714 0%, #0a0f0c 100%);
}
/* La "tarjeta" deja de ser tarjeta: transparente, sin borde, a la izquierda */
.gate-card {
  max-width: 420px;
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  padding: 2rem 1.9rem;
  text-align: left;
}
.gate-logo {
  margin: 0 0 1.3rem;
  width: 56px; height: 56px; border-radius: 15px;
  background: linear-gradient(160deg, #3ee6a9, #12b981);
  color: #05231a;
  box-shadow: 0 8px 24px -6px rgba(18,185,129,.5);
}
.gate-logo img { width: 36px; height: 36px; display: block; }
.gate-card h1 {
  color: #f0f6f2;
  font-size: 1.5rem; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase;
  margin-bottom: .15rem;
}
.gate-sub { color: #8ba79b; margin-bottom: 1.6rem; }
.gate-card input {
  min-height: 54px;
  background: #17231d;
  border: 1px solid #2c3b34;
  color: #e9f3ee;
  border-radius: 13px;
  margin-bottom: 1rem;
}
.gate-card input::placeholder { color: #7c948a; }
.gate-card input:focus {
  outline: none; border-color: #12b981;
  box-shadow: 0 0 0 3px rgba(18,185,129,.26);
}
.gate .btn-primary {
  min-height: 54px;
  background: linear-gradient(180deg, #16c98c, #10b47e);
  color: #05231a; font-weight: 700; border-radius: 13px;
  box-shadow: 0 10px 22px -10px rgba(18,185,129,.5);
}
.gate .btn-primary:hover { background: linear-gradient(180deg, #1ad698, #13c085); }
/* Separador de línea completa + "Forgot" centrado debajo */
.gate-forgot {
  display: block; width: 100%;
  margin: 1.5rem 0 0; padding: 1.2rem 0 0;
  border: 0; border-top: 1px solid #26362f;
  background: transparent; text-align: center;
  color: #47e0a6; font-family: inherit; font-weight: 600; font-size: .9rem; cursor: pointer;
}
.gate-forgot:hover { text-decoration: underline; }
.gate-err { color: #f0776a; text-align: left; }
.gate-err:empty, .gate-note:empty { display: none; }
.gate-note { color: #8ba79b; text-align: center; }
.gate-note.ok  { color: #47e0a6; }
.gate-note.err { color: #f0776a; }

/* Botón Enter del login a ancho completo, como los inputs */
.gate .btn-primary { width: 100%; box-sizing: border-box; }
/* En desktop, el logo (la llave) centrado */
@media (min-width: 700px) {
  .gate-logo { margin-left: auto; margin-right: auto; }
}

/* ── Menú del candado (logo → dropdown) ──────────────────────────────────── */
.app-bar .wrap { position: relative; }
.logo { border: 0; background: transparent; font: inherit; color: inherit; cursor: pointer; }
.logo-caret { flex: none; opacity: .7; transition: transform .15s ease; }
.logo[aria-expanded="true"] .logo-caret { transform: rotate(180deg); }

.menu {
  position: absolute; top: calc(100% + 8px); left: 20px; z-index: 80;
  min-width: 196px; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 2px;
}
.menu[hidden] { display: none; }
.menu a, .menu button {
  display: flex; align-items: center; gap: .6rem;
  width: 100%; text-align: left;
  padding: .62rem .7rem; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink); font-family: inherit; font-size: .93rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
.menu a svg, .menu button svg { flex: none; color: var(--slate); }
.menu a:hover, .menu button:hover { background: var(--bg); }
.menu a[hidden], .menu button[hidden] { display: none; }
.menu #menu-team svg { color: #12855a; }
.menu #menu-sheet svg { color: #188038; }
.menu #menu-install svg { color: #12855a; }
.menu #menu-notify svg { color: #12855a; }
.menu #menu-password svg { color: #12855a; }
.menu #menu-account svg { color: #12855a; }

/* Toast de avisos (notificaciones, etc.). */
.notify-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  z-index: 400; max-width: 88%;
  background: #0f2a20; color: #eafff6;
  padding: .8rem 1.1rem; border-radius: 12px;
  box-shadow: 0 14px 34px -12px rgba(0,0,0,.5);
  font-size: .9rem; font-weight: 500; text-align: center;
  opacity: 0; transition: opacity .25s ease, transform .25s ease; pointer-events: none;
}
.notify-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Modal de cuenta (onboarding de contraseña / cambiar contraseña). z-index por
   debajo del boot-cover (500) para no asomar durante la carga. */
.acct-modal {
  position: fixed; inset: 0; z-index: 490;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(15, 23, 32, .5);
}
.acct-card {
  background: #fff; width: 100%; max-width: 400px;
  border-radius: 16px; padding: 1.5rem 1.4rem 1.6rem;
  box-shadow: var(--shadow-lg);
}
.acct-card h2 { margin: 0 0 .5rem; font-size: 1.2rem; }
.acct-card.acct-center { text-align: center; }
.acct-card p { margin: 0 0 1.2rem; color: var(--slate); font-size: .92rem; line-height: 1.5; }
.acct-field input {
  width: 100%; min-height: 46px; padding: .6rem .8rem;
  border: 1px solid #ccd3dd; border-radius: 10px;
  font-size: 1rem; font-family: inherit; margin-bottom: .6rem;
}
.log-page .acct-field input { background: #eef2f0; border-color: transparent; }
.log-page .acct-field input:focus {
  background: #fff; border-color: #12b981;
  box-shadow: 0 0 0 3px rgba(18,185,129,.2); outline: none;
}
.acct-err { color: var(--err); font-size: .85rem; margin: .1rem 0 0; }
.acct-err[hidden] { display: none; }
.acct-actions { display: grid; gap: .6rem; margin-top: 1.1rem; }

/* Apartado Account: email + lista de acciones. */
.acct-card.acct-account .acct-email {
  margin: 0 0 1rem; color: var(--ink); font-weight: 600; font-size: .95rem; word-break: break-all;
}
.acct-list { display: grid; gap: .45rem; }
.acct-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  width: 100%; text-align: left; font-family: inherit; font-size: .95rem; font-weight: 600;
  color: var(--ink); background: #eef2f0; border: 0; border-radius: 10px;
  padding: .8rem .9rem; cursor: pointer;
}
.acct-row:hover { background: #e4eae7; }
.acct-row:disabled { opacity: .6; cursor: default; }
.acct-row-val { color: var(--slate); font-weight: 500; font-size: .9rem; flex: none; }
.menu #logout { color: var(--err); }
.menu #logout svg { color: var(--err); }

/* Guía de instalación en iPhone (overlay que sale desde abajo). */
.ios-install {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(15, 23, 32, .5);
}
.ios-install-card {
  background: #fff; width: 100%; max-width: 480px;
  border-radius: 18px 18px 0 0;
  padding: 1.6rem 1.4rem 2rem;
  box-shadow: var(--shadow-lg);
}
.ios-install-card h2 { margin: 0 0 1rem; font-size: 1.2rem; }
.ios-install-card ol {
  margin: 0 0 1.4rem; padding-left: 1.2rem;
  display: grid; gap: .7rem; color: var(--ink-soft); font-size: .95rem; line-height: 1.5;
}
.ios-install-card .share-ico { vertical-align: -3px; color: #2f80ed; }
.ios-install-card .ios-warn {
  color: #a83a22; background: #fdece8; border-radius: 10px;
  padding: .65rem .8rem; font-size: .9rem; line-height: 1.45; margin: 0 0 1rem;
}
.ios-link { display: flex; gap: .5rem; margin: 0 0 1.1rem; }
.ios-link input {
  flex: 1; min-width: 0; min-height: 42px; padding: .5rem .7rem;
  border: 1px solid #ccd3dd; border-radius: 9px;
  font-size: .85rem; font-family: inherit; background: #f4f6f8; color: var(--ink);
}
.ios-link .btn { flex: none; min-height: 42px; padding: .5rem .9rem; }
@media (min-width: 560px) {
  .ios-install { align-items: center; }
  .ios-install-card { border-radius: 18px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   "LOG A JOB" — estilo "Aireado" (claro): campos rellenos sin borde, tarjetas
   suaves, botón oscuro, acentos esmeralda. Scopeado a .log-page.
   ══════════════════════════════════════════════════════════════════════════ */
body.log-page { background: #f6f8f7; }

/* Cover de arranque: mismo fondo que el login (transición sin parpadeo). Se
   quita cuando sabemos el rol; si el worker se redirige, se queda hasta navegar. */
.boot-cover {
  position: fixed; inset: 0; z-index: 500;
  display: grid; place-items: center;
  background: linear-gradient(180deg, #0f1714 0%, #0a0f0c 100%);
}
.boot-cover[hidden] { display: none; }
.boot-spin {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.16); border-top-color: #3ee6a9;
  animation: spin .7s linear infinite;
}
.log-page .card {
  border-color: transparent;
  border-radius: 16px;
  box-shadow: 0 12px 34px -22px rgba(20,26,23,.5);
}
.log-page legend { color: #12855a; border-color: #e7efe9; }

/* Campos: rellenos, sin borde; al enfocar, blanco + anillo esmeralda */
.log-page .field input,
.log-page .field select,
.log-page .field textarea {
  background: #eef2f0; border-color: transparent;
}
.log-page .field input:focus,
.log-page .field select:focus,
.log-page .field textarea:focus {
  background: #fff; border-color: #12b981;
  box-shadow: 0 0 0 3px rgba(18,185,129,.20);
}
.log-page .field.invalid input,
.log-page .field.invalid select { background: #fdeeee; border-color: var(--err); }

/* Segmented — seleccionado en verde OSCURO, distinto de los botones esmeralda. */
.log-page .seg label { background: #eef2f0; border-color: transparent; }
.log-page .seg input:checked + label { background: #143a2b; border-color: #143a2b; color: #eafff6; }
/* "Emergency" se queda rojo (es su significado). */
.log-page .seg input:checked + label.is-urgent { background: var(--urgent); border-color: var(--urgent); color: #fff; }

/* Botón principal esmeralda (igual que el "Enter" del login); secundario relleno */
.log-page .btn-primary {
  background: linear-gradient(180deg, #16c98c, #10b47e); color: #05231a;
  box-shadow: 0 10px 22px -12px rgba(18,185,129,.5);
}
.log-page .btn-primary:hover { background: linear-gradient(180deg, #1ad698, #13c085); }
.log-page .btn-quiet { background: #eef2f0; border-color: transparent; color: var(--ink); }
.log-page .btn-quiet:hover { background: #e4eae7; }
.log-page .scan-btn svg { color: #12b981; }

/* Sugerencias de cliente y dirección — claras y suaves */
.log-page .cust-suggest { background: #eef5f1; border-color: transparent; }
.log-page .cust-row { background: #fff; border-color: #e3ebe6; }
.log-page .cust-row:hover { border-color: #12b981; }

/* Barra de búsqueda (Jobs) — relleno suave y foco esmeralda, como los campos. */
.log-page .search-bar input { background: #eef2f0; border-color: transparent; }
.log-page .search-bar input:focus {
  background: #fff; border-color: #12b981;
  box-shadow: 0 0 0 3px rgba(18,185,129,.20);
}
.log-page .search-clear:hover { background: #e4eae7; color: var(--ink); }

/* Lista de personas (Team): hover en esmeralda, no azul. */
.log-page .team-item:hover { border-color: #12b981; }

/* Modal de editar (Jobs) — botón dársena/guardar oscuro, seg esmeralda ya
   heredan de .log-page. Título con acento esmeralda para atarlo al tema. */
.log-page .modal-foot { background: #f6f8f7; border-top-color: #e7efe9; }

/* Dashboard: selector de fecha y botones al tema (relleno + foco esmeralda). */
.log-page .day-picker { background: #eef2f0; border-color: transparent; }
.log-page .day-picker:focus {
  background: #fff; border-color: #12b981;
  box-shadow: 0 0 0 3px rgba(18,185,129,.20);
}
.log-page .daybtn { background: #eef2f0; border-color: transparent; color: #12855a; }
.log-page .daybtn:hover { background: #e4eae7; }

/* El botón "Enter" del login se queda ESMERALDA, aunque la página sea log-page
   (si no, el .log-page .btn-primary oscuro se lo comería). */
.log-page .gate .btn-primary {
  background: linear-gradient(180deg, #16c98c, #10b47e);
  color: #05231a;
  box-shadow: 0 10px 22px -10px rgba(18,185,129,.5);
}
.log-page .gate .btn-primary:hover { background: linear-gradient(180deg, #1ad698, #13c085); }
