/* =========================================================
   JSimulador — Design System Institucional Claro v3.0
   Paleta: Azul marino / Índigo profundo + Verde petróleo
   Display: Source Serif 4 (títulos académicos)
   Texto: Inter (cuerpo, UI)
    ========================================================= */

/* =========================================================
   TOKENS — variables de diseño
   ========================================================= */
:root {
  /* Marca (sobrescritos inline por tenant) */
  --brand:   #143a6b;
  --brand-2: #0f766e;

  /* Acento derivado visible */
  --brand-light:  #dbeafe;
  --brand-mid:    #2563eb;
  --brand-2-light:#ccfbf1;
  --brand-2-mid:  #14b8a6;

  /* Fondos */
  --bg:        #f7f9fc;
  --bg-2:      #ffffff;
  --bg-3:      #f0f4f9;

  /* Superficies */
  --surface:   #ffffff;
  --surface-2: #f4f7fb;
  --surface-3: #edf1f7;

  /* Card */
  --card:      #ffffff;
  --card-border: #e5e9f2;

  /* Texto */
  --text:      #1f2937;
  --text-2:    #374151;
  --muted:     #4b5563;
  --dim:       #4b5563;

  /* Bordes */
  --line:      #e5e9f2;
  --line-2:    #d1d8e8;
  --line-3:    #bec9de;

  /* Semánticos */
  --ok:        #047857;
  --ok-dim:    #d1fae5;
  --warn:      #b45309;
  --warn-dim:  #fef3c7;
  --bad:       #dc2626;
  --bad-dim:   #fee2e2;
  --info:      #0369a1;
  --info-dim:  #e0f2fe;

  /* Radios */
  --r-xs:  6px;
  --r-sm:  10px;
  --r:     14px;
  --r-lg:  18px;
  --r-xl:  22px;
  --r-2xl: 28px;

  /* Sombras — muy suaves, propias de fondo claro */
  --shadow-sm:  0 1px 4px 0 rgba(20,58,107,.06), 0 2px 8px -2px rgba(20,58,107,.07);
  --shadow:     0 2px 12px -2px rgba(20,58,107,.09), 0 4px 24px -4px rgba(20,58,107,.08);
  --shadow-lg:  0 4px 32px -4px rgba(20,58,107,.12), 0 8px 48px -8px rgba(20,58,107,.1);
  --shadow-brand: 0 0 0 2px rgba(20,58,107,.15), 0 4px 20px -4px rgba(20,58,107,.2);

  /* Transiciones */
  --t-fast: .1s ease;
  --t:      .18s ease;
  --t-slow: .28s ease;

  /* Espaciado base */
  --gap:    20px;
  --gap-sm: 14px;
  --gap-lg: 32px;
}

/* =========================================================
   RESET Y BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  background-color: var(--bg);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-mid); }
a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

img { max-width: 100%; height: auto; }

/* =========================================================
   TIPOGRAFÍA
   ========================================================= */
h1, h2, h3, h4, h5 {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  line-height: 1.25;
  color: var(--text);
}

h1 { font-size: clamp(22px, 3.5vw, 30px); font-weight: 700; letter-spacing: -.3px; }
h2 { font-size: 17px; font-weight: 700; letter-spacing: -.1px; }
h3 { font-size: 15px; font-weight: 700; }
h4 { font-size: 13.5px; font-weight: 600; }

p { color: var(--text-2); line-height: 1.7; }
p + p { margin-top: .6em; }

.lead {
  font-size: 15px;
  color: var(--muted);
  max-width: 66ch;
  line-height: 1.65;
}

.eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  font-family: "Inter", sans-serif;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--brand-mid);
  margin-bottom: 6px;
}

.muted  { color: var(--muted) !important; }
.dim    { color: var(--dim) !important; }
.ok     { color: var(--ok); }
.warn   { color: var(--warn); }
.bad    { color: var(--bad); }
.info   { color: var(--info); }

.mono {
  font-family: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
  font-size: .875em;
  color: var(--muted);
}

/* =========================================================
   TOPBAR
   ========================================================= */
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: stretch;
  height: 60px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 0 var(--line), 0 2px 12px -4px rgba(20,58,107,.08);
}

.topbar-inner {
  width: 100%; max-width: 1280px; margin: 0 auto;
  padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

/* Logo / marca */
.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; flex-shrink: 0;
}
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  font-family: "Source Serif 4", serif;
  font-size: 17px; font-weight: 700; color: #fff;
  background: var(--brand);
  box-shadow: 0 2px 8px -2px rgba(20,58,107,.35);
  transition: var(--t);
  flex-shrink: 0;
  letter-spacing: 0;
}
.brand:hover .brand-mark {
  background: #1a4a85;
  box-shadow: 0 4px 14px -2px rgba(20,58,107,.4);
}

