/* ============================================================
   Acta de Tecnología | Levapan
   Estilo visual: Liquid Glass (Apple OS) · Rojo corporativo
   ------------------------------------------------------------
   Esta hoja solo define la apariencia. No altera campos,
   estructura del formulario ni la lógica de JavaScript.
   ============================================================ */

:root {
  /* Paleta corporativa */
  --rojo: #d92638;
  --rojo-claro: #f0616f;
  --rojo-oscuro: #981127;
  --rojo-suave: rgba(217, 38, 56, 0.12);
  --rojo-borde: rgba(217, 38, 56, 0.45);

  /* Texto */
  --texto: #15171c;
  --texto-medio: #30343d;
  --texto-suave: #5a606c;

  /* Cristal */
  --cristal: rgba(255, 255, 255, 0.42);
  --cristal-fuerte: rgba(255, 255, 255, 0.58);
  --cristal-borde: rgba(255, 255, 255, 0.62);
  --blur: blur(22px) saturate(165%);
  --sombra-cristal:
    0 8px 32px rgba(12, 8, 14, 0.14),
    0 28px 80px rgba(12, 8, 14, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --sombra-panel:
    0 6px 22px rgba(12, 8, 14, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);

  /* Formas */
  --radio: 20px;
  --radio-campo: 12px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

::selection {
  color: var(--texto);
  background: rgba(217, 38, 56, 0.24);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    system-ui, sans-serif;
  color: var(--texto);
  background-color: #121418;
  background-image: url(../images/fondo-poster.jpg);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------------- Fondo animado suavizado y neutro ---------------- */

.video-fondo {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  pointer-events: none;
  filter: grayscale(35%) brightness(0.72) blur(2px);
  transform: scale(1.02);
}

.velo-fondo {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(
      120% 90% at 50% 0%,
      rgba(255, 255, 255, 0.05) 0%,
      rgba(255, 255, 255, 0) 62%
    ),
    linear-gradient(
      180deg,
      rgba(12, 14, 18, 0.48) 0%,
      rgba(12, 14, 18, 0.58) 55%,
      rgba(9, 11, 15, 0.68) 100%
    );
}

/* ---------------- Contenedor principal de cristal ---------------- */

.contenedor {
  width: min(920px, 94vw);
  margin: 24px auto 36px;
  padding: 20px;
  border-radius: 32px;
  background:
    radial-gradient(
      120% 90% at 0% 0%,
      rgba(255, 255, 255, 0.82) 0%,
      rgba(255, 255, 255, 0) 52%
    ),
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.64) 0%,
      rgba(255, 255, 255, 0.46) 52%,
      rgba(255, 255, 255, 0.56) 100%
    );
  border: 1px solid var(--cristal-borde);
  box-shadow: var(--sombra-cristal);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  isolation: isolate;
}

/* ---------------- Cabecera / barra superior ---------------- */

.cabecera {
  position: relative;
  text-align: center;
  padding: 20px 20px 22px;
  margin-bottom: 14px;
  border-radius: 24px;
  background:
    linear-gradient(
      150deg,
      rgba(255, 255, 255, 0.6) 0%,
      rgba(255, 255, 255, 0.34) 100%
    );
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow:
    0 8px 26px rgba(12, 8, 14, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

.cabecera::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(217, 38, 56, 0.42),
    transparent
  );
  pointer-events: none;
}

.cabecera-superior {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 8px;
}

.logo-app {
  width: auto;
  height: 52px;
  filter: drop-shadow(0 6px 12px rgba(152, 17, 39, 0.18));
  flex: 0 0 auto;
}

.cabecera-texto {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.marca {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.24em;
  color: var(--rojo);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.marca-sub {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #6a4a50;
}

.titulo {
  font-size: clamp(1.55rem, 3.4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--rojo-oscuro);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

.subtitulo {
  max-width: 620px;
  margin: 9px auto 0;
  font-size: 0.95rem;
  color: #3f444d;
  line-height: 1.55;
}

.acciones-superiores {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

/* ---------------- Estados / píldoras de información ---------------- */

.sesion-usuario {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 5px 7px 5px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  color: #4e545f;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.sesion-nombre {
  max-width: min(340px, 58vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sesion-salir {
  flex: 0 0 auto;
  padding: 4px 11px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--rojo-oscuro);
  text-decoration: none;
  background: rgba(217, 38, 56, 0.1);
  border: 1px solid rgba(217, 38, 56, 0.26);
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.sesion-salir:hover,
.sesion-salir:focus-visible {
  color: #fff;
  background: var(--rojo);
}

.estado {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  color: #4e545f;
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.estado:empty {
  display: none;
}

.estado[hidden] {
  display: none;
}

.estado.ok {
  color: #1f6a44;
  background: rgba(46, 160, 96, 0.12);
  border-color: rgba(46, 160, 96, 0.28);
}

.estado.error {
  color: var(--rojo-oscuro);
  background: rgba(217, 38, 56, 0.12);
  border-color: rgba(217, 38, 56, 0.3);
}

.estado a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.estado a:hover {
  opacity: 0.75;
}

.estado-inventario {
  display: flex;
  width: fit-content;
  margin: 10px auto 0;
}

/* ---------------- Ficha rápida del equipo encontrado ---------------- */

.equipo-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px 16px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.equipo-info[hidden] {
  display: none;
}

.equipo-info-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.equipo-info-etiqueta {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #8a5a60;
}

.equipo-info-valor {
  font-size: 0.88rem;
  font-weight: 600;
  color: #2f333a;
  overflow-wrap: anywhere;
}

/* ---------------- Formulario ---------------- */

.formulario {
  display: block;
}

.seccion {
  position: relative;
  padding: 18px;
  margin-bottom: 12px;
  border-radius: 22px;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.54) 0%,
      rgba(255, 255, 255, 0.32) 100%
    );
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--sombra-panel);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
}

.seccion-titulo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--rojo-oscuro);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.seccion-titulo::before {
  content: "";
  width: 4px;
  height: 21px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--rojo-claro), var(--rojo-oscuro));
  box-shadow: 0 0 12px rgba(217, 38, 56, 0.38);
}

.grid-campos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px 14px;
}

.campo {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* --- Selects de formulario (Tipo, Marca, Modelo, Agente TI, Sede) ---
    Todos los <select> del formulario comparten el mismo estilo de cristal,
    flecha CSS discreta y proporciones. El campo Sede (id="sede") hereda este
    estilo automáticamente, sin flecha nativa desalineada. */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  padding: 11px 13px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--texto);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.56) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='12' viewBox='0 0 20 12'%3E%3Cpath d='M2 2l8 8 8-8' fill='none' stroke='%23282c34' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
      right 13px center no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.56) 100%);
  background-repeat: no-repeat, repeat;
  background-position: right 13px center, center;
  background-size: 12px 7px, 100% 100%;
  cursor: pointer;
  color: var(--texto);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radio-campo);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

