:root {
  --azul: #0b4f9e;
  --azul-oscuro: #0a3d7a;
  --azul-claro: #e8f0fb;
  --amarillo: #fbc700;
  --rojo: #ce1126;
  --texto: #1a1a1a;
  --gris: #555555;
  --gris-claro: #f4f6f9;
  --borde: #dce3ec;
  --sombra: 0 2px 8px rgba(11, 79, 158, 0.08);
  --sombra-hover: 0 8px 24px rgba(11, 79, 158, 0.16);
  --verde: #1b7a37;
  --naranja: #c2620b;
  --rojo-alt: #b3261e;
}

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

html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }


body {
  font-family: 'Work Sans', 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #ffffff;
  color: var(--texto);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--azul); text-decoration: none; }
a:hover { text-decoration: underline; }

main { flex: 1; animation: pageEnter 0.2s ease-out; }

@keyframes pageEnter {
  from { opacity: 0; }
  to { opacity: 1; }
}

body.page-leave main {
  opacity: 0;
  transition: opacity 0.12s ease;
}

@media (prefers-reduced-motion: reduce) {
  main { animation: none; }
  body.page-leave main { transition: none; }
}

.tricolor {
  display: flex;
  height: 8px;
}
.tricolor .amarillo { flex: 1; background: var(--amarillo); }
.tricolor .azul { flex: 1; background: var(--azul); }
.tricolor .rojo { flex: 1; background: var(--rojo); }

.top-bar {
  background: #f0f3f8;
  font-size: 0.78rem;
  color: var(--gris);
  border-bottom: 1px solid var(--borde);
}
.top-bar .inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6px 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.top-bar a { color: var(--gris); }

.site-header {
  background: #ffffff;
  border-bottom: 2px solid var(--azul);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {

  height: 52px;
  object-fit: contain;
  flex: 0 0 92px;
}
.brand-text .line1 {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--azul);
  line-height: 1.1;
}
.brand-text .line2 {
  font-size: 0.72rem;
  color: var(--gris);
  letter-spacing: 0.3px;
}

.nav-hamburger {
  display: none;
  background: none;
  border: 1px solid var(--borde);
  border-radius: 6px;
  padding: 6px 10px;
  min-width: 44px;
  min-height: 44px;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--azul);
}
.main-nav { margin-left: auto; }
.nav-list {
  list-style: none;
  display: flex;
  gap: 2px;
}
.nav-item { position: relative; }
.nav-link {
  display: block;
  padding: 10px 14px;
  color: var(--texto);
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 6px;
}
.nav-link:hover { background: var(--azul-claro); color: var(--azul); text-decoration: none; }
.nav-item.has-children > .nav-link::after {
  content: '▾';
  font-size: 0.7rem;
  margin-left: 5px;
}
.nav-item:hover .submenu { display: block; }
.submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid var(--borde);
  border-top: 3px solid var(--azul);
  border-radius: 0 0 6px 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 220px;
  padding: 6px 0;
  z-index: 90;
}
.submenu a {
  display: block;
  padding: 9px 16px;
  color: var(--texto);
  font-size: 0.88rem;
}
.submenu a:hover { background: var(--azul-claro); color: var(--azul); text-decoration: none; }

.hero {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  background: var(--azul);
  color: #fff;
  overflow: hidden;
}
.carousel {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  height: 460px;
  opacity: 0;
  transition: opacity 0.25s ease;
  background: #dfe7f1;
}
.carousel.is-ready { opacity: 1; }
.carousel-track {
  display: flex;
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  transition: transform 0.6s ease;
}
.carousel-slide {
  min-width: 100%;
  width: 100%;
  height: 100%;
  position: relative;
  margin: 0;
  padding: 0;
  border-radius: 0;
  overflow: hidden;
}
.carousel-slide:has(.carousel-image-only) {
  display: block;
  padding: 0;
  background: #fff;
}
.carousel-image-only {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  object-fit: cover;
  object-position: center;
  background: #fff;
}
.carousel-bg-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.35;
}
.carousel-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 60px;
}
.carousel-badge {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
  align-self: flex-start;
}
.carousel-title {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 14px;
  max-width: 700px;
  line-height: 1.15;
}
.carousel-subtitle {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.9);
  max-width: 640px;
  margin-bottom: 26px;
}
.carousel-btn {
  align-self: flex-start;
  background: #fff;
  color: var(--azul);
  font-weight: 700;
  padding: 13px 28px;
  border-radius: 6px;
  border: none;
  font-size: 0.98rem;
  cursor: pointer;
}
.carousel-btn:hover { background: var(--azul-claro); text-decoration: none; }
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(0,0,0,0.3);
  color: #fff;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel-arrow:hover { background: rgba(0,0,0,0.55); }
