/* ═══════════════════════════════════════════════════════
   CMRI – Estilos principales
   Archivo: cmri-styles.css
   Requiere: Bootstrap 5 + Bootstrap Icons (en head.html)
═══════════════════════════════════════════════════════ */

/* ─── Variables ───────────────────────────────────────── */
:root {
  --sidebar-w:   220px;
  --header-h:    80px;
  --c-primary:   #1a2e5a;   /* Azul Marino Kari */
  --c-primary-d: #111e3d;   /* Azul Marino oscuro */
  --c-primary-l: #243f7a;   /* Azul Marino suavizado */
  --c-accent:    #1a2e5a;   /* Acento = Azul Marino */
  --c-yellow:    #d4a017;   /* Reservado tropas Leos */
  --c-red:       #d63b3b;
  --c-violet:    #7c4fa0;
  --c-skyblue:   #4db8e8;
  --c-sidebar:   #f5f6f8;   /* Gris Perla — sidebar */
  --c-sidebar-d: #eaecf0;   /* Gris Perla — header sidebar */
  --c-sidebar-b: #d4d8e0;   /* Gris Perla — bordes */
  --c-bg:        #f4f5f7;   /* Gris Perla — fondo general */
  --c-text:      #1a2e5a;   /* Azul Marino — texto principal */
  --c-muted:     #6b7280;   /* Gris Perla oscuro — subtítulos */
  --transition:  0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Roboto', sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  margin: 0;
  overflow-x: hidden;
}

/* Montserrat — titulares y encabezados institucionales */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
}

/* ─── Offset del header fijo ──────────────────────────── */
#main {
  margin-top: var(--header-h);
}

/* ══════════════════════════════════════════════════════
   OVERLAY
══════════════════════════════════════════════════════ */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 35, 70, 0.38);
  z-index: 1040;
  backdrop-filter: blur(1.5px);
}
#sidebar-overlay.active { display: block; }

/* ══════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════ */
#cmri-sidebar {
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  width: var(--sidebar-w);
  background: var(--c-sidebar);
  border-right: 1px solid var(--c-sidebar-b);
  display: flex;
  flex-direction: column;
  z-index: 1050;
  transform: translateX(calc(-1 * var(--sidebar-w)));
  transition: transform var(--transition), box-shadow var(--transition);
  will-change: transform;
}
#cmri-sidebar.open {
  transform: translateX(0);
  box-shadow: 6px 0 28px rgba(20, 40, 100, 0.16);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--c-sidebar-d);
  border-bottom: 1px solid var(--c-sidebar-b);
  flex-shrink: 0;
}
.sidebar-header span {
  font-size: 12px;
  font-weight: 800;
  color: #3a4a6b;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.btn-close-sidebar {
  background: none;
  border: none;
  padding: 2px 6px;
  font-size: 18px;
  color: #5a6a8a;
  cursor: pointer;
  border-radius: 6px;
  line-height: 1;
  transition: background 0.15s;
}
.btn-close-sidebar:hover { background: #b5c2da; color: #1a2a4a; }

.sidebar-nav { padding: 10px 0; flex: 1; overflow-y: auto; }

.nav-item-cmri {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  font-size: 13.5px;
  font-weight: 700;
  color: #3a4a6b;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.nav-item-cmri i { font-size: 16px; width: 20px; text-align: center; }
.nav-item-cmri:hover {
  background: #ccd6ea;
  border-left-color: var(--c-primary);
  color: var(--c-primary-d);
}
.nav-item-cmri.active {
  background: #bfcde3;
  border-left-color: var(--c-primary);
  color: var(--c-primary-d);
}

.sidebar-divider {
  height: 1px;
  background: var(--c-sidebar-b);
  margin: 6px 16px;
}

.sidebar-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--c-sidebar-b);
  font-size: 11px;
  color: #7a8aaa;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════
   HEADER PRINCIPAL
══════════════════════════════════════════════════════ */
#cmri-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--c-primary);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 1030;
  gap: 14px;
  box-shadow: 0 2px 16px rgba(20, 40, 100, 0.2);
}

#btn-toggle-sidebar {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  color: #fff;
  width: 40px; height: 40px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
#btn-toggle-sidebar:hover { background: rgba(255,255,255,0.22); }

.header-logo {
  width: 50px; height: 50px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  border: 2px solid var(--c-yellow);
  padding: 2px;
  flex-shrink: 0;
}

.header-title { flex: 1; min-width: 0; }
.header-title h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
  color: #fff;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-title small {
  font-size: 11px;
  color: #a8c0f0;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* Zona usuario / botones login */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-header {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  font-family: 'Roboto', sans-serif;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
  border: none;
}
.btn-header-outline {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
}
.btn-header-outline:hover { background: rgba(255,255,255,0.2); color: #fff; }
.btn-header-solid {
  background: var(--c-yellow);
  color: var(--c-primary-d);
}
.btn-header-solid:hover { background: #e0b010; color: var(--c-primary-d); }

/* Badge usuario logueado */
.user-badge {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 20px;
  padding: 4px 12px 4px 6px;
}
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--c-yellow);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900;
  color: var(--c-primary-d);
}
.user-name { font-size: 12px; color: #e0eaff; font-weight: 700; }

/* ══════════════════════════════════════════════════════
   HERO (index.php)
══════════════════════════════════════════════════════ */
.cmri-hero {
  min-height: calc(100vh - var(--header-h));
  background: linear-gradient(135deg, var(--c-primary-d) 0%, var(--c-primary) 50%, #1d4db8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 60px 24px;
}

/* Fondo decorativo */
.hero-dots {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.09) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
}
.hero-circle {
  position: absolute; border-radius: 50%;
  opacity: 0.07; pointer-events: none;
}
.hero-circle.c1 { width:560px; height:560px; background:var(--c-yellow);  top:-180px; right:-140px; }
.hero-circle.c2 { width:380px; height:380px; background:var(--c-skyblue); bottom:-130px; left:-90px; }
.hero-circle.c3 { width:220px; height:220px; background:var(--c-red);     top:42%; left:32%; }

.hero-inner {
  position: relative; z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px;
  max-width: 1080px;
  width: 100%;
}

/* Texto hero */
.hero-text { flex: 1; min-width: 0; max-width: 500px; }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 11px; font-weight: 800;
  color: var(--c-yellow);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.hero-text h2 {
  font-size: clamp(24px, 3.5vw, 42px);
  font-weight: 900;
  color: #fff;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.hero-text h2 .hl { color: var(--c-yellow); }

.hero-text p {
  font-size: 14.5px;
  color: rgba(255,255,255,0.72);
  line-height: 1.7;
  margin-bottom: 30px;
  max-width: 400px;
}

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-cta-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px;
  background: var(--c-yellow); color: var(--c-primary-d);
  font-size: 14px; font-weight: 800;
  border-radius: 10px; border: none;
  text-decoration: none; cursor: pointer;
  font-family: 'Roboto', sans-serif;
  transition: all 0.18s;
}
.btn-cta-primary:hover {
  background: #e0b010; color: var(--c-primary-d);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0,0,0,0.22);
}
.btn-cta-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px;
  background: rgba(255,255,255,0.1); color: #fff;
  font-size: 14px; font-weight: 700;
  border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,0.3);
  text-decoration: none; cursor: pointer;
  font-family: 'Roboto', sans-serif;
  transition: all 0.18s;
}
.btn-cta-secondary:hover {
  background: rgba(255,255,255,0.18); color: #fff;
  transform: translateY(-2px);
}