.brand-text { display: flex; flex-direction: column; gap: 1px; line-height: 1; }
.brand-text small {
  font-size: 10px; font-weight: 500; color: var(--dim);
  text-transform: uppercase; letter-spacing: .8px;
  font-family: "Inter", sans-serif;
}
.brand-text span {
  font-family: "Source Serif 4", serif;
  font-size: 15px; font-weight: 700;
  color: var(--brand);
  letter-spacing: -.2px;
}

/* Acciones topbar */
.top-actions {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}

.chip {
  font-size: 12px; font-weight: 500;
  font-family: "Inter", sans-serif;
  color: var(--muted);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  padding: 5px 13px; border-radius: 999px;
  transition: var(--t);
  cursor: default; user-select: none;
  white-space: nowrap;
}
a.chip, button.chip {
  cursor: pointer;
  font: inherit;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
}
a.chip:hover, button.chip:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-light);
}
button.chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.chip.tenant {
  color: var(--brand);
  border-color: rgba(20,58,107,.2);
  background: var(--brand-light);
  font-weight: 600;
}
.chip.role {
  color: var(--brand-2);
  border-color: rgba(15,118,110,.2);
  background: var(--brand-2-light);
  font-weight: 600;
}

/* =========================================================
   LAYOUT PRINCIPAL
   ========================================================= */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 36px 28px 80px;
  animation: page-enter .3s cubic-bezier(.16,1,.3,1) both;
}

@keyframes page-enter {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   PAGE HERO
   ========================================================= */
.page-hero {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  padding: 0 0 28px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 36px;
}
.page-hero h1 { margin-bottom: 4px; }
.page-hero .lead { margin-top: 4px; }

/* =========================================================
   ACENTO IZQUIERDO EN TÍTULOS DE SECCIÓN
   ========================================================= */
h2.accented,
.card h2 {
  display: flex; align-items: center; gap: 10px;
}
h2.accented::before,
.card h2::before {
  content: "";
  width: 3px; height: 16px; border-radius: 2px; flex-shrink: 0;
  background: var(--brand);
}

/* =========================================================
   GRID
   ========================================================= */
.grid { display: grid; gap: var(--gap); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .container { padding: 20px 16px 60px; }
}

/* =========================================================
   CARDS
   ========================================================= */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--r-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}
.card:hover {
  border-color: var(--line-2);
  box-shadow: var(--shadow);
}

.card.accent {
  border-color: rgba(20,58,107,.18);
  border-left: 3px solid var(--brand);
  background: linear-gradient(135deg, rgba(219,234,254,.3) 0%, #fff 60%);
  box-shadow: var(--shadow-sm);
}

.card.soft {
  background: var(--surface-2);
  border-color: var(--line);
}
.card.table-card {
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.card.table-card table { border-radius: 0; }
.card.table-card[tabindex="0"]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

/* Top accent stripe */
.card.stripe-top::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

/* =========================================================
   KPI TILES
   ========================================================= */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--gap-sm);
}

.kpi-tile {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
  transition: var(--t);
}
.kpi-tile:hover {
  border-color: var(--line-2);
  box-shadow: var(--shadow-sm);
}
.kpi-tile .label {
  font-size: 11px; font-weight: 700;
  color: var(--dim); text-transform: uppercase; letter-spacing: .9px;
  margin-bottom: 6px;
  font-family: "Inter", sans-serif;
}
.kpi-tile .val {
  font-family: "Inter", sans-serif;
  font-size: 24px; font-weight: 700; letter-spacing: -.5px;
  line-height: 1;
  color: var(--brand);
}
.kpi-tile .val small {
  font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0;
}
.kpi-tile .sub {
  font-size: 11.5px; color: var(--dim); margin-top: 4px;
  font-family: "Inter", sans-serif;
}

/* KPI card grande */
.kpi-card { padding: 24px 26px; }
.kpi-label {
  font-size: 11px; font-weight: 700; letter-spacing: .9px;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 10px;
  font-family: "Inter", sans-serif;
}
.kpi {
  font-family: "Inter", sans-serif;
  font-size: 34px; font-weight: 800; letter-spacing: -1.5px;
  color: var(--brand);
  line-height: 1;
}
.kpi-card .muted { font-size: 12.5px; margin-top: 6px; }

/* Icon badge */
.icon-badge {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center;
  font-family: "Source Serif 4", serif;
  font-size: 16px; font-weight: 700; color: var(--brand);
  background: var(--brand-light);
  border: 1px solid rgba(20,58,107,.12);
  margin-bottom: 14px;
}

/* =========================================================
   SECCIÓN HEAD
   ========================================================= */
.section-head {
  display: flex; align-items: center; gap: 12px;
  margin: 36px 0 14px;
}
.section-head h2 { margin: 0; }
.section-head h2::before { display: none; }

