:root {
  --azul: #0082CD;
  --azul-suave: #e3f1fa;
  --verde: #34c759;
  --naranja: #ff9500;
  --rojo: #ff3b30;
  --morado: #af52de;
  --texto: #1c1c1e;
  --gris: #8e8e93;
  --gris2: #c7c7cc;
  --linea: #e5e5ea;
  --fondo: #ffffff;
  --fondo2: #f5f5f7;
  --radio: 14px;
  --sombra: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--fondo); color: var(--texto);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* barra superior */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 10px) 18px 10px; background: rgba(255,255,255,.9);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--linea); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; }
.brand img.logo-top { height: 30px; width: auto; display: block; }
.topuser { font-size: 14px; color: var(--gris); }

main { max-width: 760px; margin: 0 auto; padding: 18px 16px calc(env(safe-area-inset-bottom) + 96px); }
.cargando { text-align: center; color: var(--gris); padding: 60px 0; }

h1 { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 2px; }
h2 { font-size: 20px; font-weight: 700; margin: 28px 0 10px; letter-spacing: -.01em; }
.sub { color: var(--gris); margin: 0 0 18px; }
.muted { color: var(--gris); }
.small { font-size: 13px; }

/* tarjetas */
.card { background: var(--fondo); border: 1px solid var(--linea); border-radius: var(--radio); box-shadow: var(--sombra);
  padding: 16px; margin-bottom: 12px; }
