/* Calefaltec PWA Técnico — Mobile-first styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── TOKENS (Bloque 3 · SPEC_APP_TECNICO_V3, 03/09/2026) ─────────────────────────────────
   UNA paleta para las dos apps: los valores viven en /css/tokens.css (--k-*) y aquí sólo se
   traducen a los nombres que esta hoja ya consume. La regla del puente de la web se aplica
   igual: dentro de un <button> → NARANJA (acción); todo lo demás → navy/teal (acento). Los
   colores de ESTADO (verde/ámbar/morado/rojo) NO son marca: los inyecta ClfCore desde el mapa
   único de estados. Un hex de marca escrito a mano en esta hoja es una regresión
   (smoke-tecnico-tokens lo vigila). ── */
:root {
  --blue:      var(--k-navy);          /* tinta de marca: nav activo, títulos, «Siguiente» */
  --blue-dk:   #061830;
  --blue-lt:   #E6F7F5;                /* fondo suave del acento (teal) */
  --blue-mid:  #C6EEEA;
  --teal:      var(--k-teal-ink);      /* acento legible: links, foco, activo */
  --orange:    var(--k-naranja);       /* ÚNICO color de acción */
  --orange-lt: #FFF3EA;
  --green:     #16A34A;
  --green-lt:  #F0FDF4;
  --red:       var(--k-rojo);
  --red-lt:    #FBEDED;
  --yellow:    #CA8A04;
  --yellow-lt: #FEFCE8;
  --purple:    #7C3AED;
  --purple-lt: #F5F3FF;
  --gray:      var(--k-lienzo);
  --gray1:     #EEF1F5;
  --gray2:     var(--k-hairline);
  --gray3:     #D5DBE3;
  --text:      var(--k-ink);
  --text2:     #3E4856;
  --text3:     var(--k-ink-2);
  --text4:     var(--k-ink-3);
  --white:     var(--k-superficie);
  --nav-h:     64px;
  --header-h:  56px;

  /* Ancho de la columna de la app. Antes eran 9 `max-width: 430px` sueltos (un iPhone Pro
     Max) sin NINGUNA media query: en tablet la app quedaba en una tira estrecha centrada
     desaprovechando la pantalla (Vincent 06/08/2026). Ahora es una sola variable — el body
     y todos los elementos fijos que deben alinearse con él (header, bottom-nav, action-bar,
     sheet, toast) la comparten, así no pueden volver a descuadrarse entre sí. */
  --app-w:     430px;
  --r:         var(--k-r);
  --r-sm:      var(--k-r-sm);
  --sh:        var(--k-sh);
  --sh-md:     var(--k-sh-md);
  --sh-lg:     var(--k-sh-lg);
  /* Cristal de la cabecera: el mismo que el login de la web (levedad, Vincent 03/09/2026). */
  --glass:        var(--k-glass);
  --glass-border: var(--k-glass-border);
  --glass-blur:   var(--k-glass-blur);
}

/* Tablet y superiores: la app usa el ancho REAL de la pantalla. Por debajo de 700px se
   mantiene la columna de 430px intacta — el móvil, que es el uso principal del técnico,
   no cambia ni un píxel. */
@media (min-width: 700px) {
  :root { --app-w: 100%; }
}


html { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  /* Fuente del sistema a propósito (Vincent 03/09): una webfont son 100-200 KB en obra. */
  background:
    radial-gradient(260px 260px at 100% -60px, rgba(18,184,171,.18), transparent 70%),
    radial-gradient(220px 220px at -60px 140px, rgba(255,140,66,.14), transparent 70%),
    var(--gray);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100%;
  max-width: var(--app-w);
  margin: 0 auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── HEADER ────────────────────────────────────────────── */
/* Cabecera de CRISTAL (Bloque 3): el navy sólido pesaba; el cristal del login da levedad y deja
   ver las manchas del fondo. Texto e iconos en navy, no en blanco. */
.app-header, .header-back {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--sh);
  color: var(--blue);
  z-index: 200;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  max-width: var(--app-w);
  margin: 0 auto;
}
.header-back { padding: 0 4px; gap: 4px; }
.app-header .h-title, .header-back .h-title {
  flex: 1;
  font-size: 17px;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: -.2px;
}
.app-header .h-sub, .header-back .h-sub { font-size: 12px; color: var(--text3); }
.app-header .h-icon-btn {
  width: 36px; height: 36px;
  border: none; background: rgba(10,35,64,.06);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--blue); font-size: 18px;
  transition: background .15s;
}
.app-header .h-icon-btn:hover { background: rgba(10,35,64,.12); }
.app-header .h-avatar {
  width: 34px; height: 34px;
  background: var(--blue);
  border: 2px solid var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: var(--white);
  cursor: pointer;
}
.header-back .back-btn {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--blue); font-size: 22px;
  cursor: pointer;
}

