/* ==========================================================================
   AiWork · hoja de estilos única
   Paleta: azul marino del logo + blanco + gris frío. El azul marino se usa como único acento; los gráficos usan tonos del mismo azul para mantener la coherencia. Texto e interfaz con contraste AA.
   ========================================================================== */

/* 1. Variables y reset ---------------------------------------------------- */
:root {
  --navy: #0b1b33; --navy-hover: #17335a; --ink: #142033;
  --muted: #5b6b7f; --bg: #f5f7fa; --surface: #ffffff;
  --surface-2: #eef2f7; --border: #dde3ea; --border-strong: #c9d3de;
  --success: #1f6b45; --danger: #a12a2a; --warning: #8a5a12;
  --radius: 12px; --radius-sm: 8px; --shadow: 0 1px 2px rgba(11, 27, 51, 0.05);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0; min-height: 100vh; background: var(--bg);
  color: var(--ink); font-family: var(--font); font-size: 16px;
  line-height: 1.6; -webkit-font-smoothing: antialiased;
}
img {
  display: block; max-width: 100%;
}
a {
  color: var(--navy); text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}
h1 {
  font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 700; letter-spacing: -0.045em;
  line-height: 1.04;
}
h2 {
  font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 700; letter-spacing: -0.035em;
  line-height: 1.12;
}
h3 {
  font-size: 1.05rem; font-weight: 600; line-height: 1.3;
}
p {
  color: var(--muted);
}
:focus-visible {
  outline: 2px solid var(--navy); outline-offset: 2px;
}
.skip-link {
  position: absolute; top: -60px; left: 16px;
  z-index: 100; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--navy); color: #fff; font-size: 0.85rem;
  font-weight: 600;
}
.skip-link:focus {
  top: 16px;
}
.container {
  width: min(1120px, calc(100% - 40px)); margin-inline: auto;
}