.card.plana { box-shadow: none; }
.lista { border: 1px solid var(--linea); border-radius: var(--radio); overflow: hidden; margin-bottom: 12px; background: #fff; }
.fila { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px;
  border-bottom: 1px solid var(--linea); }
.fila:last-child { border-bottom: 0; }
.fila .t { font-weight: 500; }
.fila .d { color: var(--gris); font-size: 14px; }
.fila.click { cursor: pointer; }
.fila.click:active { background: var(--fondo2); }

/* fichar */
.reloj { font-size: 54px; font-weight: 300; letter-spacing: -.03em; font-variant-numeric: tabular-nums; text-align: center; margin: 6px 0 0; }
.estado { display: flex; justify-content: center; margin: 8px 0 22px; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: var(--fondo2); color: var(--gris); }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.trabajando { background: #e9f9ee; color: #1f9d45; }
.pill.pausa { background: #fff4e5; color: #c77700; }
.pill.fuera { background: var(--fondo2); color: var(--gris); }
.botonera { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 26px; }
.fichar { width: 190px; height: 190px; border-radius: 50%; border: 0; color: #fff; font-size: 22px; font-weight: 700; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,.15); transition: transform .12s ease; }
.fichar small { font-size: 14px; font-weight: 500; opacity: .9; }
.fichar:active { transform: scale(.96); }
.fichar.entrada, .fichar.vuelta { background: #0082CD; }
.fichar.pausa { background: linear-gradient(160deg, #ffad33, #ff8a00); }
.fichar.salida { background: linear-gradient(160deg, #ff5a50, #e5281e); }
.fichar.fin { background: var(--fondo2); color: var(--gris); box-shadow: none; cursor: default; }
.fichar[disabled] { opacity: .6; }
.btn-link { background: none; border: 0; color: var(--azul); font-weight: 500; cursor: pointer; padding: 8px; }
.btn-link.rojo { color: var(--rojo); }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.stat { background: var(--fondo2); border-radius: var(--radio); padding: 14px 16px; }
.stat .k { font-size: 13px; color: var(--gris); font-weight: 500; }
.stat .v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat .v small { font-size: 14px; color: var(--gris); font-weight: 500; }
.barra { height: 6px; background: var(--linea); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.barra i { display: block; height: 100%; background: var(--azul); border-radius: 3px; transition: width .4s; }
.pos { color: #1f9d45; } .neg { color: var(--rojo); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--linea); }
.timeline li:last-child { border-bottom: 0; }
.timeline .h { font-variant-numeric: tabular-nums; font-weight: 600; width: 52px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.entrada, .dot.vuelta { background: var(--verde); } .dot.pausa { background: var(--naranja); } .dot.salida { background: var(--rojo); }

.aviso { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: var(--radio); margin-bottom: 12px;
  background: var(--azul-suave); color: #00679f; font-size: 15px; }
.aviso.amarillo { background: #fff6e0; color: #8a5a00; }
.aviso.rojo { background: #ffecea; color: #b3261e; }
.aviso b { font-weight: 600; }
.aviso .btn-link { padding: 0; margin-left: auto; white-space: nowrap; }

/* botones y formularios */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px; padding: 12px 18px;
  font-weight: 600; cursor: pointer; background: var(--azul); color: #fff; text-decoration: none; font-size: 16px; }
.btn.sec { background: var(--azul-suave); color: var(--azul); }
.btn.gris { background: var(--fondo2); color: var(--texto); }
.btn.rojo { background: #ffecea; color: var(--rojo); }
.btn.verde { background: var(--verde); }
.btn.peq { padding: 7px 12px; font-size: 14px; border-radius: 10px; }
.btn.full { width: 100%; }
.btn:active { opacity: .8; }
.acciones { display: flex; gap: 10px; flex-wrap: wrap; }
label.campo { display: block; margin-bottom: 14px; }
label.campo > span { display: block; font-size: 13px; color: var(--gris); font-weight: 500; margin: 0 0 6px 2px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number], input[type=month], select, textarea {
  width: 100%; border: 1px solid var(--linea); background: var(--fondo2); border-radius: 12px; padding: 12px 14px; outline: none;
  -webkit-appearance: none; appearance: none; min-height: 46px; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238e8e93' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
input:focus, select:focus, textarea:focus { border-color: var(--azul); background: #fff; box-shadow: 0 0 0 3px var(--azul-suave); }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cuatro { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.error { color: var(--rojo); font-size: 14px; margin: -4px 0 12px; min-height: 1em; }

/* login */
.login { max-width: 380px; margin: 8vh auto 0; text-align: center; }
.login img.logo-login { width: 240px; max-width: 70%; height: auto; }
.login form { text-align: left; margin-top: 24px; }

/* pestañas */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: center;
  background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--linea); padding: 6px 4px calc(env(safe-area-inset-bottom) + 6px); }
.tabs button { flex: 1; min-width: 0; max-width: 140px; background: none; border: 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; font-weight: 500; color: var(--gris); cursor: pointer; padding: 4px 0; position: relative; }
.tabs button svg { width: 26px; height: 26px; }
.tabs button.on { color: var(--azul); }
.badge { position: absolute; top: 0; left: calc(50% + 6px); background: var(--rojo); color: #fff; font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 5px; }

/* toast y modal */
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 84px); transform: translateX(-50%); z-index: 30;
  background: rgba(28,28,30,.94); color: #fff; padding: 12px 16px; border-radius: 14px; display: flex; gap: 16px; align-items: center;
  font-size: 15px; box-shadow: 0 8px 24px rgba(0,0,0,.2); width: max-content; max-width: calc(100% - 32px); }
.toast span { flex: 1; }
.toast button { background: none; border: 0; color: #0082CD; font-weight: 600; cursor: pointer; padding: 0; }
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.35); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 20px 20px 0 0;
  padding: 20px 18px calc(env(safe-area-inset-bottom) + 20px); animation: sube .22s ease; }
@media (min-width: 700px) { .modal { align-items: center; } .sheet { border-radius: 20px; } }
@keyframes sube { from { transform: translateY(40px); opacity: 0; } }
.sheet h3 { margin: 0 0 16px; font-size: 20px; display: flex; justify-content: space-between; align-items: center; }
.cerrar { background: var(--fondo2); border: 0; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; color: var(--gris); font-size: 18px; line-height: 1; }

h3.anio { font-size: 17px; margin: 18px 0 8px; display: flex; align-items: baseline; gap: 10px; }
h3.anio span { font-weight: 500; }

/* saldos */
.saldo-cab { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.saldo-cab b { font-size: 17px; }
.card.saldo { padding: 6px 16px 12px; }
.card.saldo .saldo-cab { padding: 10px 0 4px; }
.saldo-fila { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--linea); }
.saldo-fila > div:first-child { flex: 1; }
.saldo-fila .t { font-weight: 500; }
.saldo-fila .d { color: var(--gris); font-size: 13px; }
.saldo-v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 56px; text-align: right; }
.saldo-fila.total { border-bottom: 0; }
.saldo-fila.total .t { font-weight: 700; }
.saldo-fila.total .saldo-v { color: var(--azul); font-size: 26px; }
.card.bolsa { padding-top: 14px; }
.card.click, .stat.click { cursor: pointer; }
.card.click:active, .stat.click:active { opacity: .7; }
.fila-bolsa { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.fila-bolsa .v { font-size: 20px; }
[data-mov] { width: 34px; padding: 6px 0; }

/* avatares */
.av { border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; color: #fff;
  font-weight: 700; flex: none; letter-spacing: -.02em; background: var(--gris2); vertical-align: middle; }
.con-av { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topuser-in { display: inline-flex; align-items: center; gap: 8px; }
.av-btn { position: relative; border: 0; background: none; padding: 0; cursor: pointer; }
.av-cam { position: absolute; right: -2px; bottom: -2px; background: #fff; border-radius: 50%; width: 24px; height: 24px; font-size: 13px;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.av.dia { font-size: 18px !important; color: var(--rojo); }
.av.dia.fest { background: #ffecea; }
.av.dia.red { background: #fff4e5; color: #c77700; font-weight: 800; }
.avs-grandes { display: flex; flex-wrap: wrap; gap: 14px; }
.persona { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 56px; }
.persona small { color: var(--gris); font-size: 12px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.aviso.click { cursor: pointer; }

/* calendario del equipo */
.cal-card { padding: 14px 10px; }
.cal-eq .c { min-height: 78px; border: 0; text-align: left; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  cursor: pointer; font: inherit; color: inherit; font-size: 13px; }
.cal-eq .c:active { opacity: .7; }
.cal-eq .c.finde { cursor: default; }
.avs { display: flex; flex-wrap: wrap; gap: 3px; margin-top: auto; padding-top: 2px; }
.avw { position: relative; display: inline-flex; border-radius: 50%; box-shadow: 0 0 0 2px var(--c, #fff); background: #fff; }
.avw .av { border: 1.5px solid #fff; }
.avw .medio { position: absolute; right: -4px; top: -5px; font-style: normal; font-size: 9px; font-weight: 800; background: #fff; color: var(--texto);
  border-radius: 6px; padding: 0 2px; line-height: 12px; box-shadow: 0 0 0 1px var(--linea); }
.av.mas { width: 20px; height: 20px; font-size: 9px; background: var(--texto); }
.leyenda { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--gris); margin-top: 12px; align-items: center; }
.leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.lg.fest { background: #ffd9d6; } .lg.red { background: #ffe7b8; }
@media (max-width: 420px) { .tu-nombre { display: none; } .cal-eq .c { min-height: 66px; padding: 4px; } }

/* control segmentado */
.seg { display: flex; background: var(--fondo2); border-radius: 11px; padding: 3px; margin-bottom: 14px; gap: 2px; }
.seg button { flex: 1; border: 0; background: none; padding: 9px 6px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--gris); cursor: pointer; }
.seg button.on { background: #fff; color: var(--texto); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.t-Día { background: #e6f7f7; color: #0f8a8a; }

/* revisar */
.rev .cab { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.rev .cab b { font-size: 17px; }
.slot { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 10px; padding: 6px 0; }
.slot .tipo { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.slot .fijo { padding: 12px 14px; color: var(--gris); }
.slot input[type=time] { min-height: 42px; padding: 8px 12px; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--fondo2); color: var(--gris); }
.chip.azul { background: var(--azul-suave); color: var(--azul); }
.chip.naranja { background: #fff4e5; color: #c77700; }
.chip.rojo { background: #ffecea; color: var(--rojo); }
.chip.verde { background: #e9f9ee; color: #1f9d45; }
.chip.morado { background: #f6ecfb; color: #8a35b5; }
.vacio { text-align: center; padding: 40px 16px; color: var(--gris); }
.vacio .ico { font-size: 44px; margin-bottom: 6px; }

/* calendario */
.cal-cab { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cal-cab b { font-size: 17px; text-transform: capitalize; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dn { text-align: center; font-size: 12px; color: var(--gris); font-weight: 600; padding-bottom: 4px; }
.cal .c { min-height: 64px; border-radius: 10px; background: var(--fondo2); padding: 5px; font-size: 13px; overflow: hidden; }
.cal .c.otro { background: transparent; }
.cal .c.finde { background: #fafafa; color: var(--gris2); }
.cal .c.hoy .n { background: var(--azul); color: #fff; border-radius: 50%; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; }
.cal .c.fest { background: #fff0ef; }
.cal .c.fest .n { color: var(--rojo); }
.cal .n { font-weight: 600; }
.cal .c.red { background: #fff6e0; }
.cal .c.cie { background: #f6ecfb; }
.cal .c.cie .n { color: #8a35b5; }
.t-Cie { background: transparent; color: #8a35b5; padding-left: 0; }
.lg.cie { background: #ead5f5; }
.av.dia.cie { background: #f6ecfb; }
.aviso.morado { background: #f6ecfb; color: #6e2a91; }
.cal .c.red .n { color: #c77700; }
.t-Red { background: transparent; color: #c77700; padding-left: 0; }
.cal .ev { display: block; margin-top: 3px; font-size: 10.5px; font-weight: 600; padding: 2px 4px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-Vacaciones { background: var(--azul-suave); color: var(--azul); }
.t-Baja { background: #ffecea; color: var(--rojo); }
.t-Asuntos { background: #f6ecfb; color: #8a35b5; }
.t-Permiso { background: #e9f9ee; color: #1f9d45; }
.t-Ausencia { background: #fff4e5; color: #c77700; }
.t-Fest { background: transparent; color: var(--rojo); padding-left: 0; }

/* informe */
.tabla-wrap { overflow-x: auto; border: 1px solid var(--linea); border-radius: var(--radio); }
table.inf { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
table.inf th { text-align: left; font-size: 12px; color: var(--gris); font-weight: 600; padding: 10px 10px; background: var(--fondo2); white-space: nowrap; }
table.inf td { padding: 10px; border-top: 1px solid var(--linea); white-space: nowrap; }
table.inf td.obs { white-space: normal; min-width: 140px; }
table.inf tr.nolab td { color: var(--gris2); }
table.inf tr.nolab td.obs { color: var(--gris); }
table.inf tr.inc td { background: #fffaf0; }
table.inf tr.click { cursor: pointer; }
table.inf tr.click:hover td { background: var(--fondo2); }
table.inf tfoot td { font-weight: 700; background: var(--fondo2); }
.marca { font-size: 10px; font-weight: 700; color: var(--naranja); vertical-align: super; margin-left: 1px; }
.print-only { display: none; }
.firmas { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 40px; }
.firmas div { border-top: 1px solid #000; padding-top: 6px; font-size: 12px; }

@media (max-width: 520px) {
  h1 { font-size: 26px; }
  .cuatro { grid-template-columns: 1fr 1fr; }
  .reloj { font-size: 48px; }
}

@media print {
  @page { size: A4; margin: 14mm; }
  body { font-size: 11px; }
  .no-print, .tabs, .topbar, .toast, .modal { display: none !important; }
  .print-only { display: block; }
  main { padding: 0; max-width: none; }
  .tabla-wrap { border: 0; overflow: visible; }
  table.inf { font-size: 10.5px; }
  table.inf th, table.inf td { padding: 4px 6px; border: 1px solid #bbb; }
  table.inf tr.inc td { background: none; }
  table.inf tr.nolab td { color: #666; }
  .stats { display: none; }
  .obs, .marca { display: none !important; }
  h1 { font-size: 18px; }
}

/* documentos */
.doc-link { text-decoration: none; color: inherit; flex: 1; min-width: 0; }
.av.dia.doc { background: var(--azul-suave); font-size: 20px !important; }

/* festivos plegables por año */
details.anio-plegable { border: 1px solid var(--linea); border-radius: var(--radio); margin-bottom: 10px; background: #fff; }
details.anio-plegable summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px 16px; }
details.anio-plegable summary::-webkit-details-marker { display: none; }
details.anio-plegable summary b { font-size: 17px; }
details.anio-plegable summary::after { content: "›"; margin-left: auto; color: var(--gris); font-size: 20px; transition: transform .2s; }
details.anio-plegable[open] summary::after { transform: rotate(90deg); }
details.anio-plegable .lista { border: 0; border-top: 1px solid var(--linea); border-radius: 0 0 var(--radio) var(--radio); margin: 0; }

.avw.medio { box-shadow: none; outline: 2px dashed var(--c); outline-offset: 1px; }
.lg-medio { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

/* interruptor jefe / empleado */
.modo { display: inline-flex; background: var(--fondo2); border-radius: 9px; padding: 2px; margin-right: 4px; }
.modo button { border: 0; background: none; padding: 5px 10px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--gris); cursor: pointer; }
.modo button.on { background: #fff; color: var(--azul); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
@media (max-width: 420px) { .modo button { padding: 5px 8px; font-size: 12px; } .tabs button span { font-size: 10px; } }

.yo-link { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.tabs button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@media (max-width: 420px) { .tabs button span { font-size: 9.5px; letter-spacing: -.02em; } .tabs { padding-left: 0; padding-right: 0; } }

.tabs .lt-corto { display: none; }
@media (max-width: 480px) { .tabs .lt-largo { display: none; } .tabs .lt-corto { display: block; } }

.dos-saldos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .dos-saldos { grid-template-columns: 1fr; } }

/* menú de la cuenta */
.yo-wrap { position: relative; }
button.yo-link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: inherit; }
.yo-menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 40; background: #fff; border: 1px solid var(--linea); border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.15); min-width: 250px; padding: 6px; display: flex; flex-direction: column; }
.yo-menu[hidden] { display: none; }
.yo-cab { display: flex; align-items: center; gap: 10px; padding: 10px 10px 12px; border-bottom: 1px solid var(--linea); margin-bottom: 4px; color: var(--texto); }
.yo-menu button { background: none; border: 0; text-align: left; padding: 11px 10px; border-radius: 10px; font-size: 15px; cursor: pointer; color: var(--texto); }
.yo-menu button:hover { background: var(--fondo2); }
.yo-menu button.rojo { color: var(--rojo); }

.comp-der { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; margin-left: 12px; }
.comp-der span { display: flex; gap: 14px; }

/* teletrabajo, firma, coincidencias, justificantes, doble verificación */
.tele-wrap { text-align: center; margin: -6px 0 6px; }
.tele { border: 1px solid var(--linea); background: var(--fondo2); color: var(--gris); border-radius: 999px; padding: 6px 14px; font-size: 14px; cursor: pointer; }
.tele.on { background: var(--azul-suave); color: var(--azul); border-color: transparent; font-weight: 600; }
.aviso.verde { background: #e9f9ee; color: #17703a; }
.coincide { margin-top: 6px; font-size: 13px; color: #8a5a00; background: #fff6e0; border-radius: 8px; padding: 6px 9px; }
.peqlink { font-size: 13px; padding: 0; }
.casa { font-size: 12px; }
.clave2fa { font: 600 18px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; background: var(--fondo2); border-radius: 10px; padding: 10px 12px; margin: 8px 0; text-align: center; user-select: all; }
ol.pasos { padding-left: 20px; } ol.pasos li { margin-bottom: 10px; }
.cmd { font: 12.5px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; background: #1c1c1e; color: #e5e5ea; border-radius: 10px; padding: 10px 12px; word-break: break-all; user-select: all; }

/* modo oscuro (automático según el móvil u ordenador; al imprimir siempre claro) */
@media screen and (prefers-color-scheme: dark) {
  :root {
    --azul: #2a9df4; --azul-suave: #0f2c42; --texto: #f2f2f7; --gris: #98989f; --gris2: #48484a;
    --linea: #2c2c2e; --fondo: #000000; --fondo2: #1c1c1e;
    --sombra: none; color-scheme: dark;
  }
  .topbar { background: rgba(18,18,20,.88); }
  .tabs { background: rgba(18,18,20,.92) !important; }
  .lista, details.anio-plegable, .sheet, .yo-menu { background: #1c1c1e; }
  .card { background: #1c1c1e; }
  .card.plana, .stat { background: #1c1c1e; }
  input, select, textarea { background: #2c2c2e !important; border-color: #3a3a3c !important; }
  input:focus, select:focus, textarea:focus { background: #2c2c2e !important; }
  .seg, .modo { background: #2c2c2e !important; }
  .seg button.on, .modo button.on { background: #48484a; color: #fff; }
  .yo-menu button:hover { background: #2c2c2e; }
  .avw, .av-cam, .avw .medio { background: #1c1c1e; }
  .avw .av { border-color: #1c1c1e; }
  .aviso.amarillo, .coincide { background: #3a2c05; color: #ffd36b; }
  .aviso.rojo { background: #3b1513; color: #ff8a80; }
  .aviso.morado { background: #2c1838; color: #d9a6f2; }
  .aviso.verde { background: #0f2e1a; color: #6fe09a; }
  .chip.naranja { background: #3a2c05; color: #ffb340; }
  .chip.rojo { background: #3b1513; color: #ff6961; }
  .chip.verde { background: #0f2e1a; color: #4cd964; }
  .chip.morado { background: #2c1838; color: #d9a6f2; }
  img.logo-top, img.logo-login { filter: invert(1) hue-rotate(180deg) brightness(1.15); }
  table.inf th { background: #1c1c1e; }
  .btn.gris, .btn.peq.gris { background: #2c2c2e; color: var(--texto); }
  .btn.sec { background: var(--azul-suave); color: var(--azul); }
  .cal .c { border-color: #2c2c2e; }
}
.lista .d a { color: var(--azul); text-decoration: none; font-weight: 600; }

.fila-check { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--linea); font-size: 15px; cursor: pointer; }
.fila-check:last-of-type { border-bottom: 0; }
.fila-check input { width: 20px; height: 20px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--azul); }
.dos { display: grid; grid-template-columns: 1fr 110px; gap: 10px; }

/* ===================== Notas de Gastos ===================== */
.cab-vista { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.volver { padding: 4px 0; margin: 0 0 6px; font-size: 15px; }
.ev-card { background: #fff; border: 1px solid var(--linea); border-radius: 16px; padding: 14px 16px; margin-bottom: 12px; cursor: pointer; }
.ev-card:active { background: var(--fondo2); }
.ev-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.ev-nombre { font-size: 18px; font-weight: 700; margin-bottom: 2px; }
.ev-pie { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; font-size: 15px; flex-wrap: wrap; }
.ev-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.stats4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 6px 0 14px; }
.stats4 .stat { padding: 12px 14px; }
.stats4 .stat .v { font-size: 19px; }
.stats4 .stat.dest { background: var(--azul-suave); }
.stats4 .stat.dest .v { color: var(--azul); }
@media (max-width: 640px) { .stats4 { grid-template-columns: 1fr 1fr; } }
.btn.grande { padding: 16px; font-size: 17px; margin-bottom: 14px; }
.seg.filtro { margin: 4px 0 6px; }
.seg.filtro button { font-size: 13px; }
.dia-cab { font-size: 13px; font-weight: 600; color: var(--gris); text-transform: uppercase; letter-spacing: .03em; margin: 16px 4px 6px; }
.fila.gasto { align-items: flex-start; }
.g-ico { font-size: 20px; line-height: 1.3; }
.g-txt { flex: 1; min-width: 0; }
.g-txt .t { overflow: hidden; text-overflow: ellipsis; }
.g-imp { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.verT { padding: 2px 0 0; font-size: 14px; }
.sin-foto { color: var(--naranja); display: inline-block; padding-top: 3px; }
.jus { font-weight: 600; }
.j-Factura { color: #1f9d45; } .j-Tiquet { color: #c77700; } .j-Nada { color: var(--rojo); }
.txt-naranja { color: #c77700; }
table.caja { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
table.caja th { text-align: right; color: var(--gris); font-weight: 600; font-size: 12px; padding: 4px 6px; border-bottom: 1px solid var(--linea); }
table.caja td { text-align: right; padding: 7px 6px; border-bottom: 1px solid var(--linea); }
table.caja th:first-child, table.caja td:first-child { text-align: left; }
table.caja tr:last-child td { border-bottom: 0; }
.cat-fila { display: grid; grid-template-columns: minmax(0, 1.4fr) 1fr auto; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; }
.cat-barra { height: 8px; background: var(--fondo2); border-radius: 4px; overflow: hidden; }
.cat-barra i { display: block; height: 100%; background: var(--azul); border-radius: 4px; }
.dos-c { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.imp-fila { display: grid; grid-template-columns: 1fr 120px; gap: 10px; }
.campo .lab { display: block; font-size: 14px; color: var(--gris); font-weight: 500; margin-bottom: 6px; }
.seg.seg-campo { display: flex; }
.seg.seg-campo button { flex: 1; font-size: 13px; padding: 9px 4px; }
.foto-zona { margin-bottom: 14px; }
.foto-btn { cursor: pointer; padding: 15px; font-size: 16px; }
.foto-ok { background: var(--fondo2); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; font-size: 14px; }
.foto-ok .btn-link { padding: 0 2px; }
.vista-ticket { display: block; max-width: 100%; max-height: 260px; margin: 10px auto 0; border-radius: 10px; border: 1px solid var(--linea); }
.modal.confirmar { z-index: 40; align-items: center; }
.sheet.peque { max-width: 380px; border-radius: 20px; text-align: center; margin: 16px; }
.conf-ico { font-size: 34px; margin-top: 4px; }
.conf-txt { color: var(--gris); margin: 4px 0 18px; line-height: 1.45; }
.conf-bot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn.rojo-solido { background: var(--rojo); color: #fff; }
@media screen and (prefers-color-scheme: dark) {
  .ev-card { background: #1c1c1e; }
  .ev-card:active { background: #2c2c2e; }
}

.ev-sub { display: flex; align-items: center; gap: 6px; }
.ev-sub .av { flex-shrink: 0; }
.foto-perfil { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.ef-fila { margin-bottom: 8px; }
img.av { object-fit: cover; border-radius: 50%; }

.avs-fila { display: inline-flex; flex-shrink: 0; }
.avs-fila .av + .av { margin-left: -6px; box-shadow: 0 0 0 2px #fff; }
.resp-lista { display: flex; flex-wrap: wrap; gap: 8px; }
.resp-op { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--linea); border-radius: 12px; padding: 6px 10px 6px 8px; cursor: pointer; font-size: 15px; }
.resp-op input { width: 18px; height: 18px; accent-color: var(--azul); margin: 0; }
.resp-op:has(input:checked) { border-color: var(--azul); background: var(--azul-suave); }
.g-av { margin-top: 4px; }
.reemb { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: -6px 0 14px; font-size: 14px; color: var(--gris); }

.tabla-scroll { overflow-x: auto; margin: 0 -4px; }
@media (max-width: 480px) { table.caja { font-size: 13px; } table.caja th, table.caja td { padding: 6px 4px; } }