/* ── PAGE ──────────────────────────────────────────────── */
.page-body {
  padding-top: var(--header-h);
  padding-bottom: calc(var(--nav-h) + 8px);
  min-height: 100vh;
}
.page-body.no-nav {
  padding-bottom: 24px;
}
.page-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── OFFLINE BANNER ─────────────────────────────────────── */
.offline-banner {
  background: var(--yellow);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 16px;
  text-align: center;
  display: none;
}
body.offline .offline-banner { display: block; }

/* ── BOTTOM NAV ─────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--white);
  border-top: 1px solid var(--gray2);
  display: flex;
  align-items: center;
  z-index: 200;
  max-width: var(--app-w);
  margin: 0 auto;
  box-shadow: 0 -2px 10px rgba(0,0,0,.07);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text3);
  font-size: 10px;
  font-weight: 500;
  min-height: 44px;
  cursor: pointer;
  position: relative;
  transition: color .15s;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active { color: var(--blue); }
.nav-item.active svg path, .nav-item.active svg rect, .nav-item.active svg circle { stroke: var(--blue); }
.nav-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-center-btn {
  width: 52px; height: 52px;
  background: var(--blue);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(10,35,64,.28);
  color: white; font-size: 28px; text-decoration: none;
  margin-bottom: 12px;
  transition: transform .15s, box-shadow .15s;
}
.nav-center-btn:active { transform: scale(.93); box-shadow: 0 2px 8px rgba(10,35,64,.2); }
.nav-badge {
  position: absolute;
  top: 4px; right: calc(50% - 18px);
  background: var(--red);
  color: white; font-size: 9px; font-weight: 800;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--white);
}

/* ── PILLS / FILTER BAR ─────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--white);
  border-bottom: 1px solid var(--gray2);
}
.filter-bar::-webkit-scrollbar { display: none; }
.pill {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--gray3);
  background: var(--white);
  font-size: 13px;
  font-weight: 600;
  color: var(--text3);
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.pill.active {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
  box-shadow: var(--sh);
}

/* ── SECTION HEADER ─────────────────────────────────────── */
.section-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 8px;
}
.section-hd h2 { font-size: 15px; font-weight: 700; color: var(--text); }
.section-hd span { font-size: 12px; color: var(--text3); font-weight: 500; }

