:root {
  --c1: #0f766e; --c1-texto: #fff;
  --c2: #f59e0b; --c2-texto: #171717;
  --fondo: #f5f5f4; --tarjeta: #fff; --texto: #1c1917; --suave: #78716c; --borde: #e7e5e4;
  --ok: #15803d; --alerta: #b45309; --error: #b91c1c;
  --radio: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--texto); background: var(--fondo);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; }
h1, h2, h3 { margin: 0 0 .5rem; }
.vacio { color: var(--suave); padding: 1rem; }
.sub { color: inherit; opacity: .75; font-size: .85rem; font-weight: 400; }
.aviso-chico { color: var(--suave); font-size: .85rem; margin: .25rem 0 .75rem; }

/* Botones */
button { cursor: pointer; border: 0; border-radius: 10px; padding: .6rem 1rem; font-weight: 600; }
button:disabled { opacity: .5; cursor: wait; }
.primario { background: var(--c1); color: var(--c1-texto); }
.secundario { background: transparent; color: var(--texto); border: 1px solid var(--borde); }
.secundario-fuerte { background: var(--c2); color: var(--c2-texto); }
.peligro { background: var(--error); color: #fff; }
.link { background: none; padding: .2rem .4rem; color: var(--c1); text-decoration: underline; font-weight: 500; }
.link.peligro { color: var(--error); background: none; }
.grande { width: 100%; padding: 1rem; font-size: 1.15rem; margin-top: auto; }
.ancho { width: 100%; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--c2); outline-offset: 2px; }