/* 2. Botones, formularios y mensajes ------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; min-height: 42px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--radius-sm); font: inherit;
  font-size: 0.9rem; font-weight: 600; line-height: 1;
  text-align: center; cursor: pointer; transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.btn:hover {
  text-decoration: none; transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn-primary {
  background: var(--navy); color: #fff;
}
.btn-primary:hover {
  background: var(--navy-hover);
}
.btn-ghost {
  border-color: var(--border-strong); background: transparent; color: var(--navy);
}
.btn-ghost:hover {
  background: var(--surface-2);
}
.btn-danger {
  border-color: #e4baba; background: transparent; color: var(--danger);
}
.btn-danger:hover {
  background: #fbeeee;
}
.btn-lg {
  min-height: 48px; padding: 0 22px; font-size: 1rem;
}
.btn-block {
  width: 100%;
}
label {
  display: block; margin-bottom: 6px; color: var(--ink);
  font-size: 0.8rem; font-weight: 600;
}
input,
select,
textarea {
  width: 100%; min-height: 42px; padding: 9px 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--ink); font: inherit; font-size: 0.92rem;
}
input::placeholder {
  color: #6b7785;
}
input:focus, select:focus,
textarea:focus {
  outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(11, 27, 51, 0.12);
}
input[type="radio"],
input[type="checkbox"] {
  width: auto; min-height: 0; accent-color: var(--navy);
}
body.sidebar-open {
  overflow: hidden;
}
#contenido:focus {
  outline: none;
}
input[type="file"] {
  padding: 8px;
}
input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 8px 12px; border: 1px solid var(--border-strong);
  border-radius: 6px; background: var(--surface-2); color: var(--navy);
  font: inherit; font-size: 0.85rem; font-weight: 600;
  cursor: pointer;
}
#id_mode {
  display: flex; flex-wrap: wrap; gap: 16px;
  margin: 0; padding: 0; list-style: none;
}
#id_mode li {
  display: flex; align-items: center; gap: 6px;
}
#id_mode label {
  display: inline; margin: 0; font-weight: 500;
}
.form-group {
  margin-bottom: 16px;
}
.form-error {
  margin-bottom: 16px; padding: 10px 12px; border-left: 3px solid var(--danger);
  border-radius: 4px; background: #fdf1f1; color: var(--danger);
  font-size: 0.86rem;
}
.field-error {
  display: block; margin-top: 6px; color: var(--danger);
  font-size: 0.8rem;
}
.help-text {
  display: block; margin-top: 6px; color: var(--muted);
  font-size: 0.78rem;
}
.messages {
  position: fixed; right: 16px; bottom: 16px;
  z-index: 100; display: grid; gap: 8px;
  width: min(380px, calc(100% - 32px)); margin: 0; padding: 0;
  animation: rise 0.3s ease both;
}
.message {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--border); border-left: 3px solid var(--navy);
  border-radius: 6px; background: var(--surface); box-shadow: 0 8px 24px rgba(11, 27, 51, 0.12);
  color: var(--ink); font-size: 0.86rem;
}
.message-close {
  flex-shrink: 0; padding: 0; border: 0; background: transparent;
  color: var(--muted); font-size: 1.1rem; line-height: 1; cursor: pointer;
}
.message-success {
  border-left-color: var(--success);
}
.message-error {
  border-left-color: var(--danger);
}
.message-warning {
  border-left-color: var(--warning);
}

/* 3. Navegación pública --------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid var(--border); background: var(--bg);
}
.nav {
  display: flex; align-items: center; gap: 16px;
  min-height: 72px;
}
.brand {
  display: inline-flex; align-items: center;
}
.logo-chip {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; background: transparent;
}
.brand-logo {
  width: auto; height: 40px;
}
.nav-actions {
  display: flex; align-items: center; gap: 8px;
  margin-left: auto;
}
.nav-actions form {
  margin: 0;
}

/* 4. Landing ------------------------------------------------------------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr); gap: 64px;
  align-items: center; padding: 88px 0 72px;
}
.hero-copy {
  animation: rise 0.5s ease both;
}
.hero-aside {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  animation: rise 0.5s ease 0.08s both;
}
.eyebrow {
  display: inline-block; margin-bottom: 16px; color: var(--muted);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hero h1 {
  max-width: 720px; margin-bottom: 20px;
}
.hero-subtitle {
  max-width: 560px; margin-bottom: 28px; font-size: 1.08rem;
}
.hero-actions {
  display: flex; flex-wrap: wrap; gap: 12px;
}
.hero-kpi {
  padding: 20px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
}
.hero-kpi-label {
  display: block; margin-bottom: 8px; color: var(--muted);
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hero-kpi-value {
  display: block; color: var(--navy); font-size: 1.8rem;
  font-weight: 700; letter-spacing: -0.04em; line-height: 1.1;
}
.hero-kpi-note {
  display: block; margin-top: 6px; color: var(--muted);
  font-size: 0.75rem;
}
.section {
  padding: 64px 0; border-top: 1px solid var(--border);
}
.section-head {
  max-width: 760px; margin-bottom: 28px;
}
.section-head h2 {
  margin-bottom: 12px;
}
.section-head p {
  max-width: 680px; margin-bottom: 0;
}
.panel {
  padding: 24px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 18px;
}
.panel-head h2,
.panel-head h3 {
  margin: 0;
}
.badge {
  display: inline-flex; align-items: center; padding: 4px 9px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2);
  color: var(--muted); font-size: 0.7rem; font-weight: 600;
  white-space: nowrap;
}
.chart-box {
  position: relative; height: 360px;
}
.chart-box canvas {
  width: 100% !important; height: 100% !important;
}
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px;
}
.kpi-card {
  padding: 20px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
}
.kpi-card-head {
  margin-bottom: 10px; color: var(--muted); font-size: 0.7rem;
  font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.kpi-value {
  display: block; color: var(--navy); font-size: 2rem;
  font-weight: 700; letter-spacing: -0.04em; line-height: 1.1;
}
.kpi-note {
  display: block; margin-top: 6px; color: var(--muted);
  font-size: 0.8rem;
}
.cta-section {
  padding: 64px 0 88px;
}
.cta-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: 32px; padding: 40px; border-radius: 16px;
  background: var(--navy); color: #fff;
}
.cta-card h2 {
  margin-bottom: 8px; color: #fff;
}
.cta-card p {
  max-width: 560px; margin-bottom: 0; color: #d7e0ea;
}
.cta-actions {
  display: flex; flex-wrap: wrap; flex-shrink: 0;
  gap: 10px;
}
.cta-card .btn-primary {
  background: #fff; color: var(--navy);
}
.cta-card .btn-primary:hover {
  background: var(--surface-2);
}
.cta-card .btn-ghost {
  border-color: #8fa3b8; color: #fff;
}
.cta-card .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}
.cta-card .btn:focus-visible {
  outline-color: #fff;
}

/* Mapa mundial ------------------------------------------------------------ */
.map-panel {
  overflow: hidden; padding: 0;
}
.map-frame {
  position: relative; aspect-ratio: 2 / 1; background: var(--surface-2);
}
.map-details {
  display: grid; grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
}
.map-image {
  width: 100%; height: 100%; object-fit: cover;
}
.map-dot {
  position: absolute; display: grid; place-items: center;
  width: var(--dot); height: var(--dot); padding: 0;
  border: 2px solid #fff; border-radius: 50%; background: var(--navy);
  box-shadow: 0 0 0 1px rgba(11, 27, 51, 0.25);
  transform: translate(-50%, -50%);
  transition: background-color 0.18s, transform 0.18s; cursor: pointer;
}
.map-dot::after {
  content: ""; position: absolute; inset: -10px; border-radius: 50%;
}
.map-dot:hover, .map-dot:focus-visible, .map-dot.is-active {
  background: #fff; border-color: var(--navy);
  transform: translate(-50%, -50%) scale(1.18);
}
.map-dot-label {
  position: absolute; left: 50%; bottom: calc(100% + 8px);
  padding: 4px 7px; border-radius: 4px; background: var(--navy); color: #fff;
  font-size: 0.7rem; white-space: nowrap; opacity: 0; pointer-events: none;
  transform: translateX(-50%); transition: opacity 0.15s;
}
.map-dot:hover .map-dot-label,
.map-dot:focus-visible .map-dot-label,
.map-dot.is-active .map-dot-label {
  opacity: 1;
}
.map-info {
  display: flex; flex-direction: column; justify-content: center;
  padding: 24px;
}
.map-info h3 {
  margin: 6px 0 14px; color: var(--navy); font-size: 1.5rem;
}
.map-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; margin: 0;
}
.map-stats div {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.map-stats dt {
  color: var(--muted); font-size: 0.78rem;
}
.map-stats dd {
  margin: 0; color: var(--ink); font-weight: 600;
}
.map-sector {
  margin: 16px 0 0; font-size: 0.85rem;
}
.map-sector strong {
  color: var(--ink);
}
.map-hint {
  margin: 12px 0 0; font-size: 0.75rem;
}

/* Overlay de detalle del país --------------------------------------------- */
.map-overlay {
  position: absolute; inset: 12px; z-index: 5; display: flex;
  pointer-events: none; transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.map-overlay.is-open {
  pointer-events: auto; transform: translateY(0);
}
.map-overlay[hidden],
.map-view[hidden] {
  display: none;
}
.map-overlay-card {
  position: relative; display: flex; flex-direction: column;
  width: 100%; overflow: hidden; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface);
  box-shadow: 0 18px 40px rgba(11, 27, 51, 0.18);
}
.map-overlay-scroll {
  height: 100%; overflow-y: auto;
}
.map-overlay-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--border); border-radius: 50%;
  background: var(--surface); color: var(--navy);
  font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.map-overlay-close:hover {
  background: var(--surface-2);
}
.map-overlay .map-details {
  min-height: 100%; border-top: 0;
}
.map-overlay .map-info {
  justify-content: flex-start;
}
.valuation-view {
  padding: 24px;
}
.valuation-view h3 {
  margin: 14px 0 4px; color: var(--navy); font-size: 1.3rem;
}
.valuation-view p {
  margin: 0 0 16px; color: var(--muted); font-size: 0.85rem;
}
.valuation-back {
  display: inline-flex; align-items: center; gap: 6px; padding: 0;
  border: 0; background: none; color: var(--navy);
  font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer;
}
.valuation-back:hover {
  text-decoration: underline;
}
.valuation-box {
  position: relative; height: 340px;
}