/* =========================================================
   BOTONES
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: "Inter", sans-serif; font-size: 14px; font-weight: 600;
  padding: 10px 22px; border-radius: var(--r-sm); border: 0;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform var(--t), background var(--t), box-shadow var(--t), color var(--t);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 8px -2px rgba(20,58,107,.3);
  letter-spacing: .1px;
}
.btn:hover {
  background: #1a4a85;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px -4px rgba(20,58,107,.4);
  color: #fff;
}
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

.btn.ghost {
  background: transparent;
  border: 1.5px solid var(--line-2);
  color: var(--text-2);
  box-shadow: none;
}
.btn.ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-light);
  transform: translateY(-1px);
  box-shadow: none;
}

.btn.teal {
  background: var(--brand-2);
  box-shadow: 0 2px 8px -2px rgba(15,118,110,.3);
}
.btn.teal:hover {
  background: #0c5f57;
  box-shadow: 0 4px 16px -4px rgba(15,118,110,.4);
}

.btn.ok {
  background: var(--ok);
  box-shadow: 0 2px 8px -2px rgba(5,150,105,.3);
}
.btn.ok:hover {
  background: #047857;
  box-shadow: 0 4px 16px -4px rgba(5,150,105,.4);
}

.btn.block { width: 100%; }
.btn.small {
  font-size: 12.5px; padding: 6px 14px; border-radius: 8px;
  box-shadow: none;
}
.btn.lg { font-size: 15px; padding: 13px 30px; border-radius: var(--r); }

.btn:disabled, .btn[disabled] {
  opacity: .45; cursor: not-allowed; transform: none; box-shadow: none;
}

/* =========================================================
   FORMULARIOS
   ========================================================= */
.field { margin-bottom: 18px; }

label {
  display: block;
  font-size: 13px; font-weight: 600; color: var(--text);
  margin-bottom: 6px;
  font-family: "Inter", sans-serif;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
select,
textarea {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--line-2);
  color: var(--text);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 14px; font-family: "Inter", inherit;
  line-height: 1.5;
  transition: border-color var(--t), box-shadow var(--t);
  appearance: none;
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(20,58,107,.1);
}
input::placeholder, textarea::placeholder { color: var(--dim); }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
select option { background: #fff; color: var(--text); }

textarea { resize: vertical; min-height: 90px; }

@media (forced-colors: active) {
  select {
    appearance: auto;
    -webkit-appearance: auto;
    background-image: none;
    padding-right: 14px;
  }
  input:focus, select:focus, textarea:focus {
    outline: 2px solid CanvasText;
    outline-offset: 2px;
  }
}

/* Django as_p */
form p { margin: 0 0 16px; }
form p label { display: block; }
form p input, form p select, form p textarea { margin-top: 4px; }

.field-hint { font-size: 12px; color: var(--dim); margin-top: 4px; font-family: "Inter", sans-serif; }
.field-warn { font-size: 12px; color: var(--warn); margin-top: 4px; font-family: "Inter", sans-serif; }
.field-ok   { font-size: 12px; color: var(--ok);   margin-top: 4px; font-family: "Inter", sans-serif; }

/* =========================================================
   TABLAS
   ========================================================= */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

thead { background: var(--surface-2); }
th {
  color: var(--dim); font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: .8px;
  padding: 12px 18px; text-align: left;
  border-bottom: 1px solid var(--line);
  font-family: "Inter", sans-serif;
}
td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  vertical-align: middle;
  font-family: "Inter", sans-serif;
}
td strong { color: var(--text); font-weight: 600; }
tbody tr { transition: background var(--t-fast); }
tbody tr:hover td { background: rgba(20,58,107,.03); }
tbody tr:last-child td { border-bottom: 0; }

.table-card thead th:first-child { padding-left: 22px; }
.table-card td:first-child { padding-left: 22px; }

/* =========================================================
   BADGES / NIVELES DE COMPETENCIA
   ========================================================= */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line);
  white-space: nowrap;
  background: var(--surface-2);
  color: var(--muted);
  font-family: "Inter", sans-serif;
}

/* Niveles de competencia — conservar nombres exactos */
.lvl-DESTACADO {
  color: #065f46;
  border-color: #a7f3d0;
  background: #d1fae5;
}
.lvl-LOGRADO {
  color: #047857;
  border-color: #6ee7b7;
  background: #ecfdf5;
}
.lvl-EN_PROCESO {
  color: #92400e;
  border-color: #fcd34d;
  background: #fffbeb;
}
.lvl-NO_LOGRADO {
  color: #991b1b;
  border-color: #fca5a5;
  background: #fef2f2;
}

/* Pill / chip de info */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 500;
  color: var(--brand); border: 1px solid rgba(20,58,107,.2);
  padding: 3px 12px; border-radius: 999px;
  background: var(--brand-light);
  font-family: "Inter", sans-serif;
}
.pill.violet {
  color: #5b21b6;
  border-color: rgba(124,58,237,.2);
  background: #ede9fe;
}
.pill.indigo {
  color: var(--brand);
  border-color: rgba(20,58,107,.2);
  background: var(--brand-light);
}
.pill.ok   {
  color: var(--ok);
  border-color: rgba(5,150,105,.2);
  background: var(--ok-dim);
}
.pill.warn {
  color: var(--warn);
  border-color: rgba(217,119,6,.2);
  background: var(--warn-dim);
}
.pill.bad  {
  color: var(--bad);
  border-color: rgba(220,38,38,.2);
  background: var(--bad-dim);
}