/* Login y pantallas centradas */
.centro { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.tarjeta { background: var(--tarjeta); border-radius: var(--radio); padding: 1.5rem; box-shadow: 0 4px 20px #0001; max-width: 380px; width: 100%; }
.login { display: grid; gap: .9rem; }
.login h1 { text-align: center; }
.logo-app { font-size: 3rem; text-align: center; }
label { display: grid; gap: .3rem; font-size: .9rem; color: var(--suave); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=month], input[type=datetime-local], select {
  padding: .6rem .7rem; border: 1px solid var(--borde); border-radius: 10px; background: #fff; color: var(--texto);
}
.error { color: var(--error); min-height: 1.2em; margin: 0; }

/* Encabezado con la marca del hotel */
.encabezado { background: var(--c1); color: var(--c1-texto); display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 1rem; padding-top: max(.8rem, env(safe-area-inset-top)); flex-wrap: wrap; }
.marca { display: flex; align-items: center; gap: .8rem; }
.logo-hotel { height: 48px; max-width: 140px; object-fit: contain; background: #fff; border-radius: 8px; padding: 4px; }
.nombre-hotel { font-size: 1.25rem; font-weight: 700; }
.botones-enc { display: flex; gap: .5rem; }
.enc { background: color-mix(in srgb, var(--c1-texto) 15%, transparent); color: var(--c1-texto); }

.contenido { padding: 1rem; max-width: 1100px; margin: 0 auto; }

/* Grilla de bicis (recepción) */
.grilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.bici { background: var(--tarjeta); border-radius: var(--radio); padding: 1rem; display: flex; flex-direction: column; gap: .4rem; min-height: 190px; border: 2px solid transparent; box-shadow: 0 2px 8px #0000000d; }
.bici .codigo { font-size: 1.8rem; font-weight: 800; }
.bici .estado { color: var(--suave); }
.bici.libre { border-color: color-mix(in srgb, var(--c1) 35%, transparent); }
.bici.usada { border-color: var(--c2); background: color-mix(in srgb, var(--c2) 8%, #fff); }
.bici.tarde { border-color: var(--alerta); }
.bici.fuera { opacity: .55; }
.reloj { font-variant-numeric: tabular-nums; font-size: 1.4rem; font-weight: 700; }
.aviso { color: var(--alerta); font-size: .85rem; font-weight: 600; }
.hoy { margin-top: 1.5rem; }
.lista-hoy { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; }
.lista-hoy li { background: var(--tarjeta); border-radius: 10px; padding: .55rem .8rem; }
.anulado { text-decoration: line-through; opacity: .6; }

/* Avisos */
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 150%); background: #1c1917; color: #fff; padding: .8rem 1.2rem; border-radius: 12px; transition: transform .25s; z-index: 50; max-width: 90vw; }
.toast.visible { transform: translate(-50%, 0); }
.toast.error { background: var(--error); }
.banner-error { background: var(--error); color: #fff; padding: .8rem 1rem; text-align: center; position: sticky; top: 0; z-index: 40; }
.banner-aviso { background: #fef3c7; color: #78350f; padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1rem; }

/* Diálogos */
.dialogo { border: 0; border-radius: var(--radio); padding: 1.3rem; width: min(480px, 92vw); max-height: 90vh; overflow: auto; }
.dialogo::backdrop { background: #0007; }
.acciones { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }
.form { display: grid; gap: .8rem; }
.check { display: flex; align-items: center; gap: .4rem; color: var(--texto); }

/* Personalizar */
.personalizar h3 { font-size: 1rem; margin-top: 1rem; }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.swatch { background: #fff; border: 2px solid var(--borde); padding: .4rem; font-size: .75rem; font-weight: 500; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; color: var(--texto); }
.swatch span { height: 22px; border-radius: 4px; }
.swatch.activo { border-color: var(--texto); }
.propios { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: .5rem; }
.muestra { display: flex; gap: .5rem; flex-wrap: wrap; }
.muestra span { padding: .5rem .8rem; border-radius: 8px; font-weight: 600; }
.fila-logo { display: flex; align-items: center; gap: 1rem; }
.logo-prev { height: 56px; max-width: 140px; object-fit: contain; border: 1px solid var(--borde); border-radius: 8px; padding: 4px; }

/* Admin */
.pestanas { display: flex; gap: .3rem; padding: .5rem 1rem 0; background: var(--c1); overflow-x: auto; }
.pestanas button { background: transparent; color: var(--c1-texto); opacity: .75; border-radius: 10px 10px 0 0; white-space: nowrap; }
.pestanas button.activa { background: var(--fondo); color: var(--texto); opacity: 1; }
.cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.cifra { background: var(--tarjeta); border-radius: var(--radio); padding: 1rem; }
.cifra .n { font-size: 2rem; font-weight: 800; }
.cifra .txt { color: var(--suave); }
.cifra.alerta .n { color: var(--alerta); }
.bloque { background: var(--tarjeta); border-radius: var(--radio); padding: 1rem; margin-bottom: 1rem; overflow-x: auto; }
.mini-grilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .5rem; }
.mini { border-radius: 10px; padding: .5rem .7rem; font-size: .9rem; border: 1px solid var(--borde); }
.mini.usada { background: #fef9c3; border-color: #facc15; }
.mini.tarde { background: #fee2e2; border-color: var(--error); }
.mini.fuera { opacity: .5; }
.mini .sub, .bloque .sub { color: var(--suave); opacity: 1; }
.filtros { display: flex; gap: .8rem; align-items: end; flex-wrap: wrap; margin-bottom: 1rem; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: .5rem; border-bottom: 1px solid var(--borde); }
th { color: var(--suave); font-weight: 600; }
tfoot td { font-weight: 700; }
.total-general { font-size: 1.2rem; font-weight: 800; text-align: right; }
.acciones-fila { white-space: nowrap; }
.fila-titulo { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.fila-titulo h3 { margin: 0; }
.logo-mini { height: 32px; max-width: 80px; object-fit: contain; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .6rem; }
.chip { background: color-mix(in srgb, var(--c1) 12%, #fff); color: var(--texto); padding: .35rem .7rem; border-radius: 999px; }
.chip.apagado { background: #e7e5e4; color: var(--suave); }
.subtitulo { margin: 1rem 0 .4rem; font-size: .95rem; }
.lista-usuarios { list-style: none; padding: 0; margin: 0 0 .6rem; display: grid; gap: .3rem; }
.lista-usuarios li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; border: 1px solid var(--borde); border-radius: 10px; padding: .45rem .7rem; }
.credenciales { background: var(--fondo); border-radius: 10px; padding: .8rem; white-space: pre-wrap; word-break: break-all; user-select: all; font-size: .95rem; margin: 0; }
.tabla-usuarios input, .tabla-usuarios select { width: 100%; min-width: 120px; padding: .4rem .5rem; }
.tabla-usuarios .acciones-fila { display: flex; gap: .3rem; align-items: center; }
.sin-acceso { background: #fffbeb; }
.etiqueta { display: inline-block; margin-top: .2rem; font-size: .75rem; font-weight: 600; color: var(--alerta); }
.fila-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.fila-form input, .fila-form select { flex: 1 1 160px; }

@media (max-width: 520px) {
  .grilla { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .bici { min-height: 170px; padding: .8rem; min-width: 0; }
  .grande { padding: .9rem .5rem; font-size: 1.05rem; }
  .encabezado { padding: .6rem .8rem; }
  .logo-hotel { height: 40px; }
  .bici .codigo { font-size: 1.5rem; }
  .swatches { grid-template-columns: repeat(2, 1fr); }
}