/* ── WORK ORDER CARD ─────────────────────────────────────── */
.wo-card {
  background: var(--white);
  margin: 0 12px 10px;
  border-radius: var(--r);
  box-shadow: var(--sh);
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow .15s, transform .1s;
  display: flex;
}
.wo-card:active { transform: scale(.985); box-shadow: var(--sh-md); }
.wo-card-stripe {
  width: 5px;
  flex-shrink: 0;
}
.wo-card-body {
  flex: 1;
  padding: 12px 14px;
  min-width: 0;
}
.wo-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 6px;
}
.wo-company {
  font-size: 11px;
  font-weight: 600;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.wo-time {
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.wo-client {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wo-num {
  font-size: 11px;
  color: var(--text3);
  margin-bottom: 4px;
}
.wo-desc {
  font-size: 12.5px;
  color: var(--text2);
  margin-bottom: 7px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wo-addr {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 8px;
}
.wo-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}
.wo-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--blue-mid);
  color: var(--blue);
  font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

/* Status icon (spinning / check / clock) */
.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.spin {
  border: 2px solid var(--orange);
  border-top-color: transparent;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.status-dot.done { background: var(--green); }
.status-dot.late { background: var(--red); }
.status-dot.pending { background: var(--orange); }

/* ── STATUS BADGES ─────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}
/* .status-badge.<estado>: retiradas en el Bloque 3 (P-SSU). El color lo da ClfCore.statusStyle / .b-* inyectado. */

/* ── CALENDAR ──────────────────────────────────────────── */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--white);
  padding: 12px;
  gap: 2px;
}
.cal-day-label {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  padding: 4px 0;
  text-transform: uppercase;
}
.cal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 2px;
  border-radius: 8px;
  cursor: pointer;
  min-height: 46px;
  -webkit-tap-highlight-color: transparent;
  transition: background .1s;
}
.cal-day:hover { background: var(--gray); }
.cal-day .d-num {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.cal-day.today .d-num {
  background: var(--blue);
  color: white;
  font-weight: 700;
}
.cal-day.selected .d-num {
  background: var(--blue-mid);
  color: var(--blue);
}
.cal-day.empty { cursor: default; }
.cal-day.empty:hover { background: none; }
.cal-day .d-dots {
  display: flex;
  gap: 2px;
  margin-top: 2px;
}
.cal-day .dot {
  width: 5px; height: 5px;
  border-radius: 50%;
}
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--gray2);
}
.cal-nav .month-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.cal-nav button {
  width: 34px; height: 34px;
  border: 1px solid var(--gray3);
  border-radius: 8px;
  background: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--text2);
  display: flex; align-items: center; justify-content: center;
}

/* ── TABS ──────────────────────────────────────────────── */
.tabs {
  display: flex;
  background: var(--white);
  border-bottom: 1px solid var(--gray2);
  position: sticky;
  top: var(--header-h);
  z-index: 100;
}
.tab-btn {
  flex: 1;
  padding: 12px 8px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text3);
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.tab-btn.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── LIST ITEM ─────────────────────────────────────────── */
.list-item {
  display: flex;
  background: var(--white);
  margin: 0 12px 8px;
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.list-item:active { opacity: .85; }
.list-item .li-stripe { width: 4px; flex-shrink: 0; }
.list-item .li-body { flex: 1; padding: 11px 13px; }
.list-item .li-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 3px; }
.list-item .li-client { font-size: 14px; font-weight: 700; }
.list-item .li-date { font-size: 11px; color: var(--text3); font-weight: 500; }
.list-item .li-desc { font-size: 12px; color: var(--text3); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .li-addr { font-size: 11.5px; color: var(--text3); display: flex; align-items: center; gap: 4px; }
.list-item .li-num { font-size: 11px; font-weight: 700; color: var(--blue); margin-bottom: 2px; }

/* ── DETAIL PAGE ─────────────────────────────────────────── */
.detail-section {
  background: var(--white);
  margin: 10px 12px;
  border-radius: var(--r);
  padding: 14px 16px;
  box-shadow: var(--sh);
}
.detail-section h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text3);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.info-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
  font-size: 13.5px;
}
.info-row .ir-label { color: var(--text3); min-width: 80px; flex-shrink: 0; font-size: 12.5px; }
.info-row .ir-val { color: var(--text); font-weight: 500; }
.info-row a { color: var(--blue); text-decoration: none; }

/* Photo grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.photo-thumb {
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--gray);
  position: relative;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-add-btn {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 2px dashed var(--gray3);
  background: none;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  cursor: pointer; color: var(--text3); font-size: 11px;
  -webkit-tap-highlight-color: transparent;
}
.photo-add-btn svg { width: 24px; height: 24px; }
.photo-add-btn:active { background: var(--gray); }

/* Material list */
.mat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--gray2);
  font-size: 13px;
}
.mat-row:last-child { border-bottom: none; }
.mat-row .mat-desc { flex: 1; }
.mat-row .mat-qty { color: var(--text3); font-size: 12px; }
.mat-row .mat-del { background: none; border: none; color: var(--text3); font-size: 20px; cursor: pointer; padding: 0 4px; line-height: 1; }
.mat-row .mat-del:hover { color: var(--red); }