/* =========================================================
   FLASH / MENSAJES
   ========================================================= */
.flash {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 16px; border-radius: var(--r-sm);
  margin: 0 0 16px; border: 1px solid var(--line);
  font-size: 14px; line-height: 1.5;
  font-family: "Inter", sans-serif;
}
.flash.success { border-color: #a7f3d0; background: #ecfdf5; color: #065f46; }
.flash.error   { border-color: #fca5a5; background: #fef2f2; color: #991b1b; }
.flash.warning { border-color: #fcd34d; background: #fffbeb; color: #92400e; }
.flash.info    { border-color: #bae6fd; background: #f0f9ff; color: #0369a1; }

/* =========================================================
   PROGRESS BAR
   ========================================================= */
.progress-wrap { display: flex; align-items: center; gap: 10px; }
.bar {
  flex: 1; height: 7px;
  background: var(--surface-3); border-radius: 999px;
  overflow: hidden;
}
.bar > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-mid));
  border-radius: 999px;
  transition: width .6s cubic-bezier(.16,1,.3,1);
}
.bar.thin { height: 4px; }
.bar.ok > span   { background: linear-gradient(90deg, #047857, var(--ok)); }
.bar.warn > span { background: linear-gradient(90deg, #b45309, var(--warn)); }

/* Barra de rondas */
.round-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; margin-bottom: 2px;
}
.round-bar .label {
  font-size: 12px; font-weight: 600; color: var(--dim);
  white-space: nowrap;
  font-family: "Inter", sans-serif;
}

/* =========================================================
   EMPTY STATE
   ========================================================= */
.empty {
  text-align: center; padding: 32px 24px;
  color: var(--dim); font-size: 14px;
  font-family: "Inter", sans-serif;
}
td .empty, .card.empty { padding: 24px; }

/* =========================================================
   INLINE FORM
   ========================================================= */
.inline-form {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
  margin-top: 10px;
}
.inline-form .field { flex: 1; min-width: 200px; margin-bottom: 0; }

/* =========================================================
   LOGIN — split panel
   ========================================================= */
.login-wrap {
  min-height: 100vh;
  display: grid; grid-template-columns: 1fr 1fr;
  position: relative;
  background: var(--bg);
}
@media (max-width: 700px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-visual { display: none !important; }
}

/* Panel visual izquierdo */
.login-visual {
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 52px 56px;
  background: var(--brand);
  position: relative; overflow: hidden;
}
.login-visual::before {
  content: "";
  position: absolute; bottom: 0; right: -60px;
  width: 340px; height: 340px; border-radius: 50%;
  background: rgba(255,255,255,.05);
  pointer-events: none;
}
.login-visual::after {
  content: "";
  position: absolute; top: -80px; left: -80px;
  width: 260px; height: 260px; border-radius: 50%;
  background: rgba(255,255,255,.04);
  pointer-events: none;
}

/* Línea decorativa institucional */
.login-visual-stripe {
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--brand-2), #2dd4bf);
}

.login-logo {
  display: flex; align-items: center; gap: 14px;
  position: relative; z-index: 1;
}
.login-logo .brand-mark {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  font-family: "Source Serif 4", serif;
  font-size: 20px; font-weight: 700; color: var(--brand);
  background: #fff;
  box-shadow: 0 4px 14px -4px rgba(0,0,0,.25);
}
.login-logo span {
  font-family: "Source Serif 4", serif;
  font-size: 20px; font-weight: 700;
  color: #fff;
  letter-spacing: -.3px;
}

.login-copy {
  max-width: 380px;
  position: relative; z-index: 1;
}
.login-copy .eyebrow {
  color: #ffffff;
  margin-bottom: 14px;
  display: block;
}
.login-copy h1 {
  font-size: clamp(24px, 3.5vw, 34px); font-weight: 700;
  letter-spacing: -.4px; line-height: 1.2; margin-bottom: 16px;
  color: #fff;
}
.login-copy p { color: #ffffff; font-size: 15px; line-height: 1.65; }

.login-features {
  display: flex; flex-direction: column; gap: 10px; margin-top: 28px;
}
.login-feature {
  display: flex; align-items: center; gap: 12px;
  font-size: 13.5px; color: #ffffff;
  font-family: "Inter", sans-serif;
}
.login-feature-dot {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
  background: var(--brand-2-mid);
}

.login-footer {
  font-size: 12px; color: #ffffff;
  position: relative; z-index: 1;
  font-family: "Inter", sans-serif;
}

/* Panel formulario derecho */
.login-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 48px 40px;
  background: #fff;
  border-left: 1px solid var(--line);
}

.login-card {
  width: 100%; max-width: 400px;
}
.login-card h2 {
  font-size: 22px; margin-bottom: 6px;
  display: block;
  color: var(--text);
}
.login-card h2::before { display: none; }

/* =========================================================
   HERO BRIEFING
   ========================================================= */
.briefing-hero {
  position: relative; overflow: hidden;
  border-radius: var(--r-2xl);
  padding: 44px 48px 40px;
  margin-bottom: 28px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #f0f5ff 0%, #e8f4f8 50%, #f0fdf4 100%);
  box-shadow: var(--shadow);
}
/* Franja institucional superior */
.briefing-hero::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 100%);
}
/* Círculo decorativo sutil */
.briefing-hero::after {
  content: "";
  position: absolute; bottom: -40px; right: -40px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(20,58,107,.06), transparent 70%);
  pointer-events: none;
}