/* Stats hero */
.hero-stats { margin-top: 36px; display: flex; gap: 28px; flex-wrap: wrap; }
.hero-stat .num  { font-size: 26px; font-weight: 900; color: var(--c-yellow); line-height: 1; }
.hero-stat .lbl  { font-size: 10.5px; color: rgba(255,255,255,0.5); font-weight: 700;
                   text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }

/* Visual hero */
.hero-visual {
  flex-shrink: 0;
  position: relative;
  width: 320px; height: 320px;
  display: flex; align-items: center; justify-content: center;
}

.ring {
  position: absolute; border-radius: 50%;
  border: 1.5px dashed rgba(255,255,255,0.13);
}
.ring.r1 { width:300px; height:300px; animation: spin 22s linear infinite; }
.ring.r2 { width:200px; height:200px; border-color: rgba(245,197,24,0.18); animation: spin 15s linear infinite reverse; }

@keyframes spin { to { transform: rotate(360deg); } }

.hero-cube-wrap {
  position: relative; z-index: 2;
  animation: float 4s ease-in-out infinite;
}
@keyframes float {
  0%,100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-14px) rotate(3deg); }
}

/* Badges flotantes de colores */
.color-dot {
  position: absolute;
  width: 46px; height: 46px;
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 900;
  box-shadow: 0 4px 14px rgba(0,0,0,0.22);
  z-index: 3;
}
.color-dot.d1 { background: var(--c-violet);  color:#fff; top:14px;  left:18px;  animation: bdg 3.5s ease-in-out infinite 0s; }
.color-dot.d2 { background: var(--c-red);     color:#fff; top:14px;  right:18px; animation: bdg 3.5s ease-in-out infinite 0.7s; }
.color-dot.d3 { background: var(--c-yellow);  color:var(--c-primary-d); bottom:14px; left:18px;  animation: bdg 3.5s ease-in-out infinite 1.4s; }
.color-dot.d4 { background: var(--c-skyblue); color:#fff; bottom:14px; right:18px; animation: bdg 3.5s ease-in-out infinite 2.1s; }

@keyframes bdg {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

/* ══════════════════════════════════════════════════════
   SECCIÓN RAMAS
══════════════════════════════════════════════════════ */
.section-ramas {
  padding: 64px 24px;
  background: #fff;
}

.section-label {
  text-align: center;
  font-size: 11px; font-weight: 800;
  color: var(--c-accent);
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 8px;
}
.section-title {
  text-align: center;
  font-size: 26px; font-weight: 900;
  color: var(--c-text);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.section-sub {
  text-align: center;
  font-size: 14px; color: var(--c-muted);
  margin-bottom: 40px;
  max-width: 460px; margin-left: auto; margin-right: auto;
}

.ramas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 18px;
  max-width: 1000px; margin: 0 auto;
}

.rama-card {
  border-radius: 16px;
  padding: 26px 20px;
  display: flex; flex-direction: column;
  align-items: flex-start; gap: 10px;
  transition: transform 0.18s, box-shadow 0.18s;
  position: relative; overflow: hidden;
}
.rama-card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,0.13); }
.rama-card::after {
  content: '';
  position: absolute; bottom: -20px; right: -20px;
  width: 76px; height: 76px; border-radius: 50%;
  background: rgba(255,255,255,0.1);
}
.rama-card.violet  { background: var(--c-violet);  color: #fff; }
.rama-card.red     { background: var(--c-red);     color: #fff; }
.rama-card.yellow  { background: var(--c-yellow);  color: var(--c-primary-d); }
.rama-card.skyblue { background: var(--c-skyblue); color: #fff; }
.rama-card.blue    { background: var(--c-primary); color: #fff; }

.rama-icon {
  width: 42px; height: 42px; border-radius: 11px;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
}
.rama-name { font-size: 15px; font-weight: 900; line-height: 1.2; }
.rama-desc { font-size: 12px; opacity: 0.8; line-height: 1.5; font-weight: 600; }

/* ══════════════════════════════════════════════════════
   SECCIÓN ACCESO RÁPIDO
══════════════════════════════════════════════════════ */
.section-acceso { padding: 64px 24px; background: var(--c-bg); }

.acceso-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  max-width: 820px; margin: 0 auto;
}

.acceso-card {
  background: #fff;
  border: 1px solid #dde3ef;
  border-radius: 16px;
  padding: 32px 26px;
  text-align: center;
  text-decoration: none; color: inherit;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  display: block;
}
.acceso-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(42,79,165,0.1);
  border-color: var(--c-primary);
  color: inherit;
}

.ac-icon {
  width: 62px; height: 62px; border-radius: 17px;
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 27px;
}
.ac-icon.blue  { background: #e8edfa; color: var(--c-primary); }
.ac-icon.green { background: #e2f5ee; color: #1a8055; }

.acceso-card h3 { font-size: 17px; font-weight: 900; color: var(--c-text); margin-bottom: 8px; }
.acceso-card p  { font-size: 13px; color: var(--c-muted); line-height: 1.6; margin-bottom: 20px; }

.btn-acceso {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 20px; border-radius: 9px;
  font-size: 13px; font-weight: 800;
  text-decoration: none;
  font-family: 'Roboto', sans-serif;
  transition: all 0.15s;
}
.btn-acceso.primary { background: var(--c-primary); color: #fff; }
.btn-acceso.primary:hover { background: var(--c-primary-d); color: #fff; transform: translateY(-1px); }
.btn-acceso.outline { background: transparent; color: var(--c-primary); border: 1.5px solid var(--c-primary); }
.btn-acceso.outline:hover { background: var(--c-primary); color: #fff; transform: translateY(-1px); }

/* ══════════════════════════════════════════════════════
   TOOLBAR DE PÁGINAS INTERNAS (gestión, etc.)
══════════════════════════════════════════════════════ */
.page-toolbar {
  background: #fff;
  border: 1px solid #dde3ef;
  border-radius: 12px;
  padding: 12px 18px;
  margin-bottom: 18px;
  display: flex; align-items: center;
  justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
.page-title { font-size: 15px; font-weight: 800; color: var(--c-text); margin: 0; }
.badge-count {
  background: #e8edfa; color: var(--c-primary);
  font-size: 11px; font-weight: 700;
  padding: 2px 9px; border-radius: 10px; margin-left: 8px;
}

/* Buscador */
.search-wrap { position: relative; flex-shrink: 0; }
.search-wrap i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #8a9ab5; font-size: 14px; }
.search-wrap input {
  padding-left: 32px;
  font-size: 13px; font-weight: 600;
  border: 1px solid #d0d8ea; border-radius: 8px;
  background: #f4f6fb; color: var(--c-text);
  width: 200px; height: 36px;
  font-family: 'Roboto', sans-serif;
  transition: border-color 0.15s, background 0.15s;
}
.search-wrap input:focus {
  outline: none; border-color: var(--c-primary);
  background: #fff; box-shadow: 0 0 0 3px rgba(42,79,165,0.1);
}

/* ══════════════════════════════════════════════════════
   TABLA INTERNA
══════════════════════════════════════════════════════ */
.table-card {
  background: #fff;
  border: 1px solid #dde3ef;
  border-radius: 12px;
  overflow: hidden;
}
.table-cmri { width: 100%; border-collapse: collapse; }
.table-cmri thead tr { background: #f4f6fb; border-bottom: 2px solid #dde3ef; }
.table-cmri thead th {
  padding: 11px 14px;
  font-size: 10.5px; font-weight: 800;
  color: #4a5a7a; letter-spacing: 0.06em;
  text-transform: uppercase; white-space: nowrap;
}
.table-cmri tbody tr { border-bottom: 1px solid #edf0f7; transition: background 0.1s; }
.table-cmri tbody tr:last-child { border-bottom: none; }
.table-cmri tbody tr:hover { background: #f7f9ff; }
.table-cmri tbody td { padding: 10px 14px; font-size: 13px; color: var(--c-text); vertical-align: middle; }

.td-reg   { font-weight: 800; font-size: 12.5px; color: #1a2a4a; white-space: nowrap; }
.td-muted { color: var(--c-muted); font-size: 12px; }
.td-fecha { color: #7a8aaa; font-size: 12px; font-family: 'Courier New', monospace; }
.td-fecha.empty { color: #b0b8cc; font-style: italic; font-size: 11px; font-family: 'Roboto', sans-serif; }

.btn-gestionar {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--c-accent); color: #fff;
  border: none; border-radius: 7px;
  padding: 5px 12px; font-size: 12px; font-weight: 800;
  font-family: 'Roboto', sans-serif;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
}
.btn-gestionar:hover { background: #178ab0; color: #fff; transform: translateY(-1px); }
.btn-gestionar:active { transform: scale(0.97); }

/* Paginación */
.pagination-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-top: 1px solid #edf0f7;
  flex-wrap: wrap; gap: 8px;
}
.pag-info { font-size: 12px; color: var(--c-muted); font-weight: 600; }
.pag-btns { display: flex; gap: 4px; }
.pag-btn {
  padding: 5px 11px; border: 1px solid #d0d8ea;
  border-radius: 7px; background: #fff;
  font-size: 12px; font-weight: 700;
  font-family: 'Roboto', sans-serif;
  color: #3a4a6b; cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.pag-btn:hover:not(.active) { background: #f0f4ff; border-color: #b0bcd8; }
.pag-btn.active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }

/* ══════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════ */
.cmri-footer {
  background: var(--c-primary-d);
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-brand {
  display: flex; align-items: center; gap: 10px;
}
.footer-brand img {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.3);
}
.footer-brand span {
  font-size: 13px; font-weight: 700;
  color: rgba(255,255,255,0.85);
}
.footer-links { display: flex; align-items: center; gap: 16px; }
.footer-links a {
  display: flex; align-items: center; gap: 6px;
  color: rgba(255,255,255,0.55);
  font-size: 12px; font-weight: 600;
  text-decoration: none;
  transition: color 0.15s;
}
.footer-links a:hover { color: rgba(255,255,255,0.9); }
.footer-links a i { font-size: 15px; }
.footer-copy {
  font-size: 11px; color: rgba(255,255,255,0.35);
  font-weight: 600; width: 100%; text-align: center;
  padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.08);
}

/* ══════════════════════════════════════════════════════
   CONTENIDO GENERAL (páginas internas)
══════════════════════════════════════════════════════ */
.page-content { padding: 24px; }

/* ══════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .hero-inner    { flex-direction: column; gap: 36px; text-align: center; }
  .hero-text p   { max-width: 100%; }
  .hero-cta      { justify-content: center; }
  .hero-stats    { justify-content: center; }
  .hero-visual   { width: 260px; height: 260px; }
  .ring.r1       { width: 240px; height: 240px; }
  .ring.r2       { width: 160px; height: 160px; }
  .header-title h1 { font-size: 13px; }
  .btn-header    { padding: 6px 10px; font-size: 11.5px; }
  .cmri-footer   { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .header-title small { display: none; }
  .page-content { padding: 16px; }
}

/* ══════════════════════════════════════════════════════
   FORMULARIOS AUTH (login / register)
══════════════════════════════════════════════════════ */
.auth-card {
  background: #fff;
  border: 1px solid #dde3ef;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 32px rgba(42,79,165,0.08);
  margin-bottom: 32px;
}

.auth-card-header {
  background: linear-gradient(135deg, var(--c-primary-d), var(--c-primary));
  padding: 32px 32px 28px;
  text-align: center;
}
.auth-icon {
  width: 60px; height: 60px;
  background: rgba(255,255,255,0.15);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--c-yellow);
  margin: 0 auto 14px;
  border: 1px solid rgba(255,255,255,0.2);
}
.auth-icon.green { color: #5ddb9a; }

.auth-card-header h2 {
  font-size: 22px; font-weight: 900;
  color: #fff; margin: 0 0 6px;
}
.auth-card-header p {
  font-size: 13px; color: rgba(255,255,255,0.65);
  margin: 0; font-weight: 600;
}

.auth-card-body { padding: 28px 32px 32px; }

/* Grupos de campo */
.form-group-cmri { margin-bottom: 16px; flex: 1; }
.form-row-cmri {
  display: flex; gap: 16px;
}
@media (max-width: 576px) {
  .form-row-cmri { flex-direction: column; gap: 0; }
}

.form-label-cmri {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 800;
  color: var(--c-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.form-label-cmri i { font-size: 13px; }

.form-input-cmri {
  width: 100%;
  padding: 10px 14px;
  font-size: 13.5px; font-weight: 600;
  font-family: 'Roboto', sans-serif;
  border: 1.5px solid #d0d8ea;
  border-radius: 9px;
  background: #f8f9fd;
  color: var(--c-text);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  outline: none;
}
.form-input-cmri:focus {
  border-color: var(--c-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(42,79,165,0.1);
}
.form-textarea-cmri {
  resize: vertical;
  min-height: 90px;
}

/* Botones formulario */
.btn-form-primary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  padding: 12px;
  background: var(--c-primary); color: #fff;
  font-size: 14px; font-weight: 800;
  font-family: 'Roboto', sans-serif;
  border: none; border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
  margin-top: 4px;
}
.btn-form-primary:hover { background: var(--c-primary-d); color: #fff; transform: translateY(-1px); }
.btn-form-primary.green { background: #1a8055; }
.btn-form-primary.green:hover { background: #136642; }

.btn-form-outline {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  padding: 10px;
  background: transparent; color: var(--c-primary);
  font-size: 13.5px; font-weight: 800;
  font-family: 'Roboto', sans-serif;
  border: 1.5px solid var(--c-primary);
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.btn-form-outline:hover { background: var(--c-primary); color: #fff; }

.auth-divider {
  text-align: center; margin: 16px 0;
  position: relative;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  position: absolute; top: 50%;
  width: calc(50% - 70px);
  height: 1px; background: #dde3ef;
}
.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }
.auth-divider span {
  font-size: 12px; color: var(--c-muted);
  font-weight: 700; background: #fff;
  padding: 0 8px; position: relative;
}

/* ══════════════════════════════════════════════════════
   REDIRECT / BIENVENIDA
══════════════════════════════════════════════════════ */
.redirect-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding: 40px 0;
}

.redirect-card {
  background: #fff;
  border: 1px solid #dde3ef;
  border-radius: 18px;
  padding: 40px 36px;
  text-align: center;
  max-width: 440px; width: 100%;
  box-shadow: 0 4px 32px rgba(42,79,165,0.08);
}
.redirect-icon {
  font-size: 52px; color: #1a8055;
  margin-bottom: 16px; line-height: 1;
}
.redirect-card h2 {
  font-size: 22px; font-weight: 900;
  color: var(--c-text); margin-bottom: 8px;
}
.redirect-card p {
  font-size: 14px; color: var(--c-muted);
  margin-bottom: 24px; font-weight: 600;
}

.redirect-img-wrap img {
  max-width: 280px; width: 100%;
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.1);
}

/* ══════════════════════════════════════════════════════
   CAJA DE ERROR
══════════════════════════════════════════════════════ */
.error-box {
  max-width: 420px;
  margin: 60px auto;
  background: #fff;
  border: 1px solid #f0c0c0;
  border-radius: 18px;
  padding: 40px 32px;
  text-align: center;
  box-shadow: 0 4px 32px rgba(200,50,50,0.07);
}
.error-icon {
  font-size: 52px; color: var(--c-red);
  margin-bottom: 14px; line-height: 1;
}
.error-box h3 {
  font-size: 20px; font-weight: 900;
  color: var(--c-text); margin-bottom: 8px;
}
.error-box p {
  font-size: 13.5px; color: var(--c-muted);
  margin-bottom: 22px; font-weight: 600;
}

/* ══════════════════════════════════════════════════════
   MÓDULO SN — BIENVENIDA
══════════════════════════════════════════════════════ */
.sn-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding: 40px 0;
}

.sn-welcome-card {
  background: #fff;
  border: 1px solid #dde3ef;
  border-radius: 18px;
  padding: 40px 36px;
  text-align: center;
  max-width: 500px; width: 100%;
  box-shadow: 0 4px 32px rgba(42,79,165,0.07);
}
.sn-welcome-icon {
  width: 64px; height: 64px;
  background: #e8edfa; color: var(--c-primary);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin: 0 auto 18px;
}
.sn-welcome-card h2 {
  font-size: 21px; font-weight: 900;
  color: var(--c-text); margin-bottom: 8px;
}
.sn-welcome-card p {
  font-size: 13.5px; color: var(--c-muted);
  line-height: 1.6; margin-bottom: 28px; font-weight: 600;
}
.sn-welcome-actions {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
}
.sn-quick-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: #f4f6fb; border: 1px solid #dde3ef;
  border-radius: 12px; padding: 16px 20px;
  font-size: 12px; font-weight: 800;
  color: var(--c-primary); cursor: pointer;
  font-family: 'Roboto', sans-serif;
  transition: all 0.15s; min-width: 90px;
}
.sn-quick-btn i { font-size: 22px; }
.sn-quick-btn:hover {
  background: var(--c-primary); color: #fff;
  border-color: var(--c-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(42,79,165,0.15);
}
.sn-welcome-img img {
  max-width: 260px; width: 100%;
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.1);
}

/* ══════════════════════════════════════════════════════
   FORMULARIO CARD (editar grupo)
══════════════════════════════════════════════════════ */
.form-card {
  background: #fff;
  border: 1px solid #dde3ef;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(42,79,165,0.06);
  max-width: 820px;
}
.form-card-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 24px;
  background: #f4f6fb;
  border-bottom: 1px solid #dde3ef;
  font-size: 14px; font-weight: 800;
  color: var(--c-primary);
}
.form-card-header i { font-size: 18px; }
.form-card-body { padding: 24px; }

.form-actions {
  display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap;
}
.form-actions .btn-form-primary { flex: 1; min-width: 140px; }
.form-actions .btn-form-outline  { flex: 1; min-width: 140px; }

/* Botón toolbar volver */
.btn-toolbar-back {
  display: inline-flex; align-items: center; gap: 6px;
  background: #f4f6fb; border: 1px solid #d0d8ea;
  border-radius: 8px; padding: 7px 14px;
  font-size: 13px; font-weight: 700;
  color: var(--c-muted); cursor: pointer;
  font-family: 'Roboto', sans-serif;
  transition: all 0.15s;
}
.btn-toolbar-back:hover { background: #dde3ef; color: var(--c-text); }

/* Filas vacías de tabla */
.tr-empty td { opacity: 0.25; }
.btn-gestionar-disabled {
  background: #b0bcd8 !important;
  cursor: not-allowed !important;
  transform: none !important;
}
.btn-validar { background: #1a8055; }
.btn-validar:hover { background: #136642 !important; }

/* ══════════════════════════════════════════════════════
   REPORTES GRID
══════════════════════════════════════════════════════ */
.reportes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.reporte-card {
  background: #fff;
  border: 1px solid #dde3ef;
  border-radius: 14px;
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
  transition: box-shadow 0.18s, border-color 0.18s, transform 0.18s;
}
.reporte-card:hover {
  border-color: var(--c-accent);
  box-shadow: 0 6px 22px rgba(30,168,212,0.1);
  transform: translateY(-2px);
}
.reporte-icon {
  width: 48px; height: 48px; flex-shrink: 0;
  background: #e8f7fc; color: var(--c-accent);
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.reporte-info { flex: 1; min-width: 0; }
.reporte-info h4 {
  font-size: 13.5px; font-weight: 800;
  color: var(--c-text); margin: 0 0 4px;
}
.reporte-info p {
  font-size: 11.5px; color: var(--c-muted);
  margin: 0; line-height: 1.5; font-weight: 600;
}
.btn-reporte {
  display: inline-flex; align-items: center; gap: 5px;
  flex-shrink: 0;
  background: var(--c-accent); color: #fff;
  border-radius: 8px; padding: 7px 14px;
  font-size: 12px; font-weight: 800;
  text-decoration: none; white-space: nowrap;
  font-family: 'Roboto', sans-serif;
  transition: background 0.15s, transform 0.1s;
}
.btn-reporte:hover {
  background: var(--c-accent-d, #178ab0); color: #fff;
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════════════════
   SN — PANTALLA DE BIENVENIDA
══════════════════════════════════════════════════════ */
.sn-welcome {
  display: flex;
  align-items: center;
  gap: 48px;
  max-width: 900px;
  margin: 40px auto;
  flex-wrap: wrap;
}
.sn-welcome-img img {
  width: 260px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}
.sn-welcome-text { flex: 1; min-width: 260px; }
.sn-welcome-text h2 {
  font-size: 32px; font-weight: 900;
  color: var(--c-text); margin: 12px 0 10px;
  letter-spacing: -0.02em;
}
.sn-welcome-text h2 .hl { color: var(--c-primary); }
.sn-welcome-text p {
  font-size: 14.5px; color: var(--c-muted);
  line-height: 1.7; margin-bottom: 24px;
}
.sn-quick-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-quick {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  background: #fff;
  border: 1.5px solid #d0d8ea;
  border-radius: 10px;
  font-size: 13px; font-weight: 700;
  font-family: 'Roboto', sans-serif;
  color: var(--c-text);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-quick:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
  background: #f0f4ff;
  transform: translateY(-1px);
}
.btn-quick.accent {
  background: var(--c-primary); color: #fff; border-color: var(--c-primary);
}
.btn-quick.accent:hover { background: var(--c-primary-d); }
.btn-quick i { font-size: 15px; }

/* ══════════════════════════════════════════════════════
   BOTONES DE TABLA — VARIANTES
══════════════════════════════════════════════════════ */
.btn-gestionar.yellow { background: #c8920a; }
.btn-gestionar.yellow:hover { background: #a67508; }
.btn-gestionar.disabled {
  background: #d0d8ea; color: #9aaac0;
  pointer-events: none; cursor: default;
}
.tr-empty td { opacity: 0.3; }

/* ══════════════════════════════════════════════════════
   REPORTES GRID
══════════════════════════════════════════════════════ */
.reportes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.reporte-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border: 1px solid #dde3ef;
  border-radius: 14px;
  padding: 18px 20px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.reporte-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(42,79,165,0.1);
  border-color: var(--c-accent);
  color: inherit;
}
.reporte-icon {
  width: 48px; height: 48px;
  border-radius: 13px;
  background: #e8f4fb;
  color: var(--c-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.reporte-icon.amber { background: #fdf3db; color: #b07d0a; }
.reporte-info { flex: 1; min-width: 0; }
.reporte-title {
  font-size: 14px; font-weight: 800;
  color: var(--c-text); margin-bottom: 3px;
}
.reporte-desc {
  font-size: 12px; color: var(--c-muted);
  line-height: 1.5; font-weight: 600;
}
.reporte-arrow {
  font-size: 16px; color: #b0bcd8;
  flex-shrink: 0;
  transition: color 0.15s;
}
.reporte-card:hover .reporte-arrow { color: var(--c-accent); }

/* ══════════════════════════════════════════════════════
   MÓDULO TN — FORMULARIO KARI (foto + campos)
══════════════════════════════════════════════════════ */
.kari-form-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.kari-foto-wrap {
  flex-shrink: 0;
  width: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.kari-foto {
  width: 128px;
  height: 128px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid #dde3ef;
  background: #f4f6fb;
}
.kari-fields { flex: 1; min-width: 240px; }

/* Badge de periodo destacado */
.periodo-badge {
  background: #e2f5ee !important;
  color: #1a8055 !important;
}

/* Badge de seleccionados */
.badge-selected {
  background: #fef3cd !important;
  color: #856404 !important;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Acciones en pie de tabla */
.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Botón enviar inscritos */
.btn-enviar {
  background: #1a8055 !important;
}
.btn-enviar:hover { background: #136642 !important; }
.btn-enviar[disabled] {
  background: #b0bcd8 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* Checkbox estilizado */
.checkbox-cmri {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}
.checkbox-cmri input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--c-primary);
  cursor: pointer;
  flex-shrink: 0;
}
.checkbox-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-muted);
}

/* Responsive kari form */
@media (max-width: 500px) {
  .kari-form-layout { flex-direction: column; align-items: center; }
  .kari-foto-wrap { width: 100%; }
  .kari-fields { width: 100%; }
}

/* ══════════════════════════════════════════════════════
   HERO VISUAL — 5 dots de tropas reposicionados
   en círculo equidistante (72° entre cada uno)
══════════════════════════════════════════════════════ */

/* Posiciones en círculo r≈130px desde el centro (320/2=160)
   ángulos: -90°, -18°, 54°, 126°, 198°  (cada 72°)
   top/left = 50% + r*sin(θ) / 50% - r*cos(θ) */

/* d1 Arco Iris  — arriba (−90°) */
.color-dot.d1 { background: #7c4fa0; top: 10px;  left: 50%; transform: translateX(-50%); }
/* d2 Gnomos     — derecha arriba (−18°) */
.color-dot.d2 { background: #d63b3b; top: 22%;  right: 12px; left: auto; transform: none; }
/* d3 Leos       — derecha abajo (+54°) */
.color-dot.d3 { background: #f5c518; bottom: 22%; right: 12px; left: auto; top: auto; transform: none; }
/* d4 Serges     — izquierda abajo (+126°) */
.color-dot.d4 { background: #4db8e8; bottom: 22%; left: 12px; top: auto; transform: none; }
/* d5 Maha       — izquierda arriba (+198°/−162°) */
.color-dot.d5 {
  position: absolute;
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 900;
  box-shadow: 0 4px 14px rgba(0,0,0,0.22);
  z-index: 3;
  background: #2a4fa5;
  top: 22%; left: 12px;
  animation: bdg 3.5s ease-in-out infinite 2.8s;
}

/* ══════════════════════════════════════════════════════
   HERO VISUAL v2 — 3 dots arriba / 2 abajo + logo centro
══════════════════════════════════════════════════════ */

/* Contenedor central con arco + logo apilados */
.hero-center-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* Logo omek debajo del arco */
.hero-omek-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: contain;
  border: 3px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.12);
  margin-top: -10px; /* se pega un poco al arco */
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

/* ── Fila superior — 3 dots ── */
/* Arco Iris: centro arriba */
.color-dot.dt1 {
  background: #7c4fa0;
  top: 8px; left: 50%;
  transform: translateX(-50%);
  animation: bdg 3.5s ease-in-out infinite 0s;
}
/* Gnomos: arriba izquierda */
.color-dot.dt2 {
  background: #d63b3b;
  top: 52px; left: 18px;
  animation: bdg 3.5s ease-in-out infinite 0.6s;
}
/* Leos: arriba derecha */
.color-dot.dt3 {
  background: #f5c518;
  top: 52px; right: 18px;
  animation: bdg 3.5s ease-in-out infinite 1.2s;
}

/* ── Fila inferior — 2 dots ── */
/* Serges: abajo izquierda */
.color-dot.db1 {
  background: #4db8e8;
  bottom: 52px; left: 18px;
  animation: bdg 3.5s ease-in-out infinite 1.8s;
}
/* Maha: abajo derecha */
.color-dot.db2 {
  background: #2a4fa5;
  bottom: 52px; right: 18px;
  animation: bdg 3.5s ease-in-out infinite 2.4s;
}

/* Todos comparten el tamaño base del color-dot */
.color-dot.dt1,
.color-dot.dt2,
.color-dot.dt3,
.color-dot.db1,
.color-dot.db2 {
  position: absolute;
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.22);
  z-index: 3;
}

/* ── Logo OMEK centrado solo en el hero ── */
.hero-omek-logo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: contain;
  border: 4px solid rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  animation: float 4s ease-in-out infinite;
}

/* ══════════════════════════════════════════════════════
   MÓDULO ADMIN (pn/)
══════════════════════════════════════════════════════ */

/* Label de sección en sidebar */
.sidebar-section-label {
  font-size: 10px;
  font-weight: 800;
  color: #8a9ab5;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 10px 20px 4px;
}

/* ── Bienvenida admin ── */
.admin-welcome {
  background: linear-gradient(135deg, var(--c-primary-d), var(--c-primary));
  border-radius: 14px;
  padding: 28px 32px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.admin-welcome-header { display: flex; align-items: center; gap: 20px; }
.admin-welcome-icon {
  width: 60px; height: 60px;
  background: rgba(255,255,255,0.15);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--c-yellow);
  flex-shrink: 0;
}
.admin-welcome h2 { font-size: 20px; font-weight: 900; color: #fff; margin: 0 0 4px; }
.admin-welcome p  { font-size: 13px; color: rgba(255,255,255,0.65); margin: 0; font-weight: 600; }

/* ── Cards de acceso rápido ── */
.admin-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.admin-quick-card {
  background: #fff;
  border: 1px solid #dde3ef;
  border-radius: 14px;
  padding: 22px 20px;
  display: flex; align-items: center; gap: 16px;
  cursor: pointer;
  transition: all 0.18s;
}
.admin-quick-card:hover {
  border-color: var(--c-primary);
  box-shadow: 0 6px 22px rgba(42,79,165,0.1);
  transform: translateY(-2px);
}
.aqc-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
}
.aqc-icon.blue  { background: #e8edfa; color: var(--c-primary); }
.aqc-icon.green { background: #e2f5ee; color: #1a8055; }
.aqc-icon.amber { background: #fef3cd; color: #856404; }
.aqc-info { flex: 1; }
.aqc-info h3 { font-size: 15px; font-weight: 800; color: var(--c-text); margin: 0 0 4px; }
.aqc-info p  { font-size: 12px; color: var(--c-muted); margin: 0; font-weight: 600; line-height: 1.4; }
.aqc-arrow { font-size: 20px; color: #c0cade; flex-shrink: 0; }
.admin-quick-card:hover .aqc-arrow { color: var(--c-primary); }

/* ── Filtros ── */
.filter-bar {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.filter-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 14px;
  border: 1px solid #d0d8ea;
  border-radius: 8px;
  background: #fff;
  font-size: 12px; font-weight: 700;
  color: var(--c-muted);
  font-family: 'Roboto', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn:hover { background: #f0f4ff; border-color: var(--c-primary); color: var(--c-primary); }
.filter-btn.active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }

/* ── Select de tipo inline ── */
.select-tipo {
  padding: 5px 8px;
  border: 1px solid #d0d8ea;
  border-radius: 7px;
  font-size: 12px; font-weight: 700;
  font-family: 'Roboto', sans-serif;
  background: #f8f9fd;
  color: var(--c-text);
  cursor: pointer;
  transition: border-color 0.15s;
}
.select-tipo:focus { outline: none; border-color: var(--c-primary); }

/* ── Badges de estado ── */
.estado-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 800;
}
.estado-badge.habilitado    { background: #e2f5ee; color: #1a8055; }
.estado-badge.deshabilitado { background: #fce8e8; color: #a32d2d; }

/* ── Botones de acción en tabla ── */
.action-btns { display: flex; gap: 6px; }
.btn-action {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; border-radius: 7px;
  font-size: 11.5px; font-weight: 800;
  font-family: 'Roboto', sans-serif;
  border: none; cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-action.enable  { background: #e2f5ee; color: #1a8055; }
.btn-action.enable:hover  { background: #1a8055; color: #fff; }
.btn-action.disable { background: #fce8e8; color: #a32d2d; }
.btn-action.disable:hover { background: #a32d2d; color: #fff; }

/* ── Solicitud en tabla ── */
.td-solicitud { font-size: 11.5px; color: var(--c-muted); max-width: 200px;
                white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-empty { text-align: center; color: #b0b8cc; font-style: italic;
            font-size: 13px; padding: 24px !important; }

/* ── Botón nuevo grupo ── */
.btn-nuevo-grupo {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 9px;
  background: var(--c-primary); color: #fff;
  font-size: 13px; font-weight: 800;
  font-family: 'Roboto', sans-serif;
  border: none; cursor: pointer;
  transition: all 0.15s; white-space: nowrap;
  flex-shrink: 0;
}
.btn-nuevo-grupo:hover { background: var(--c-primary-d); transform: translateY(-1px); }

/* ══════════════════════════════════════════════════════
   TRASLADOS
══════════════════════════════════════════════════════ */
.traslado-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 0;
}
@media (max-width: 768px) { .traslado-layout { grid-template-columns: 1fr; } }

.traslado-panel {}

/* Búsqueda inline */
.search-inline { display: flex; gap: 8px; }
.search-inline .form-input-cmri { flex: 1; }
.btn-buscar {
  width: 40px; height: 40px; flex-shrink: 0;
  background: var(--c-primary); color: #fff;
  border: none; border-radius: 9px;
  font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.btn-buscar:hover { background: var(--c-primary-d); }

/* Resultados de búsqueda */
.resultados-busqueda {
  margin-top: 12px;
  border: 1px solid #dde3ef;
  border-radius: 10px;
  overflow: hidden;
}
.resultado-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #edf0f7;
  cursor: pointer;
  transition: background 0.12s;
}
.resultado-item:last-child { border-bottom: none; }
.resultado-item:hover { background: #f4f6fb; }
.resultado-item.selected { background: #e8edfa; border-left: 3px solid var(--c-primary); }

.ri-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--c-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; flex-shrink: 0;
}
.ri-info { flex: 1; min-width: 0; }
.ri-info strong { display: block; font-size: 13px; font-weight: 800; color: var(--c-text); }
.ri-info span   { font-size: 11px; color: var(--c-muted); font-weight: 600; }
.ri-arrow { color: #c0cade; font-size: 14px; }

.no-results { font-size: 13px; color: var(--c-muted); margin-top: 10px;
              display: flex; align-items: center; gap: 6px; font-weight: 600; }

/* Miembro seleccionado */
.miembro-card-selected {
  display: flex; align-items: center; gap: 14px;
  background: #f4f6fb; border-radius: 10px;
  padding: 14px; margin-bottom: 20px;
}
.mcs-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--c-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; flex-shrink: 0;
}
.mcs-info h4  { font-size: 15px; font-weight: 900; color: var(--c-text); margin: 0 0 2px; }
.mcs-info span { font-size: 12px; color: var(--c-muted); font-weight: 600; }

/* Flujo origen → destino */
.traslado-flujo {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.flujo-bloque {
  flex: 1; min-width: 100px;
  border-radius: 10px; padding: 12px 14px;
  border: 1px solid #dde3ef;
}
.flujo-bloque.origen  { background: #fce8e8; border-color: #f0c0c0; }
.flujo-bloque.destino { background: #e2f5ee; border-color: #b0ddc8; }
.flujo-label { font-size: 10px; font-weight: 800; text-transform: uppercase;
               letter-spacing: 0.06em; color: var(--c-muted); margin-bottom: 4px; }
.flujo-valor { font-size: 14px; font-weight: 900; color: var(--c-text); }
.flujo-valor.placeholder { color: #b0b8cc; font-weight: 600; font-style: italic; font-size: 13px; }
.flujo-sub   { font-size: 11px; color: var(--c-muted); font-weight: 600; margin-top: 2px; }
.flujo-arrow { font-size: 22px; color: #b0b8cc; flex-shrink: 0; }

.traslado-placeholder {
  text-align: center; padding: 40px 20px; color: var(--c-muted);
}
.traslado-placeholder i { font-size: 40px; display: block; margin-bottom: 12px; opacity: 0.4; }
.traslado-placeholder p { font-size: 13px; font-weight: 600; }

.alerta-warning {
  display: flex; align-items: center; gap: 8px;
  background: #fef3cd; border: 1px solid #fcd34d;
  border-radius: 8px; padding: 10px 14px;
  font-size: 12.5px; font-weight: 700;
  color: #856404; margin-bottom: 14px;
}

/* Tags de grupo en historial */
.grupo-tag {
  display: inline-block; padding: 2px 8px;
  border-radius: 6px; font-size: 11px; font-weight: 800;
}
.origen-tag  { background: #fce8e8; color: #a32d2d; }
.destino-tag { background: #e2f5ee; color: #1a8055; }

/* ── Paginación inteligente ── */
.pag-dots {
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
  font-size: 13px;
  color: var(--c-muted);
  font-weight: 700;
  user-select: none;
}
.pag-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ══════════════════════════════════════════════════════
   DASHBOARD RESUMEN GLOBAL
══════════════════════════════════════════════════════ */

/* Grid métricas principales */
.stats-grid-main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  border-radius: var(--border-radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.15s;
}
.stat-card:hover { transform: translateY(-2px); }

.stat-card.blue   { background: #e8edfa; }
.stat-card.green  { background: #e2f5ee; }
.stat-card.amber  { background: #fef3cd; }
.stat-card.purple { background: #eeedfe; }
.stat-card.teal   { background: #e1f5ee; }
.stat-card.gray   { background: #f1efe8; }

.stat-icon {
  font-size: 26px;
  flex-shrink: 0;
  width: 48px; height: 48px;
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.6);
}
.stat-card.blue   .stat-icon { color: #185FA5; }
.stat-card.green  .stat-icon { color: #3B6D11; }
.stat-card.amber  .stat-icon { color: #854F0B; }
.stat-card.purple .stat-icon { color: #534AB7; }
.stat-card.teal   .stat-icon { color: #0F6E56; }
.stat-card.gray   .stat-icon { color: #5F5E5A; }

.stat-body { min-width: 0; }
.stat-num {
  font-size: 28px; font-weight: 900;
  line-height: 1; margin-bottom: 4px;
}
.stat-card.blue   .stat-num { color: #0C447C; }
.stat-card.green  .stat-num { color: #27500A; }
.stat-card.amber  .stat-num { color: #633806; }
.stat-card.purple .stat-num { color: #3C3489; }
.stat-card.teal   .stat-num { color: #085041; }
.stat-card.gray   .stat-num { color: #444441; }

.stat-label {
  font-size: 12px; font-weight: 700;
  color: var(--c-muted);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.stat-sub { font-weight: 600; opacity: 0.8; }
.stat-sub.pending { color: #a32d2d; }

.stat-variacion {
  font-size: 11px; font-weight: 800;
  padding: 1px 6px; border-radius: 6px;
}
.stat-variacion.positivo { background: #e2f5ee; color: #3B6D11; }
.stat-variacion.negativo { background: #fcebeb; color: #A32D2D; }
.stat-variacion.neutro   { background: #f1efe8; color: #5F5E5A; }

/* Fila inferior */
.stats-bottom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stats-card-panel {
  background: #fff;
  border: 1px solid #dde3ef;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
}
.stats-panel-header {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 18px;
  background: #f4f6fb;
  border-bottom: 1px solid #dde3ef;
  font-size: 13px; font-weight: 800;
  color: var(--c-primary);
}
.stats-panel-header i { font-size: 15px; }
.stats-panel-body { padding: 14px 18px; }

/* Top grupos */
.top-grupo-item {
  margin-bottom: 12px;
}
.top-grupo-item:last-child { margin-bottom: 0; }
.tgi-info {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 5px;
}
.tgi-rank {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--c-primary); color: #fff;
  font-size: 11px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tgi-info strong { font-size: 13px; font-weight: 800; color: var(--c-text); display: block; }
.tgi-ciudad { font-size: 11px; color: var(--c-muted); font-weight: 600; }
.tgi-bar-wrap { display: flex; align-items: center; gap: 8px; }
.tgi-bar {
  height: 8px; border-radius: 4px;
  background: var(--c-primary);
  opacity: 0.7;
  transition: width 0.5s ease;
  min-width: 4px;
}
.tgi-total { font-size: 12px; font-weight: 800; color: var(--c-primary); flex-shrink: 0; }

/* Tropas */
.tropa-item { margin-bottom: 12px; }
.tropa-item:last-child { margin-bottom: 0; }
.tropa-header {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 5px;
}
.tropa-nombre { font-size: 13px; font-weight: 700; color: var(--c-text); }
.tropa-total  { font-size: 12px; font-weight: 800; color: var(--c-muted); }
.tropa-bar-wrap { display: flex; align-items: center; gap: 8px; }
.tropa-bar {
  height: 8px; border-radius: 4px;
  transition: width 0.5s ease;
  min-width: 4px; flex: 0 0 auto;
}
.tropa-pct { font-size: 11px; font-weight: 700; color: var(--c-muted); flex-shrink: 0; }

/* Colores por tropa */
.tropa-arcoiris { background: #7c4fa0; width: var(--w); }
.tropa-gnomos   { background: #d63b3b; }
.tropa-leos     { background: #f5c518; }
.tropa-serges   { background: #4db8e8; }
.tropa-maha     { background: #2a4fa5; }
.tropa-default  { background: #888780; }

.stats-empty {
  font-size: 13px; color: var(--c-muted);
  text-align: center; padding: 20px 0;
  font-weight: 600; font-style: italic;
}

/* ── Selector de periodo ── */
.periodo-selector {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  padding: 8px 16px;
}
.periodo-label {
  font-size: 13px; font-weight: 700;
  color: rgba(255,255,255,0.75);
  display: flex; align-items: center; gap: 6px;
}
.periodo-vs {
  font-size: 12px; color: rgba(255,255,255,0.6);
  font-weight: 600;
}
.periodo-vs strong { color: var(--c-yellow); }

/* ── Loading state ── */
.loading-state {
  text-align: center; padding: 48px;
  font-size: 14px; font-weight: 700;
  color: var(--c-muted);
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.spin { display: inline-block; animation: spin-anim 1s linear infinite; }
@keyframes spin-anim { to { transform: rotate(360deg); } }

/* ── Colores reales de tropas CMRI ── */
.tropa-AI { background: #7c4fa0; } /* violeta */
.tropa-GK { background: #d63b3b; } /* rojo    */
.tropa-LK { background: #f5c518; } /* amarillo */
.tropa-SK { background: #4db8e8; } /* azul cielo */
.tropa-MK { background: #2a4fa5; } /* azul */

/* ── Sin fecha de nacimiento ── */
.sin-nac-alert {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px; padding: 10px 14px;
  background: #fef3cd; border: 1px solid #fcd34d;
  border-radius: 9px;
  font-size: 12.5px; font-weight: 600; color: #856404;
}
.sin-nac-alert i  { font-size: 15px; flex-shrink: 0; }
.sin-nac-ok {
  display: flex; align-items: center; gap: 6px;
  margin-top: 14px; padding: 8px 14px;
  background: #e2f5ee; border-radius: 9px;
  font-size: 12px; font-weight: 700; color: #3B6D11;
}

/* ══════════════════════════════════════════════════════
   ESTADÍSTICAS DE INSCRIPCIONES
══════════════════════════════════════════════════════ */
.crec-item {
  padding: 10px 0;
  border-bottom: 1px solid #edf0f7;
}
.crec-item:last-child { border-bottom: none; }

.crec-header {
  display: flex; align-items: center;
  justify-content: space-between; gap: 8px;
}
.crec-nombre {
  font-size: 13px; font-weight: 800; color: var(--c-text);
}
.crec-ciudad {
  font-size: 11px; color: var(--c-muted); font-weight: 600;
  margin-top: 2px;
}
.crec-pct {
  font-size: 12px; font-weight: 800;
  padding: 3px 10px; border-radius: 8px;
  white-space: nowrap; flex-shrink: 0;
}
.crec-pct.positivo { background: #e2f5ee; color: #3B6D11; }
.crec-pct.negativo { background: #fcebeb; color: #A32D2D; }
.crec-pct.neutro   { background: #f1efe8; color: #5F5E5A; }