/* ================= RESET ================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: system-ui, Arial, sans-serif;
  background: #0f172a;
  color: #0f172a;
}

/* ================= SCROLL ================= */
body {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 6px;
}
::-webkit-scrollbar-track {
  background: #e5e7eb;
}

/* ================= LAYOUT ================= */
.container {
  max-width: 1100px;
  margin: auto;
  padding: 16px;
}

/* ================= HEADER – REDISEÑADO ================= */
header {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #ffffff;
  padding: 30px 20px;
  border-radius: 16px;
  text-align: center;
  margin-bottom: 20px;
  font-size: 26px;
  font-weight: bold;
  letter-spacing: 1px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

/* ================= NAV – REDISEÑADO ================= */
nav {
  background: #ffffff;
  padding: 16px;
  border-radius: 16px;
  margin-bottom: 20px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

nav ul li a {
  padding: 10px 18px;
  border-radius: 12px;
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
  transition: 0.25s ease;
  display: inline-block;
}

/* ============================================================
   COLORES DIFERENTES PARA CADA ITEM DEL MENÚ
============================================================ */

/* DGAJ */
.item-dgaj {
  background: #3b82f6;
}
.item-dgaj:hover {
  background: #1d4ed8;
}

/* SECUESTROS JUDICIALES */
.item-secj {
  background: #10b981;
}
.item-secj:hover {
  background: #059669;
}

/* CUD */
.item-cud {
  background: #facc15;
  color: #1e293b !important;
}
.item-cud:hover {
  background: #eab308;
}

/* SGO Acompaña */
.item-sgo {
  background: #ec4899;
}
.item-sgo:hover {
  background: #db2777;
}

/* Reglamento */
.item-reglamento {
  background: #f97316;
}
.item-reglamento:hover {
  background: #ea580c;
}

/* Salir */
.item-salir {
  background: #dc2626;
}
.item-salir:hover {
  background: #b91c1c;
}

/* ================= SECTIONS ================= */
section {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* ================= HEADINGS ================= */
h2 {
  text-align: center;
  color: #2563eb;
  margin-bottom: 20px;
}

h3 {
  text-align: center;
  background: #f97316;
  color: #ffffff;
  padding: 12px;
  border-radius: 12px;
}

/* ================= FORMS ================= */
form {
  max-width: 420px;
  margin: auto;
}

label {
  font-size: 14px;
  color: #475569;
  font-weight: 600;
  margin-top: 12px;
  display: block;
}

input,
select,
textarea,
button {
  width: 100%;
  padding: 12px;
  margin-top: 6px;
  border-radius: 10px;
  border: 2px solid #e5e7eb;
  font-size: 15px;
  transition: all 0.25s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.25);
}

input:valid {
  border-color: #16a34a;
  background: #ecfdf5;
}

input:invalid {
  border-color: #dc2626;
  background: #fef2f2;
}

/* ================= BUTTONS ================= */
button,
input[type="submit"],
.boton-consulta {
  background: #2563eb;
  color: #ffffff;
  font-weight: bold;
  border: none;
  cursor: pointer;
  margin-top: 16px;
  border-radius: 10px;
}

button:hover,
input[type="submit"]:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
}

/* ================= TOAST / MENSAJES ================= */
.toast-success,
.toast-error {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 14px 22px;
  border-radius: 12px;
  color: #ffffff;
  font-weight: bold;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  z-index: 9999;
}

.toast-success { background: #16a34a; }
.toast-error { background: #dc2626; }

/* ================= TABLAS ================= */
#tabla-container {
  overflow-x: auto;
}

.tabla-resultados {
  border-collapse: collapse;
  min-width: 100%;
  font-size: 13px;
}

.tabla-resultados th {
  background: #2563eb;
  color: #ffffff;
  padding: 8px;
}

.tabla-resultados td {
  padding: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.tabla-resultados tr:hover {
  background: #eff6ff;
}

/* ================= TABLA MOBILE ================= */
@media (max-width: 600px) {
  .tabla-resultados,
  .tabla-resultados thead,
  .tabla-resultados tbody,
  .tabla-resultados th,
  .tabla-resultados td,
  .tabla-resultados tr {
    display: block;
  }

  .tabla-resultados thead {
    display: none;
  }

  .tabla-resultados td {
    padding-left: 50%;
    position: relative;
  }

  .tabla-resultados td::before {
    content: attr(data-label);
    position: absolute;
    left: 10px;
    font-weight: bold;
    color: #2563eb;
  }
}

/* ================= TITULO FLOTANTE ================= */
.titulo1 {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #2563eb;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: bold;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

/* ================= MOBILE – OPTIMIZADO ================= */
@media (max-width: 768px) {
  nav ul {
    flex-direction: column;
    align-items: stretch;
  }

  nav ul li a {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    text-align: center;
  }

  header {
    font-size: 22px;
  }
}

@media (max-width: 480px) {
  nav {
    padding: 10px;
  }

  nav ul {
    gap: 8px;
  }

  nav ul li a {
    padding: 12px;
    font-size: 14px;
  }

  header {
    font-size: 18px;
    padding: 22px 10px;
  }
}

/* ================= BOTÓN LINK ================= */
.btn-link {
  display: inline-block;
  padding: 10px 18px;
  background-color: #2563eb;
  color: #fff;
  font-weight: bold;
  border-radius: 6px;
  text-decoration: none;
  transition: 0.3s;
}

.btn-link:hover {
  background-color: #1d4ed8;
  transform: translateY(-2px);
}
/* ================= RESET ================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s, color 0.3s;
}

/* ================= PALETA INSTITUCIONAL ================= */
:root {
  --azul: #1e3a8a;
  --azul-claro: #3b82f6;
  --gris: #64748b;
  --gris-claro: #e2e8f0;
  --blanco: #ffffff;

  --bg: #f8fafc;
  --text: #1e293b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --text: #e2e8f0;
  }
}

/* ================= USER INFO ================= */
.user-info {
  display: flex;
  gap: 20px;
  padding: 12px;
  font-weight: bold;
  color: var(--azul);
}

.user-photo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid var(--azul);
  display: block;
  margin: 10px 0;
}

/* ================= MENÚ HAMBURGUESA ================= */
.menu-toggle {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--azul);
  border-radius: 6px;
  cursor: pointer;
  display: none;
  margin: 10px;
}

.menu-toggle span {
  display: block;
  width: 70%;
  height: 4px;
  background: white;
  margin: 6px auto;
  border-radius: 2px;
  transition: 0.3s;
}

/* ================= MENÚ PRINCIPAL ================= */
.menu-principal {
  list-style: none;
  padding: 0;
  margin: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.menu-principal li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--blanco);
  border-radius: 8px;
  color: var(--azul);
  font-weight: bold;
  text-decoration: none;
  border: 2px solid transparent;
  transition: 0.25s;
}