/* Hours stopwatch */
.chrono-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--gray);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.chrono-time {
  font-size: 28px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  letter-spacing: -.5px;
}
.chrono-controls { display: flex; gap: 8px; }

/* Signature */
#sigCanvas {
  border: 2px dashed var(--gray3);
  border-radius: 10px;
  cursor: crosshair;
  touch-action: none;
  display: block;
  width: 100%;
  background: var(--white);
}

/* ── FORMS ─────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text3);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--gray3);
  border-radius: var(--r-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color .15s;
  -webkit-appearance: none;
}
.form-input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(18,184,171,.18); }

/* ── BUTTONS ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 20px;
  border-radius: var(--r-sm);
  border: none;
  /* B20-b - un boton SIN variante de color no puede quedarse con el gris del navegador:
     medido, es #F0F0F0 sobre una tarjeta #F3F4F6 (tres unidades: ninguna caja). Las
     variantes de color se declaran DESPUES y ganan, asi que esto solo alcanza a los
     botones que hoy no declaran nada. */
  background: white;
  color: var(--text2);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  min-height: 44px;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: scale(.96); }
/* El primario es NARANJA: es una acción (misma regla que theme-bridge.css en la web). «Siguiente» (.btn-next) sigue en navy: es navegación. */
.btn-primary { background: var(--orange);  color: white; box-shadow: 0 2px 8px rgba(255,140,66,.28); }
.btn-primary:hover { background: var(--k-naranja-hover); }
.btn-green   { background: var(--green); color: white; box-shadow: 0 2px 8px rgba(22,163,74,.25); }
.btn-orange  { background: var(--orange);color: white; box-shadow: 0 2px 8px rgba(255,140,66,.28); }
.btn-red     { background: var(--red);   color: white; }
.btn-ghost   { background: var(--gray2); color: var(--text2); }
.btn-outline { background: none; border: 1.5px solid var(--gray3); color: var(--text2); }
.btn-sm      { padding: 7px 14px; font-size: 12.5px; min-height: 34px; }
.btn-full    { width: 100%; }
.btn-icon    { width: 40px; height: 40px; padding: 0; border-radius: 50%; }

/* ── BOTTOM ACTION BAR ─────────────────────────────────── */
.action-bar {
  position: fixed;
  bottom: var(--nav-h);
  left: 0; right: 0;
  max-width: var(--app-w);
  margin: 0 auto;
  background: var(--white);
  border-top: 1px solid var(--gray2);
  padding: 10px 16px;
  display: flex;
  gap: 8px;
  z-index: 150;
}

/* ── PLAN BTN ─────────────────────────────────────────── */
.plan-btn {
  position: fixed;
  bottom: calc(var(--nav-h) + 12px);
  left: 12px; right: 12px;
  max-width: calc(var(--app-w) - 24px);
  margin: 0 auto;
  z-index: 150;
}

/* ── CALENDAR ACCESS BTN ─────────────────────────────── */
.cal-access-btn {
  margin: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--blue-lt);
  border: 1.5px solid var(--blue-mid);
  border-radius: var(--r);
  padding: 13px 16px;
  cursor: pointer;
  text-decoration: none;
  color: var(--blue);
  font-weight: 600;
  font-size: 14px;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s;
}
.cal-access-btn:active { background: var(--blue-mid); }
.cal-access-btn svg { width: 22px; height: 22px; flex-shrink: 0; }