.donut-block {
  padding: 24px; border-left: 1px solid var(--border);
}
.donut-head h3 {
  margin: 4px 0 12px; color: var(--navy); font-size: 1.2rem;
}
.donut-box {
  position: relative; height: 150px; max-width: 220px; margin: 0 auto;
}
.donut-legend {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px;
  margin-top: 12px; color: var(--muted); font-size: 0.75rem;
}
.donut-legend span {
  display: flex; align-items: center; gap: 6px;
}
.donut-legend i {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.donut-legend strong {
  margin-left: auto; color: var(--ink); font-weight: 600;
}
.chart-grid {
  display: grid; grid-template-columns: 1.4fr 0.8fr;
  gap: 20px; margin-bottom: 20px;
}
.chart-box-donut {
  height: 230px;
}
.chart-box-sectors {
  height: 380px;
}
.admin-chart-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}
.admin-chart-grid h3 {
  margin: 0 0 10px; font-size: 1rem;
}
.chart-box.chart-box-admin {
  height: 260px;
}
.chart-box.chart-box-admin-donut {
  height: 220px;
}
.chart-grid .panel {
  margin-bottom: 0;
}

/* 5. Acceso --------------------------------------------------------------- */
.auth-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 48px 20px;
}
.auth-shell {
  width: 100%; max-width: 420px;
}
.auth-brand {
  display: flex; justify-content: center; margin-bottom: 24px;
}
.auth-logo {
  width: auto; height: 84px;
}
.auth-box {
  padding: 32px;
}
.auth-box h1 {
  margin-bottom: 6px; font-size: 1.6rem;
}
.auth-subtitle {
  margin-bottom: 24px; font-size: 0.9rem;
}
.auth-switch {
  margin: 20px 0 0; color: var(--muted); font-size: 0.85rem;
  text-align: center;
}
.auth-switch a {
  font-weight: 600; text-decoration: underline;
}