.briefing-hero h1 {
  font-size: clamp(26px, 4.5vw, 40px);
  font-weight: 700; letter-spacing: -.5px; margin-bottom: 16px;
  color: var(--brand);
  position: relative; z-index: 1;
}
.briefing-hero .meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  position: relative; z-index: 1;
}
.briefing-hero .cta-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 28px; position: relative; z-index: 1;
}

/* Chips de metadata en briefing */
.meta-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600;
  padding: 5px 14px; border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,.75);
  color: var(--text-2);
  white-space: nowrap;
  font-family: "Inter", sans-serif;
}
.meta-chip.sector {
  color: var(--brand-2);
  border-color: rgba(15,118,110,.25);
  background: var(--brand-2-light);
}
.meta-chip.dific {
  color: var(--warn);
  border-color: rgba(217,119,6,.25);
  background: var(--warn-dim);
}
.meta-chip.rondas {
  color: #5b21b6;
  border-color: rgba(91,33,182,.2);
  background: #ede9fe;
}
.meta-chip.sim {
  color: var(--brand);
  border-color: rgba(20,58,107,.2);
  background: var(--brand-light);
}

/* =========================================================
   PARTIDA — ENCABEZADO
   ========================================================= */
.partida-header {
  padding: 0 0 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.partida-header-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 14px;
}
.partida-header h1 {
  font-size: clamp(20px, 3vw, 28px); margin-bottom: 4px;
}
.partida-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* =========================================================
   CAMPO DE DECISIÓN
   ========================================================= */
.decision-fields { display: flex; flex-direction: column; gap: 6px; }

.decision-field {
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  padding: 16px 18px;
  background: var(--surface);
  transition: border-color var(--t), box-shadow var(--t);
}
.decision-field:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(20,58,107,.08);
}
.decision-field label {
  font-size: 13px; font-weight: 700; color: var(--text);
  margin-bottom: 8px; display: block; cursor: pointer;
  font-family: "Inter", sans-serif;
}
.decision-field input,
.decision-field select {
  background: var(--surface-2);
  border: 1.5px solid var(--line);
}
.decision-field input:focus,
.decision-field select:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(20,58,107,.08);
}

.field-meta { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.field-hint-text {
  font-size: 12px; color: var(--muted); line-height: 1.5;
  font-family: "Inter", sans-serif;
}
.field-hint-text strong { color: var(--text-2); }
.field-warn-text {
  font-size: 12px; color: var(--warn); line-height: 1.5;
  font-family: "Inter", sans-serif;
}

.diagnostico-opcion {
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
}
.diagnostico-opcion:hover,
.diagnostico-opcion:focus-within {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 3px rgba(20,58,107,.1);
}
.diagnostico-opcion:has(input:checked) {
  border-color: var(--brand) !important;
  background: var(--brand-light) !important;
}
.diagnostico-opcion input[type="radio"]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

/* =========================================================
   HOME ESTUDIANTE — catálogo por carreras
   ========================================================= */
.career-section { margin-bottom: 44px; }

.career-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 18px; padding-bottom: 14px;
  border-bottom: 2px solid var(--line);
}
.career-icon {
  width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 20px;
  background: var(--brand-light);
  border: 1px solid rgba(20,58,107,.15);
  color: var(--brand);
}
.career-header h2 {
  font-size: 16px; margin: 0; color: var(--text);
}
.career-header h2::before { display: none; }
.career-header p { font-size: 13px; color: var(--dim); margin-top: 2px; }

.sim-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: var(--gap-sm);
}

.sim-card {
  display: flex; flex-direction: column; gap: 12px;
  min-height: 168px; padding: 22px 24px;
  cursor: pointer;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}
.sim-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(20,58,107,.18);
}

.sim-card-ico {
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center; font-size: 20px;
  background: var(--brand-light);
  border: 1px solid rgba(20,58,107,.12);
  flex-shrink: 0;
  color: var(--brand);
  transition: var(--t);
}
.sim-card:hover .sim-card-ico {
  background: var(--brand);
  color: #fff;
}

.sim-card h3 { font-size: 14.5px; margin-bottom: 2px; color: var(--text); }
.sim-card .sim-meta { font-size: 12px; color: var(--dim); line-height: 1.4; }
.sim-card .sim-estado { margin-top: auto; }
.sim-card .btn { margin-top: 8px; }

/* =========================================================
   PUNTUACIONES EN TABLAS
   ========================================================= */
