/* TALINETZ 2 · estilos de la app (diseño aprobado: azul marino + naranja, Barlow) */
:root {
  --navy: #0B2238; --navy2: #13325A; --navy3: #2A4870; --amber: #F2A33A; --amber-bg: #FFF1DC; --amber-ink: #7A4A00;
  --ink: #0F1B2A; --muted: #4A5868; --line: #DCE2E9; --line2: #C9D2DC; --ground: #F2F4F7; --soft: #EEF2F6; --card: #FFFFFF;
  --ok: #1E6B45; --ok-bg: #E3F3EA; --err: #A3261C; --err-bg: #FDE4E2; --info: #1D4F91; --info-bg: #E3ECF7; --sub-on-navy: #B9C6D6;
  --r: 16px; --r-sm: 12px;
  --f: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fc: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
  --fm: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 16px/1.4 var(--f); -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--navy2); }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Estructura ---------- */
.app { min-height: 100vh; min-height: 100dvh; display: flex; }
.sidebar { display: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vista { flex: 1; display: flex; flex-direction: column; padding-bottom: calc(76px + var(--safe-b)); }
.contenido { padding: 16px; display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 760px; margin: 0 auto; }
.contenido.ancho { max-width: 1400px; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); padding: 6px 6px calc(10px + var(--safe-b)); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 12px; font-weight: 500;
  color: var(--muted); text-decoration: none; border-radius: 10px; }
.tabbar a.activo { color: var(--navy); font-weight: 700; }
.tabbar a.activo svg { stroke-width: 2.2; }