/* 6. Dashboard: estructura y sidebar -------------------------------------- */
.dashboard-page {
  background: var(--bg);
}
.dashboard-shell {
  display: flex; min-height: 100vh;
}
.sidebar {
  position: sticky; top: 0; display: flex;
  flex-direction: column; flex-shrink: 0; width: 240px;
  height: 100vh; padding: 20px 16px; border-right: 1px solid var(--border);
  background: var(--surface);
}
.sidebar-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 28px;
}
.sidebar .brand-logo {
  height: 36px;
}
.sidebar-close {
  display: none; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--border); border-radius: 6px; background: transparent;
  color: var(--muted); font-size: 1.1rem; cursor: pointer;
}
.sidebar-profile {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 24px; padding: 12px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--bg);
}
.avatar {
  display: grid; flex-shrink: 0; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--navy); color: #fff; font-size: 0.8rem;
  font-weight: 700;
}
.sidebar-profile-copy {
  min-width: 0;
}
.sidebar-profile-copy strong {
  display: block; overflow: hidden; font-size: 0.82rem;
  text-overflow: ellipsis; white-space: nowrap;
}
.role-label {
  display: block; margin-top: 2px; color: var(--muted);
  font-size: 0.7rem;
}
.sidebar-nav {
  display: grid; gap: 2px;
}
.sidebar-nav a {
  padding: 9px 10px; border-radius: 6px; color: var(--ink);
  font-size: 0.85rem; font-weight: 500;
}
.sidebar-nav a:hover {
  background: var(--surface-2); text-decoration: none;
}
.sidebar-footer {
  margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border);
}
.sidebar-link {
  display: block; margin-bottom: 10px; color: var(--muted);
  font-size: 0.78rem;
}
.sidebar-link:hover {
  color: var(--navy);
}
.sidebar-footer .btn {
  min-height: 36px; font-size: 0.8rem;
}
.sidebar-backdrop {
  display: none;
}
.dashboard-main {
  flex: 1; width: 100%; min-width: 0;
  max-width: 1400px; padding: 32px 40px 64px;
}
.dashboard-topbar {
  display: flex; flex-wrap: wrap; align-items: flex-start;
  justify-content: space-between; gap: 20px; margin-bottom: 28px;
}
.topbar-title {
  display: flex; align-items: flex-start; gap: 12px;
}
.topbar-title h1 {
  margin: 0 0 4px; font-size: 1.6rem; letter-spacing: -0.03em;
}
.topbar-title p {
  margin: 0; font-size: 0.85rem;
}
.menu-toggle {
  display: none; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface);
  color: var(--navy); font-size: 1rem; cursor: pointer;
}