.score-hi { color: var(--ok); font-weight: 700; }
.score-md { color: var(--warn); font-weight: 600; }
.score-lo { color: var(--bad); }

.ranking-me td { background: rgba(20,58,107,.08) !important; }
.ranking-leader td:first-child { color: #d97706; font-weight: 800; }
.ranking-pos-1 { color: #d97706; font-weight: 800; }

/* =========================================================
   ACTIVIDAD DETALLE (tablero docente)
   ========================================================= */
.actividad-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding-bottom: 24px; margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

/* =========================================================
   RESULTADO ANTERIOR
   ========================================================= */
.resultado-card {
  border-color: rgba(20,58,107,.2);
  border-left: 3px solid var(--brand);
  background: linear-gradient(135deg, rgba(219,234,254,.2) 0%, #fff 70%);
}
.resultado-card h3 { color: var(--brand); }

/* Noticias */
.noticias-list { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 0; }
.noticias-list li {
  padding: 10px 14px; border-radius: var(--r-xs);
  background: var(--info-dim); border-left: 3px solid var(--info);
  font-size: 13.5px; color: var(--text-2);
  font-family: "Inter", sans-serif;
}

/* =========================================================
   CAT TITLE
   ========================================================= */
.cat-title {
  font-family: "Inter", sans-serif;
  font-size: 11px; letter-spacing: 1.3px; text-transform: uppercase;
  color: var(--dim); margin: 32px 0 12px;
  display: flex; align-items: center; gap: 10px;
}
.cat-title::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}

/* =========================================================
   FOOTER
   ========================================================= */
footer.page-footer {
  text-align: center;
  padding: 20px 24px 32px;
  font-size: 12px; color: var(--dim);
  border-top: 1px solid var(--line);
  margin-top: 48px;
  background: #fff;
  font-family: "Inter", sans-serif;
}

/* =========================================================
   UTILIDADES
   ========================================================= */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center{ align-items: center; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.mt-4        { margin-top: 4px; }
.mt-8        { margin-top: 8px; }
.mt-16       { margin-top: 16px; }
.mt-24       { margin-top: 24px; }
.mb-0        { margin-bottom: 0; }
.w-full      { width: 100%; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.divider {
  height: 1px; background: var(--line); margin: 24px 0; border: none;
}

/* =========================================================
   SKIP LINK (accesibilidad)
   ========================================================= */
.skip-link {
  position: absolute; top: -100%; left: 16px;
  background: var(--brand); color: #fff;
  padding: 8px 16px; border-radius: 0 0 8px 8px;
  font-size: 13px; font-weight: 600;
  font-family: "Inter", sans-serif;
  z-index: 9999;
  text-decoration: none;
  transition: top .1s;
}
.skip-link:focus { top: 0; }

/* =========================================================
   SEPARADOR VISUAL CON ACENTO
   ========================================================= */
.accent-rule {
  height: 2px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 60%, transparent 100%);
  border: none;
  margin: 32px 0;
  border-radius: 1px;
}

/* =========================================================
   STAT PILL (para briefing / partida)
   ========================================================= */
.stat-block {
  display: inline-flex; flex-direction: column; align-items: flex-start;
  padding: 10px 16px; border-radius: var(--r-sm);
  background: rgba(255,255,255,.8);
  border: 1px solid var(--line);
  min-width: 80px;
}
.stat-block .stat-val {
  font-family: "Inter", sans-serif;
  font-size: 18px; font-weight: 800; color: var(--brand);
  letter-spacing: -.5px; line-height: 1;
}
.stat-block .stat-lbl {
  font-size: 10.5px; font-weight: 600; color: var(--dim);
  text-transform: uppercase; letter-spacing: .8px; margin-top: 3px;
  font-family: "Inter", sans-serif;
}

/* =========================================================
   RESPONSIVE TOPBAR
   ========================================================= */
@media (max-width: 600px) {
  .topbar { height: auto; min-height: 60px; }
  .topbar-inner {
    padding: 8px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .brand-text small { display: none; }
  .top-actions {
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-end;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .top-actions .chip.tenant,
  .top-actions .chip.user { display: none; }
}

/* =========================================================
   IMPRESIÓN básica
   ========================================================= */
@media print {
  .topbar, footer.page-footer, .btn { display: none !important; }
  .container { padding: 0; }
  .card { box-shadow: none; border-color: #ccc; }
  body { font-size: 12px; }
}

/* =========================================================
   GAMIFICACIÓN — XP / Logros / Podio / Countdown / Trayectoria
   ========================================================= */

/* --- Cintillo de logros desbloqueados (M3) --- */
.logros-cintillo {
  border-left: 3px solid var(--brand-2);
  background: linear-gradient(135deg, rgba(13,148,136,.08) 0%, #fff 70%);
}
.logros-cintillo-list {
  display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px;
}
.logro-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--line);
  font-family: "Inter", sans-serif;
  animation: logro-pop .6s ease-out both;
}
.logro-chip.logro-nuevo {
  border-color: var(--brand-2);
  background: rgba(13,148,136,.06);
}
.logro-chip.logro-bloqueado {
  opacity: .55;
  filter: grayscale(.6);
  background: var(--surface-2);
}
.logro-ico { font-size: 22px; line-height: 1; }
.logro-chip strong { font-size: 13.5px; color: var(--text); display: block; }
.logro-desc {
  font-size: 11.5px; color: var(--dim);
  font-family: "Inter", sans-serif; line-height: 1.35;
  display: block; margin-top: 2px;
}
.logros-todos summary::-webkit-details-marker { display: none; }
.logros-todos summary::marker { content: ""; }

/* --- HTMX indicator + spinner (M4) --- */
.htmx-indicator.htmx-request,
.htmx-request .htmx-indicator { display: block !important; }
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2.5px solid var(--line); border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Utilidades para estilos inline recurrentes --- */
.icon-circle-lg {
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--brand-light);
  border: 1px solid rgba(20,58,107,.15);
  display: grid; place-items: center;
  margin: 0 auto 16px; font-size: 26px;
}
.icon-circle-md {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--brand-light);
  display: grid; place-items: center;
  margin: 0 auto 12px; font-size: 20px;
}
.kpi-danger { color: var(--bad); }
.obj-callout {
  font-size: 13px; color: var(--brand-2); margin-bottom: 20px;
  font-weight: 500; font-family: "Inter", sans-serif;
  background: var(--brand-2-light);
  padding: 10px 14px; border-radius: var(--r-sm);
  border: 1px solid rgba(15,118,110,.2);
}
.flex-ai-wrap {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.gamif-next-lvl {
  display: block; margin-top: 6px;
  font-size: 11.5px; font-weight: 600; color: var(--dim);
  font-family: "Inter", sans-serif; letter-spacing: .2px;
}
.logro-xp {
  font-size: 11px; font-weight: 700; color: var(--brand-2);
  letter-spacing: .3px;
}
@keyframes logro-pop {
  0%   { opacity: 0; transform: scale(.8) translateY(6px); }
  60%  { transform: scale(1.05) translateY(0); }
  100% { opacity: 1; transform: scale(1); }
}

/* --- Tarjeta de XP/nivel en home estudiante (M3) --- */
.gamif-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px 18px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--line);
  min-width: 220px;
}
.gamif-nivel {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; margin-bottom: 6px;
}
.gamif-nivel-num {
  font-family: "Inter", sans-serif; font-weight: 800;
  font-size: 15px; color: var(--brand);
}
.gamif-xp-num {
  font-family: "Inter", sans-serif; font-weight: 700;
  font-size: 13px; color: var(--muted);
}
.gamif-xp .bar {
  height: 6px; background: var(--line); border-radius: 4px; overflow: hidden;
}
.gamif-xp .bar > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 100%);
  transition: width .6s ease;
}
.gamif-logros {
  display: flex; align-items: baseline; gap: 6px;
  padding-top: 8px; border-top: 1px solid var(--line);
}
.gamif-logros-num {
  font-family: "Inter", sans-serif; font-weight: 800;
  font-size: 16px; color: var(--brand-2);
}
.gamif-logros-txt {
  font-size: 12px; color: var(--dim);
  font-family: "Inter", sans-serif;
}