/* Focus en todos los selects */
select:focus {
  outline: none;
  border-color: var(--rojo-borde);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.8) 100%);
  box-shadow:
    0 0 0 4px rgba(217, 38, 56, 0.14),
    0 8px 22px rgba(217, 38, 56, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Flecha al pasar */
select:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='12' viewBox='0 0 20 12'%3E%3Cpath d='M2 2l8 8 8-8' fill='none' stroke='%23282c34' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"), linear-gradient(180deg, rgba(255, 255, 255, 0.86) 0%, rgba(255, 255, 255, 0.64) 100%);
}

/* Opción inválida */
select option {
  color: var(--texto);
  background: #ffffff;
}

/* Campo de solo lectura */
select[readonly] {
  color: #5a5f69;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0.34) 100%);
  cursor: default;
}

select[readonly]:focus {
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 2px rgba(20, 12, 16, 0.05), 0 0 0 3px rgba(217, 38, 56, 0.08);
}

/* Opción inválida */
#sede option {
  color: var(--texto);
  background: #ffffff;
}

/* Campo de solo lectura */
#sede[readonly] {
  color: #5a5f69;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0.34) 100%);
  cursor: default;
}

#sede[readonly]:focus {
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 2px rgba(20, 12, 16, 0.05), 0 0 0 3px rgba(217, 38, 56, 0.08);
}

/* --- Selects de formulario (Tipo, Marca, Modelo, Agente TI, Sede) ---
    Todos los <select> del formulario comparten el mismo estilo de cristal,
    flecha CSS discreta y proporciones. El campo Sede (id="sede") hereda este
    estilo automáticamente, sin flecha nativa desalineada. */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  padding: 11px 13px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--texto);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.56) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='12' viewBox='0 0 20 12'%3E%3Cpath d='M2 2l8 8 8-8' fill='none' stroke='%23282c34' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
      right 13px center no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.56) 100%);
  background-repeat: no-repeat, repeat;
  background-position: right 13px center, center;
  background-size: 12px 7px, 100% 100%;
  cursor: pointer;
  color: var(--texto);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radio-campo);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

