/* ============================================================================
   AVI DISPATCH — REDISEÑO VISUAL APROBADO (previo ui_preview/ v3, el owner).
   SOLO tratamiento visual: colores/bordes/sombras/blur/radios/foco.
   PROHIBIDO aquí: display/grid/flex/width/order — la retícula, agrupación y
   densidad de los formularios actuales NO se tocan (regla absoluta del owner).
   Se carga DESPUÉS de app.css y theme-dark.css (gana en cascada).
   Azul real de la app; el verde existente queda solo para éxito/acción positiva.
   ============================================================================ */

/* ── 1 · Tarjetas y paneles: azul por capas con glass SUTIL ─────────────── */
body.tdk .card,
body.tdk .act,
body.tdk .admin-card,
body.tdk .fp-card,
body.tdk details.nb-adm .nb-adm-panel {
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.015) 46%), rgba(16,41,74,.55);
  -webkit-backdrop-filter: blur(9px) saturate(1.05);
  backdrop-filter: blur(9px) saturate(1.05);
  border: 1px solid rgba(159,182,212,.26);
  border-top-color: rgba(255,255,255,.14);
  box-shadow: 0 1px 2px rgba(4,12,24,.35), 0 8px 22px rgba(4,12,24,.22);
}
body.tdk .card { border-radius: 16px; }
body.tdk .act:hover { background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03) 46%), rgba(16,41,74,.62); border-color: rgba(127,176,255,.55); }

/* ── 2 · Casillas: claras como hoy, con acabado pulido y foco visible ───── */
body.tdk input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]),
body.tdk select, body.tdk textarea {
  background: linear-gradient(180deg, rgba(255,255,255,1), rgba(244,248,253,.96));
  box-shadow: inset 0 1px 2px rgba(11,34,64,.14);
}
body.tdk input:focus, body.tdk select:focus, body.tdk textarea:focus {
  outline: 3px solid #4da3ff;
  outline-offset: 0;
}
:focus-visible { outline-color: #4da3ff; }

/* ── 3 · Botones: radio consistente + brillo sutil; el submit sigue VERDE
        (semántica de acción positiva ya existente — no se cambia) ────────── */
body.tdk button, body.tdk .btn { border-radius: 12px; }
body.tdk button[type="submit"], body.tdk input[type="submit"] {
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,0) 45%),
              linear-gradient(160deg, #2fae6e, #22995d);
  box-shadow: 0 2px 10px rgba(4,12,24,.28);
}
body.tdk button[type="submit"]:hover, body.tdk input[type="submit"]:hover {
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,0) 45%),
              linear-gradient(160deg, #35bd79, #27a566);
}

/* ── 4 · Navegación: navy con glass; selección = cápsula azul clara ─────── */
@media (max-width: 768px), (min-width: 769px) and (max-width: 1024px) {
  body.tdk .tbar {
    background: rgba(11,34,64,.90);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: 0 8px 26px rgba(4,12,24,.5);
  }
  body.tdk .titem { border-radius: 14px; }
  body.tdk .titem.on {
    color: #fff;
    background: rgba(77,163,255,.22);
    box-shadow: inset 0 0 0 1px rgba(77,163,255,.45);
  }
}
body.tdk .appnav .nl:hover { background: rgba(77,163,255,.14); border-radius: 10px; }
body.tdk .appnav .nb-adm-panel {
  border-radius: 14px;
}

/* ── 5 · Tablas y acordeones: filo suave ────────────────────────────────── */
body.tdk details { border-radius: 14px; }
body.tdk tr:hover td { background: rgba(77,163,255,.06); }

/* ── 6 · BÚSQUEDA GLOBAL del Home (elemento nuevo aprobado) ─────────────── */
.gs {
  display: flex; align-items: center; gap: 10px;
  margin: 12px 0 4px;
  padding: 5px 8px 5px 16px; min-height: 50px;
  background: linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,.06));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(191,224,255,.35);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(4,12,24,.35), 0 8px 22px rgba(4,12,24,.22);
}
.gs:focus-within { border-color: #4da3ff; outline: 2px solid #4da3ff; }
.gs .gs-ic { width: 20px; height: 20px; flex: none; fill: none; stroke: #bfe0ff; stroke-width: 1.8; stroke-linecap: round; }
.gs input[type="search"] {
  flex: 1; min-width: 0; min-height: 40px;
  background: transparent !important; border: 0 !important; box-shadow: none !important;
  color: #fff !important; font-weight: 600; font-size: 1rem; padding: 6px 4px;
}
.gs input[type="search"]::placeholder { color: #9fb6d4; font-weight: 500; }
.gs input[type="search"]:focus { outline: none !important; }
.gs-panel {
  margin: 8px 0 2px; padding: 6px 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015) 46%), rgba(11,34,64,.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(159,182,212,.28); border-top-color: rgba(255,255,255,.14);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(4,12,24,.45);
}
.gs-panel .gs-g { font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #9fb6d4; margin: 8px 4px 2px; }
.gs-panel a.gs-r {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 6px; min-height: 46px;
  color: #dbe9fa; text-decoration: none; border-radius: 10px;
  border-bottom: 1px solid rgba(159,182,212,.16);
}
.gs-panel a.gs-r:last-child { border-bottom: 0; }
.gs-panel a.gs-r:hover, .gs-panel a.gs-r:focus-visible { background: rgba(77,163,255,.14); }
.gs-panel .gs-t { font-weight: 700; color: #fff; }
.gs-panel .gs-s { font-size: .8rem; color: #9fb6d4; }
.gs-panel .gs-none { padding: 10px 6px; color: #9fb6d4; font-size: .86rem; }

/* ── 7 · Login / 2FA / restablecer contraseña: SIN cambios aquí a propósito.
   Esas pantallas ya traen el vestido navy aprobado en app.css («Navy Bold»,
   tarjeta blanca única) y login_2fa es CSS inline por regla propia (secreto
   2FA). Re-estilizarlas duplicaba la tarjeta y lavaba las etiquetas. */

/* ── 8 · Accesibilidad: sin animaciones para quien las reduce ───────────── */
@media (prefers-reduced-motion: reduce) {
  body.tdk *, body.tdk *::before, body.tdk *::after { transition: none !important; animation: none !important; }
}