@media (min-width: 900px) {
  .sidebar { display: flex; flex-direction: column; gap: 22px; width: 240px; flex: 0 0 240px; background: var(--navy); color: #fff;
    padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
  .tabbar { display: none; }
  .vista { padding-bottom: 24px; }
  .contenido { padding: 24px 28px; }
}
.marca { display: flex; align-items: center; gap: 10px; padding: 0 6px; color: #fff; text-decoration: none; }
.logo { width: 36px; height: 36px; border-radius: 10px; background: var(--amber); color: var(--navy); display: grid; place-items: center;
  font: 700 21px var(--fc); flex: 0 0 auto; }
.marca b { font: 700 21px var(--fc); letter-spacing: .04em; display: block; }
.marca small { font-size: 11.5px; color: var(--sub-on-navy); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { height: 42px; padding: 0 12px; border-radius: 10px; display: flex; align-items: center; gap: 10px; color: #D5DEE8;
  text-decoration: none; font-size: 15px; font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.06); }
.nav a.activo { background: var(--navy2); color: #fff; font-weight: 700; }
.nav a.activo svg { stroke: var(--amber); }
.nav .sep { height: 1px; background: var(--navy3); margin: 8px 6px; }
.sidebar-pie { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 8px 6px; color: #fff; text-decoration: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; background: var(--navy2); flex: 0 0 auto; }
.sidebar-pie small { display: block; color: var(--sub-on-navy); font-size: 12px; }

/* ---------- Cabeceras ---------- */
.cab { background: var(--navy); color: #fff; padding: 18px 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.cab-in { width: 100%; max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.cab .sub { color: var(--sub-on-navy); font-size: 14px; }
.cab h1 { font-size: 23px; font-weight: 700; line-height: 1.15; }
.fila { display: flex; align-items: center; gap: 10px; }
.entre { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.btn-ico { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--navy3); background: var(--navy2); color: #fff;
  display: grid; place-items: center; cursor: pointer; text-decoration: none; flex: 0 0 auto; }
.btn-ico.claro { background: var(--ground); border-color: transparent; color: var(--navy); }
.cab-simple { background: #fff; border-bottom: 1px solid var(--line); padding: 12px 16px; position: sticky; top: 0; z-index: 20; }
.cab-simple .cab-in { flex-direction: row; align-items: center; gap: 12px; }
.cab-simple h1 { font-size: 19px; }
.cab-simple .sub { color: var(--muted); font-size: 13.5px; }
.titulo-pag { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.titulo-pag h1 { font: 700 34px/1.05 var(--fc); color: var(--navy); }
.eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- Tarjetas y piezas ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.card.elevada { box-shadow: 0 6px 18px rgba(11,34,56,.08); padding: 16px; }
.card-tit { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--navy2); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.stat b { font: 700 28px/1 var(--fc); }
.stat span { font-size: 12.5px; color: var(--sub-on-navy); }
.hora-grande { font: 700 30px/1 var(--fc); color: var(--navy); }
.hora-grande small { font-size: 18px; color: var(--muted); }
.dir { font-size: 18px; font-weight: 600; }
.muted { color: var(--muted); }
.peq { font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-mono { font: 500 12.5px var(--fm); background: var(--soft); border-radius: 8px; padding: 5px 8px; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pill.pendiente { background: var(--amber-bg); color: var(--amber-ink); }
.pill.en_curso { background: var(--info-bg); color: var(--info); }
.pill.completado { background: var(--ok-bg); color: var(--ok); }
.pill.cancelado { background: var(--soft); color: var(--muted); }
.pill.oscura { background: var(--amber-bg); color: var(--amber-ink); }

.btn { min-height: 48px; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--navy); background: #fff; color: var(--navy);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 15.5px; text-decoration: none; cursor: pointer; }
.btn.primario { background: var(--navy); color: #fff; }
.btn.naranja { background: var(--amber); border-color: var(--amber); color: var(--navy); font-weight: 700; }
.btn.verde { background: var(--ok); border-color: var(--ok); color: #fff; font-weight: 700; }
.btn.peligro { border-color: var(--err); color: var(--err); }
.btn.suave { border-color: var(--line2); }
.btn.grande { min-height: 54px; font-size: 17px; border-radius: 14px; width: 100%; }
.btn.chico { min-height: 38px; font-size: 14px; padding: 0 12px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.oscuro { background: var(--navy2); border-color: var(--navy2); color: #fff; min-height: 46px; font-size: 14.5px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

.item { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: inherit; }
.item:hover { border-color: var(--line2); }
.item .h { font: 700 20px var(--fc); min-width: 52px; color: var(--navy); flex: 0 0 auto; white-space: nowrap; }
.item .cuerpo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item .t { font-size: 15.5px; font-weight: 600; line-height: 1.25; overflow-wrap: break-word; hyphens: auto; }
.item.est-soplada { background: #E3ECF7; border-color: #9DB8DE; }
.item.est-hecho { background: #E3F3EA; border-color: #A3D4B8; }
.item.est-cancelado { background: #FDE4E2; border-color: #F0ADA7; }
.item.est-cancelado .t { text-decoration: line-through; }
.tarjeta.est-soplada { background: #E3ECF7; border-color: #9DB8DE; }
.tarjeta.est-hecho { background: #E3F3EA; border-color: #A3D4B8; }
.tarjeta.est-cancelado { background: #FDE4E2; border-color: #F0ADA7; }
.leyenda-estados { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); }
.leyenda-estados i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 5px; vertical-align: -2px; border: 1px solid var(--line2); }
/* Flechas del visor de fotos */
.visor-flecha { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(11,34,56,.65); color: #fff; display: grid; place-items: center; cursor: pointer; z-index: 2; }
.visor-flecha.izq { left: 10px; } .visor-flecha.der { right: 10px; }
.lista { display: flex; flex-direction: column; gap: 8px; }

.datos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.dato { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dato > span { font-size: 12.5px; color: var(--muted); }
.dato > b { font: 600 16px var(--fm); word-break: break-word; }
.dato > b.grande { font-size: 22px; color: var(--navy); }
.dato > b.texto { font-family: var(--f); font-size: 15px; }
.dato.ancho { grid-column: 1 / -1; background: var(--ground); border-radius: 10px; padding: 8px 10px; }

.contacto { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--soft); }
.contacto:last-child { border-bottom: 0; }

/* Fotos */
.fotos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.foto { aspect-ratio: 1; border-radius: 12px; overflow: hidden; position: relative; background: var(--navy2); border: 0; padding: 0; cursor: pointer; }
.foto img { width: 100%; height: 100%; object-fit: cover; }
.foto .etq { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 5px; font-size: 11.5px; font-weight: 600; color: #fff; text-align: left;
  background: linear-gradient(transparent, rgba(11,34,56,.85)); }
.foto .ok { position: absolute; top: 5px; right: 5px; width: 20px; height: 20px; border-radius: 50%; background: #2E9E66; display: grid; place-items: center; }
.foto-add { aspect-ratio: 1; border-radius: 12px; border: 1.5px dashed #9AA8B8; background: var(--ground); color: var(--muted); font-size: 11.5px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; padding: 4px; text-align: center; }
.foto-add.falta { border-color: #C26D00; background: #FFF6E9; color: var(--amber-ink); font-weight: 700; }
.foto-add.subiendo { border-style: solid; }
.foto-add small { font-size: 10.5px; font-weight: 500; opacity: .85; }
.foto-add span { line-height: 1.15; }
.punto-fibra { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; box-shadow: 0 0 0 1.5px rgba(255,255,255,.9); }
.punto-fibra.grande { width: 20px; height: 20px; margin: 0; box-shadow: 0 0 0 1.5px #9AA8B8; }

/* Formularios */
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo label, .etiqueta { font-size: 13px; font-weight: 600; color: var(--muted); }
.input { width: 100%; min-height: 48px; border: 1px solid var(--line2); border-radius: 12px; padding: 0 12px; background: #fff; font-size: 16px; }
textarea.input { padding: 10px 12px; min-height: 80px; resize: vertical; }
.input:focus, .btn:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid rgba(242,163,58,.6); outline-offset: 1px; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.stepper button { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--soft); color: var(--navy); font-size: 22px; font-weight: 700; cursor: pointer; }
.stepper input { width: 80px; border: 0; background: transparent; text-align: center; font: 700 30px var(--fc); color: var(--navy); }
.stepper input:focus { outline: none; border-bottom: 2px solid var(--amber); }
.opciones { display: flex; flex-wrap: wrap; gap: 8px; }
.opcion { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line2); background: #fff; display: inline-flex; align-items: center;
  font-size: 14.5px; font-weight: 500; cursor: pointer; }
.opcion.sel { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.buscador { position: relative; }
.buscador svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.buscador .input { padding-left: 40px; }

.pie-accion { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: #fff; border-top: 1px solid var(--line);
  padding: 12px 16px calc(14px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; }
.pie-accion > * { width: 100%; max-width: 728px; margin: 0 auto; }
.con-pie .vista { padding-bottom: calc(110px + var(--safe-b)); }
.con-pie .tabbar { display: none; }
@media (min-width: 900px) { .pie-accion { left: 240px; } }

/* Mensajes */
.aviso { border-radius: 12px; padding: 12px 14px; font-size: 14.5px; }
.aviso.error { background: var(--err-bg); color: var(--err); }
.aviso.ok { background: var(--ok-bg); color: var(--ok); }
.aviso.info { background: var(--info-bg); color: var(--info); }
.aviso.naranja { background: var(--amber-bg); color: var(--amber-ink); }
.vacio { text-align: center; color: var(--muted); padding: 32px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.vacio svg { color: #9AA8B8; }
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(90px + var(--safe-b)); z-index: 100; display: flex; flex-direction: column; gap: 8px;
  width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--navy); color: #fff; border-radius: 12px; padding: 12px 14px; font-size: 14.5px; box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: entra .2s ease-out; }
.toast.error { background: var(--err); }
.toast.ok { background: var(--ok); }
@keyframes entra { from { opacity: 0; transform: translateY(8px); } }
.cargando { display: grid; place-items: center; padding: 48px; color: var(--muted); }
.spin { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--navy); border-radius: 50%; animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.barra-prog { height: 4px; background: var(--soft); border-radius: 2px; overflow: hidden; }
.barra-prog i { display: block; height: 100%; background: var(--amber); width: 0; transition: width .2s; }

/* Visor de fotos */
.visor { position: fixed; inset: 0; z-index: 90; background: rgba(5,14,24,.94); display: flex; flex-direction: column; }
.visor-barra { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; color: #fff; gap: 8px; }
.visor-img { flex: 1; display: grid; place-items: center; padding: 8px; min-height: 0; }
.visor-img img { max-height: 100%; max-width: 100%; object-fit: contain; border-radius: 6px; }

/* Login */
.login { min-height: 100vh; min-height: 100dvh; background: var(--navy); display: grid; place-items: center; padding: 16px; }
.login form { width: 100%; max-width: 380px; background: #fff; border-radius: 20px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.login .marca { color: var(--navy); padding: 0; margin-bottom: 4px; }
.login .marca small { color: var(--muted); }

/* Detalles plegables */
details.card > summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.card > summary::-webkit-details-marker { display: none; }
.hist { font-size: 13.5px; display: flex; flex-direction: column; gap: 8px; }
.hist div { display: flex; flex-direction: column; border-left: 3px solid var(--line); padding-left: 10px; }
.filtros { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.filtros .opcion { flex: 0 0 auto; }
.grupo-dia { font-size: 13px; font-weight: 700; color: var(--muted); margin: 6px 2px 0; }

/* Ventanas emergentes */
.modal-fondo { position: fixed; inset: 0; z-index: 80; background: rgba(5,14,24,.55); display: flex; align-items: flex-end; justify-content: center; }
.modal { background: #fff; width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + var(--safe-b));
  display: flex; flex-direction: column; gap: 14px; animation: sube .18s ease-out; }
.modal:focus { outline: none; }
.modal-acciones { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.modal-acciones .btn { flex: 1 1 140px; }
@media (min-width: 700px) { .modal-fondo { align-items: center; } .modal { border-radius: 20px; } }
@keyframes sube { from { transform: translateY(24px); opacity: 0; } }

/* Planificación */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 1px; }
.kpi b { font: 700 30px/1.1 var(--fc); color: var(--navy); }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi.alerta { background: #FFF6E9; border-color: #F3D5A6; }
.kpi.alerta b, .kpi.alerta span { color: var(--amber-ink); }
.tablero-caja { overflow-x: auto; padding-bottom: 6px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.tablero { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(215px, 1fr); gap: 12px; min-width: min-content; }
.columna { background: #E9EDF2; border: 1px solid var(--line); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 220px; transition: background .15s; }
.columna.sin { background: #FFF6E9; border-color: #F3D5A6; }
.columna.hoy { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.columna.encima { background: #DCE6F2; border-style: dashed; border-color: var(--navy2); }
.columna-cab { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 4px 4px; }
.columna-cab b { font-size: 15.5px; }
.tarjeta { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; display: flex; flex-direction: column; gap: 5px;
  box-shadow: 0 1px 2px rgba(11,34,56,.05); cursor: grab; text-align: left; width: 100%; font: inherit; color: inherit; }
.tarjeta:active { cursor: grabbing; }
.tarjeta.arrastrando { opacity: .4; }
.tarjeta.hecha { border-left: 4px solid var(--ok); }
.tarjeta.curso { border-left: 4px solid var(--info); }
.tarjeta.atenuada { opacity: .35; }
.tarjeta .t-h { font: 700 18px var(--fc); color: var(--navy); }
.tarjeta .t-d { font-size: 14px; font-weight: 600; line-height: 1.25; }
.fibra { font: 600 11.5px var(--fm); padding: 3px 7px; border-radius: 7px; }
.fibra.f12 { background: var(--info-bg); color: var(--navy2); }
.fibra.f4 { background: var(--amber-bg); color: var(--amber-ink); }
.op { height: 24px; min-width: 24px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
@media (min-width: 900px) { .tablero-caja { margin: 0; padding-left: 0; padding-right: 0; } }

/* Formularios en rejilla */
.form-rejilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-rejilla .todo { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-rejilla { grid-template-columns: 1fr; } }
select.input { appearance: auto; }
.tabla-caja { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabla th, .tabla td { padding: 9px 8px; border-bottom: 1px solid var(--soft); text-align: left; vertical-align: top; }
.tabla th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.zona-imagen { border: 2px dashed rgba(29,79,145,.35); border-radius: 14px; background: rgba(29,79,145,.04); padding: 14px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.zona-imagen.encima, .zona-imagen:focus { border-color: var(--info); background: rgba(29,79,145,.09); outline: none; }
.zona-imagen img { max-height: 160px; object-fit: contain; border-radius: 8px; margin-top: 8px; }
.clave-api { font: 600 14px var(--fm); background: var(--ground); border: 1px dashed var(--navy2); border-radius: 10px; padding: 12px; word-break: break-all; user-select: all; }

@media (max-width: 600px) {
  .titulo-pag h1 { font-size: 27px; }
  .kpi b { font-size: 26px; }
}

/* Economía */
.tip { position: absolute; z-index: 5; width: 190px; background: var(--navy); color: #fff; border-radius: 10px; padding: 8px 10px; font-size: 13px;
  display: flex; flex-direction: column; gap: 2px; pointer-events: none; box-shadow: 0 6px 18px rgba(11,34,56,.25); }
.tip b { font-size: 13.5px; }
.tip span { color: var(--sub-on-navy); }
svg rect[tabindex]:focus { outline: none; }

/* Equipo y ajustes */
.colores { display: flex; flex-wrap: wrap; gap: 8px; }
.color-op { width: 36px; height: 36px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--line2); cursor: pointer; padding: 0; }
.color-op.sel { box-shadow: 0 0 0 3px var(--amber); }
.interruptor { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--soft); cursor: pointer; }
.interruptor:last-child { border-bottom: 0; }
.interruptor input { width: 22px; height: 22px; accent-color: var(--navy); flex: 0 0 auto; }
.euro-campo { position: relative; }
.euro-campo .input { padding-right: 34px; text-align: right; font: 600 17px var(--fm); }
.euro-campo span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }

/* Mapa */
.mapa-caja { position: relative; height: calc(100dvh - 250px); min-height: 360px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: #E9EDF2; }
@media (min-width: 900px) { .mapa-caja { height: calc(100vh - 210px); } }
.mapa-caja .leaflet-container { height: 100%; font: inherit; }
.marcador { width: 30px; height: 30px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); display: grid; place-items: center; border: 2.5px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.marcador b { transform: rotate(45deg); color: #fff; font: 700 12px var(--fc); }
.marcador.pendiente { background: var(--amber); } .marcador.pendiente b { color: var(--navy); }
.marcador.en_curso { background: var(--info); }
.marcador.completado { background: var(--ok); }
.marcador.cancelado { background: #8795A5; }
.pop { display: flex; flex-direction: column; gap: 4px; min-width: 200px; font-size: 14px; }
.pop > div { display: flex; flex-direction: column; gap: 3px; }
.pop b { font-size: 15px; }
.pop .acc { display: flex; gap: 6px; margin-top: 6px; }
.pop .acc a { flex: 1; text-align: center; padding: 8px; border-radius: 9px; background: var(--navy); color: #fff !important; text-decoration: none; font-weight: 600; font-size: 13.5px; }
.pop .acc a.sec { background: var(--soft); color: var(--navy) !important; }
.leyenda { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--muted); }
.leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }

/* Selección múltiple */
.sel-fila { display: flex; align-items: center; gap: 0; }
.sel-fila > .item { flex: 1; min-width: 0; }
.sel-marca { display: none; width: 0; }
.seleccionando .sel-marca { display: grid; place-items: center; width: 40px; flex: 0 0 40px; cursor: pointer; }
.sel-caja { width: 22px; height: 22px; accent-color: var(--navy); cursor: pointer; }
.seleccionando .sel-fila > .item { cursor: pointer; }
.sel-fila.elegido > .item { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); background: #F3F6FB; }
.sel-grupo { display: none; border: 0; background: none; color: var(--navy2); font: 600 13px var(--f); cursor: pointer; padding: 2px 4px; text-decoration: underline; }
.seleccionando .sel-grupo { display: inline; }
.barra-seleccion { gap: 10px; }
.sel-acciones { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 8px; }
@media (max-width: 560px) { .sel-acciones { grid-template-columns: 1fr 1fr; } .sel-acciones .btn { grid-column: 1 / -1; } }
.grupo-cab { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 6px 2px 0; }
.grupo-cab .grupo-dia { margin: 0; }
.op-cab { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15.5px; }
.op-cab small { font-weight: 500; color: var(--muted); font-size: 13px; }
.grupo-op.sin { background: #FFF6E9; border-color: #F3D5A6; }

/* Visor de PDF */
.visor-pdf .visor-barra { background: #0B2238; }
.pdf-info { font-size: 12.5px; color: var(--sub-on-navy); }
.pdf-paginas { flex: 1; overflow: auto; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 10px; -webkit-overflow-scrolling: touch; }
.pdf-pagina { background: #fff; border-radius: 4px; box-shadow: 0 2px 10px rgba(0,0,0,.35); flex: 0 0 auto; max-width: none; }
.pdf-pagina canvas { display: block; border-radius: 4px; }

/* iPhone: que nada quede debajo de la barra de estado / notch */
.cab { padding-top: calc(18px + env(safe-area-inset-top, 0px)); }
.cab-simple { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
.vista > .contenido:first-child { padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
.visor-barra { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
.login { padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
@media (min-width: 900px) { .vista > .contenido:first-child { padding-top: calc(24px + env(safe-area-inset-top, 0px)); } }
.visor { padding-bottom: env(safe-area-inset-bottom, 0px); }
/* Visor de fotos: la foto entera siempre cabe en la pantalla (móvil, tablet u ordenador), sin recortar */
.visor-img { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; display: block; padding: 0; }
.visor-img img { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); max-width: none; max-height: none; object-fit: contain; border-radius: 0; touch-action: pan-y pinch-zoom; }
@media (min-width: 900px) { .visor-img img { inset: 16px 72px; width: calc(100% - 144px); height: calc(100% - 32px); } }

/* Protocolos: tabla en el ordenador, tarjetas en el móvil */
.tabla-proto-caja { padding: 4px 6px; }
.tabla-proto td { vertical-align: middle; }
.tabla-proto th .orden { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; }
.tabla-proto th[aria-sort="ascending"] .orden, .tabla-proto th[aria-sort="descending"] .orden { color: var(--navy); }
.contenido.ancho { max-width: 1120px; }
.tabla-proto .dir-in { display: flex; flex-direction: column; gap: 2px; }
.tabla-proto td.dir .t { font-weight: 650; }
.tabla-proto td.sop, .tabla-proto td.nvt { white-space: nowrap; }
.tabla-proto .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 600; }
.tabla-proto .acc { text-align: right; }
.tabla-proto .acc-in { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; align-items: center; white-space: nowrap; }
.tabla-proto .acc-in .sin-trabajo { min-width: 118px; justify-content: center; }
.tabla-proto .sin-trabajo { display: inline-flex; align-items: center; min-height: 36px; padding: 0 8px; }
@media (max-width: 700px) {
  .tabla-proto-caja { background: none; border: 0; box-shadow: none; padding: 0; }
  .tabla-proto, .tabla-proto tbody, .tabla-proto tr, .tabla-proto td { display: block; width: 100%; }
  .tabla-proto thead { display: flex; gap: 14px; padding: 0 4px 6px; }
  .tabla-proto thead tr { display: flex; gap: 14px; }
  .tabla-proto thead th { border: 0; padding: 0; }
  .tabla-proto thead th.acc { display: none; }
  .tabla-proto tr { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; }
  .tabla-proto td { border: 0; padding: 0; }
  .tabla-proto td.dir { grid-column: 1 / -1; }
  .tabla-proto td.dir .t { font-size: 16px; }
  .tabla-proto td.sop { font-size: 14px; }
  .tabla-proto td.nvt { text-align: right; font-size: 14px; }
  .tabla-proto td.acc { grid-column: 1 / -1; margin-top: 6px; }
  .tabla-proto .acc-in { justify-content: stretch; flex-wrap: nowrap; }
  .tabla-proto .acc-in > * { flex: 1 1 0; justify-content: center; padding-left: 6px; padding-right: 6px; min-width: 0; }
  .tabla-proto .acc-in svg { display: none; }
  .tabla-proto .acc-in .sin-trabajo { min-width: 0; }
}

/* Ajustes → Google Drive → compartir */
.compartir { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 2px; }
.compartir-form { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
.compartir-form .input { min-width: 0; }
@media (max-width: 560px) { .compartir-form { grid-template-columns: 1fr 1fr; } .compartir-form input { grid-column: 1 / -1; } }
.lista-acceso { display: flex; flex-direction: column; }
.acceso { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--soft); }
.acceso:last-child { border-bottom: 0; }
.acceso .cuerpo { flex: 1; min-width: 0; }
.avatar-acceso { width: 36px; height: 36px; border-radius: 50%; background: #E3ECF7; color: var(--navy); display: grid; place-items: center; font-weight: 700; flex: 0 0 auto; }
.acceso .nom { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Ajustes: menú de pestañas arriba */
.pestanas { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 14px;
  position: sticky; top: calc(8px + env(safe-area-inset-top, 0px)); z-index: 15; box-shadow: 0 2px 10px rgba(11,34,56,.06); }
.pestanas::-webkit-scrollbar { display: none; }
.pestana { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 14px; border: 0; border-radius: 10px; background: none;
  font: inherit; font-size: 14.5px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.pestana:hover { background: #F1F4F8; color: var(--navy); }
.pestana.sel { background: var(--navy); color: #fff; }
.ajustes-zona { display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 700px) { .pestana svg { display: none; } .pestana { padding: 0 12px; } }

/* Avisos de un trabajo (lo que le falta) */
.aviso-mini { flex: 0 0 auto; font-size: 12px; font-weight: 700; color: var(--amber-ink); background: var(--amber-bg); border-radius: 999px; padding: 3px 8px; white-space: nowrap; }
/* Fotos guardadas en el móvil sin conexión */
.foto-cola { position: relative; cursor: default; opacity: .85; }
.foto-cola .cola-marca { position: absolute; left: 4px; right: 4px; bottom: 4px; background: rgba(11,34,56,.82); color: #fff; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 3px 4px; text-align: center; }

/* Panel */
.panel-zona { display: flex; flex-direction: column; gap: 14px; }
.kpi .comp { font-size: 12.5px; color: var(--muted); }
.kpi .comp.sube { color: var(--ok); font-weight: 600; }
.kpi .comp.baja { color: #B4352B; font-weight: 600; }
a.kpi { text-decoration: none; color: inherit; }
a.kpi:hover { border-color: var(--line2); box-shadow: 0 2px 10px rgba(11,34,56,.06); }
.grafico-caja { position: relative; }
.grafico { width: 100%; height: auto; display: block; overflow: visible; }
.grafico .rejilla { stroke: #EEF1F5; stroke-width: 1; }
.grafico .base { stroke: #C9D2DC; stroke-width: 1; }
.grafico .eje { font-size: 11px; fill: #6B7889; font-family: inherit; }
.grafico .barra { fill: #4F7FD0; }
.grafico .hit { fill: transparent; cursor: default; }
.grafico .hit:hover { fill: rgba(19,50,90,.06); }
.grafico .hit.futuro:hover { fill: transparent; }
.grafico-caja .tip { position: absolute; top: -6px; width: 120px; background: #0B2238; color: #fff; border-radius: 8px; padding: 6px 9px; font-size: 12.5px; display: flex; flex-direction: column; pointer-events: none; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.grafico-caja .tip[hidden] { display: none; }
.panel-dos { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 860px) { .panel-dos { grid-template-columns: 1fr; } }
.lista-ops { display: flex; flex-direction: column; gap: 12px; }
.op-fila { display: flex; gap: 10px; align-items: center; }
.op-cuerpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.op-cuerpo .entre { gap: 8px; flex-wrap: wrap; }
.op-barra { display: flex; gap: 2px; height: 8px; background: #F1F4F8; border-radius: 4px; overflow: hidden; }
.op-barra i, .leyenda-barra i { display: block; height: 100%; }
.op-barra .hecho, .leyenda-barra .hecho { background: #2A9D5C; border-radius: 4px; }
.op-barra .pend, .leyenda-barra .pend { background: #4F7FD0; border-radius: 4px; }
.leyenda-barra { display: flex; align-items: center; gap: 6px; }
.leyenda-barra i { width: 12px; height: 8px; margin-left: 6px; }
/* Economía: selector de mes y liquidación */
.selector-mes { padding: 8px 10px; gap: 4px; }
.selector-mes .mes-et { font-size: 17px; }
.selector-mes details summary { cursor: pointer; text-align: center; }
.chip { display: inline-flex; gap: 4px; align-items: baseline; padding: 4px 10px; border-radius: 999px; background: #F1F4F8; font-size: 13px; color: var(--muted); }
.chip b { color: var(--navy); }
.liq-detalle summary { cursor: pointer; color: var(--info); font-weight: 600; font-size: 14px; }
.liq-detalle .tabla a { color: inherit; font-weight: 600; }
/* Facturas */
.tabla-fact td.num, .tabla-fact th.num { text-align: right; white-space: nowrap; }
.tabla-fact tr.anulada td { opacity: .55; }
.tabla-fact td.cli { min-width: 140px; }
.pill.vencida { background: #FDE4E2; color: #9B2C22; }
@media (max-width: 700px) { .tabla-fact td.num { text-align: left; } }
.nueva-fact { border: 2px solid var(--navy); }
.lineas-fact { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; max-height: 360px; overflow: auto; }
.linea-fact { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; padding: 9px 12px; border-bottom: 1px solid var(--soft); font-size: 13.5px; cursor: pointer; }
.linea-fact:last-child { border-bottom: 0; }
.linea-fact.todas { grid-template-columns: auto 1fr; background: #F7F9FB; position: sticky; top: 0; }
.linea-fact input { width: 18px; height: 18px; margin-top: 1px; }
.linea-fact .imp { white-space: nowrap; }
.extras-fact { display: flex; flex-direction: column; gap: 8px; }
.extra-fila { display: grid; grid-template-columns: 1fr 70px 100px auto; gap: 6px; }
.totales-fact { display: flex; flex-direction: column; gap: 6px; background: #F7F9FB; border-radius: 12px; padding: 12px 14px; }
.totales-fact .total { font-size: 18px; border-top: 1px solid var(--line); padding-top: 6px; }
/* Actividad */
.actividad { display: flex; flex-direction: column; gap: 6px; }
.act { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; color: inherit; text-decoration: none; font-size: 14px; }
a.act:hover { border-color: var(--line2); }
.act.alerta { background: #FFF6F5; border-color: #F2C9C4; }
.act-h { font: 700 13px/28px var(--fc); color: var(--muted); min-width: 40px; }
.act-cuerpo { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.act-tipo { color: var(--info); font-weight: 600; }
@media (max-width: 700px) { .tabla-fact .acc-in svg { display: inline-block; } .tabla-fact .acc-in > .btn-ico { flex: 0 0 44px; } }

/* Por confirmar */
.rev-lista { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; max-height: 60vh; overflow: auto; }
.rev-fila { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--soft); align-items: start; }
.rev-fila:last-child { border-bottom: 0; }
.rev-fila > input { width: 20px; height: 20px; margin-top: 12px; }
.rev-campos { display: grid; grid-template-columns: 1.4fr 1fr; gap: 6px; min-width: 0; }
.rev-campos .input { min-height: 42px; }
.rev-campos > div { grid-column: 1 / -1; }
@media (max-width: 600px) { .rev-campos { grid-template-columns: 1fr; } }
.rev-fila.dup { background: #F7F8FA; }
.rev-fila.dup .input { opacity: .6; }
.rev-dup { font-size: 13px; color: #9B2C22; }
.rev-dup a { color: inherit; font-weight: 700; }
.texto-leido { white-space: pre-wrap; font-size: 12px; background: #F7F9FB; border-radius: 8px; padding: 10px; max-height: 240px; overflow: auto; }
.pc-item { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.pc-item > input { width: 20px; height: 20px; flex: 0 0 auto; }
.pc-item .cuerpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pc-todas { display: flex; gap: 8px; align-items: center; padding: 0 4px; }
.pc-barra { position: sticky; bottom: calc(76px + var(--safe-b)); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--navy); color: #fff; border-radius: 14px; padding: 10px 12px; box-shadow: 0 6px 20px rgba(0,0,0,.2); z-index: 10; }
.pc-barra > span { flex: 1 1 auto; }
@media (min-width: 900px) { .pc-barra { bottom: 16px; } }
.pc-filtros { gap: 8px; padding: 10px 12px; }
.pc-filtros-rejilla { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 760px) { .pc-filtros-rejilla { grid-template-columns: 1fr 1fr; } }
.pc-cab { gap: 8px; flex-wrap: wrap; padding: 0 4px; }
.enlace { background: none; border: 0; padding: 0; font: inherit; color: var(--info); font-weight: 600; cursor: pointer; text-decoration: underline; }

/* Fotos: seleccionar varias */
.foto.sel-modo img { transition: transform .12s; }
.foto.elegida img { transform: scale(.88); border-radius: 8px; }
.foto.elegida { outline: 3px solid var(--navy); outline-offset: -3px; background: #DCE6F2; }
.marca-sel { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; background: rgba(11,34,56,.35); color: #fff; display: grid; place-items: center; font-size: 14px; font-weight: 800; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.foto.elegida .marca-sel { background: var(--navy); }
.fotos-sel-barra { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: #EEF2F7; border-radius: 12px; padding: 8px 10px; position: sticky; top: calc(6px + env(safe-area-inset-top, 0px)); z-index: 5; }
.fotos-sel-barra > span { flex: 1 1 100%; font-size: 14px; }
@media (min-width: 600px) { .fotos-sel-barra > span { flex: 1 1 auto; } }
/* Importar: modo de las citas nuevas */
.modo-imp { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line2); border-radius: 12px; padding: 12px; cursor: pointer; }
.modo-imp.sel { border-color: var(--navy); background: #F3F6FA; }
.modo-imp input { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 auto; }
.badge-menu { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--amber, #F2A33A); color: #0B2238; font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; }
/* Por confirmar: Portal Telekom / Listas */
.fuentes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fuente { display: flex; align-items: center; gap: 12px; text-align: left; font: inherit; padding: 14px; border-radius: 14px; border: 1.5px solid var(--line2); background: #fff; color: var(--navy); cursor: pointer; min-width: 0; }
.fuente:hover { border-color: var(--navy); }
.fuente.sel { background: var(--navy); border-color: var(--navy); color: #fff; }
.fuente-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.fuente-txt b { font-size: 16px; }
.fuente-txt span { font-size: 12.5px; opacity: .75; }
.fuente .badge-menu { margin-left: 0; }
@media (max-width: 560px) { .fuente { padding: 10px; gap: 8px; } .fuente-txt span { display: none; } .fuente svg { width: 18px; height: 18px; } }

/* Compartir por WhatsApp */
.btn.whatsapp { background: #1FA855; border-color: #1FA855; color: #fff; }
.btn.whatsapp:hover { background: #188F48; }
.btn.whatsapp:disabled { opacity: .55; }
.texto-compartir { white-space: pre-wrap; font: 14px/1.45 inherit; font-family: inherit; background: #F7F9FB; border-radius: 10px; padding: 10px 12px; margin: 0; max-height: 200px; overflow: auto; }
.progreso-barra { height: 8px; border-radius: 4px; background: #EEF2F7; overflow: hidden; }
.progreso-barra i { display: block; height: 100%; background: #1FA855; transition: width .2s; }

/* Economía: filtros de varias opciones */
.eco-filtros { gap: 0; }
.eco-filtros > summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; cursor: pointer; list-style: none; min-height: 32px; }
.eco-filtros > summary::-webkit-details-marker { display: none; }
.eco-filtros > summary::after { content: '▾'; margin-left: auto; color: var(--sub, #4A5868); transition: transform .2s; }
.eco-filtros[open] > summary::after { transform: rotate(180deg); }
.eco-filtros-in { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.eco-filtro { display: flex; flex-direction: column; gap: 6px; }
.eco-filtro .etiqueta { font-weight: 600; font-size: 13px; }
.eco-chips { flex-wrap: wrap; overflow: visible; max-height: 168px; overflow-y: auto; }
.eco-chips .opcion { min-height: 34px; padding: 0 12px; gap: 5px; font-size: 13.5px; }
/* Facturas: elegir trabajos */
.fact-filtros { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fact-filtros .input { flex: 1 1 150px; min-height: 40px; width: auto; }
.linea-fact .sub { display: block; color: var(--sub, #4A5868); font-size: 12.5px; margin-top: 2px; }
.linea-fact.oculta { display: none; }
/* Filas de trabajos con varias etiquetas (Soplada, avisos, Info pend.): que bajen de línea en el móvil en vez de salirse */
.item { flex-wrap: wrap; row-gap: 6px; }
.item .cuerpo { flex: 1 1 150px; }
/* Gastos */
.gasto-cat { display: flex; flex-direction: column; gap: 6px; text-align: left; background: none; border: 0; padding: 4px 2px; border-radius: 10px; cursor: pointer; font: inherit; color: inherit; width: 100%; }
.gasto-cat:hover { background: var(--soft); }
.gasto-cat.sel { background: var(--info-bg); padding: 6px 8px; }
.gasto-cat .entre > span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.gasto-fila { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; flex-wrap: nowrap; }
.gasto-fila .cuerpo { flex: 1 1 auto; }
.gasto-mini { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 10px; object-fit: cover; background: var(--soft); border: 1px solid var(--line); display: grid; place-items: center; font: 700 12px var(--fc); color: var(--navy); }
.gasto-mini.sin { color: var(--amber-ink); background: var(--amber-bg); border-color: transparent; }
.gasto-imp { display: flex; flex-direction: column; align-items: flex-end; flex: 0 0 auto; white-space: nowrap; }
.gasto-imp b { font-size: 16px; color: var(--navy); }
.modal-gasto { max-width: 620px; }
.gasto-form { gap: 12px; }
.gasto-ticket { border-radius: 14px; overflow: hidden; background: var(--soft); margin-bottom: 8px; }
.gasto-ticket img { display: block; width: 100%; max-height: 300px; object-fit: contain; background: #1b2633; }
.gasto-ticket-vacio, .gasto-ticket-pdf { display: flex; align-items: center; gap: 12px; padding: 16px; color: var(--muted); font-size: 14px; width: 100%; border: 0; background: none; font-family: inherit; text-align: left; }
.gasto-ticket-pdf { color: var(--navy); font-weight: 600; cursor: pointer; }
.gasto-total { font: 700 24px var(--fc) !important; color: var(--navy); }
.gasto-desglose > summary { cursor: pointer; font-size: 13px; color: var(--muted); margin-top: 6px; }
/* Correos */
.correos-lista { padding: 10px 8px; }
.correo-fila { display: flex; gap: 10px; align-items: flex-start; padding: 11px 8px; border-bottom: 1px solid var(--soft); text-decoration: none; color: inherit; border-radius: 10px; }
.correo-fila:last-child { border-bottom: 0; }
.correo-fila:hover { background: #F6F8FB; }
.correo-punto { width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; flex: 0 0 9px; background: transparent; }
.correo-fila.nuevo .correo-punto { background: var(--info, #1D4F91); }
.correo-cuerpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.correo-de { font-size: 14.5px; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.correo-fila.nuevo .correo-de, .correo-fila.nuevo .correo-asunto { font-weight: 700; }
.correo-fecha { flex: 0 0 auto; font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.correo-asunto { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.correo-frag { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.correo-titulo { font: 700 22px/1.25 var(--fc); color: var(--navy); margin: 0; overflow-wrap: anywhere; }
.correo-meta { display: flex; gap: 8px; margin-top: 4px; overflow-wrap: anywhere; }
.correo-meta > .muted { flex: 0 0 34px; }
.correo-adjuntos { display: flex; flex-direction: column; gap: 6px; }
.correo-adj { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; }
.correo-adj-ico { color: var(--navy); display: grid; place-items: center; flex: 0 0 auto; }
.correo-adj-nom { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.correo-adj-nom b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.correo-mensaje { padding: 12px; }
.correo-marco { width: 100%; border: 0; min-height: 120px; display: block; }
.correo-texto { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.5; }
/* Documentación CAE */
.doc-grupo > summary { cursor: pointer; list-style: none; }
.doc-grupo > summary::-webkit-details-marker { display: none; }
.doc-cae-lista { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.doc-cae { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-left: 5px solid #A3D4B8; border-radius: 12px; background: #fff; }
.doc-cae.est-caducado { border-left-color: #D64545; background: #FFF6F5; }
.doc-cae.est-pronto { border-left-color: var(--amber, #F2A33A); background: #FFFAF2; }
.doc-cae.est-archivado { opacity: .65; border-left-color: #C9D2DC; }
.doc-cae.est-sin_fecha { border-left-color: #C9D2DC; }
.doc-cae-cuerpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.doc-cae-nombre { font-size: 15px; color: var(--navy); overflow-wrap: anywhere; }
.doc-cae-fecha { font-size: 13.5px; }
.doc-cae.est-caducado .doc-cae-fecha b { color: #B3261E; }
.doc-cae.est-pronto .doc-cae-fecha b { color: var(--amber-ink); }
.doc-cae-correo { color: var(--navy2, #13325A); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; align-items: center; gap: 2px; max-width: 100%; }
.doc-cae-acc { display: flex; gap: 6px; align-items: center; flex: 0 0 auto; }
.avisos-prefs { display: flex; flex-direction: column; }
/* Impuestos */
.imp-apartar { background: var(--navy); color: #fff; border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.imp-apartar > span:first-child { color: var(--sub-on-navy, #B9C6D6); font-size: 13px; }
.imp-apartar b { font: 700 30px/1.1 var(--fc); }
.imp-apartar .peq { color: var(--sub-on-navy, #B9C6D6); }
.imp-bloques { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.imp-bloque { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.imp-tit { font-weight: 700; color: var(--navy); font-size: 14px; }
.imp-fila { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; align-items: baseline; }
.imp-fila > span { min-width: 0; }
.imp-fila b { white-space: nowrap; }
.imp-fila.fuerte { border-top: 1px solid var(--line); padding-top: 6px; font-size: 15.5px; }
.imp-fila.fuerte b { color: var(--navy); font-size: 17px; }
.tabla-imp tr.sel td { background: var(--info-bg); }
.tabla-imp td.num, .tabla-imp th.num { text-align: right; white-space: nowrap; }
.imp-trims { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.imp-trim { display: grid; grid-template-columns: 110px repeat(5, minmax(0, 1fr)); gap: 8px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; color: inherit; text-align: left; width: 100%; }
button.imp-trim { cursor: pointer; }
.imp-trim.sel { background: var(--info-bg); border-color: #9DB8DE; }
.imp-trim.total { background: #F7F9FB; }
.imp-c { display: flex; flex-direction: column; min-width: 0; font-size: 14px; white-space: nowrap; }
.imp-et { font-size: 11.5px; color: var(--muted); }
@media (max-width: 640px) {
  .imp-trim { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .imp-t { grid-column: 1 / -1; }
}
.doc-cae { flex-wrap: wrap; }
.doc-cae-cuerpo { flex: 1 1 200px; }
@media (max-width: 520px) { .doc-cae-acc { width: 100%; justify-content: flex-end; } }
/* Coliseo */
.coliseo-lista { display: flex; flex-direction: column; }
.coliseo-fila { display: flex; gap: 10px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--soft); border-radius: 10px; }
.coliseo-fila:last-child { border-bottom: 0; }
.coliseo-fila.sel { background: var(--info-bg); }
.coliseo-check { display: grid; place-items: center; padding: 6px; cursor: pointer; }
.coliseo-check input { width: 20px; height: 20px; }
.coliseo-cuerpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; text-decoration: none; color: inherit; }
.coliseo-cuerpo b { color: var(--navy); overflow-wrap: anywhere; }
.coliseo-acc { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: 0 0 auto; }
.coliseo-imp { font-size: 14px; white-space: nowrap; }
.coliseo-barra { position: sticky; bottom: calc(76px + var(--safe-b, 0px)); z-index: 30; margin-top: 10px; background: var(--navy); color: #fff; border-radius: 14px; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
@media (min-width: 900px) { .coliseo-barra { bottom: 16px; } }
.subir-proto-res { max-height: 45vh; overflow-y: auto; }
/* Factura desde el desglose */
.dg-cabecera { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.dg-grupo { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.dg-fila { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--soft); }
.dg-fila.apagada { opacity: .5; }
.dg-cuerpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dg-cuerpo a { color: var(--navy); text-decoration: none; }
.dg-precio-caja { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.dg-precio { width: 82px; min-height: 38px; text-align: right; }
.dg-ra { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--soft); border-radius: 12px; padding: 10px 12px; }
.dg-ra .segmentado { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.dg-ra .segmentado button { border: 0; background: transparent; padding: 8px 14px; font: inherit; font-weight: 600; color: var(--navy); min-height: 38px; cursor: pointer; }
.dg-ra .segmentado button.activo { background: var(--navy); color: #fff; }
.dg-eleccion { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.dg-eleccion .input { min-height: 38px; font-size: 14px; }
/* Protocolos: elegir y borrar */
.proto-barra { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 2px; }
.proto-barra > span:first-child { flex: 1 1 auto; }
.tabla-proto th.sel, .tabla-proto td.sel { width: 34px; padding-right: 0; }
.tabla-proto .sel input, .sp-fila input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--navy); cursor: pointer; }
.tabla-proto tr.elegida td { background: #FFF7E6; }
@media (max-width: 899px) {
  .tabla-proto thead th.sel { display: flex; align-items: center; }
  .tabla-proto tr { position: relative; }
  .tabla-proto tr.elegida { background: #FFF7E6; border-color: var(--amber, #F5A524); }
  .tabla-proto tr.elegida td { background: none; }
  .tabla-proto.con-sel td.sel { position: absolute; top: 12px; right: 14px; width: auto; }
  .tabla-proto.con-sel td.dir { padding-right: 34px; }
}
/* Subir protocolos: revisar antes de subir */
.sp-revision { display: flex; flex-direction: column; gap: 10px; }
.sp-todos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 8px; align-items: end; background: var(--soft); border-radius: 12px; padding: 10px; }
.sp-revisar { display: flex; flex-direction: column; max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.sp-fila { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--soft); }
.sp-fila:first-child { border-top: 0; }
.sp-nombre { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.sp-campos { display: grid; grid-template-columns: 1fr 1.4fr 110px; gap: 6px; }
.sp-campos .input { min-height: 38px; font-size: 14px; padding-top: 6px; padding-bottom: 6px; }
.sp-precio { display: flex; align-items: center; gap: 4px; }
.sp-precio .input { text-align: right; width: 100%; }
@media (max-width: 560px) {
  .sp-todos { grid-template-columns: 1fr 1fr; }
  .sp-todos .campo:nth-child(2) { grid-column: 2; }
  .sp-todos .btn { grid-column: 1 / -1; }
  .sp-campos { grid-template-columns: 1fr 1fr; }
  .sp-precio { grid-column: 1 / -1; }
}
/* Papelera y duplicados */
.papelera-item { flex-wrap: wrap; }
.dup-grupo { gap: 10px; }
.dup-lista { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.dup-fila { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-top: 1px solid var(--soft); }
.dup-fila:first-child { border-top: 0; }
.dup-fila.queda { background: #EEF7F0; }
.dup-fila.apagada { opacity: .5; }
.dup-fila input[type=radio], .dup-check input { width: 20px; height: 20px; accent-color: var(--navy); margin-top: 2px; flex: 0 0 auto; }
.dup-cuerpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.dup-cuerpo a { color: var(--navy); text-decoration: none; }
.dup-obs { white-space: pre-line; max-height: 3.2em; overflow: hidden; }
.dup-check { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; cursor: pointer; flex: 0 0 auto; }
.sp-rep { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 6px; }
.sp-rep .input { min-height: 38px; font-size: 14px; }
.sp-g-cat { grid-column: 1 / -1; }
.rep-lista { display: flex; flex-direction: column; gap: 8px; }
.rep-fila { display: grid; grid-template-columns: minmax(0, 1fr) 130px auto; gap: 8px; align-items: center; }
@media (max-width: 560px) { .sp-rep { grid-template-columns: 1fr; } .rep-fila { grid-template-columns: minmax(0, 1fr) 110px auto; } }
.avisos-prefs .entre .interruptor { flex: 1; border-bottom: 0; }
/* Buscador global */
.buscador.grande .input { min-height: 52px; font-size: 17px; }
.buscar-res { display: flex; flex-direction: column; gap: 14px; }
.buscar-grupo { display: flex; flex-direction: column; gap: 6px; }
.buscar-grupo .eyebrow { display: inline-flex; align-items: center; gap: 6px; }
.buscar-grupo .item .btn { flex: 0 0 auto; }
/* Calendario de pagos */
.cal-anio { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.cal-mes { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cal-mes-t { background: #A9B8CC; color: #24324A; font-weight: 700; text-align: center; padding: 4px; text-transform: lowercase; }
.cal-rejilla { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 6px; }
.cal-cab { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding: 2px 0; }
.cal-dia { position: relative; aspect-ratio: 1; min-height: 28px; border: 0; background: #fff; border-radius: 6px; font: 600 13px var(--fm, inherit); color: var(--ink, #10213A); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.cal-dia.vacio { background: none; cursor: default; }
.cal-dia.finde { color: #5B6F8F; background: #F3F5F9; }
.cal-dia.hoy { outline: 2px dashed var(--amber, #F5A524); outline-offset: -2px; }
.cal-dia.aro { border-radius: 50%; }
.cal-dia.llena.aro { border-radius: 6px; }
.cal-dia:hover { filter: brightness(.95); }
.cal-mas { position: absolute; top: 0; right: 2px; font-style: normal; font-size: 10px; }
.cal-marca { display: inline-block; border-radius: 50%; flex: 0 0 auto; }
.cal-marca.llena { border-radius: 3px; }
.cal-leyenda { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.cal-leyenda > span { display: inline-flex; align-items: center; gap: 4px; }
.cal-edit-fila { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--soft); }
.cal-edit-q { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.cal-edit-q input { width: 20px; height: 20px; accent-color: var(--navy); }
.cal-aviso { flex-direction: row; align-items: center; gap: 10px; text-decoration: none; color: inherit; padding: 12px 14px; border-left: 4px solid var(--amber, #F5A524); }
.cal-aviso > span { flex: 1; }