/* Focus en todos los selects */
select:focus {
  outline: none;
  border-color: var(--rojo-borde);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.8) 100%);
  box-shadow:
    0 0 0 4px rgba(217, 38, 56, 0.14),
    0 8px 22px rgba(217, 38, 56, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Flecha al pasar */
select:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='12' viewBox='0 0 20 12'%3E%3Cpath d='M2 2l8 8 8-8' fill='none' stroke='%23282c34' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"), linear-gradient(180deg, rgba(255, 255, 255, 0.86) 0%, rgba(255, 255, 255, 0.64) 100%);
}

/* Opción inválida */
select option {
  color: var(--texto);
  background: #ffffff;
}

/* Campo de solo lectura */
select[readonly] {
  color: #5a5f69;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0.34) 100%);
  cursor: default;
}

select[readonly]:focus {
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 2px rgba(20, 12, 16, 0.05), 0 0 0 3px rgba(217, 38, 56, 0.08);
}

/* Opción inválida */
#sede option {
  color: var(--texto);
  background: #ffffff;
}

/* Campo de solo lectura */
#sede[readonly] {
  color: #5a5f69;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62) 0%, rgba(255, 255, 255, 0.34) 100%);
  cursor: default;
}

#sede[readonly]:focus {
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 2px rgba(20, 12, 16, 0.05), 0 0 0 3px rgba(217, 38, 56, 0.08);
}

.campo label,
.campo-foto label,
.subbloque-ti-titulo {
  margin-bottom: 7px;
  font-size: 0.81rem;
  font-weight: 700;
  line-height: 1.2;
  color: #282c34;
  letter-spacing: 0.01em;
}

/* "Agente TI" es un subtítulo, pero debe verse exactamente igual que
   las etiquetas del formulario (tamaño, peso, color y altura de línea). */
.subbloque-ti-titulo {
  margin: 0 0 7px;
}

/* Separa el bloque del Agente TI sin agregar una tarjeta adicional. */
.subbloque-ti {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(217, 38, 56, 0.12);
}

/* ---------------- Campos de texto ---------------- */

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 11px 13px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--texto);
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.78) 0%,
      rgba(255, 255, 255, 0.56) 100%
    );
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radio-campo);
  box-shadow:
    inset 0 1px 2px rgba(20, 12, 16, 0.06),
    0 2px 8px rgba(20, 12, 16, 0.05);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

input[type="text"]::placeholder,
input[type="number"]::placeholder,
textarea::placeholder {
  color: #7b818c;
}

input[type="text"]:hover,
input[type="number"]:hover,
select:hover,
textarea:hover {
  border-color: rgba(255, 255, 255, 0.95);
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.86) 0%,
      rgba(255, 255, 255, 0.64) 100%
    );
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--rojo-borde);
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.94) 0%,
      rgba(255, 255, 255, 0.8) 100%
    );
  box-shadow:
    0 0 0 4px rgba(217, 38, 56, 0.14),
    0 8px 22px rgba(217, 38, 56, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

input[aria-invalid="true"] {
  border-color: rgba(217, 38, 56, 0.72);
  box-shadow:
    0 0 0 4px rgba(217, 38, 56, 0.14),
    inset 0 1px 2px rgba(20, 12, 16, 0.06);
}

/* ---------------- Selects de cristal ---------------- */

/* Una sola flecha CSS (SVG con tamaño explícito). Se repiten
   background-size/repeat/position en cada estado para que ningún
   navegador la estire al tamaño natural del SVG (300×150). */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 38px;
  background-color: rgba(255, 255, 255, 0.7);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='12' viewBox='0 0 20 12'%3E%3Cpath d='M2 2l8 8 8-8' fill='none' stroke='%23282c34' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.78) 0%,
      rgba(255, 255, 255, 0.56) 100%
    );
  background-repeat: no-repeat, no-repeat;
  background-position: right 13px center, center;
  background-size: 12px 7px, 100% 100%;
  cursor: pointer;
}

/* Oculta la flecha nativa en navegadores antiguos (IE/Edge legacy). */
select::-ms-expand {
  display: none;
}

select:hover {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='12' viewBox='0 0 20 12'%3E%3Cpath d='M2 2l8 8 8-8' fill='none' stroke='%23282c34' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.86) 0%,
      rgba(255, 255, 255, 0.64) 100%
    );
  background-repeat: no-repeat, no-repeat;
  background-position: right 13px center, center;
  background-size: 12px 7px, 100% 100%;
}

select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='12' viewBox='0 0 20 12'%3E%3Cpath d='M2 2l8 8 8-8' fill='none' stroke='%238f1024' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.94) 0%,
      rgba(255, 255, 255, 0.8) 100%
    );
  background-repeat: no-repeat, no-repeat;
  background-position: right 13px center, center;
  background-size: 12px 7px, 100% 100%;
}

select:invalid {
  color: var(--texto-suave);
}