/* ── BANNER ────────────────────────────────────────────── */
.banner {
  margin: 12px;
  border-radius: var(--r);
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.banner.blue   { background: var(--blue-lt);  border: 1px solid var(--blue-mid);  }
.banner.purple { background: var(--purple-lt); border: 1px solid #DDD6FE; }
.banner.green  { background: var(--green-lt);  border: 1px solid #BBF7D0; }
.banner.yellow { background: var(--yellow-lt); border: 1px solid #FEF08A; }
.banner .ban-icon { font-size: 22px; line-height: 1; }
.banner .ban-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.banner .ban-text  { font-size: 12px; color: var(--text3); line-height: 1.5; }

/* ── DISPONIBLES CARD ──────────────────────────────────── */
.disp-card {
  background: var(--white);
  margin: 0 12px 10px;
  border-radius: var(--r);
  box-shadow: var(--sh);
  overflow: hidden;
}
.disp-card-body { padding: 14px; }
.disp-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.disp-num { font-size: 11px; font-weight: 700; color: var(--blue); }
.disp-client { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.disp-desc { font-size: 12.5px; color: var(--text3); margin-bottom: 7px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.disp-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--text3); margin-bottom: 10px; }
.disp-meta span { display: flex; align-items: center; gap: 4px; }
.disp-footer { border-top: 1px solid var(--gray2); padding: 10px 14px; display: flex; justify-content: flex-end; }

/* ── MODAL / BOTTOM SHEET ──────────────────────────────── */
.sheet-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 500;
  display: none;
  align-items: flex-end;
}
.sheet-overlay.open { display: flex; }
.sheet {
  background: var(--white);
  border-radius: 18px 18px 0 0;
  width: 100%;
  max-width: var(--app-w);
  margin: 0 auto;
  padding: 16px 20px 32px;
  animation: slideUp .25s ease-out;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-handle { width: 36px; height: 4px; background: var(--gray3); border-radius: 2px; margin: 0 auto 16px; }
.sheet-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; }

/* ── LOGIN ─────────────────────────────────────────────── */
.login-bg {
  background: var(--blue);   /* el login del técnico se alinea con el de la web en la tanda 3b */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  max-width: var(--app-w);
  margin: 0 auto;
}
.login-logo {
  text-align: center;
  margin-bottom: 36px;
  color: white;
}
/* 30/08/2026 (Vincent) — unificado con la web: el recuadro del logo es BLANCO, no un
   translucido sobre el azul. Mismo motivo que el `.logo-badge` del escritorio el 29/08 —
   un fondo de color tine el logo del tenant, que puede ser de cualquier color. El texto
   pasa a oscuro porque sobre blanco el blanco no se ve (era una C blanca sobre azul). */
.login-logo .logo-mark {
  /* el ancho se adapta: un logotipo apaisado se leia diminuto encajado en 72x72, y una
     sola inicial necesita el cuadrado. min-width lo mantiene cuadrado cuando no hay logo. */
  min-width: 72px; max-width: 240px; height: 72px; width: auto;
  background: #fff;
  border-radius: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 900; color: var(--blue);
  margin: 0 auto 12px;
  overflow: hidden; padding: 8px;
}
.login-logo .logo-mark img { max-width: 100%; max-height: 100%; object-fit: contain; }
.login-logo .logo-name { font-size: 22px; font-weight: 800; }
.login-logo .logo-sub  { font-size: 13px; opacity: .75; margin-top: 3px; }
.login-card {
  background: white;
  border-radius: 18px;
  padding: 24px 20px;
  width: 100%;
  box-shadow: var(--sh-lg);
}
.login-card h2 { font-size: 17px; font-weight: 700; margin-bottom: 20px; color: var(--text); }

/* ── EMPTY STATE ───────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text3);
}
.empty-state .es-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state .es-title { font-size: 16px; font-weight: 700; color: var(--text2); margin-bottom: 6px; }
.empty-state .es-sub   { font-size: 13px; line-height: 1.6; }

/* ── TOAST ─────────────────────────────────────────────── */
/* .t-toast: retirado en el Bloque 2 (03/09/2026) — el aviso lo pinta ClfCore.toast, inline. */
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ── LOADING ───────────────────────────────────────────── */
.loading-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px;
  color: var(--text3);
  font-size: 14px;
}
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid var(--gray3);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ── FAB (Floating Action Button) ─────────────────────── */
.fab-btn {
  position: fixed;
  right: 20px;
  bottom: calc(var(--nav-h) + 16px);
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--orange);
  border: none;
  box-shadow: 0 4px 16px rgba(255,140,66,.45);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 210;
  transition: transform .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.fab-btn:active { transform: scale(.92); box-shadow: 0 2px 8px rgba(255,140,66,.3); }

/* ── PHONE BUTTONS IN CARDS ────────────────────────────── */
.wo-phone-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  margin-bottom: 4px;
}
.wo-phone-num { font-size: 12px; color: var(--text3); flex: 1; }
.wo-phone-btn {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  border: 1.5px solid var(--gray3);
  color: var(--text);
  background: var(--white);
  cursor: pointer;
  white-space: nowrap;
}
.wo-phone-btn.wa { background: #25D366; border-color: #25D366; color: white; }

/* ── CARD V2 — Base styles (compartido por index.html + calendario.html) ─── */
.wo-card-v2 {
  background: white;
  border: 1px solid var(--gray2);
  border-left: 3px solid var(--gray2);
  border-radius: 12px;
  margin: 0 12px 10px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .15s;
}
.wo-card-v2:active { box-shadow: 0 0 0 2px rgba(18,184,171,.35); }
.wo-card-v2-inner  { padding: 14px 14px 10px; }
.wo-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.wo-number { font-size: 12px; font-weight: 700; color: var(--text3); }
.wo-card-v2 .wo-time { font-size: 12px; color: var(--text3); font-weight: normal; display: inline; }
.wo-client-name { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.wo-addr-link { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--blue); margin-bottom: 6px; text-decoration: none; }
.wo-addr-link:active { opacity: .7; }
.wo-card-v2 .wo-footer { display: flex; align-items: center; gap: 8px; justify-content: flex-start; margin-top: 0; }
.wo-gps-btn  { display: inline-flex; align-items: center; gap: 4px; padding: 6px 11px; border: 1px solid var(--gray2); border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--text2); text-decoration: none; background: white; flex-shrink: 0; }
.wo-chat-btn { display: inline-flex; align-items: center; gap: 4px; padding: 6px 11px; border: 1px solid var(--gray2); border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--text2); background: white; flex-shrink: 0; cursor: pointer; }
.wo-chat-btn.has-unread { background: var(--blue-lt); border-color: #C6EEEA; color: var(--teal); }
.wo-status-chip { margin-left: auto; flex-shrink: 0; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 99px; }
/* .chip-<estado>: retiradas en el Bloque 3 (P-SSU). ot-card.js pinta el chip con ClfCore.statusStyle. */

/* ── CARD V3 — Borde izquierdo por estado ─── */
/* .wo-card-v2.state-<estado>: retiradas en el Bloque 3. El borde lo pone ot-card.js con el color del estado (mapa único). */

/* Posición relativa para badge adjuntos */
.wo-card-wrap { position: relative; }
.wo-attach-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--blue-lt); color: var(--teal);
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 99px;
  pointer-events: none;
}