.carousel-arrow.prev { left: 14px; }
.carousel-arrow.next { right: 14px; }
.carousel-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  gap: 8px;
}
.carousel-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
  border: none;
  cursor: pointer;
  transition: background 0.3s;
}
.carousel-dot.active { background: #fff; }

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 16px;
  width: 100%;
}

.page h1 {
  font-size: 1.9rem;
  color: var(--azul);
  margin-bottom: 8px;
}
.page .lead {
  color: var(--gris);
  margin-bottom: 28px;
  max-width: 700px;
}

.tramites-page { padding-top: 24px; }
.tramites-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  max-width: 1080px;
  margin: 0 auto;
  align-items: stretch;
}
.tramite-card {
  border: 1px solid #d7e0ec;
  border-radius: 10px;
  padding: 24px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
}
.tramite-card:hover {
  box-shadow: var(--sombra-hover);
  transform: translateY(-4px);
}
.tramite-card .icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--azul-claro);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--azul);
  margin-bottom: 16px;
}
.tramite-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--azul-oscuro);
  margin-bottom: 8px;
  line-height: 1.3;
}
.tramite-card p {
  color: #52667e;
  font-size: 0.9rem;
  line-height: 1.55;
  flex: 1;
  margin-bottom: 16px;
}
.tramite-card a.card-link {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--azul);
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #eef2f7;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tramite-card a.card-link span { transition: transform 0.2s ease; }
.tramite-card a.card-link:hover { color: var(--azul-oscuro); text-decoration: none; }
.tramite-card a.card-link:hover span { transform: translateX(3px); }

.ayuda-franja {
  max-width: 1080px;
  margin: 28px auto 0;
  background: #eef3fa;
  border: 1px solid #d7e0ec;
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.ayuda-icon {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #d7e0ec;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--azul);
}
.ayuda-texto { flex: 1; min-width: 0; }
.ayuda-texto h3 {
  font-size: 1.05rem;
  color: var(--azul-oscuro);
  margin-bottom: 4px;
}
.ayuda-texto p {
  font-size: 0.9rem;
  color: #52667e;
}
.ayuda-btn {
  flex: 0 0 auto;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--azul);
  background: #fff;
  border: 1px solid var(--azul);
  border-radius: 8px;
  padding: 10px 22px;
  transition: background 0.2s ease;
}
.ayuda-btn:hover { background: var(--azul-claro); text-decoration: none; }

.direccion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 260px));
  justify-content: center;
  gap: 22px;
  max-width: 1080px;
  margin: 0 auto;
  align-items: stretch;
}
.funcionario-card {
  background: #fff;
  border: 1px solid #d7e0ec;
  border-radius: 10px;
  padding: 26px 20px 22px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.funcionario-card:hover {
  box-shadow: var(--sombra-hover);
  transform: translateY(-4px);
}
.funcionario-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--azul-claro);
  border: 2px solid #d7e0ec;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--azul);
  margin-bottom: 14px;
}
.funcionario-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tramites-entidad-link {
  text-align: center;
  font-size: 0.88rem;
  color: var(--gris);
  margin-top: 22px;
}
.tramites-entidad-link a { font-weight: 700; white-space: nowrap; }
.tramites-entidad-link a span { transition: transform 0.2s ease; display: inline-block; }
.tramites-entidad-link a:hover { text-decoration: none; }
.tramites-entidad-link a:hover span { transform: translateX(3px); }