/* 7. Dashboard: contenido ------------------------------------------------ */
.dashboard-main .kpi-grid {
  margin-bottom: 20px;
}
.dashboard-main .panel {
  margin-bottom: 20px;
}
.filter-bar {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; align-items: end;
  gap: 12px;
}
.filter-field label {
  margin-bottom: 5px; color: var(--muted); font-size: 0.7rem;
  font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.filter-actions {
  display: flex; align-items: center; gap: 8px;
}
.filter-bar-compact {
  grid-template-columns: minmax(0, 2fr) minmax(160px, 1fr) auto; margin-bottom: 18px; padding: 0;
  border: 0; background: transparent;
}
.table-wrap {
  overflow-x: auto;
}
.table-sub {
  margin: 0 0 16px; color: var(--muted); font-size: 0.82rem;
}
.data-table {
  width: 100%; border-collapse: collapse; font-size: 0.85rem;
}
.data-table th {
  padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--muted);
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em;
  text-align: left; text-transform: uppercase; white-space: nowrap;
}
.data-table td {
  padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle;
}
.data-table tbody tr:hover {
  background: var(--bg);
}
.data-table td:first-child {
  min-width: 190px;
}
.data-table td:last-child {
  white-space: nowrap;
}
.actions-cell {
  min-width: 180px;
}
.table-actions {
  display: flex; flex-wrap: nowrap; gap: 6px;
}
.table-actions form {
  margin: 0;
}
.table-actions .btn {
  min-height: 30px; padding: 0 10px; font-size: 0.75rem;
}
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-top: 16px; color: var(--muted);
  font-size: 0.8rem;
}
.pagination > div:last-child {
  display: flex; gap: 6px;
}
.import-form {
  display: grid; gap: 16px; max-width: 640px;
}
.import-form .btn {
  justify-self: start;
}

/* 8. Formulario de edición ------------------------------------------------ */
.form-page-shell {
  max-width: 960px; padding-top: 32px; padding-bottom: 64px;
}
.form-page-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 24px;
}
.form-card {
  padding: 28px;
}
.form-card h1 {
  margin-bottom: 4px; font-size: 1.7rem;
}
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px;
}

