/* Turnos de farmacia — hoja de estilos única.
   Paleta: tinta de botica, papel clínico y el verde de la cruz de farmacia.
   Los colores de los turnos vienen del catálogo (mismos códigos que el Excel). */

@font-face {
  font-family: 'Atkinson';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(../fonts/atkinson-hyperlegible-next-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Atkinson';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(../fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --tinta: #16302B;
  --tinta-2: #3F5A54;
  --tinta-3: #6B827C;
  --papel: #F3F6F4;
  --superficie: #FFFFFF;
  --linea: #D3DDD8;
  --linea-suave: #E6ECE9;
  --cruz: #0E9F4F;
  --cruz-osc: #0A7A3C;
  --cruz-claro: #E3F5EA;
  --alerta: #C2362B;
  --alerta-fondo: #FBE3E0;
  --ambar: #A15C00;
  --ambar-fondo: #FFF1D6;
  --finde: #EDF2F0;
  --festivo: #FBECEA;
  --radio: 6px;
  --radio-g: 12px;
  --sombra: 0 10px 30px rgba(22, 48, 43, .16), 0 2px 6px rgba(22, 48, 43, .08);
  --fuente: 'Atkinson', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --barra: 56px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--fuente);
  font-size: 16px;
  line-height: 1.45;
  color: var(--tinta);
  background: var(--papel);
  font-variant-numeric: tabular-nums;
}
a { color: var(--cruz-osc); }
h1, h2, h3 { line-height: 1.15; margin: 0; font-weight: 750; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75em; }
small, .suave { color: var(--tinta-3); }
.suave-2 { color: var(--tinta-2); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--cruz); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Botones y formularios ---------- */
button, .boton {
  font: inherit;
  font-weight: 650;
  font-size: .95rem;
  border-radius: var(--radio);
  border: 1px solid var(--linea);
  background: var(--superficie);
  color: var(--tinta);
  padding: .55rem .9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  text-decoration: none;
  line-height: 1.2;
  min-height: 40px;
}
button:hover, .boton:hover { border-color: var(--tinta-3); }
button:disabled { opacity: .55; cursor: not-allowed; }
.primario { background: var(--cruz); border-color: var(--cruz); color: #fff; }
.primario:hover { background: var(--cruz-osc); border-color: var(--cruz-osc); }
.peligro { color: var(--alerta); border-color: #EBC2BD; }
.peligro:hover { border-color: var(--alerta); }
.discreto { background: transparent; border-color: transparent; color: var(--tinta-2); }
.discreto:hover { background: var(--linea-suave); border-color: transparent; }
.mini { min-height: 32px; padding: .3rem .6rem; font-size: .85rem; }

label { display: block; font-weight: 650; font-size: .9rem; margin-bottom: .3rem; }
.campo { margin-bottom: 1rem; }
.campo .ayuda { font-size: .82rem; color: var(--tinta-3); margin-top: .25rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number], input[type=search], select, textarea {
  font: inherit;
  width: 100%;
  padding: .55rem .7rem;
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  background: var(--superficie);
  color: var(--tinta);
  min-height: 42px;
}
input[type=color] { width: 48px; height: 36px; padding: 2px; border: 1px solid var(--linea); border-radius: var(--radio); background: #fff; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--cruz); outline: none; box-shadow: 0 0 0 3px var(--cruz-claro); }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--cruz); }
.fila { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
.fila > * { flex: 1 1 160px; }
.acciones { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.error-form { color: var(--alerta); font-weight: 600; margin: .5rem 0; }

/* ---------- Estructura ---------- */
.barra {
  position: sticky; top: 0; z-index: 30;
  height: var(--barra);
  display: flex; align-items: center; gap: 1rem;
  padding: 0 1rem;
  background: var(--tinta);
  color: #fff;
}
.marca { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-weight: 750; white-space: nowrap; min-width: 0; }
.marca img { width: 30px; height: 30px; object-fit: contain; border-radius: 6px; background: #fff; }
.marca span { overflow: hidden; text-overflow: ellipsis; }
.cruz-svg { width: 26px; height: 26px; flex: none; }
.nav { display: flex; gap: .15rem; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: #CFE0DA; text-decoration: none; padding: .45rem .7rem; border-radius: var(--radio); white-space: nowrap; font-weight: 600; font-size: .95rem;
  display: inline-flex; gap: .35rem; align-items: center;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.nav a.activo { color: #fff; background: rgba(255, 255, 255, .14); box-shadow: inset 0 -3px 0 var(--cruz); }
.burbuja { background: var(--cruz); color: #fff; border-radius: 999px; font-size: .75rem; padding: 0 .45rem; min-width: 1.3rem; text-align: center; line-height: 1.3rem; font-weight: 700; }
.usuario { display: flex; align-items: center; gap: .5rem; }
.usuario button { background: transparent; color: #CFE0DA; border-color: rgba(255, 255, 255, .25); min-height: 34px; padding: .3rem .7rem; }
.usuario button:hover { color: #fff; border-color: #fff; }
.menu-movil { display: none; }

.contenido { padding: 1.25rem 1rem 3rem; max-width: 1240px; margin: 0 auto; }
.contenido.ancho { max-width: none; padding-left: 1rem; padding-right: 1rem; }
.cabecera { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.cabecera p { margin: .3rem 0 0; color: var(--tinta-2); }
.demo-aviso { background: var(--ambar-fondo); color: #5C3A00; text-align: center; font-size: .85rem; padding: .35rem 1rem; }

.panel {
  background: var(--superficie);
  border: 1px solid var(--linea);
  border-radius: var(--radio-g);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.1rem;
}
.panel > h2, .panel > h3 { margin-bottom: .8rem; }
.panel-cab { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .8rem; flex-wrap: wrap; }
.panel-cab h2, .panel-cab h3 { margin: 0; }
.rejilla-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.1rem; align-items: start; }
.rejilla-2 > .panel { margin-bottom: 0; }
.columna { display: grid; gap: 1.1rem; }

/* Selector de mes */
.mes-nav { display: inline-flex; align-items: center; gap: .25rem; background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio); padding: 2px; }
.mes-nav button { border: 0; min-height: 36px; padding: .3rem .6rem; font-size: 1.1rem; }
.mes-nav strong { min-width: 9.5rem; text-align: center; font-size: 1rem; }

/* Etiquetas de estado */
.estado { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px; padding: .15rem .65rem; font-size: .82rem; font-weight: 700; border: 1px solid transparent; }
.estado.borrador { background: var(--ambar-fondo); color: #6E4100; border-color: #F0D49A; }
.estado.publicado { background: var(--cruz-claro); color: var(--cruz-osc); border-color: #B5E3C6; }
.estado.pendiente { background: var(--ambar-fondo); color: #6E4100; }
.estado.aprobada { background: var(--cruz-claro); color: var(--cruz-osc); }
.estado.rechazada { background: var(--alerta-fondo); color: var(--alerta); }
.estado.cancelada { background: var(--linea-suave); color: var(--tinta-2); }
.estado.inactivo { background: var(--linea-suave); color: var(--tinta-2); }

/* Fichas de turno (mismos colores que el Excel) */
.ficha {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.2em; padding: .1em .45em; border-radius: 5px;
  font-weight: 750; font-size: .85rem; line-height: 1.5; white-space: nowrap;
  border: 1px solid rgba(22, 48, 43, .12);
}
.ficha.grande { font-size: 1.05rem; padding: .2em .6em; }

/* Tablas */
.tabla-env { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--linea-suave); vertical-align: middle; }
th { font-size: .82rem; color: var(--tinta-2); font-weight: 700; background: #F8FAF9; }
td.num, th.num { text-align: right; }
tr.clic { cursor: pointer; }
tr.clic:hover td { background: #F6FAF8; }
.neg { color: var(--alerta); font-weight: 750; }
.pos { color: var(--ambar); font-weight: 750; }
.vacio { padding: 2rem 1rem; text-align: center; color: var(--tinta-3); }

/* Cifras del mes (panel) */
.cifras { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--linea); border-radius: var(--radio-g); background: var(--superficie); margin-bottom: 1.1rem; }
.cifra { padding: .85rem 1rem; border-left: 1px solid var(--linea-suave); }
.cifra:first-child { border-left: 0; }
.cifra b { display: block; font-size: 1.6rem; line-height: 1.1; font-weight: 750; }
.cifra span { font-size: .85rem; color: var(--tinta-2); }
.cifra.mal b { color: var(--alerta); }

/* Barras de horas */
.barras { display: grid; gap: .45rem; }
.barra-fila { display: grid; grid-template-columns: 9.5rem 1fr 4.5rem; gap: .6rem; align-items: center; font-size: .88rem; }
.barra-fila .nombre { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pista { position: relative; height: 14px; background: var(--linea-suave); border-radius: 3px; }
.pista .relleno { position: absolute; inset: 0 auto 0 0; background: var(--cruz); border-radius: 3px; }
.pista .relleno.exceso { background: #D98A1D; }
.pista .marca-contrato { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--tinta); }
.barra-fila .valor { text-align: right; color: var(--tinta-2); }
.anual { display: grid; grid-template-columns: repeat(12, 1fr); gap: .35rem; align-items: end; height: 150px; padding-top: 1.2rem; }
.anual .col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: .72rem; color: var(--tinta-3); gap: .25rem; }
.anual .col i { display: block; width: 100%; background: #9CCFB2; border-radius: 3px 3px 0 0; min-height: 2px; }
.anual .col.sel i { background: var(--cruz); }
.anual .col b { font-weight: 650; color: var(--tinta-2); }

.lista-simple { list-style: none; margin: 0; padding: 0; }
.lista-simple li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--linea-suave); }
.lista-simple li:last-child { border-bottom: 0; }
.aviso-linea { display: flex; gap: .6rem; align-items: baseline; padding: .5rem 0; border-bottom: 1px solid var(--linea-suave); }
.aviso-linea:last-child { border-bottom: 0; }
.punto { width: 8px; height: 8px; border-radius: 50%; background: var(--cruz); flex: none; margin-top: .45rem; }
.punto.leido { background: var(--linea); }

/* ---------- Cuadrante ---------- */
.herramientas { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .75rem; }
.herramientas .separa { flex: 1; }
.cuadrante-env {
  overflow: auto;
  max-height: calc(100vh - var(--barra) - 150px);
  border: 1px solid var(--linea);
  border-radius: var(--radio-g);
  background: var(--superficie);
  user-select: none;
  -webkit-user-select: none;
}
table.cuadrante { border-collapse: separate; border-spacing: 0; width: max-content; font-size: .85rem; }
.cuadrante th, .cuadrante td { padding: 0; border-bottom: 1px solid var(--linea-suave); border-right: 1px solid var(--linea-suave); background: var(--superficie); }
.cuadrante thead th { position: sticky; top: 0; z-index: 3; text-align: center; font-weight: 700; color: var(--tinta-2); background: #F8FAF9; height: 44px; min-width: 42px; }
.cuadrante thead th .dn { display: block; font-size: .95rem; color: var(--tinta); }
.cuadrante thead th .ds { display: block; font-size: .72rem; font-weight: 600; }
.cuadrante thead th.finde { background: var(--finde); }
.cuadrante thead th.festivo { background: var(--festivo); }
.cuadrante thead th.festivo .ds::after { content: ' F'; color: var(--alerta); }
.cuadrante thead th.hoy .dn { color: #fff; background: var(--cruz); border-radius: 4px; display: inline-block; padding: 0 .3rem; }
.cuadrante .nombre-col { position: sticky; left: 0; z-index: 2; text-align: left; padding: 0 .6rem; min-width: 180px; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; border-right: 1px solid var(--linea); }
.cuadrante thead .nombre-col { z-index: 4; }
.cuadrante .nombre-col small { display: block; font-weight: 500; font-size: .74rem; }
.cuadrante td.c { width: 42px; min-width: 42px; height: 44px; text-align: center; cursor: cell; position: relative; }
.cuadrante td.c.finde { background: var(--finde); }
.cuadrante td.c.festivo { background: var(--festivo); }
.cuadrante td.c.fuera { background: repeating-linear-gradient(135deg, #F1F3F2 0 4px, #E6EAE8 4px 8px); cursor: not-allowed; }
.cuadrante td.c .cod { display: block; font-weight: 750; font-size: .8rem; line-height: 1.1; }
.cuadrante td.c .h { display: block; font-size: .66rem; opacity: .8; margin-top: 1px; }
.cuadrante td.c.lleno { box-shadow: inset 0 0 0 1px rgba(22, 48, 43, .08); }
.cuadrante td.c.sel { outline: 2px solid var(--tinta); outline-offset: -2px; z-index: 1; }
.cuadrante td.c.sel::after { content: ''; position: absolute; inset: 0; background: rgba(14, 159, 79, .16); pointer-events: none; }
.cuadrante td.c.foco { outline: 3px solid var(--cruz); outline-offset: -3px; }
.cuadrante td.tot { min-width: 58px; text-align: right; padding: 0 .5rem; font-weight: 600; background: #FAFBFB; }
.cuadrante th.tot { min-width: 58px; font-size: .74rem; }
.cuadrante tr.cob td, .cuadrante tr.cob th { background: #F8FAF9; height: 32px; }
.cuadrante tr.cob td { text-align: center; font-weight: 650; }
.cuadrante tr.cob td.falta { background: var(--alerta-fondo); color: var(--alerta); }
.cuadrante tr.cob.primera td, .cuadrante tr.cob.primera th { border-top: 2px solid var(--linea); }
/* Las filas de cobertura quedan fijas abajo mientras se recorre el cuadrante */
.cuadrante tr.cob td, .cuadrante tr.cob th { position: sticky; z-index: 2; }
.cuadrante tr.cob th.nombre-col { z-index: 4; }
.cuadrante tr.cob.f1 td, .cuadrante tr.cob.f1 th { bottom: 96px; }
.cuadrante tr.cob.f2 td, .cuadrante tr.cob.f2 th { bottom: 64px; }
.cuadrante tr.cob.f3 td, .cuadrante tr.cob.f3 th { bottom: 32px; }
.cuadrante tr.cob.f4 td, .cuadrante tr.cob.f4 th { bottom: 0; }
.cuadrante tr.cob td, .cuadrante tr.cob th { height: 32px; box-sizing: border-box; }
.con-paleta .cuadrante-env { max-height: calc(100vh - var(--barra) - 150px - 175px); min-height: 260px; }
.cuadrante tr.baja-emp .nombre-col { color: var(--tinta-3); }

/* Paleta de turnos acoplada abajo (aparece al seleccionar celdas) */
.paleta {
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%);
  width: min(1100px, calc(100vw - 24px));
  background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio-g);
  box-shadow: var(--sombra); z-index: 40; padding: .75rem .9rem;
}
.paleta-cab { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin-bottom: .6rem; }
.paleta-cab .que { font-weight: 700; }
.paleta-cab input[type=search] { max-width: 220px; min-height: 36px; }
.paleta-cab .separa { flex: 1; }
.paleta-fichas { display: flex; flex-wrap: wrap; gap: .35rem; max-height: 140px; overflow-y: auto; }
.paleta-fichas button { min-height: 0; padding: 0; border: 0; background: none; border-radius: 6px; }
.paleta-fichas .ficha { font-size: .95rem; padding: .3em .55em; min-width: 3em; flex-direction: column; line-height: 1.15; }
.paleta-fichas .ficha small { font-size: .66rem; font-weight: 600; color: inherit; opacity: .85; }
.paleta-fichas button:focus-visible .ficha, .paleta-fichas button.primero .ficha { outline: 3px solid var(--tinta); outline-offset: 1px; }
.paleta .actuales { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; font-size: .88rem; }
.paleta .actuales .ficha button { border: 0; background: none; min-height: 0; padding: 0 0 0 .25rem; font-size: .9rem; color: inherit; }

/* Vista semanal (como los bloques del Excel) */
.semana-excel { display: grid; grid-template-columns: repeat(7, minmax(140px, 1fr)); gap: .5rem; overflow-x: auto; }
.semana-excel .dia { background: var(--superficie); border: 1px solid var(--linea); border-radius: var(--radio); min-height: 220px; }
.semana-excel .dia header { background: var(--tinta); color: #fff; padding: .35rem .55rem; border-radius: var(--radio) var(--radio) 0 0; display: flex; justify-content: space-between; font-weight: 700; font-size: .9rem; }
.semana-excel .dia.finde header { background: var(--tinta-2); }
.semana-excel .dia.fuera { opacity: .45; }
.semana-excel .dia ul { list-style: none; margin: 0; padding: .35rem .45rem; }
.semana-excel .dia li { display: flex; justify-content: space-between; gap: .4rem; align-items: center; padding: .2rem 0; font-size: .86rem; border-bottom: 1px dashed var(--linea-suave); }
.semana-excel .dia li:last-child { border-bottom: 0; }
.semana-excel .dia .fest { font-size: .75rem; color: var(--alerta); padding: .2rem .55rem 0; }

/* Ficha anual (12 meses × días) */
.anio-grid { border-collapse: separate; border-spacing: 2px; font-size: .7rem; }
.anio-grid th, .anio-grid td { padding: 0; border: 0; text-align: center; background: none; }
.anio-grid th { font-weight: 650; color: var(--tinta-3); font-size: .68rem; }
.anio-grid th.mes { text-align: left; padding-right: .4rem; color: var(--tinta-2); font-size: .78rem; white-space: nowrap; }
.anio-grid td { width: 28px; height: 30px; border-radius: 3px; background: #F7F9F8; line-height: 1.05; }
.anio-grid td.finde { background: var(--finde); }
.anio-grid td.festivo { background: var(--festivo); }
.anio-grid td.na { background: transparent; }
.anio-grid td b { display: block; font-size: .68rem; }
.anio-grid td i { display: block; font-style: normal; font-size: .58rem; opacity: .8; }

/* Diálogos */
dialog {
  border: 0; border-radius: var(--radio-g); padding: 0; box-shadow: var(--sombra);
  width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); color: var(--tinta);
}
dialog.ancho { width: min(820px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(22, 48, 43, .45); }
dialog .dlg-cab { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem .4rem; }
dialog .dlg-cuerpo { padding: .4rem 1.2rem 1rem; overflow-y: auto; max-height: calc(100vh - 200px); }
dialog .dlg-pie { display: flex; justify-content: flex-end; gap: .5rem; padding: .8rem 1.2rem 1rem; border-top: 1px solid var(--linea-suave); flex-wrap: wrap; }
.alertas-lista { list-style: none; margin: 0; padding: 0; }
.alertas-lista li { padding: .5rem .65rem; border-left: 3px solid #D98A1D; background: var(--ambar-fondo); margin-bottom: .4rem; border-radius: 0 var(--radio) var(--radio) 0; font-size: .92rem; }
.alertas-lista li b { font-weight: 700; }

/* Avisos emergentes */
.toasts { position: fixed; top: calc(var(--barra) + 10px); right: 12px; z-index: 60; display: grid; gap: .5rem; max-width: min(420px, calc(100vw - 24px)); }
.toast { background: var(--tinta); color: #fff; padding: .7rem 1rem; border-radius: var(--radio); box-shadow: var(--sombra); font-weight: 600; animation: entra .18s ease-out; }
.toast.error { background: var(--alerta); }
@keyframes entra { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }

.cargando { padding: 3rem 1rem; text-align: center; color: var(--tinta-3); }
.pestanas { display: flex; gap: .25rem; border-bottom: 1px solid var(--linea); margin-bottom: 1rem; overflow-x: auto; }
.pestanas button { border: 0; border-radius: 0; background: none; min-height: 40px; padding: .4rem .8rem; color: var(--tinta-2); border-bottom: 3px solid transparent; }
.pestanas button.activo { color: var(--tinta); border-bottom-color: var(--cruz); }
.segmentado { display: inline-flex; border: 1px solid var(--linea); border-radius: var(--radio); overflow: hidden; background: var(--superficie); }
.segmentado button { border: 0; border-radius: 0; min-height: 36px; }
.segmentado button.activo { background: var(--tinta); color: #fff; }

/* ---------- Acceso ---------- */
.acceso { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem; }
.acceso-caja { width: min(420px, 100%); }
.acceso-marca { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.4rem; }
.acceso-marca .cruz-svg { width: 40px; height: 40px; }
.acceso-marca b { font-size: 1.2rem; display: block; }
.acceso-marca span { color: var(--tinta-2); font-size: .92rem; }
.acceso .panel { padding: 1.4rem; }
.acceso h1 { font-size: 1.45rem; margin-bottom: 1rem; }

/* ---------- Empleado (móvil primero) ---------- */
.emp { max-width: 560px; margin: 0 auto; padding: 1rem 1rem calc(80px + env(safe-area-inset-bottom)); }
.saludo { margin: .25rem 0 1rem; }
.saludo h1 { font-size: 1.5rem; }
.saludo p { margin: .2rem 0 0; color: var(--tinta-2); }

/* El «turno» como el tique del dispensador de la farmacia */
.tique {
  --muesca: 12px;
  position: relative;
  background: var(--superficie);
  border-radius: 14px;
  padding: 1.1rem 1.2rem 1rem;
  margin-bottom: 1.1rem;
  border: 1px solid var(--linea);
  -webkit-mask: radial-gradient(circle var(--muesca) at 0 62%, #0000 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle var(--muesca) at 100% 62%, #0000 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle var(--muesca) at 0 62%, #0000 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle var(--muesca) at 100% 62%, #0000 98%, #000) right / 51% 100% no-repeat;
}
.tique .tique-cab { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; color: var(--tinta-2); font-weight: 650; }
.tique .tique-cuerpo { display: flex; align-items: center; gap: 1rem; margin: .6rem 0 .9rem; }
.tique .codigo-grande {
  font-size: 3.4rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em;
  padding: .12em .28em; border-radius: 10px; min-width: 2.1em; text-align: center;
}
.tique .cuando b { display: block; font-size: 1.35rem; line-height: 1.2; }
.tique .cuando span { color: var(--tinta-2); }
.tique .tique-pie { border-top: 2px dashed var(--linea); padding-top: .7rem; display: flex; justify-content: space-between; gap: .5rem; color: var(--tinta-2); font-size: .92rem; }
.tique .tique-pie b { color: var(--tinta); }
.tique.vacio-tique .tique-cuerpo { color: var(--tinta-2); }

.semana-mini { display: grid; gap: .35rem; }
.semana-mini .d { display: grid; grid-template-columns: 3.2rem 1fr auto; align-items: center; gap: .6rem; padding: .45rem .55rem; border-radius: var(--radio); background: #F8FAF9; }
.semana-mini .d.hoy { background: var(--cruz-claro); box-shadow: inset 3px 0 0 var(--cruz); }
.semana-mini .d .dia { font-weight: 700; line-height: 1.1; }
.semana-mini .d .dia small { display: block; font-weight: 500; }
.semana-mini .d .turnos { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.semana-mini .d .horario { color: var(--tinta-2); font-size: .88rem; }
.progreso { height: 8px; border-radius: 4px; background: var(--linea-suave); overflow: hidden; margin-top: .5rem; }
.progreso i { display: block; height: 100%; background: var(--cruz); }

.saldo { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: .8rem; }
.saldo div { background: #F8FAF9; border-radius: var(--radio); padding: .6rem; text-align: center; }
.saldo b { display: block; font-size: 1.45rem; line-height: 1.1; }
.saldo span { font-size: .8rem; color: var(--tinta-2); }

/* Calendario del empleado */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal .cab { text-align: center; font-size: .78rem; color: var(--tinta-3); font-weight: 700; padding: .2rem 0; }
.cal button.dia {
  min-height: 62px; padding: .25rem .15rem; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px;
  border: 1px solid var(--linea-suave); border-radius: var(--radio); background: var(--superficie); font-weight: 600;
}
.cal button.dia .n { font-size: .82rem; color: var(--tinta-2); }
.cal button.dia.finde { background: var(--finde); }
.cal button.dia.festivo { background: var(--festivo); }
.cal button.dia.hoy { border: 2px solid var(--cruz); }
.cal button.dia .ficha { font-size: .74rem; padding: 0 .3em; min-width: 1.9em; }
.cal .relleno { min-height: 62px; }
.anio-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.anio-mini .m h3 { font-size: .92rem; margin-bottom: .3rem; }
.anio-mini .m .g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.anio-mini .m .g span { height: 16px; border-radius: 2px; background: #F1F4F3; font-size: .55rem; display: grid; place-items: center; font-weight: 700; }
.anio-mini .m.sin { opacity: .5; }

.hoja {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--superficie); border-radius: 16px 16px 0 0; box-shadow: var(--sombra);
  padding: 1rem 1.1rem calc(1.1rem + env(safe-area-inset-bottom)); max-height: 75vh; overflow-y: auto;
  max-width: 560px; margin: 0 auto;
}
.hoja-fondo { position: fixed; inset: 0; background: rgba(22, 48, 43, .35); z-index: 49; }

/* Barra inferior del empleado */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--superficie); border-top: 1px solid var(--linea);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .45rem .2rem .5rem; text-decoration: none; color: var(--tinta-3); font-size: .74rem; font-weight: 650; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.activo { color: var(--cruz-osc); }
.tabbar a.activo svg { stroke: var(--cruz); }

.guardias-lista li .quien { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: flex-end; }
.leyenda { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .45rem; }
.leyenda div { display: flex; gap: .5rem; align-items: center; font-size: .86rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .rejilla-2 { grid-template-columns: 1fr; }
  .cifras { grid-template-columns: repeat(3, 1fr); }
  .cifra:nth-child(4) { border-left: 0; }
  .cifra:nth-child(n+4) { border-top: 1px solid var(--linea-suave); }
}
@media (max-width: 1100px) {
  .nav.admin { display: none; position: absolute; top: var(--barra); left: 0; right: 0; flex-direction: column; background: var(--tinta); padding: .5rem; overflow: visible; }
  .nav.admin.abierto { display: flex; }
  .menu-movil { display: inline-flex; background: transparent; color: #fff; border-color: rgba(255, 255, 255, .3); min-height: 36px; }
  .barra .marca { flex: 1; }
}
@media (max-width: 760px) {
  .barra { gap: .5rem; }
  .usuario .quien { display: none; }
  .cifras { grid-template-columns: repeat(2, 1fr); }
  .cifra { border-left: 0; border-top: 1px solid var(--linea-suave); }
  .cifra:nth-child(-n+2) { border-top: 0; }
  .cifra:nth-child(even) { border-left: 1px solid var(--linea-suave); }
  .barra-fila { grid-template-columns: 6.5rem 1fr 3.8rem; }
  h1 { font-size: 1.45rem; }
  .paleta { bottom: 0; border-radius: var(--radio-g) var(--radio-g) 0 0; width: 100vw; }
}
@media (min-width: 761px) {
  .emp { padding-bottom: 2rem; }
  .tabbar { position: sticky; top: var(--barra); bottom: auto; grid-template-columns: repeat(5, auto); justify-content: center; gap: 1rem; border-top: 0; border-bottom: 1px solid var(--linea); }
  .tabbar a { flex-direction: row; font-size: .9rem; padding: .7rem .6rem; }
  .tabbar a svg { width: 20px; height: 20px; }
}

/* ---------- Impresión ---------- */
@media print {
  .barra, .tabbar, .herramientas, .paleta, .toasts, .demo-aviso { display: none !important; }
  body { background: #fff; }
  .cuadrante-env { max-height: none; overflow: visible; border: 0; }
  @page { size: A4 landscape; margin: 8mm; }
}
