:root {
  --azul: #1a3560;
  --azul-claro: #e9eef6;
  --texto: #1f2933;
  --gris: #6b7785;
  --borde: #d5dce5;
  --verde: #1d7a46;
  --rojo: #b42318;
  --fondo: #f5f7fa;
}
/* Colores por empresa, tomados de sus logos */
.tema-bargo     { --azul: #2b4c9b; --azul-claro: #e8edf7; --acento: #1d3576; }
.tema-ductiline { --azul: #0066b3; --azul-claro: #e5f0f9; --acento: #8a8f9c; }
.tema-grupo     { --acento: #1a3560; }

* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, sans-serif; color: var(--texto); background: var(--fondo); font-size: 15px; }
.barra { background: #fff; border-bottom: 4px solid var(--azul); display: flex; align-items: center; justify-content: space-between; padding: 0.6rem 1.5rem; flex-wrap: wrap; gap: 0.5rem; }
.marca { display: flex; align-items: center; gap: 0.9rem; text-decoration: none; color: var(--azul); font-weight: 600; font-size: 1.05rem; }
.marca img { height: 44px; width: auto; }
.marca img + span { border-left: 2px solid var(--borde); padding-left: 0.9rem; }
.enlace { color: var(--azul); font-weight: 600; text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; padding: 0; box-shadow: none; }
.enlace:hover { text-decoration: underline; transform: none; box-shadow: none; }

/* ---------- Menú lateral con opciones en burbuja 3D ---------- */
.con-menu { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.menu-interruptor, .velo, .hamburguesa { display: none; }
.lateral { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
           padding: 1rem 0.9rem 1.2rem; background: linear-gradient(180deg, #fff 0%, var(--azul-claro) 100%);
           border-right: 1px solid var(--borde); box-shadow: 2px 0 14px rgba(20, 40, 80, 0.07); }
.lateral-cabeza { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
                  padding-bottom: 0.9rem; margin-bottom: 0.4rem; border-bottom: 4px solid var(--azul); }
.lateral .marca { flex-direction: column; align-items: flex-start; gap: 0.4rem; font-size: 0.95rem; }
.lateral .marca img { height: 46px; max-width: 200px; }
.lateral .marca img + span { border-left: 0; padding-left: 0; }
.menu { display: flex; flex-direction: column; gap: 0.45rem; flex: 1; }
.menu-grupo { margin: 0.9rem 0 0.1rem 0.9rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
              text-transform: uppercase; color: var(--gris); }
.burbuja { position: relative; display: block; overflow: hidden; padding: 0.6rem 1.1rem; border-radius: 999px;
           color: var(--azul); font-weight: 600; text-decoration: none;
           background: linear-gradient(180deg, #fff 0%, #eef2f8 100%); border: 1px solid rgba(255, 255, 255, 0.9);
           box-shadow: 0 2px 5px rgba(20, 40, 80, 0.12), inset 0 -3px 5px rgba(20, 40, 80, 0.08), inset 0 2px 2px rgba(255, 255, 255, 0.95);
           transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease; }
/* brillo superior de la burbuja */
.burbuja::before, button::before, .boton::before {
  content: ""; position: absolute; left: 14%; right: 14%; top: 2px; height: 42%; border-radius: 999px; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0)); }
.burbuja:hover, .burbuja:focus-visible {
  transform: translateY(-2px) scale(1.03); outline: none;
  background: radial-gradient(120% 140% at 30% 20%, #fff 0%, color-mix(in srgb, var(--azul) 20%, #fff) 100%);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--azul) 32%, transparent), 0 0 0 3px color-mix(in srgb, var(--azul) 16%, transparent),
              inset 0 -4px 6px rgba(20, 40, 80, 0.12), inset 0 2px 3px #fff; }
.burbuja.activa, .burbuja.activa:hover {
  color: #fff; transform: none; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
  background: radial-gradient(130% 160% at 30% 15%, color-mix(in srgb, var(--azul) 55%, #fff) 0%, var(--azul) 45%, color-mix(in srgb, var(--azul) 65%, #000) 100%);
  box-shadow: 0 6px 14px color-mix(in srgb, var(--azul) 42%, transparent), inset 0 -4px 8px rgba(0, 0, 0, 0.25), inset 0 2px 4px rgba(255, 255, 255, 0.35); }
.burbuja.activa::before { background: linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0)); }
.burbuja:active { transform: translateY(1px) scale(0.98); }
.lateral-pie { margin-top: auto; padding-top: 1.2rem; display: flex; flex-direction: column; gap: 0.7rem; }
.lateral-pie form { margin: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.lateral-pie button { width: 100%; }
.cambio-empresa button { font-size: 0.8rem; }
.usuario-actual { margin: 0; text-align: center; font-size: 0.82rem; color: var(--gris); }
.contenido { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.contenido main { width: 100%; }
.contenido footer { margin-top: auto; }
.hamburguesa span { display: block; width: 22px; height: 3px; border-radius: 2px; background: var(--azul); transition: transform 0.2s, opacity 0.2s; }

/* Tablet y celular: barra superior con menú desplegable */
@media (max-width: 900px) {
  .con-menu { display: block; }
  .lateral { z-index: 30; height: auto; overflow: visible; padding: 0.5rem 0.9rem; background: #fff;
             border-right: 0; border-bottom: 4px solid var(--azul); box-shadow: 0 2px 10px rgba(20, 40, 80, 0.08); }
  .lateral-cabeza { border-bottom: 0; padding: 0; margin: 0; }
  .lateral .marca { flex-direction: row; align-items: center; gap: 0.7rem; }
  .lateral .marca img { height: 36px; }
  .lateral .marca img + span { border-left: 2px solid var(--borde); padding-left: 0.7rem; }
  .hamburguesa { display: inline-flex; flex-direction: column; justify-content: center; gap: 4px; width: 44px; height: 44px;
                 margin: 0; align-items: center; cursor: pointer; border-radius: 50%;
                 background: linear-gradient(180deg, #fff 0%, #eef2f8 100%);
                 box-shadow: 0 2px 5px rgba(20, 40, 80, 0.15), inset 0 -3px 5px rgba(20, 40, 80, 0.08), inset 0 2px 2px #fff; }
  .menu { display: none; position: absolute; top: 100%; left: 0; right: 0; max-height: calc(100vh - 64px); overflow-y: auto;
          padding: 0.6rem 1rem 1.2rem; background: linear-gradient(180deg, #fff 0%, var(--azul-claro) 100%);
          border-radius: 0 0 18px 18px; box-shadow: 0 14px 28px rgba(20, 40, 80, 0.18); }
  .menu-interruptor:checked ~ .lateral .menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.5rem; }
  .menu-grupo, .lateral-pie { grid-column: 1 / -1; }
  .burbuja { text-align: center; padding: 0.75rem 1rem; }
  .lateral-pie { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: flex-end; }
  .lateral-pie form { flex: 1 1 200px; }
  .menu-interruptor:checked ~ .velo { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(15, 25, 45, 0.35); }
  .menu-interruptor:checked ~ .lateral .hamburguesa span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-interruptor:checked ~ .lateral .hamburguesa span:nth-child(2) { opacity: 0; }
  .menu-interruptor:checked ~ .lateral .hamburguesa span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  body:has(.menu-interruptor:checked) { overflow: hidden; }
  .contenido main { overflow-x: auto; }
}
@media (max-width: 600px) {
  .menu-interruptor:checked ~ .lateral .menu { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lateral .marca span { font-size: 0.88rem; }
  .burbuja { padding: 0.75rem 0.6rem; font-size: 0.92rem; }
}
.portada { text-align: center; margin: 3rem auto; max-width: 820px; }
.portada h1 { font-size: 1.8rem; }
.portada p { color: var(--gris); }
.empresas { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; margin-top: 2rem; }
.empresa { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; background: #fff; border: 1px solid var(--borde); border-top: 6px solid var(--azul); border-radius: 10px; padding: 2.2rem 1.5rem; text-decoration: none; color: var(--gris); font-size: 0.85rem; transition: box-shadow 0.15s, transform 0.15s; }
.empresa:hover { box-shadow: 0 6px 18px rgba(20, 40, 80, 0.12); transform: translateY(-2px); }
.empresa img { max-height: 110px; max-width: 260px; }
.logo-login { display: block; max-height: 90px; max-width: 260px; margin: 0 auto 1.2rem; }
.nota a { color: var(--azul); }
.aviso-ok { background: #e6f4ec; color: var(--verde); border-radius: 6px; padding: 0.6rem 0.8rem; }
.etiqueta.advertencia { background: #fff4e0; color: #9a5b00; }
.sin-margen { margin-top: 0; }
.botones-checar { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
button.grande { font-size: 1.1rem; padding: 0.9rem 1.8rem; }
button.salida { background: var(--acento); }
button:disabled { opacity: 0.6; cursor: wait; }
.filtros label.ancho { flex: 1; min-width: 240px; }
.filtros label.ancho input { width: 100%; }
fieldset.dias { border: 1px solid var(--borde); border-radius: 6px; margin: 0 0 1rem; padding: 0.5rem 0.8rem; }
fieldset.dias legend { font-size: 0.85rem; color: var(--gris); }
fieldset.dias label { display: inline-flex; align-items: center; gap: 0.3rem; margin: 0 0.9rem 0 0; font-weight: 400; }
fieldset.dias input, input.casilla { width: auto; display: inline; margin: 0; }
.acciones-lote { margin-top: 1rem; }
.casilla-linea { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
a.secundario-enlace { background: #fff; color: var(--azul); border: 1px solid var(--borde); font-weight: 500; }
form.relacionar input[name=num_empleado] { display: inline-block; width: 7rem; margin: 0 0.4rem 0 0; padding: 0.3rem 0.5rem; }
input[type=file] { padding: 0.4rem; background: #fff; }
details.alta-empleado { margin-bottom: 1.5rem; }
details.alta-empleado summary { cursor: pointer; font-weight: 600; color: var(--azul); }
details.alta-empleado[open] summary { margin-bottom: 0.8rem; }
.alerta ul { margin: 0.4rem 0 0; }
.pestanas { display: flex; gap: 0.3rem; align-items: center; border-bottom: 2px solid var(--azul); margin: 0.5rem 0 0.8rem; }
.pestanas a:not(.boton) { padding: 0.5rem 1rem; text-decoration: none; color: var(--azul); border-radius: 6px 6px 0 0; }
.pestanas a.activa { background: var(--azul); color: #fff; }
.pestanas a.boton { margin-left: auto; margin-bottom: 0.3rem; }
/* Checado de campo (pensado para celular) */
.campo { max-width: 480px; margin: 0 auto; }
.campo h1 { margin-bottom: 0.2rem; }
.paso { display: flex; align-items: center; gap: 0.5rem; margin: 0.9rem 0 0.4rem; }
.paso span { display: inline-flex; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--azul); color: #fff;
             align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; flex: none; }
.boton-foto { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; border: 2px dashed var(--azul);
              border-radius: 10px; padding: 1rem; color: var(--azul); font-weight: 600; cursor: pointer; min-height: 7rem; }
.boton-foto input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.boton-foto img { max-width: 100%; max-height: 260px; border-radius: 8px; }
.campo .botones-checar button { flex: 1; }
.ancho-total { width: 100%; }
.salir-campo { margin: 1.5rem 0 0.5rem; text-align: center; }
.pin { font-size: 2.6rem; font-weight: 700; letter-spacing: 0.3rem; text-align: center; color: var(--azul); margin: 1rem 0; font-family: Consolas, monospace; }
tr.sustituida td { color: var(--gris); text-decoration: line-through; }
tr.sustituida td .etiqueta { text-decoration: none; }
.mas-espacio { margin-top: 1rem; }
.preferencias label.opcion { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; margin-bottom: 0.4rem; }
.preferencias label.opcion input { width: auto; display: inline; margin: 0; }
.preferencias label.opcion.deshabilitada { color: var(--gris); }
img.miniatura { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid var(--borde); }
@media (max-width: 600px) {
  main { padding: 0 0.8rem; margin-top: 1rem; }
  .barra { padding: 0.5rem 0.8rem; }
  .marca img { height: 34px; }
}
.tarjeta + h2, table + h2 { margin-top: 2rem; }
main { max-width: 1200px; margin: 1.5rem auto; padding: 0 1.5rem; }
footer { text-align: center; color: var(--gris); font-size: 0.8rem; padding: 2rem 0; }
h1 { color: var(--azul); font-size: 1.5rem; margin: 0 0 1rem; }
h2 { color: var(--azul); font-size: 1.15rem; margin: 2rem 0 0.7rem; }
.tarjeta { background: #fff; border: 1px solid var(--borde); border-radius: 8px; padding: 1.8rem; }
.angosta { max-width: 440px; margin: 3rem auto; }
label { display: block; margin-bottom: 0.9rem; font-weight: 600; font-size: 0.9rem; }
input, select { display: block; width: 100%; margin-top: 0.3rem; padding: 0.55rem 0.65rem; border: 1px solid var(--borde); border-radius: 6px; font: inherit; }
input:focus, select:focus { outline: 2px solid var(--azul); outline-offset: 1px; }
/* Botones en burbuja 3D: relieve, brillo superior, se elevan al pasar el cursor y se hunden al presionar */
button, .boton { position: relative; overflow: hidden; color: #fff; border: 0; border-radius: 999px; padding: 0.6rem 1.3rem;
                 font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
                 background: radial-gradient(130% 160% at 30% 15%, color-mix(in srgb, var(--azul) 55%, #fff) 0%, var(--azul) 50%, color-mix(in srgb, var(--azul) 68%, #000) 100%);
                 box-shadow: 0 3px 8px color-mix(in srgb, var(--azul) 30%, transparent), inset 0 -3px 6px rgba(0, 0, 0, 0.22), inset 0 2px 3px rgba(255, 255, 255, 0.35);
                 transition: transform 0.18s ease, box-shadow 0.18s ease; }
button::before, .boton::before { background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0)); }
button:hover, .boton:hover { transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--azul) 38%, transparent), 0 0 0 3px color-mix(in srgb, var(--azul) 18%, transparent),
              inset 0 -3px 6px rgba(0, 0, 0, 0.22), inset 0 2px 3px rgba(255, 255, 255, 0.4); }
button:active, .boton:active { transform: translateY(1px) scale(0.98); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), inset 0 3px 6px rgba(0, 0, 0, 0.3); }
button:disabled, button:disabled:hover { transform: none; }
button.salida { background: radial-gradient(130% 160% at 30% 15%, color-mix(in srgb, var(--acento) 55%, #fff) 0%, var(--acento) 50%, color-mix(in srgb, var(--acento) 68%, #000) 100%); }
button.secundario, a.secundario-enlace { color: var(--azul); text-shadow: none; border: 1px solid rgba(255, 255, 255, 0.9);
  background: linear-gradient(180deg, #fff 0%, #eef2f8 100%);
  box-shadow: 0 2px 5px rgba(20, 40, 80, 0.14), inset 0 -3px 5px rgba(20, 40, 80, 0.08), inset 0 2px 2px #fff; }
button.secundario { padding: 0.35rem 0.85rem; font-weight: 500; font-size: 0.85rem; }
button.secundario::before, a.secundario-enlace::before { background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0)); }
button.secundario:hover, a.secundario-enlace:hover { background: radial-gradient(120% 140% at 30% 20%, #fff 0%, color-mix(in srgb, var(--azul) 18%, #fff) 100%); }
button.enlace::before { display: none; }
.en-linea { display: inline; margin: 0; }
.alerta { background: #fdecea; color: var(--rojo); border-radius: 6px; padding: 0.6rem 0.8rem; }
.aviso { background: var(--azul-claro); border-radius: 6px; padding: 0.8rem 1rem; margin-bottom: 1rem; }
.nota { color: var(--gris); font-size: 0.85rem; }
code { font-family: Consolas, "Cascadia Mono", monospace; }
.clave { font-size: 1rem; letter-spacing: 0.05em; }
.enlace-activacion { display: block; word-break: break-all; background: #fff; padding: 0.6rem; border-radius: 6px; border: 1px solid var(--borde); user-select: all; }
.qr { text-align: center; margin: 1rem 0; }
.qr svg { width: 220px; height: 220px; }
.codigos { columns: 2; list-style: none; padding: 0; font-size: 1.05rem; }
.codigos li { padding: 0.25rem 0; }
.indicadores { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.indicadores div { background: #fff; border: 1px solid var(--borde); border-radius: 8px; padding: 1rem 1.2rem; }
.indicadores strong { display: block; font-size: 1.6rem; color: var(--azul); }
.indicadores span { color: var(--gris); font-size: 0.85rem; }
.indicadores .bien strong { color: var(--verde); }
.indicadores .mal { border-color: var(--rojo); }
.indicadores .mal strong { color: var(--rojo); }
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--borde); border-radius: 8px; overflow: hidden; font-size: 0.9rem; }
th { background: var(--azul); color: #fff; text-align: left; padding: 0.55rem 0.7rem; font-weight: 600; }
td { padding: 0.5rem 0.7rem; border-top: 1px solid var(--borde); }
tr:nth-child(even) td { background: #fafbfd; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.vacio { text-align: center; color: var(--gris); padding: 1.5rem; }
.inactivo td { color: var(--gris); }
.acciones { white-space: nowrap; }
.detalle { color: var(--gris); font-size: 0.82rem; }
.etiqueta { display: inline-block; border-radius: 999px; padding: 0.1rem 0.6rem; font-size: 0.8rem; background: #eef1f5; color: var(--gris); }
.etiqueta.bien { background: #e6f4ec; color: var(--verde); }
.etiqueta.mal { background: #fdecea; color: var(--rojo); }
.filtros { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: flex-end; margin-bottom: 1rem; }
.filtros label { margin: 0; }
.filtros input, .filtros select { width: auto; min-width: 160px; }