.breadcrumb {
  font-size: 0.82rem;
  color: var(--gris);
  margin-bottom: 10px;
}
.breadcrumb a { color: var(--azul); }
.breadcrumb span { margin: 0 6px; color: #9db1c7; }
.breadcrumb strong { color: var(--texto); font-weight: 600; }
.directorio-intro { margin-bottom: 8px; }
.directorio-intro p {
  font-size: 0.92rem;
  color: #3d4f66;
  line-height: 1.65;
  margin-bottom: 12px;
}
.directorio-intro p:last-child { margin-bottom: 0; }
.directorio-funciones { margin-top: 28px; }
.directorio-funciones ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.directorio-funciones li {
  font-size: 0.9rem;
  color: #3d4f66;
  padding-left: 26px;
  position: relative;
  line-height: 1.55;
}
.directorio-funciones li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--azul-claro);
  color: var(--azul);
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.funcionario-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--azul-oscuro);
  line-height: 1.3;
  margin-bottom: 4px;
}
.funcionario-cargo {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--azul);
}

.asistente {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  max-width: min(300px, calc(100vw - 40px));
}
.asistente-globo {
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(11, 79, 158, 0.16);
  padding: 14px 36px 14px 14px;
  position: relative;
  width: 100%;
}
.asistente-globo p {
  font-size: 0.88rem;
  color: var(--azul-oscuro);
  font-weight: 600;
  margin-bottom: 8px;
}
.asistente-links { display: flex; flex-direction: column; gap: 4px; }
.asistente-links a { font-size: 0.82rem; font-weight: 600; }
.asistente-cerrar {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--gris);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.asistente-cerrar:hover { background: var(--gris-claro); color: var(--texto); }
.asistente-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--azul);
  border: none;
  border-radius: 40px;
  padding: 6px 14px 6px 6px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(11, 79, 158, 0.3);
}
.asistente-btn:hover { background: var(--azul-oscuro); }
.asistente-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--azul);
  flex: 0 0 52px;
}
.asistente-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.asistente-nombre { color: #fff; font-size: 0.8rem; font-weight: 700; text-align: left; line-height: 1.25; }
.asistente-nombre small { display: block; font-weight: 400; opacity: 0.85; }
.asistente[data-cerrado="1"] .asistente-globo { display: none; }

.section {
  padding: 40px 0;
}
.section-title { max-width: 720px; margin: 0 auto 34px; }
.section-title h2 {
  font-size: 1.6rem;
  color: var(--azul);
  text-align: center;
  margin-bottom: 6px;
}
.section-title p {
  text-align: center;
  color: var(--gris);
  margin-bottom: 0;
}
.section-title .bar {
  width: 60px;
  height: 4px;
  background: var(--azul);
  margin: 12px auto;
  border-radius: 2px;
}

.strip {
  background: var(--azul);
  color: #fff;
  padding: 30px 16px;
  text-align: center;
}
.strip h2 { font-size: 1.5rem; margin-bottom: 6px; }
.strip p { color: rgba(255,255,255,0.85); margin-bottom: 14px; }
.strip .btn-white {
  background: #fff;
  color: var(--azul);
  padding: 12px 28px;
  border-radius: 6px;
  font-weight: 700;
  display: inline-block;
}
.strip .btn-white:hover { background: var(--azul-claro); text-decoration: none; }
.strip-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.strip .btn-outline-white {
  background: transparent;
  color: #fff;
  padding: 12px 28px;
  border-radius: 6px;
  font-weight: 700;
  display: inline-block;
  border: 2px solid rgba(255,255,255,0.7);
}
.strip .btn-outline-white:hover { background: rgba(255,255,255,0.15); color: #fff; text-decoration: none; border-color: #fff; }

.site-footer {
  background: #0d2c4d;
  color: #d5e2f0;
  margin-top: auto;
}
.footer-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 26px 16px 14px;
  text-align: center;
}
.footer-brand {
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 10px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 10px;
  font-size: 0.85rem;
}
.footer-links a { color: #c2d2e5; }
.footer-links a:hover { color: #fff; }
.footer-links span { color: #5f7a96; }
.footer-legal {
  padding: 12px 16px 16px;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.1);
  max-width: 1200px;
  margin: 12px auto 0;
}
.footer-legal-main {
  margin: 0 16px 4px;
  font-size: 12px;
  line-height: 1.5;
  color: #8b9cb3;
}
.footer-legal-sub {
  margin: 0 16px;
  font-size: 11px;
  line-height: 1.5;
  color: #8b9cb3;
  opacity: 0.7;
}

.form-consulta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 24px;
}
input, select, textarea {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 12px 14px;
  border: 1px solid var(--borde);
  border-radius: 8px;
  width: 100%;
  background: #fff;
  color: var(--texto);
}
input[type="radio"],
input[type="checkbox"] {
  width: auto;
  min-width: 0;
  padding: 0;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--azul);
  cursor: pointer;
}
.form-group { margin-bottom: 16px; }
.radio-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.radio-option {
  flex: 1 1 0;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--borde);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.3;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.radio-option:hover { border-color: var(--azul); }
.radio-option:has(input:checked) {
  border-color: var(--azul);
  background: var(--azul-claro);
  box-shadow: 0 0 0 3px rgba(11,79,158,0.12);
  font-weight: 600;
  color: var(--azul-oscuro);
}
.radio-option input { width: 18px; height: 18px; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--azul);
  box-shadow: 0 0 0 3px rgba(11,79,158,0.12);
}
label.field-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--texto);
  margin-bottom: 6px;
  display: block;
}