/* Filas nuevas */
.wo-phone-row-v3 {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 5px;
}
.wo-phone-link-v3 {
  flex: 1; font-size: 13px; font-weight: 600;
  color: var(--text); text-decoration: none;
  display: flex; align-items: center; gap: 5px;
}
.wo-wa-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: #25D366; border-radius: 8px;
  border: none; cursor: pointer; flex-shrink: 0;
  color: white; font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

/* Dropdown plantillas WhatsApp */
.wo-wa-dropdown {
  position: fixed;
  background: white;
  border: 1px solid var(--gray2);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  z-index: 9000;
  min-width: 230px;
  overflow: hidden;
}
.wo-wa-dropdown-item {
  display: block; width: 100%;
  padding: 12px 16px;
  border: none; background: none;
  text-align: left; font-size: 14px;
  font-family: inherit; cursor: pointer;
  border-bottom: 1px solid var(--gray2);
  color: var(--text);
}
.wo-wa-dropdown-item:last-child { border-bottom: none; }
.wo-wa-dropdown-item:active { background: var(--gray1); }

/* Separador entre desc y footer */
.wo-sep {
  border: none; border-top: 1px solid var(--gray2);
  margin: 8px 0;
}

/* Botón acción principal */
.wo-action-btn {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 5px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13px; font-weight: 700;
  border: none; cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .12s;
}
.wo-action-btn:active { opacity: .8; }
.wo-action-btn.orange { background: var(--orange); color: white; }
.wo-action-btn.blue   { background: var(--blue); color: white; }
.wo-action-btn.purple { background: #7C3AED; color: white; }

/* Truncar desc a 1 línea */
.wo-desc-v3 {
  font-size: 13px; color: var(--text2);
  margin-bottom: 0; line-height: 1.4;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 1; -webkit-box-orient: vertical;
}

/* ── UTILITIES ─────────────────────────────────────────── */
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.flex  { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.text-sm { font-size: 12.5px; }
.text-muted { color: var(--text3); }
.font-bold { font-weight: 700; }
.p-16 { padding: 16px; }
.hidden { display: none !important; }
.w-full { width: 100%; }

/* ── Sprint IA-2a — Dictado por voz (botón 🎤 + banner "pendiente") ── */
.dict-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; line-height: 1;
  padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--teal); background: var(--blue-lt); color: var(--teal);
  cursor: pointer; white-space: nowrap;
  /* pulsar-mantener: sin scroll táctil, sin selección ni menú de pulsación larga */
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.dict-btn:active { background: #fee2e2; border-color: #dc2626; color: #b91c1c; }
.dict-btn:disabled { opacity: .5; cursor: not-allowed; }
.dict-insert-btn {
  font-size: 12px; font-weight: 600;
  padding: 5px 12px; border-radius: 6px; border: 0;
  background: var(--orange); color: #fff; cursor: pointer; white-space: nowrap;
}


/* ── MODAL LITE (23/08/2026) — lo que los modales COMPARTIDOS de la web (nueva-tarea-modal,
   nueva-ot-modal) esperan de la pagina. Vive AQUI, en el nucleo que cargan todas las pantallas
   del tecnico, y no como copia inline por pagina: index.html ya llevaba una copia para el modal
   de OT, y dos copias por pantalla es la enfermedad de las copias que nadie obliga a coincidir.
   (La copia de index queda como esta — retirarla es limpieza aparte, no de este cambio.) ── */
:root{--primary:var(--k-teal-ink);--primary-bg:#E6F7F5;--border:var(--k-hairline);--bg:var(--k-lienzo);--bg2:#EEF1F5;--r-md:var(--k-r-sm)}   /* modal lite: sobre tokens; --text* ya vienen del :root de arriba */
.overlay{position:fixed;inset:0;background:rgba(0,0,0,.45);display:flex;align-items:center;justify-content:center;z-index:500;padding:16px}
.modal{background:#fff;border-radius:12px;max-width:540px;width:100%;max-height:90vh;display:flex;flex-direction:column;box-shadow:0 20px 60px rgba(0,0,0,.25)}
.modal-head{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:1px solid var(--border);flex-shrink:0}
.modal-head h3{font-size:15px;font-weight:700;margin:0}
.modal-x{width:30px;height:30px;border:none;background:none;cursor:pointer;border-radius:6px;font-size:20px;color:var(--text3);line-height:1}
.modal-body{padding:14px 16px;overflow-y:auto;flex:1;-webkit-overflow-scrolling:touch}
.modal-foot{border-top:1px solid var(--border);padding:12px 16px;flex-shrink:0;display:flex;gap:8px;justify-content:flex-end}
.modal-body .fg{display:flex;flex-direction:column;gap:4px;margin-bottom:10px}
.modal-body .fg label{font-size:12px;font-weight:600;color:var(--text2)}
.modal-body .fc{border:1.5px solid var(--border);border-radius:8px;padding:9px 10px;font-size:14px;font-family:inherit;background:#fff;color:var(--text);width:100%;box-sizing:border-box}
.modal-body .fg.full{width:100%}

/* ── 03/09/2026 · lo que el FORMULARIO ÚNICO de dirección (js/address-form.js) necesita para
   vestirse aquí. Ese fichero es el MISMO que carga la web (R-CONVERGENCIA), y su markup usa las
   clases del modal web (.modal-title/.modal-close/.form-grid/.btn-out). Se traducen a esta hoja
   en vez de copiar el formulario. ── */
.modal-title{font-size:15px;font-weight:700;margin:0}
.modal-close{width:32px;height:32px;border:none;background:none;cursor:pointer;border-radius:6px;font-size:22px;color:var(--text3);line-height:1}
.modal-body .form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 10px}
.modal-body .form-grid .fg.full{grid-column:1 / -1}
.modal-body .fg select.fc{appearance:auto}
.btn-out{background:#fff;border:1.5px solid var(--border);color:var(--text2)}
.modal-foot .btn{min-height:44px;padding:0 16px;border-radius:10px;font-weight:700;font-size:14px}
@media (max-width:420px){ .modal-body .form-grid{grid-template-columns:1fr} }


/* ── PLACEHOLDERS (23/08/2026) — un ejemplo no puede vestir igual que un dato. El amigo
   de Vincent dio por rellenado el municipio porque «La Nucia» (placeholder) se pintaba
   como texto real. Cursiva + gris claro: el convenio universal de «esto es un ejemplo».
   opacity 1 porque Firefox atenua por opacidad y el color dejaria de mandar. ── */
::placeholder { color: #b3bfce; font-style: italic; opacity: 1; }


/* ── MANT-PISCINAS F2 · formulario de visita (24/08/2026) — botones GRANDES a proposito:
   se rellena a pie de piscina, a veces con guantes. Ambar = fuera de banda ideal; rojo =
   en el tope duro del rango. Genrico: no sabe que es «cloro». ── */
.fv-campo{border:1px solid var(--border,#e2e8f0);border-radius:10px;padding:10px 12px;margin-bottom:8px;background:#fff}
.fv-label{font-size:13px;font-weight:700;color:var(--text2,#475569);margin-bottom:6px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.fv-banda{font-size:11px;font-weight:600;color:#059669;background:#ecfdf5;border-radius:99px;padding:1px 8px}
.fv-pre{font-size:10px;font-weight:700;color:#7c3aed;background:#f3e8ff;border-radius:99px;padding:1px 6px}
.fv-stepper{display:flex;align-items:center;gap:10px}
.fv-btn{width:52px;height:52px;border-radius:12px;border:1.5px solid var(--border,#e2e8f0);background:#f8fafc;font-size:26px;font-weight:700;color:var(--text,#0f172a);cursor:pointer;flex-shrink:0}
.fv-btn:active{background:#e2e8f0}
.fv-valor{min-width:74px;text-align:center;font-size:24px;font-weight:800;color:var(--text,#0f172a);padding:6px 8px;border-radius:10px}
.fv-valor.fv-ambar{background:#fef3c7;color:#92400e}
.fv-valor.fv-rojo{background:#fee2e2;color:#991b1b}
.fv-chips{display:flex;gap:8px;flex-wrap:wrap}
.fv-chip{padding:12px 18px;border-radius:10px;border:1.5px solid var(--border,#e2e8f0);background:#fff;font-size:15px;font-weight:700;cursor:pointer}
.fv-chip.on{background:var(--blue);border-color:var(--blue);color:#fff}
.fv-check{width:100%;padding:14px;border-radius:10px;border:1.5px solid var(--border,#e2e8f0);background:#fff;font-size:15px;font-weight:700;cursor:pointer;text-align:center}
.fv-check.on{background:#ecfdf5;border-color:#059669;color:#065f46}
.fv-check.corr.on{background:#fef2f2;border-color:#dc2626;color:#991b1b}
.fv-foto{display:flex;align-items:center;gap:10px}
.fv-equipo{border:1px dashed var(--border,#e2e8f0);border-radius:10px;padding:10px 12px;margin-bottom:8px;background:#f8fafc}
.fv-vol{display:flex;align-items:center;gap:8px;margin-top:6px;flex-wrap:wrap;font-size:13px}