/* --- Podio animado top-3 (M5) --- */
.podio {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 14px; margin: 0 auto var(--gap); max-width: 640px;
  padding: 24px 16px 0;
  list-style: none;
}
@media (min-width: 601px) {
  .podio:not(.podio-mini) .pos-2 { order: 1; }
  .podio:not(.podio-mini) .pos-1 { order: 2; }
  .podio:not(.podio-mini) .pos-3 { order: 3; }
}
.podium-slot {
  display: flex; flex-direction: column; align-items: center;
  flex: 1; max-width: 200px; text-align: center;
  animation: podium-rise .8s cubic-bezier(.2,.7,.3,1) both;
}
.podium-slot.pos-2 { animation-delay: .1s; }
.podium-slot.pos-1 { animation-delay: .0s; }
.podium-slot.pos-3 { animation-delay: .2s; }
.podium-medal { font-size: 32px; line-height: 1; margin-bottom: 6px; }
.podium-name {
  font-family: "Inter", sans-serif; font-weight: 700;
  font-size: 13px; color: var(--text);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.podium-score {
  font-family: "Inter", sans-serif; font-weight: 800;
  font-size: 22px; color: var(--brand); margin: 2px 0 8px;
}
.podium-block {
  width: 100%; border-radius: var(--r-sm) var(--r-sm) 0 0;
  background: linear-gradient(180deg, var(--brand-light) 0%, var(--surface-2) 100%);
  border: 1px solid var(--line); border-bottom: none;
}
.podium-block.h-1 { height: 96px; background: linear-gradient(180deg, #fef3c7 0%, #fffbeb 100%); border-color: #fbbf24; }
.podium-block.h-2 { height: 70px; background: linear-gradient(180deg, #f1f5f9 0%, #f8fafc 100%); border-color: #cbd5e1; }
.podium-block.h-3 { height: 50px; background: linear-gradient(180deg, #fed7aa 0%, #fff7ed 100%); border-color: #fb923c; }
.podium-slot.pos-1 .podium-medal { animation: medal-bounce 1s ease-out .3s both; }
@keyframes podium-rise {
  0%   { opacity: 0; transform: translateY(40px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes medal-bounce {
  0%   { transform: translateY(-20px) scale(.6); opacity: 0; }
  60%  { transform: translateY(4px) scale(1.15); opacity: 1; }
  100% { transform: translateY(0) scale(1); }
}
.podio-mini { max-width: 420px; }

/* --- KPI causal (M2): delta + causa --- */
.kpi-tile-causal { padding-bottom: 12px; }
.kpi-causa {
  margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed var(--line);
  display: flex; flex-direction: column; gap: 2px;
}
.kpi-delta {
  font-family: "Inter", sans-serif; font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: baseline; gap: 4px;
}
.kpi-delta.ok  { color: var(--ok); }
.kpi-delta.bad { color: var(--bad); }
.kpi-delta small { font-weight: 600; color: var(--dim); font-size: 10.5px; }
.kpi-causa-txt {
  font-size: 11.5px; color: var(--dim);
  font-family: "Inter", sans-serif; line-height: 1.4;
}

/* --- Estado de ronda en vivo (M4) --- */
.round-status-live {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 14px 18px; border-radius: var(--r);
  background: var(--surface-2); border: 1px solid var(--line);
  font-family: "Inter", sans-serif;
}
.rsl-item { display: flex; align-items: center; gap: 8px; }
.rsl-ico { font-size: 18px; }
.countdown {
  font-weight: 800; font-size: 18px; color: var(--brand);
  letter-spacing: 1px; font-variant-numeric: tabular-nums;
}
.countdown.closed { color: var(--bad); }
.countdown.muted { color: var(--dim); font-weight: 600; font-size: 13px; }
.rsl-feed strong { color: var(--text); }
.rsl-bar {
  display: inline-block; width: 90px; height: 6px;
  background: var(--line); border-radius: 4px; overflow: hidden;
}
.rsl-bar > span {
  display: block; height: 100%;
  background: var(--brand); transition: width .5s ease;
}
.rsl-listo { background: rgba(13,148,136,.12); }
.rsl-pendiente { background: rgba(217,119,6,.12); color: #b45309; }

/* --- Trayectoria alumno (M6) --- */
.trayectoria-modal {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.45);
  display: grid; place-items: center;
  padding: 20px; animation: tray-fade .2s ease both;
}
@keyframes tray-fade { from { opacity: 0; } to { opacity: 1; } }
.trayectoria-card {
  max-width: 640px; width: 100%; max-height: 88vh; overflow: auto;
  animation: tray-rise .25s ease both;
}
@keyframes tray-rise {
  from { opacity: 0; transform: translateY(20px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.trayectoria-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.traj-chart {
  width: 100%; max-width: 560px; height: auto;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 8px;
}

/* --- Responsive: podio en móvil y tablas con scroll horizontal --- */
@media (max-width: 600px) {
  /* Podio: apilar verticalmente para no aplazar nombres/bloques en móvil */
  .podio {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    max-width: 100%;
    padding: 12px 8px 0;
  }
  .podium-slot {
    max-width: 100%;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    text-align: left;
  }
  .podium-slot .podium-block {
    width: auto;
    min-width: 8px;
    align-self: stretch;
    border-radius: 8px 0 0 8px;
  }
  .podium-slot.pos-1 { order: 1; }
  .podium-slot.pos-2 { order: 2; }
  .podium-slot.pos-3 { order: 3; }
  .podium-block.h-1,
  .podium-block.h-2,
  .podium-block.h-3 { height: 56px; }
  .podium-medal { font-size: 24px; margin-bottom: 0; }
  .podium-name { white-space: normal; }
  .podium-score { margin: 0 0 0 auto; font-size: 18px; }

  /* Cintillo de logros: una columna en móvil */
  .logros-cintillo-list { flex-direction: column; gap: 8px; }

  /* Tarjeta gamif del hero del estudiante: ancho completo */
  .gamif-card { width: 100%; min-width: 0; }

  /* Round-status-live: apilar items */
  .round-status-live { gap: 10px; }
  .rsl-bar { width: 64px; }

  /* Trayectoria modal: ocupar casi toda la pantalla en móvil */
  .trayectoria-modal { padding: 8px; }
  .trayectoria-card { max-width: 100%; max-height: 94vh; }
}

/* Cualquier tabla sin .table-card también scrolleable en móvil */
@media (max-width: 600px) {
  .card > table,
  .table-card > table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
}

/* --- prefers-reduced-motion: desactivar animaciones lúdicas --- */
@media (prefers-reduced-motion: reduce) {
  .podium-slot, .podium-slot.pos-1 .podium-medal,
  .logro-chip, .trayectoria-modal, .trayectoria-card {
    animation: none !important;
  }
}