.btn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s, opacity 0.2s;
}
.btn-primary { background: var(--azul); color: #fff; }
.btn-primary:hover { background: var(--azul-oscuro); }
.btn-secondary { background: var(--azul-claro); color: var(--azul); }
.btn-secondary:hover { background: #d4e4f7; }
.btn-outline { background: #fff; color: var(--azul); border: 1px solid var(--azul); }
.btn-outline:hover { background: var(--azul-claro); }
.btn-danger { background: var(--rojo-alt); color: #fff; }
.btn-danger:hover { background: #8f1d16; }
.btn-success { background: var(--verde); color: #fff; }
.btn-success:hover { background: #135d2a; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-sm { padding: 8px 14px; font-size: 0.82rem; }
.text-muted { color: var(--gris); font-size: 0.85rem; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: girar 0.7s linear infinite;
  display: inline-block;
}
@keyframes girar { to { transform: rotate(360deg); } }

.alert {
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 18px;
  border: 1px solid;
  font-size: 0.92rem;
}
.alert-error { background: #fdecea; border-color: #f5c6c0; color: #8f1d16; }
.alert-success { background: #e8f6ec; border-color: #bfe3c8; color: #135d2a; }
.alert-info { background: #e8f0fb; border-color: #bcd3f2; color: var(--azul-oscuro); }
.alert-warning { background: #fdf3e2; border-color: #f2dfbc; color: #7a4a08; }

.panel {
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: 10px;
  padding: 24px;
  box-shadow: var(--sombra);
}
.panel h2 { color: var(--azul); font-size: 1.25rem; margin-bottom: 16px; }

.timeline { display: flex; flex-direction: column; gap: 0; margin-top: 20px; }
.timeline-item {
  display: flex;
  gap: 16px;
  position: relative;
  padding-bottom: 28px;
}
.timeline-item .timeline-dot {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border-radius: 50%;
  border: 3px solid var(--borde);
  background: #fff;
  margin-top: 4px;
  position: relative;
  z-index: 2;
}
.timeline-item.active .timeline-dot { border-color: var(--azul); background: var(--azul); }
.timeline-item.done .timeline-dot { background: var(--verde); border-color: var(--verde); }
.timeline-item.rejected .timeline-dot { background: var(--rojo-alt); border-color: var(--rojo-alt); }
.timeline-item .timeline-line {
  position: absolute;
  left: 8px;
  top: 22px;
  bottom: 0;
  width: 3px;
  background: var(--borde);
}
.timeline-item.done .timeline-line { background: var(--verde); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:last-child .timeline-line { display: none; }
.timeline-content h4 { font-size: 1rem; color: var(--texto); }
.timeline-content p { color: var(--gris); font-size: 0.88rem; }
.timeline-content .fecha { color: #888; font-size: 0.8rem; }

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.badge-pendiente { background: #fff3dc; color: #9a6b05; border: 1px solid #f2dfbc; }
.badge-aprobada { background: #e8f6ec; color: #135d2a; border: 1px solid #bfe3c8; }
.badge-rechazada { background: #fdecea; color: #8f1d16; border: 1px solid #f5c6c0; }
.badge-super_admin { background: #f3e4fd; color: #6a1b9a; border: 1px solid #e1bcf2; }
.badge-auditor { background: #e8f0fb; color: var(--azul); border: 1px solid #bcd3f2; }
.badge-funcionario { background: #e9f4ee; color: #1b7a37; border: 1px solid #c1e0cb; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.data-table th {
  background: var(--azul-claro);
  color: var(--azul-oscuro);
  text-align: left;
  padding: 12px 14px;
  font-weight: 700;
  white-space: nowrap;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--borde);
  vertical-align: middle;
}
.data-table tr:hover td { background: #fafcff; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13,44,77,0.5);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 12px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--borde);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-head h3 { color: var(--azul); font-size: 1.15rem; }
.modal-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--gris);
  cursor: pointer;
  line-height: 1;
}
.modal-body { padding: 22px; }

@media (max-width: 1024px) {
  .tramites-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .carousel { height: 400px; }
  .carousel-content { padding: 32px 40px; }
  .carousel-title { font-size: 2rem; }
  .carousel-subtitle { font-size: 1.02rem; }
  .nav-hamburger { display: none; }
  .main-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: min(270px, 84vw);
    height: 100vh;
    height: 100dvh;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    padding: 20px;
    transform: translateX(105%);
    visibility: hidden;
    transition: transform 250ms ease-out, visibility 250ms;
    z-index: 300;
  }
  .main-nav.open { transform: none; visibility: visible; }
  .nav-list { flex-direction: column; }
  .nav-item.has-children .submenu {
    position: static;
    display: block;
    box-shadow: none;
    border: none;
    border-left: 3px solid var(--azul);
    margin: 4px 0 4px 12px;
    min-width: 0;
  }
  .nav-item.has-children:hover .submenu { display: block; }
}

@media (max-width: 640px) {
  .hero { width: 100%; max-width: 100%; margin: 0; padding: 0; }
  .carousel { height: auto; min-height: 0; margin: 0; padding: 0; }
  .carousel-track { height: auto; align-items: flex-start; margin: 0; padding: 0; }
  .carousel-slide { height: auto; min-height: 0; margin: 0; padding: 0; }
  .carousel-slide:not(:has(.carousel-image-only)) { min-height: 280px; background: var(--azul); }
  .carousel-slide:has(.carousel-image-only) { min-height: 0; padding: 0; margin: 0; background: #fff; display: block; }
  .carousel-image-only {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 200px;
    max-height: 65vh;
    margin: 0;
    padding: 0;
    border: 0;
    object-fit: cover;
    object-position: center;
    background: #fff;
  }
  .carousel-dots { background: rgba(0,0,0,0.28); padding: 6px 10px; border-radius: 20px; bottom: 10px; }
  .carousel-dot { background: rgba(255,255,255,0.6); }
  .carousel-dot.active { background: #fff; }
  .carousel-content { padding: 30px 50px 52px; min-height: 280px; height: auto; }
  .carousel-title { font-size: 1.6rem; }
  .carousel-subtitle { font-size: 0.98rem; }
  .carousel-arrow { width: 44px; height: 44px; }
  .header-inner { flex-wrap: wrap; justify-content: space-between; gap: 12px; }
  .brand-logo { flex: 0 0 64px; height: 44px; }
  .brand-text .line1 { font-size: 1.02rem; }
  .brand-text .line2 { font-size: 0.66rem; }
  .form-consulta { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
  .carousel-btn { align-self: stretch; text-align: center; }

  body { overflow-x: hidden; overflow-x: clip; }
  img { max-width: 100%; height: auto; }
  .page { padding: 28px 14px; }
  .page h1 { font-size: 1.45rem; overflow-wrap: anywhere; }
  .page .lead { font-size: 0.92rem; margin-bottom: 20px; }
  .panel { padding: 18px 14px; }
  .panel h2 { font-size: 1.1rem; overflow-wrap: anywhere; }
  .section { padding: 28px 0; }
  .section-title h2 { font-size: 1.3rem; padding: 0 12px; }
  .section-title p { padding: 0 16px; margin-bottom: 24px; }
  .tramites-grid { grid-template-columns: 1fr; gap: 16px; }
  .direccion-grid { grid-template-columns: minmax(230px, 300px); gap: 16px; }
  .ayuda-franja { flex-direction: column; text-align: center; padding: 20px 16px; }
  .ayuda-texto h3 { font-size: 1rem; }
  .ayuda-btn { width: 100%; text-align: center; }
  .asistente { right: 12px; bottom: 12px; max-width: min(250px, calc(100vw - 24px)); }
  .asistente-avatar { width: 44px; height: 44px; flex-basis: 44px; }
  .asistente-nombre { font-size: 0.74rem; }
  .asistente-globo { padding: 12px 32px 12px 12px; }
  .asistente-globo p { font-size: 0.82rem; }
  .top-bar { font-size: 0.72rem; }
  .top-bar .inner { justify-content: center; text-align: center; }
  .strip { padding: 26px 16px; }
  .strip h2 { font-size: 1.2rem; }
  .strip .btn-white { display: block; margin: 4px auto 0; max-width: 320px; }
  .strip-actions { flex-direction: column; align-items: stretch; }
  .strip .btn-outline-white { display: block; margin: 0 auto; max-width: 320px; text-align: center; }
  .footer-main { padding: 22px 16px 12px; }

  .radio-row { flex-direction: column; gap: 8px !important; }
  .radio-option { min-width: 0; font-size: 0.9rem; }

  #resultado .panel h2,
  .timeline-content h4,
  .timeline-content p,
  .timeline-content .fecha { overflow-wrap: anywhere; word-break: break-word; }
  .timeline-item { gap: 12px; }

  #calendario-lista .panel { flex-direction: column !important; align-items: stretch !important; gap: 12px !important; }
  #calendario-lista .panel > div:first-child {
    border-right: none !important;
    border-bottom: 1px solid var(--borde);
    padding-right: 0 !important;
    padding-bottom: 10px;
    text-align: left !important;
    display: flex;
    align-items: baseline;
    gap: 8px;
  }
  #calendario-lista .panel > div:first-child > div:first-child { font-size: 1.5rem !important; }

  .confirm-box { padding: 28px 14px !important; }
  .confirm-code { font-size: 1.05rem !important; padding: 10px 14px !important; overflow-wrap: anywhere; word-break: break-all; max-width: 100%; }
  #resumen-contenido { overflow-x: auto; }
  .modal-body { padding: 18px 14px; }
}

@media (max-width: 400px) {
  .header-inner { padding: 10px 12px; gap: 10px; }
  .brand-logo { flex: 0 0 52px; height: 38px; }
  .brand-text .line1 { font-size: 0.92rem; }
  .brand-text .line2 { font-size: 0.6rem; }
  .page h1 { font-size: 1.3rem; }
  .carousel-content { padding: 24px 20px 60px; }
  .carousel-title { font-size: 1.35rem; }
  .carousel-arrow { width: 32px; height: 32px; font-size: 1.1rem; }
  .carousel-arrow.prev { left: 8px; }
  .carousel-arrow.next { right: 8px; }
  .strip h2 { font-size: 1.05rem; }
  .footer-links { font-size: 0.78rem; }
}