select option {
  color: var(--texto);
  background: #ffffff;
}

input[readonly] {
  color: #3a3f48;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.58) 0%,
      rgba(255, 255, 255, 0.42) 100%
    );
  cursor: default;
}

input[readonly]:focus {
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow:
    inset 0 1px 2px rgba(20, 12, 16, 0.05),
    0 0 0 3px rgba(217, 38, 56, 0.08);
}

input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.92) inset;
  -webkit-text-fill-color: var(--texto);
}

textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.55;
}

.ayuda {
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--texto-suave);
}

/* Aviso discreto de error del inventario bajo el campo Placa. */
.placa-aviso {
  display: block;
  margin-top: 6px;
  padding: 6px 9px;
  border-radius: 9px;
  border: 1px solid #fecaca;
  background-color: #fef2f2;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #b91c1c;
  overflow-wrap: anywhere;
}

.placa-aviso[hidden] {
  display: none;
}

/* ---------------- Sugerencias de Placa (Liquid Glass) ---------------- */

.campo-placa-caja {
  position: relative;
}

.placa-sugerencias {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: auto;
  z-index: 9999;
  min-width: 360px;
  max-width: min(460px, 90vw);
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 16px;
  border: 1px solid #cbd5e1;
  background-color: #ffffff !important;
  opacity: 1 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  animation: aparecerSugerencias 0.14s ease-out;
}

.placa-sugerencias[hidden] {
  display: none;
}

.placa-sugerencia {
  position: relative;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 11px;
  background-color: #ffffff;
  color: var(--texto);
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s ease, box-shadow 0.14s ease;
}

.placa-sugerencia + .placa-sugerencia {
  margin-top: 2px;
}

.placa-sugerencia:hover,
.placa-sugerencia.activa {
  background: rgba(217, 38, 56, 0.12);
  box-shadow: inset 0 0 0 1px rgba(217, 38, 56, 0.24);
}

.placa-sugerencia:focus-visible {
  outline: none;
  background: rgba(217, 38, 56, 0.16);
  box-shadow: inset 0 0 0 2px rgba(217, 38, 56, 0.35);
}

.placa-sugerencia-placa {
  font-weight: 800;
  color: var(--rojo-oscuro);
  letter-spacing: 0.02em;
}

.placa-sugerencia-detalle {
  font-size: 0.8rem;
  line-height: 1.3;
  color: #5b4750;
}

.placa-sugerencias-vacia {
  padding: 10px 12px;
  font-size: 0.85rem;
  color: var(--texto-suave);
  background-color: #ffffff;
}

select:disabled {
  opacity: 1;
  color: #4b3138;
  cursor: default;
  background-image: none;
  padding-right: 13px;
}