.menu-principal li a:hover {
  border-color: var(--azul);
  background: var(--gris-claro);
}

/* ================= ÍCONOS ================= */
.icon {
  font-style: normal;
  font-weight: bold;
}

/* Iconos institucionales */
.icon-dgaj::before { content: "⚖️"; }
.icon-secj::before { content: "🚓"; }
.icon-cud::before { content: "🏢"; }
.icon-sgo::before { content: "📌"; }
.icon-regl::before { content: "📘"; }
.icon-salir::before { content: "🚪"; }

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .menu-principal {
    flex-direction: column;
    display: none;
  }

  .menu-principal.open {
    display: flex;
  }
}

/* ================= ANIMACIÓN ================= */
.menu-principal li a {
  opacity: 0;
  transform: translateY(10px);
  animation: aparecer 0.4s forwards;
}

.menu-principal li:nth-child(1) a { animation-delay: .1s; }
.menu-principal li:nth-child(2) a { animation-delay: .2s; }
.menu-principal li:nth-child(3) a { animation-delay: .3s; }
.menu-principal li:nth-child(4) a { animation-delay: .4s; }
.menu-principal li:nth-child(5) a { animation-delay: .5s; }
.menu-principal li:nth-child(6) a { animation-delay: .6s; }

@keyframes aparecer {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* ===== Links existentes ===== */
.enlace {
    display: inline-block;
    padding: 10px 20px;
    font-size: 16px;
    background-color: #0056b3;
    color: #fff;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s ease;
    margin: 5px;
    border: 2px solid transparent;
}

.enlace:hover {
    color: #fff;
    background-color: #007bff;
    cursor: pointer;
    transform: scale(1.05);
    border-color: #fff;
}