/* Mantenedores ------------------------------------------------------------ */
.maintainer-shell {
  max-width: 1200px;
}
.maintainer-head {
  display: flex; flex-wrap: wrap; align-items: flex-start;
  justify-content: space-between; gap: 16px;
}
.maintainer-head h1 {
  margin-bottom: 4px;
}
.maintainer-filter {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: end; gap: 12px; margin: 18px 0;
}
.maintainer-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
}
.maintainer-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.maintainer-card:hover {
  border-color: var(--navy); box-shadow: 0 8px 20px rgba(11, 27, 51, 0.08);
  text-decoration: none; transform: translateY(-2px);
}
.maintainer-title {
  color: var(--navy); font-size: 0.95rem; font-weight: 700;
}
.maintainer-count {
  color: var(--muted); font-size: 0.72rem;
}
.maintainer-desc {
  color: var(--muted); font-size: 0.8rem;
}
.maintainer-link {
  margin-top: auto; color: var(--navy); font-size: 0.78rem; font-weight: 600;
}

/* 9. Footer --------------------------------------------------------------- */
.site-footer {
  padding: 28px 0; border-top: 1px solid var(--border); background: var(--surface);
}
.footer-simple {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 16px; color: var(--muted);
  font-size: 0.8rem;
}
.footer-logo {
  width: auto; height: 32px;
}

/* 10. Animaciones --------------------------------------------------------- */

@keyframes rise {
  from {
    opacity: 0; transform: translateY(10px);
  }
  to {
    opacity: 1; transform: none;
  }
}
.dashboard-main > .kpi-grid,
.dashboard-main > .panel {
  animation: rise 0.45s ease both;
}

/* 11. Responsive ---------------------------------------------------------- */

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr; gap: 40px; padding: 64px 0 48px;
  }
  .hero-aside {
    max-width: 560px;
  }
  .map-details {
    grid-template-columns: 1fr;
  }
  .donut-block {
    border-left: 0; border-top: 1px solid var(--border);
  }
  .chart-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-shell {
    display: block;
  }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 40;
    transform: translateX(-100%); transition: transform 0.25s ease; box-shadow: 0 0 40px rgba(11, 27, 51, 0.18);
  }
  .sidebar-open .sidebar {
    transform: translateX(0);
  }
  .sidebar-open .sidebar-backdrop {
    position: fixed; inset: 0; z-index: 30;
    display: block; background: rgba(11, 27, 51, 0.35);
  }
  .sidebar-close,
  .menu-toggle {
    display: inline-flex;
  }
  .dashboard-main {
    padding: 24px 20px 48px;
  }
  .filter-bar,
  .filter-bar-compact {
    grid-template-columns: 1fr 1fr;
  }
  .filter-actions {
    grid-column: 1 / -1;
  }
  .maintainer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .container {
    width: calc(100% - 32px);
  }
  .nav {
    min-height: 64px;
  }
  .hero {
    padding-top: 48px;
  }
  .hero h1 {
    font-size: 2.4rem;
  }
  .hero-aside {
    grid-template-columns: 1fr 1fr;
  }
  .hero-kpi {
    padding: 16px;
  }
  .hero-kpi-value {
    font-size: 1.5rem;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .map-stats {
    grid-template-columns: 1fr;
  }
  .map-frame {
    aspect-ratio: auto;
  }
  .map-image {
    height: auto;
  }
  .map-overlay {
    position: fixed; inset: 0; padding: 12px; z-index: 50;
  }
  .panel {
    padding: 18px;
  }
  .chart-box {
    height: 300px;
  }
  .chart-box-donut {
    height: 210px;
  }
  .chart-box-sectors {
    height: 440px;
  }
  .admin-chart-grid {
    grid-template-columns: 1fr;
  }
  .cta-card {
    flex-direction: column; align-items: flex-start; padding: 28px;
  }
  .auth-box {
    padding: 24px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-page-header {
    flex-direction: column; align-items: flex-start;
  }
  .filter-bar,
  .filter-bar-compact {
    grid-template-columns: 1fr;
  }
  .maintainer-filter {
    grid-template-columns: 1fr;
  }
  .maintainer-grid {
    grid-template-columns: 1fr;
  }
  .pagination {
    flex-direction: column; align-items: flex-start;
  }
  .data-table {
    min-width: 640px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