@keyframes aparecerSugerencias {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------------- Radios ---------------- */

.grupo-radio {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(217, 38, 56, 0.14);
}

.grupo-etiqueta {
  font-size: 0.81rem;
  font-weight: 800;
  color: #282c34;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--texto-medio);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 2px 8px rgba(20, 12, 16, 0.05);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.radio:hover {
  border-color: var(--rojo-borde);
  background: rgba(255, 255, 255, 0.66);
  transform: translateY(-1px);
}

.radio input {
  accent-color: var(--rojo);
}

.radio:has(input:checked) {
  color: var(--rojo-oscuro);
  background:
    linear-gradient(
      135deg,
      rgba(217, 38, 56, 0.18) 0%,
      rgba(217, 38, 56, 0.08) 100%
    );
  border-color: rgba(217, 38, 56, 0.55);
  box-shadow:
    0 0 0 3px rgba(217, 38, 56, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.radio:has(input:focus-visible) {
  outline: 2px solid rgba(217, 38, 56, 0.42);
  outline-offset: 2px;
}

/* ---------------- Checkboxes ---------------- */

.grid-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 7px 12px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 10px;
  font-size: 0.9rem;
  line-height: 1.3;
  color: var(--texto-medio);
  border-radius: 12px;
  cursor: pointer;
  transition:
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.check:hover {
  background: rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.check:has(input:checked) {
  background: rgba(217, 38, 56, 0.08);
  box-shadow: inset 0 0 0 1px rgba(217, 38, 56, 0.16);
}

.check input {
  flex: none;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  accent-color: var(--rojo);
  cursor: pointer;
}

.check input:focus-visible {
  outline: 2px solid rgba(217, 38, 56, 0.55);
  outline-offset: 2px;
  border-radius: 4px;
}

.otro-input {
  margin-top: 10px;
}

.otro-input:disabled {
  display: none;
}

/* ---------------- Registro fotográfico ---------------- */

.grid-fotos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.campo-foto {
  display: flex;
  flex-direction: column;
}

.campo-foto input[type="file"] {
  width: 100%;
  font-size: 0.82rem;
  color: #4f5560;
}

.campo-foto input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 9px 13px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
  background:
    linear-gradient(
      135deg,
      rgba(220, 38, 38, 0.58) 0%,
      rgba(152, 17, 39, 0.62) 100%
    );
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 11px;
  box-shadow:
    0 5px 16px rgba(160, 16, 38, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  text-shadow: 0 1px 2px rgba(80, 0, 10, 0.3);
  cursor: pointer;
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.campo-foto input[type="file"]::file-selector-button:hover {
  background:
    linear-gradient(
      135deg,
      rgba(220, 38, 38, 0.68) 0%,
      rgba(152, 17, 39, 0.72) 100%
    );
  box-shadow:
    0 8px 22px rgba(160, 16, 38, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
  transform: translateY(-1px);
}

.campo-foto input[type="file"]:focus-visible {
  outline: 2px solid rgba(217, 38, 56, 0.42);
  outline-offset: 3px;
  border-radius: 10px;
}

.preview {
  display: none;
  width: 100%;
  height: 150px;
  margin-top: 10px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 14px;
  box-shadow:
    0 8px 22px rgba(20, 12, 16, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

/* ---------------- Firmas digitales ---------------- */

.grid-firmas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.bloque-firma {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  background:
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.52) 0%,
      rgba(255, 255, 255, 0.3) 100%
    );
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 4px 16px rgba(20, 12, 16, 0.05);
}

.firma-titulo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--rojo-oscuro);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.firma-titulo::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--rojo);
  box-shadow: 0 0 8px rgba(217, 38, 56, 0.5);
}

.lienzo-firma {
  position: relative;
  margin-top: 2px;
  overflow: hidden;
  border: 1px dashed rgba(217, 38, 56, 0.4);
  border-radius: 14px;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.72) 0%,
      rgba(255, 255, 255, 0.56) 100%
    );
  box-shadow: inset 0 1px 2px rgba(20, 12, 16, 0.05);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.lienzo-firma:focus-within,
.lienzo-firma.firmado {
  border-style: solid;
  border-color: rgba(217, 38, 56, 0.5);
  box-shadow:
    inset 0 1px 2px rgba(20, 12, 16, 0.05),
    0 0 0 3px rgba(217, 38, 56, 0.08);
}

.canvas-firma {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1000 / 340;
  cursor: crosshair;
  touch-action: none;
}

.firma-guia {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(120, 84, 90, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.lienzo-firma.firmado .firma-guia {
  opacity: 0;
}

/* ---------------- Botones de cristal rojo ---------------- */

.pie-formulario {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.btn {
  position: relative;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #ffffff;
  padding: 12px 22px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 15px;
  background:
    linear-gradient(
      135deg,
      rgba(220, 38, 38, 0.58) 0%,
      rgba(152, 17, 39, 0.62) 100%
    );
  box-shadow:
    0 10px 28px rgba(160, 16, 38, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -1px 0 rgba(90, 0, 12, 0.12);
  text-shadow: 0 1px 2px rgba(80, 0, 10, 0.32);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  cursor: pointer;
  transition:
    transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.08) saturate(1.06);
  box-shadow:
    0 16px 38px rgba(160, 16, 38, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    inset 0 -1px 0 rgba(90, 0, 12, 0.1);
}

.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.994);
  box-shadow:
    0 6px 16px rgba(160, 16, 38, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.btn:focus-visible {
  outline: 2px solid rgba(217, 38, 56, 0.5);
  outline-offset: 3px;
}

.btn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
  filter: grayscale(0.12);
}

.btn-primario {
  flex: 1 1 260px;
  padding: 15px 26px;
  font-size: 1rem;
  border-radius: 17px;
  background:
    linear-gradient(
      135deg,
      rgba(220, 38, 38, 0.66) 0%,
      rgba(145, 14, 35, 0.7) 100%
    );
  box-shadow:
    0 14px 36px rgba(160, 16, 38, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.46),
    inset 0 -1px 0 rgba(90, 0, 12, 0.14);
}

.btn-primario:hover:not(:disabled) {
  box-shadow:
    0 20px 46px rgba(160, 16, 38, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.56),
    inset 0 -1px 0 rgba(90, 0, 12, 0.12);
}

.btn-secundario {
  background:
    linear-gradient(
      135deg,
      rgba(220, 38, 38, 0.42) 0%,
      rgba(160, 20, 43, 0.5) 100%
    );
  color: #ffffff;
}

/* Botón Limpiar con acabado Liquid Glass neutro. */
.btn-limpiar {
  flex: 0 0 auto;
  padding: 15px 26px;
  font-size: 1rem;
  border-radius: 17px;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.24) 0%,
      rgba(255, 255, 255, 0.08) 48%,
      rgba(255, 255, 255, 0.14) 100%
    );
  box-shadow:
    0 14px 34px rgba(4, 6, 10, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(20px) saturate(135%);
  -webkit-backdrop-filter: blur(20px) saturate(135%);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

.btn-limpiar:hover:not(:disabled) {
  filter: brightness(1.1) saturate(1.05);
  box-shadow:
    0 18px 42px rgba(4, 6, 10, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}

.btn-limpiar:active:not(:disabled) {
  box-shadow:
    0 8px 20px rgba(4, 6, 10, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

.btn-firma {
  align-self: flex-end;
  padding: 7px 16px;
  font-size: 0.78rem;
  font-weight: 800;
  border-radius: 10px;
  background:
    linear-gradient(
      135deg,
      rgba(220, 38, 38, 0.5) 0%,
      rgba(150, 16, 38, 0.56) 100%
    );
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow:
    0 4px 14px rgba(160, 16, 38, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

/* ---------------- Pie ---------------- */

.pie {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  font-size: 0.78rem;
  color: #525863;
}

/* ---------------- Barra de desplazamiento ---------------- */

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(24, 8, 12, 0.18);
}

::-webkit-scrollbar-thumb {
  background: rgba(217, 38, 56, 0.48);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(217, 38, 56, 0.66);
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* ---------------- Rendimiento en móvil ---------------- */

@media (max-width: 768px) {
  /* El video de fondo consume batería y GPU: se oculta y se pausa desde JS. */
  #videoFondo {
    display: none !important;
  }

  /* Los desenfoques grandes sobre contenedores anchos son costosos. */
  .contenedor,
  .cabecera,
  .seccion,
  .estado,
  .btn,
  .placa-sugerencias,
  .bloque-firma,
  .equipo-info {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body {
    background-attachment: scroll;
  }
}

/* ---------------- Responsive ---------------- */

@media (max-width: 640px) {
  body {
    background-attachment: scroll;
  }

  .contenedor {
    width: calc(100% - 16px);
    margin: 8px auto 20px;
    padding: 10px;
    border-radius: 20px;
  }

  .cabecera {
    padding: 14px 10px 16px;
    margin-bottom: 10px;
    border-radius: 18px;
  }

  .cabecera-superior {
    flex-direction: row;
    gap: 10px;
    margin-bottom: 6px;
  }

  .cabecera-texto {
    align-items: flex-start;
    text-align: left;
  }

  .logo-app {
    height: 38px;
  }

  .marca {
    font-size: 1.1rem;
    letter-spacing: 0.16em;
  }

  .marca-sub {
    font-size: 0.68rem;
    letter-spacing: 0.1em;
  }

  .titulo {
    font-size: 1.4rem;
  }

  .subtitulo {
    margin-top: 6px;
    font-size: 0.86rem;
    line-height: 1.45;
  }

  .acciones-superiores {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 14px;
  }

  .acciones-superiores .btn {
    width: 100%;
    padding: 11px 16px;
  }

  .sesion-usuario {
    justify-content: center;
    width: 100%;
    padding: 6px 10px;
  }

  .sesion-nombre {
    max-width: 100%;
  }

  .estado {
    width: 100%;
    justify-content: center;
    padding: 6px 10px;
    font-size: 0.78rem;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .estado-inventario {
    width: 100%;
    margin-top: 8px;
  }

  .seccion {
    padding: 14px 12px;
    margin-bottom: 10px;
    border-radius: 16px;
  }

  .seccion-titulo {
    margin-bottom: 12px;
    font-size: 0.9rem;
  }

  .grid-campos,
  .grid-fotos,
  .grid-firmas {
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .grid-checks {
    grid-template-columns: 1fr 1fr;
    gap: 6px 8px;
  }

  .check {
    min-width: 0;
    padding: 8px;
    font-size: 0.85rem;
    overflow-wrap: anywhere;
  }

  .check input {
    width: 18px;
    height: 18px;
  }

  input[type="text"],
  input[type="number"],
  select,
  textarea {
    min-height: 46px;
    padding: 11px 12px;
    font-size: 16px;
  }

  select {
    padding-right: 36px;
  }

  textarea {
    min-height: 96px;
  }

  .ayuda {
    font-size: 0.72rem;
  }

  .equipo-info {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
  }

  .grupo-radio {
    gap: 8px 12px;
    margin-top: 12px;
    padding-top: 10px;
  }

  .grupo-etiqueta {
    flex: 1 1 100%;
  }

  .radio {
    flex: 1 1 0;
    justify-content: center;
    padding: 8px 12px;
  }

  .placa-sugerencias {
    min-width: 0;
    width: 100%;
    max-height: 240px;
  }

  .bloque-firma {
    padding: 12px;
  }

  .canvas-firma {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1000 / 420;
    touch-action: none;
  }

  .pie-formulario {
    gap: 10px;
    margin-top: 14px;
  }

  .btn-primario,
  .btn-limpiar {
    width: 100%;
    flex: 1 1 100%;
  }

  .pie {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-top: 18px;
    font-size: 0.72rem;
  }
}

@media (max-width: 380px) {
  .contenedor {
    width: calc(100% - 16px);
  }

  .grid-checks {
    grid-template-columns: 1fr 1fr;
    gap: 4px 6px;
  }

  .check {
    padding: 7px 6px;
    font-size: 0.8rem;
  }
}

/* ---------------- Accesibilidad / fallbacks ---------------- */

/* Si el navegador no soporta desenfoque, se refuerza el blanco. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .contenedor {
    background: rgba(255, 255, 255, 0.9);
  }

  .cabecera,
  .seccion {
    background: rgba(255, 255, 255, 0.82);
  }

  .estado,
  .radio,
  input[type="text"],
  input[type="number"],
  textarea {
    background: rgba(255, 255, 255, 0.92);
  }
}

/* Respeta la preferencia de menos transparencia. */
@media (prefers-reduced-transparency: reduce) {
  .contenedor {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .cabecera,
  .seccion {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  input[type="text"],
  input[type="number"],
  textarea,
  .radio,
  .estado {
    background: rgba(255, 255, 255, 0.96);
  }
}

/* Respeta la preferencia de menos movimiento. */
@media (prefers-reduced-motion: reduce) {
  .video-fondo {
    display: none;
  }

  body {
    background-image: url(../images/fondo-poster.jpg);
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ============================================================
   SUPABASE EDITION · Login, pestañas, inventario y modales
   Mantiene la estética Liquid Glass y la responsividad PWA.
   ============================================================ */

/* ---------------- Inicio de sesión ---------------- */
.pantalla-login {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.08) 0%, transparent 60%),
    rgba(12, 14, 18, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.pantalla-login[hidden],
#appContent[hidden],
.panel[hidden],
.modal[hidden] {
  display: none !important;
}

.login-tarjeta {
  width: min(420px, 100%);
  padding: 28px;
  border-radius: 26px;
  border: 1px solid var(--cristal-borde);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.66));
  box-shadow: var(--sombra-cristal);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  text-align: center;
  overflow-y: auto;
  max-height: 94dvh;
}

.login-logo {
  width: 92px;
  height: auto;
  display: block;
  margin: 0 auto 6px;
}

.login-marca {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.32em;
  color: var(--rojo-oscuro);
}

.login-tarjeta h2 {
  margin: 12px 0 2px;
  font-size: 1.35rem;
}

.login-sub {
  margin: 0 0 18px;
  font-size: 0.8rem;
  color: var(--texto-suave);
}

.login-tarjeta label {
  display: block;
  margin: 12px 0 5px;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--texto-medio);
}

.login-tarjeta input {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  font-size: 16px;
  font-family: inherit;
  color: var(--texto);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--cristal-borde);
  border-radius: var(--radio-campo);
  outline: none;
}

.login-tarjeta input:focus {
  border-color: var(--rojo-borde);
  box-shadow: 0 0 0 3px var(--rojo-suave);
}

.login-boton {
  width: 100%;
  margin-top: 18px;
}

.login-error {
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.8rem;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  text-align: left;
}

.login-nota {
  display: block;
  margin-top: 14px;
  font-size: 0.7rem;
  color: var(--texto-suave);
}

.sesion-rol {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rojo-oscuro);
}

button.sesion-salir {
  cursor: pointer;
  font-family: inherit;
}

/* ---------------- Pestañas ---------------- */
.tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--cristal-borde);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow-x: auto;
}

.tab {
  flex: 1 0 auto;
  min-height: 42px;
  padding: 9px 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--texto-medio);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.tab.activa {
  color: #fff;
  background: linear-gradient(135deg, var(--rojo), var(--rojo-oscuro));
  box-shadow: 0 6px 16px rgba(152, 17, 39, 0.28);
}

.panel {
  animation: aparecerSugerencias 0.18s ease-out;
}

/* ---------------- Inventario ---------------- */
.metricas {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metrica {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 8px;
  border-radius: 18px;
  border: 1px solid var(--cristal-borde);
  background: rgba(255, 255, 255, 0.6);
  box-shadow: var(--sombra-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.metrica-valor {
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--rojo-oscuro);
}

.metrica-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--texto-suave);
  text-align: center;
}

.metrica-disponible .metrica-valor { color: #15803d; }
.metrica-asignado .metrica-valor { color: #1d4ed8; }
.metrica-mantenimiento .metrica-valor { color: #b45309; }

.barra-inventario {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.campo-busqueda {
  flex: 2 1 260px;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--texto);
  border: 1px solid var(--cristal-borde);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  outline: none;
}

.barra-inventario select {
  flex: 1 1 160px;
}

.acciones-inventario {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.mensaje-panel {
  min-height: 1.1em;
  margin: 6px 0;
  font-size: 0.8rem;
  color: var(--texto-suave);
}

.mensaje-panel.ok { color: #15803d; font-weight: 600; }
.mensaje-panel.error { color: #b91c1c; font-weight: 600; }

.tabla-contenedor {
  width: 100%;
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--cristal-borde);
  background: rgba(255, 255, 255, 0.62);
}

.tabla-datos {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.79rem;
  min-width: 720px;
}

.tabla-datos th,
.tabla-datos td {
  padding: 9px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(120, 120, 130, 0.12);
  vertical-align: middle;
}

.tabla-datos th {
  background: rgba(152, 17, 39, 0.07);
  color: var(--rojo-oscuro);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.tabla-datos tbody tr:hover { background: rgba(255, 255, 255, 0.5); }

.tabla-vacia {
  padding: 20px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--texto-suave);
}

.chip {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  background: rgba(90, 96, 108, 0.12);
}

.chip.estado-Disponible { background: rgba(21, 128, 61, 0.14); color: #15803d; }
.chip.estado-Asignado { background: rgba(29, 78, 216, 0.14); color: #1d4ed8; }
.chip.estado-En-Mantenimiento { background: rgba(180, 83, 9, 0.14); color: #b45309; }
.chip.estado-Prestamo { background: rgba(124, 58, 237, 0.14); color: #6d28d9; }
.chip.estado-Dado-de-Baja { background: rgba(120, 120, 130, 0.18); color: #4b5563; }

.celda-acciones { white-space: nowrap; }

.btn-tabla {
  padding: 5px 9px;
  margin-right: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--rojo-oscuro);
  background: rgba(217, 38, 56, 0.09);
  border: 1px solid rgba(217, 38, 56, 0.22);
  border-radius: 9px;
  cursor: pointer;
}

.btn-tabla:hover { color: #fff; background: var(--rojo); }

.lista-actas { margin: 6px 0 14px; padding-left: 18px; font-size: 0.82rem; }
.lista-actas li { margin-bottom: 6px; }

/* ---------------- Modales ---------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(12, 14, 18, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-tarjeta {
  width: min(560px, 100%);
  max-height: 90dvh;
  overflow-y: auto;
  border-radius: 24px;
  border: 1px solid var(--cristal-borde);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.82));
  box-shadow: var(--sombra-cristal);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}

.modal-ancha { width: min(900px, 100%); }

.modal-cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(120, 120, 130, 0.14);
}

.modal-cabecera h2 { font-size: 1.1rem; color: var(--rojo-oscuro); }

.modal-cerrar {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--texto-medio);
  background: rgba(120, 120, 130, 0.12);
  cursor: pointer;
}

.modal-formulario {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 18px 20px;
}

.modal-formulario label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--texto-medio);
}

.modal-formulario input,
.modal-formulario select,
.modal-formulario textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  font: inherit;
  font-size: 15px;
  color: var(--texto);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--cristal-borde);
  border-radius: 11px;
  outline: none;
}

.modal-ancho { grid-column: 1 / -1; }
.modal-pie {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.modal-contenido { padding: 16px 20px 22px; }
.modal-contenido h3 { color: var(--rojo-oscuro); font-size: 1rem; }
.modal-contenido h4 { margin: 14px 0 6px; font-size: 0.85rem; }

/* ---------------- Responsivo ---------------- */
@media (max-width: 720px) {
  .metricas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tab { flex: 1 0 auto; font-size: 0.76rem; padding: 8px 10px; }
  .modal-formulario { grid-template-columns: 1fr; }
  .sesion-nombre { max-width: 46vw; }
}

@media (max-width: 420px) {
  .metricas { gap: 6px; }
  .metrica { padding: 10px 4px; }
  .metrica-valor { font-size: 1.25rem; }
  .campo-busqueda, .barra-inventario select { flex: 1 1 100%; }
  .acciones-inventario .btn { flex: 1 1 100%; }
}
