/* ============================================================
   DANGOFE OS · Portal del técnico · «SERVICIOS SIN CERRAR» (prefijo atr-) · 2026-10-20 · chat de Diseño
   Hoja obligatoria que sale al abrir el portal cuando hay servicios de días pasados sin cerrar. Misma familia que
   las hojas del portal (checklist .chkh, cobro): cristal líquido desde abajo, SIN sombras y SIN desenfoque de fondo
   (va debajo del checklist, z 9000, y del cobro, z 10000: z-index 8800). Claro y «Noche azul» por [data-theme='dark'].
   Tres versiones por data-v: A · Lista (todos a la vista; el contestado se encoge) · B · Uno a uno (un servicio por
   pantalla, «1 de 3») · C · Por día (agrupados por fecha). Va con portal-atrasados.js.
   ============================================================ */
.atr {
  --atr-az: 3, 38, 155; --atr-ok: 29, 154, 91; --atr-amb: 194, 117, 0; --atr-mal: 192, 57, 43;
  --atr-tinta: #0a1633; --atr-tenue: #5b6880; --atr-vidrio: rgba(255, 255, 255, .94); --atr-borde: rgba(255, 255, 255, .9);
  --atr-linea: rgba(10, 22, 51, .09); --atr-campo: rgba(10, 22, 51, .05); --atr-campo2: rgba(10, 22, 51, .08); --atr-pri: #03269b; --atr-pri-txt: #fff;
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 8800; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(10, 22, 51, .42); animation: atr-aparece .25s ease both;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--atr-tinta);
}
[data-theme='dark'] .atr, .atr.is-noche {
  --atr-tinta: #f2f5fb; --atr-tenue: #a9b4c9; --atr-vidrio: rgba(12, 22, 60, .96); --atr-borde: rgba(140, 170, 255, .28);
  --atr-linea: rgba(255, 255, 255, .11); --atr-campo: rgba(255, 255, 255, .06); --atr-campo2: rgba(255, 255, 255, .1); --atr-pri: #2e5bd9;
  background: rgba(2, 6, 24, .62);
}
.atr.is-dentro { position: absolute; } /* solo en la muestra */
.atr.is-fuera { opacity: 0; transition: opacity .25s ease; pointer-events: none; }
.atr *, .atr *::before, .atr *::after { box-sizing: border-box; }
@keyframes atr-aparece { from { opacity: 0; } to { opacity: 1; } }
.atr__caja {
  position: relative; width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; overflow-y: auto; scrollbar-width: none;
  display: flex; flex-direction: column; gap: 12px; padding: 22px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  border-radius: 30px 30px 0 0; border: 1px solid var(--atr-borde); border-bottom: 0; background: var(--atr-vidrio);
  transform: translateY(24px); animation: atr-sube .35s cubic-bezier(.2, .9, .25, 1) both;
}
.atr__caja::-webkit-scrollbar { display: none; }
.atr__caja::before { content: ''; position: absolute; left: 50%; top: 8px; width: 42px; height: 5px; margin-left: -21px; border-radius: 999px; background: var(--atr-linea); }
@keyframes atr-sube { to { transform: translateY(0); } }
@media (min-width: 700px) {
  .atr { align-items: center; padding: 20px; }
  .atr__caja { border-radius: 28px; border-bottom: 1px solid var(--atr-borde); max-height: 88vh; }
  .atr__caja::before { display: none; }
}
/* cabecera */
.atr__cab { display: flex; flex-direction: column; gap: 6px; }
.atr__ojal { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: rgb(var(--atr-amb)); background: rgba(var(--atr-amb), .12); border: 1px solid rgba(var(--atr-amb), .28); }
.atr__ojal svg { width: 12px; height: 12px; }
.atr__cab > b { font-size: 22px; font-weight: 800; letter-spacing: -.015em; line-height: 1.15; }
.atr__cab > p { margin: 0; font-size: 14px; line-height: 1.4; color: var(--atr-tenue); }
.atr__prog { display: flex; align-items: center; gap: 5px; margin-top: 4px; }
.atr__prog i { display: block; width: 22px; height: 5px; border-radius: 999px; background: var(--atr-campo2); }
.atr__prog i.is-on { background: rgb(var(--atr-amb)); }
.atr__prog i.is-hecho { background: rgb(var(--atr-ok)); }
.atr__prog small { margin-left: 6px; font-size: 12px; font-weight: 700; color: var(--atr-tenue); }
/* la lista */
.atr__lista { display: flex; flex-direction: column; gap: 10px; }
.atr-item { position: relative; padding: 14px 14px 12px; border-radius: 18px; border: 1px solid var(--atr-linea); background: var(--atr-campo); transition: opacity .2s ease; }
.atr-item__cab { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 12.5px; font-weight: 700; color: var(--atr-tenue); }
.atr-item__num { color: rgb(var(--atr-az)); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; letter-spacing: .02em; }
[data-theme='dark'] .atr-item__num, .atr.is-noche .atr-item__num { color: #8fb4ff; }
.atr-item__cuando { display: inline-flex; align-items: center; gap: 5px; }
.atr-item__cuando svg { width: 13px; height: 13px; }
.atr-item__pri { margin-left: auto; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; color: rgb(var(--atr-mal)); background: rgba(var(--atr-mal), .1); border: 1px solid rgba(var(--atr-mal), .25); }
.atr-item__srv { margin: 6px 0 0; font-size: 17px; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.atr-item__cli { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 0; font-size: 13.5px; color: var(--atr-tenue); }
.atr-item__cli span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.atr-item__cli svg { width: 13px; height: 13px; flex: none; }
.atr-item__acc { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.atr-btn { flex: 1 1 140px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--atr-linea); background: var(--atr-campo2); color: inherit; font: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.atr-btn svg { width: 16px; height: 16px; flex: none; }
.atr-btn[disabled] { opacity: .55; cursor: default; }
.atr-btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(var(--atr-az), .3); }
.atr-btn--ok { background: rgba(var(--atr-ok), .14); border-color: rgba(var(--atr-ok), .4); color: rgb(var(--atr-ok)); }
[data-theme='dark'] .atr-btn--ok, .atr.is-noche .atr-btn--ok { color: #7ee0b0; }
.atr-btn--no { background: rgba(var(--atr-amb), .12); border-color: rgba(var(--atr-amb), .4); color: rgb(var(--atr-amb)); }
[data-theme='dark'] .atr-btn--no, .atr.is-noche .atr-btn--no { color: #fcd34d; }
.atr-btn--pri { background: var(--atr-pri); border-color: transparent; color: var(--atr-pri-txt); }
.atr-btn--sut { background: transparent; border-color: var(--atr-linea); color: var(--atr-tenue); flex: 0 1 auto; }
/* el motivo */
.atr-item__motivo { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--atr-linea); }
.atr-item__preg { margin: 0 0 8px; font-size: 14px; font-weight: 800; }
.atr-opc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.atr-opc__b { appearance: none; min-height: 42px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--atr-linea); background: var(--atr-campo2); color: inherit; font: inherit; font-size: 13.5px; font-weight: 600; text-align: left; cursor: pointer; }
.atr-opc__b.is-on { border-color: rgba(var(--atr-az), .55); background: rgba(var(--atr-az), .1); color: rgb(var(--atr-az)); font-weight: 800; }
[data-theme='dark'] .atr-opc__b.is-on, .atr.is-noche .atr-opc__b.is-on { color: #8fb4ff; background: rgba(143, 180, 255, .14); border-color: rgba(143, 180, 255, .5); }
.atr-item__txt { display: block; width: 100%; margin-top: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--atr-linea); background: var(--atr-campo); color: inherit; font: inherit; font-size: 14px; resize: vertical; outline: none; }
.atr-item__txt:focus { border-color: rgba(var(--atr-az), .5); }
.atr-item__txt[hidden] { display: none; }
/* estados */
.atr-item__estado { display: flex; align-items: flex-start; gap: 7px; margin: 10px 0 0; font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.atr-item__estado svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.atr-item__estado--ok { color: rgb(var(--atr-ok)); }
[data-theme='dark'] .atr-item__estado--ok, .atr.is-noche .atr-item__estado--ok { color: #7ee0b0; }
.atr-item__estado--no { color: rgb(var(--atr-amb)); }
[data-theme='dark'] .atr-item__estado--no, .atr.is-noche .atr-item__estado--no { color: #fcd34d; }
.atr-item.is-hecho, .atr-item.is-nohecho { padding-top: 10px; padding-bottom: 10px; opacity: .78; }
.atr-item.is-hecho .atr-item__cli, .atr-item.is-nohecho .atr-item__cli { display: none; }
.atr-item.is-hecho .atr-item__srv, .atr-item.is-nohecho .atr-item__srv { font-size: 14px; font-weight: 700; }
.atr-item.is-hecho { border-color: rgba(var(--atr-ok), .35); }
.atr-item.is-nohecho { border-color: rgba(var(--atr-amb), .35); }
.atr-item__error { display: flex; align-items: flex-start; gap: 6px; margin: 10px 0 0; font-size: 13px; font-weight: 700; color: rgb(var(--atr-mal)); line-height: 1.35; }
.atr-item__error svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.atr__pie { display: flex; align-items: flex-start; gap: 7px; margin: 2px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--atr-tenue); }
.atr__pie svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.atr__despues { padding: 12px 14px; border-radius: 16px; border: 1px solid rgba(var(--atr-mal), .3); background: rgba(var(--atr-mal), .07); }
.atr__despues p { margin: 0 0 10px; font-size: 13.5px; line-height: 1.4; }
/* B · Uno a uno: solo el actual a la vista, más grande */
.atr[data-v='B'] .atr-item:not(.is-actual) { display: none; }
.atr[data-v='B'] .atr-item { padding: 18px 16px 16px; border-radius: 22px; }
.atr[data-v='B'] .atr-item__srv { font-size: 20px; }
.atr[data-v='B'] .atr-btn { min-height: 50px; font-size: 15.5px; }
/* C · Por día */
.atr-dia { display: flex; flex-direction: column; gap: 8px; }
.atr-dia + .atr-dia { margin-top: 6px; }
.atr-dia__t { display: flex; align-items: center; gap: 7px; margin: 0; padding: 0 2px; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--atr-tenue); }
.atr-dia__t svg { width: 13px; height: 13px; }
.atr-dia__t small { margin-left: auto; font-size: 11.5px; font-weight: 700; letter-spacing: 0; text-transform: none; color: rgb(var(--atr-amb)); }
.atr-dia.is-lista .atr-dia__t small { color: rgb(var(--atr-ok)); }
/* el botón de la tarjeta atrasada en «Mi agenda» */
.pt-ag__cerrar { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; min-height: 36px; padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(194, 117, 0, .4); background: rgba(194, 117, 0, .12); color: #b45309; font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; }
.pt-ag__cerrar svg { width: 14px; height: 14px; }
[data-theme='dark'] .pt-ag__cerrar { color: #fcd34d; }
@media (prefers-reduced-motion: reduce) { .atr, .atr__caja { animation: none; transform: none; opacity: 1; } }
@media (max-width: 380px) { .atr-opc { grid-template-columns: 1fr; } }
