:root {
  --brand-primary: #44699d;
  --brand-primary-strong: #2f507b;
  --brand-primary-deep: #243f66;
  --accent-primary: #fde07f;

  --bg: #eef3f8;
  --bg-2: #f7f9fc;
  --surface: #ffffff;
  --surface-soft: #f8fbff;

  --text: #162033;
  --text-soft: #5f7088;
  --border: #d7e1ee;

  --success: #198754;
  --danger: #b42318;
  --warning: #946600;

  --shadow-sm: 0 6px 18px rgba(40, 66, 112, 0.06);
  --shadow-md: 0 10px 30px rgba(40, 66, 112, 0.09);
  --shadow-lg: 0 20px 42px rgba(68, 105, 157, 0.18);
  --shadow-header: 0 10px 26px rgba(31, 56, 92, 0.22);

  --radius-panel: 22px;
  --radius-card: 18px;
  --radius-control: 14px;
}

/* =========================
   RESET / BASE
   ========================= */

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

html,
body {
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(68, 105, 157, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(253, 224, 127, 0.12), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 48%, #edf2f7 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
}

/* =========================
   LAYOUT GENERAL
   ========================= */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content,
.page {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 16px 28px;
}


/* =========================
   NAVEGACIÓN APP / CABECERA COMPACTA
   ========================= */

.app-body {
  padding-bottom: env(safe-area-inset-bottom);
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-main {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 16px 34px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  color: #fff;
  background: rgba(36, 63, 102, 0.96);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 14px 34px rgba(31, 56, 92, 0.20);
  backdrop-filter: blur(18px);
}

.app-header__inner {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 16px;
  display: grid;
  grid-template-columns: minmax(190px, auto) 1fr auto;
  align-items: center;
  gap: 14px;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #fff;
}

.app-brand__mark {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: #243f66;
  background: linear-gradient(180deg, #fff 0%, #eaf1ff 100%);
  font-size: 14px;
  font-weight: 1000;
  letter-spacing: -0.04em;
  box-shadow: 0 10px 22px rgba(0,0,0,0.12);
}

.app-brand__text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.app-brand__eyebrow {
  font-size: 10px;
  line-height: 1;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.68);
}

.app-brand strong {
  font-size: 16px;
  line-height: 1.05;
  font-weight: 950;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-primary-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.app-nav-link,
.app-more-button,
.app-more-link,
.app-bottom-link {
  -webkit-tap-highlight-color: transparent;
}

.app-nav-link {
  min-height: 40px;
  padding: 0 13px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: rgba(255,255,255,0.86);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.10);
  font-size: 13px;
  font-weight: 900;
  transition: transform .16s ease, background .16s ease, color .16s ease;
}

.app-nav-link:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.13);
  color: #fff;
}

.app-nav-link--active {
  color: #243f66;
  background: #fff;
  border-color: #fff;
  box-shadow: 0 10px 24px rgba(0,0,0,0.14);
}

.app-nav-link__icon {
  font-size: 14px;
  line-height: 1;
}

.app-header__side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.app-user-chip {
  min-height: 40px;
  padding: 5px 12px;
  border-radius: 999px;
  display: grid;
  gap: 1px;
  align-content: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  line-height: 1.05;
  white-space: nowrap;
}

.app-user-chip strong {
  font-size: 12px;
  font-weight: 900;
}

.app-user-chip span {
  font-size: 10px;
  font-weight: 800;
  color: rgba(255,255,255,0.68);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.app-more-menu {
  position: relative;
}

.app-more-menu summary {
  list-style: none;
}

.app-more-menu summary::-webkit-details-marker {
  display: none;
}

.app-more-button {
  min-height: 40px;
  padding: 0 13px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  color: #fff;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.14);
  font-size: 13px;
  font-weight: 900;
}

.app-more-button--active,
.app-more-menu[open] .app-more-button {
  color: #243f66;
  background: #fff;
  border-color: #fff;
}

.app-more-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(280px, calc(100vw - 24px));
  padding: 8px;
  border-radius: 20px;
  background: rgba(255,255,255,0.98);
  border: 1px solid rgba(68,105,157,0.12);
  box-shadow: 0 22px 60px rgba(16, 38, 72, 0.24);
  display: grid;
  gap: 4px;
  z-index: 200;
}

.app-more-link {
  min-height: 42px;
  padding: 0 12px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #173c7b;
  font-size: 13px;
  font-weight: 900;
  background: transparent;
}

.app-more-link:hover,
.app-more-link--active {
  background: rgba(68,105,157,0.10);
}

.app-more-link--logout {
  color: #b42318;
  background: rgba(180,35,24,0.06);
}

.app-bottom-nav {
  display: none;
}

@media (max-width: 960px) {
  .app-header__inner {
    grid-template-columns: 1fr auto;
  }

  .app-primary-nav {
    display: none;
  }
}

@media (max-width: 760px) {
  .app-main,
  .main-content,
  .page {
    padding-left: 12px;
    padding-right: 12px;
  }

  .app-main {
    padding-bottom: calc(94px + env(safe-area-inset-bottom));
  }

  .app-header__inner {
    padding: 8px 12px;
  }

  .app-brand__mark {
    width: 38px;
    height: 38px;
    border-radius: 13px;
  }

  .app-brand__eyebrow {
    display: none;
  }

  .app-brand strong {
    max-width: 160px;
    font-size: 15px;
  }

  .app-user-chip {
    display: none;
  }

  .app-more-button {
    min-width: 42px;
    padding: 0 11px;
  }

  .app-more-button span:last-child {
    display: none;
  }

  .app-more-panel {
    right: 0;
  }

  .app-bottom-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 120;
    min-height: 66px;
    padding: 7px;
    border-radius: 24px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(68,105,157,0.14);
    box-shadow: 0 20px 56px rgba(16,38,72,0.22);
    backdrop-filter: blur(18px);
  }

  .app-bottom-link {
    border-radius: 18px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    min-width: 0;
    color: #667085;
    font-size: 10px;
    line-height: 1;
    font-weight: 900;
  }

  .app-bottom-link__icon {
    font-size: 17px;
    line-height: 1;
  }

  .app-bottom-link--active {
    color: #173c7b;
    background: #eef3ff;
  }
}


/* =========================
   HEADER APP
   ========================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, #35577f 0%, #2b486a 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow-header);
  color: #fff;
}

.site-header__inner {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  min-width: 0;
}

.brand__eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(248, 251, 255, 0.82);
}

.brand h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.brand p {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(248, 251, 255, 0.82);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-user {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

/* =========================
   BOTONES
   ========================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.16s ease, box-shadow 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  color: #fff;
  background: linear-gradient(180deg, var(--brand-primary) 0%, #5b7bad 100%);
  box-shadow: 0 12px 24px rgba(68, 105, 157, 0.18);
}

.btn--secondary {
  color: #173c7b;
  background: rgba(255, 255, 255, 0.96);
  border-color: var(--border);
}

.btn--light {
  color: #173c7b;
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 18px rgba(18, 34, 55, 0.10);
}

.btn--ghost {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.btn--danger {
  color: var(--danger);
  background: rgba(180, 35, 24, 0.08);
  border-color: rgba(180, 35, 24, 0.14);
}

.btn--success {
  color: var(--success);
  background: rgba(25, 135, 84, 0.08);
  border-color: rgba(25, 135, 84, 0.14);
}

/* =========================
   MENSAJES
   ========================= */

.flash,
.error-box {
  margin-bottom: 16px;
  border-radius: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,251,255,0.98) 100%);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 700;
}

.flash--success {
  color: var(--success);
  border-color: rgba(25, 135, 84, 0.18);
  background: linear-gradient(180deg, rgba(240,253,244,0.98) 0%, rgba(236,253,243,0.98) 100%);
}

.flash--error,
.error-box {
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.14);
  background: linear-gradient(180deg, rgba(255,250,250,0.98) 0%, rgba(255,243,243,0.98) 100%);
}

/* =========================
   HERO / CABECERA BLOQUE
   ========================= */

.hero {
  background:
    radial-gradient(circle at top right, rgba(253, 224, 127, 0.28), transparent 34%),
    linear-gradient(135deg, #44699d 0%, #5575a4 55%, #6f879e 100%);
  color: #fff;
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 18px;
}

.hero__eyebrow {
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.82);
}

.hero h2 {
  margin: 0 0 8px;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.hero p {
  margin: 0;
  max-width: 820px;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255,255,255,0.92);
}

.hero__meta {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.20);
  color: #fff;
  white-space: nowrap;
}

/* =========================
   CARDS Y PANELS
   ========================= */

.panel,
.stat-card,
.mini-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.99) 0%, rgba(248,251,255,0.98) 100%);
  border: 1px solid rgba(68, 105, 157, 0.10);
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--shadow-md);
  min-width: 0;
}

.panel {
  border-radius: 22px;
  padding: 18px;
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel__header h2,
.panel__header h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
  font-weight: 900;
  color: #173c7b;
  letter-spacing: -0.02em;
}

.panel__hint {
  font-size: 12px;
  font-weight: 800;
  color: #6f879e;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mini-card h4 {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.15;
  font-weight: 900;
  color: #173c7b;
}

.mini-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-soft);
}

/* =========================
   GRID
   ========================= */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.two-col {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

/* =========================
   STATS
   ========================= */

.stat-card__label {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6f879e;
}

.stat-card__value {
  display: block;
  font-size: 30px;
  line-height: 0.95;
  font-weight: 900;
  color: #173c7b;
}

.stat-card__detail {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.4;
  color: #6a7b90;
  font-weight: 600;
}

.stat-card--gold .stat-card__value { color: #9b6a00; }
.stat-card--green .stat-card__value { color: var(--success); }
.stat-card--red .stat-card__value { color: var(--danger); }

/* =========================
   TABLAS
   ========================= */

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 14px;
  line-height: 1.45;
}

th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6f879e;
  font-weight: 900;
  white-space: nowrap;
}

td strong {
  color: #173c7b;
}

/* =========================
   TAGS / PILLS
   ========================= */

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  border: 1px solid transparent;
}

.tag--danger {
  color: var(--danger);
  background: rgba(180,35,24,0.10);
  border-color: rgba(180,35,24,0.14);
}

.tag--warning {
  color: var(--warning);
  background: rgba(253,224,127,0.30);
  border-color: rgba(240,198,75,0.28);
}

.tag--success {
  color: var(--success);
  background: rgba(25,135,84,0.10);
  border-color: rgba(25,135,84,0.14);
}

.tag--neutral {
  color: #44699d;
  background: rgba(68,105,157,0.08);
  border-color: rgba(68,105,157,0.12);
}

.stats-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.mini-pill {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  background: rgba(68,105,157,0.08);
  border: 1px solid rgba(68,105,157,0.12);
  color: #44699d;
}

.mini-pill--green {
  color: var(--success);
  background: rgba(25,135,84,0.10);
  border-color: rgba(25,135,84,0.14);
}

.mini-pill--red {
  color: var(--danger);
  background: rgba(180,35,24,0.10);
  border-color: rgba(180,35,24,0.14);
}

.mini-pill--gold {
  color: var(--warning);
  background: rgba(253,224,127,0.30);
  border-color: rgba(240,198,75,0.28);
}

/* =========================
   LISTADOS / TARJETAS MONITOR
   ========================= */

.session-list,
.group-list {
  display: grid;
  gap: 12px;
}

.session-card,
.group-card {
  border-radius: 18px;
  padding: 16px;
  border: 1px solid rgba(68, 105, 157, 0.10);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 6px 16px rgba(68, 105, 157, 0.05);
}

.session-card__top,
.group-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.session-card h4,
.group-card h4 {
  margin: 0 0 4px;
  font-size: 17px;
  line-height: 1.15;
  font-weight: 900;
  color: #173c7b;
}

/* =========================
   TOPBAR ALUMNOS / MÓDULOS
   ========================= */

.topbar {
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.title h1 {
  margin: 0 0 6px;
  font-size: 30px;
  line-height: 1.05;
  color: #173c7b;
}

.title p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-soft);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* =========================
   FORMULARIOS / FILTROS
   ========================= */

.filters {
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 800;
  color: var(--brand-primary-strong);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  padding: 0 14px;
  font: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field textarea {
  min-height: 120px;
  padding: 12px 14px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px rgba(68, 105, 157, 0.10);
}

/* =========================
   ACCIONES INLINE
   ========================= */

.row-actions,
.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-form {
  display: inline;
}

.quick-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: #173c7b;
  background: rgba(68,105,157,0.08);
  border: 1px solid rgba(68,105,157,0.12);
}

/* =========================
   ESTADOS VACÍOS / UTILS
   ========================= */

.empty-state {
  border-radius: 18px;
  padding: 24px 18px;
  text-align: center;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,251,255,0.98) 100%);
  color: var(--text-soft);
  font-weight: 700;
}

.muted,
.meta {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
}



/* =========================
   DETALLE DE GRUPO / FICHA ALUMNO MONITOR
   ========================= */

.group-detail-page {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.group-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.group-meta-card {
  border-radius: 14px;
  background: #f7f9fc;
  border: 1px solid #e7ecf3;
  padding: 12px 14px;
}

.group-meta-card span {
  display: block;
  color: #667085;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
  margin-bottom: 5px;
}

.group-meta-card strong {
  color: #16315c;
}

.student-list {
  display: grid;
  gap: 10px;
}

.student-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid #e7ecf3;
  border-radius: 16px;
  padding: 14px 16px;
  background: #fff;
}

.student-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #eef3ff;
  color: #284b8f;
  font-weight: 800;
  flex: 0 0 auto;
}

.student-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.student-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.student-main strong {
  color: #16315c;
}

.student-name-link {
  display: inline-flex;
  width: fit-content;
  color: #16315c;
  text-decoration: none;
}

.student-name-link:hover {
  text-decoration: underline;
}

.student-sub {
  color: #667085;
  font-size: 13px;
  line-height: 1.45;
}

.student-sub a,
.student-profile-item a {
  color: var(--brand-primary-strong);
  font-weight: 800;
  text-decoration: none;
}

.student-sub a:hover,
.student-profile-item a:hover {
  text-decoration: underline;
}

.student-tags {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.tag--primary {
  color: #284b8f;
  background: #eef3ff;
  border-color: rgba(68,105,157,0.16);
}

.btn--small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.session-mini-list {
  display: grid;
  gap: 10px;
}

.session-mini-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid #e7ecf3;
  border-radius: 14px;
  background: #fff;
  padding: 12px 14px;
}

.student-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.student-modal:target {
  display: flex;
}

.student-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 28, 48, 0.64);
}

.student-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  border-radius: 24px;
  background: #fff;
  border: 1px solid rgba(255,255,255,0.40);
  box-shadow: 0 28px 70px rgba(16, 38, 72, 0.28);
}

.student-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-primary-deep) 0%, var(--brand-primary) 100%);
}

.student-modal__header h3 {
  margin: 4px 0 6px;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.student-modal__header p {
  margin: 0;
  color: rgba(255,255,255,0.82);
  font-size: 14px;
  line-height: 1.4;
}

.student-modal__eyebrow {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.75);
}

.student-modal__close {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  text-decoration: none;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.18);
}

.student-modal__body {
  padding: 20px 22px 8px;
  display: grid;
  gap: 18px;
}

.student-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.student-profile-item {
  border-radius: 16px;
  background: #f7f9fc;
  border: 1px solid #e7ecf3;
  padding: 12px 14px;
  min-width: 0;
}

.student-profile-item--wide {
  grid-column: 1 / -1;
}

.student-profile-item span {
  display: block;
  margin-bottom: 6px;
  color: #667085;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.student-profile-item strong {
  color: #16315c;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.student-profile-section {
  display: grid;
  gap: 10px;
}

.student-profile-section h4 {
  margin: 0;
  color: #173c7b;
  font-size: 15px;
  line-height: 1.15;
  font-weight: 900;
}

.student-profile-note {
  margin: 0;
  color: #667085;
  font-size: 14px;
  line-height: 1.5;
}

.student-modal__footer {
  display: flex;
  justify-content: flex-end;
  padding: 16px 22px 22px;
}

@media (max-width: 900px) {
  .group-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .student-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .student-tags {
    grid-column: 1 / -1;
    justify-content: flex-start;
    padding-left: 58px;
  }
}

@media (max-width: 640px) {
  .group-meta-grid,
  .student-profile-grid {
    grid-template-columns: 1fr;
  }

  .student-card {
    padding: 12px;
  }

  .student-tags {
    padding-left: 0;
  }

  .student-modal {
    padding: 12px;
    align-items: flex-end;
  }

  .student-modal__dialog {
    width: 100%;
    max-height: 92vh;
    border-radius: 22px 22px 0 0;
  }

  .student-modal__header,
  .student-modal__body,
  .student-modal__footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .student-modal__header h3 {
    font-size: 21px;
  }
}

/* =========================
   LOGIN
   ========================= */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 460px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-soft) 100%);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.login-card__top {
  padding: 28px 28px 16px;
  background: linear-gradient(180deg, #35577f 0%, #2b486a 100%);
  color: #fff;
}

.login-card__body {
  padding: 24px 28px 28px;
}

.login-eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.82;
  margin-bottom: 10px;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.05;
}

.login-subtitle {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255,255,255,0.88);
}

.login-help {
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-soft);
  text-align: center;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-col,
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .filters {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .site-header__inner {
    padding: 12px 14px;
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .main-content,
  .page {
    padding: 14px;
  }

  .hero {
    padding: 20px;
    border-radius: 20px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .panel,
  .mini-card,
  .stat-card,
  .session-card,
  .group-card {
    border-radius: 18px;
    padding: 14px;
  }

  .login-card__top {
    padding: 24px 20px 14px;
  }

  .login-card__body {
    padding: 20px;
  }

  .login-card h1 {
    font-size: 24px;
  }

  table {
    min-width: 500px;
  }
}

/* =========================
   CALIDAD DE DATOS
   ========================= */

.quality-intro {
  margin-bottom: 16px;
}

.quality-guidelines {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.quality-guidelines > div {
  padding: 14px;
  border-radius: 18px;
  background: rgba(68, 105, 157, 0.06);
  border: 1px solid rgba(68, 105, 157, 0.10);
}

.quality-guidelines strong {
  display: block;
  margin-bottom: 5px;
  color: #173c7b;
  font-weight: 950;
}

.quality-guidelines p,
.quality-description,
.quality-note {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
}

.quality-panel {
  margin-bottom: 16px;
}

.quality-panel__header {
  align-items: flex-start;
}

.quality-panel__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.quality-description {
  margin-top: 6px;
}

.quality-table {
  min-width: 860px;
}

.empty-state--ok {
  color: var(--success);
  background: rgba(25, 135, 84, 0.08);
  border: 1px solid rgba(25, 135, 84, 0.12);
  border-radius: 18px;
  padding: 14px;
}

.btn--sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.muted {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.35;
}

@media (max-width: 760px) {
  .quality-guidelines {
    grid-template-columns: 1fr;
  }

  .quality-panel__header {
    flex-direction: column;
  }

  .quality-panel__meta {
    justify-content: flex-start;
  }
}

/* =========================
   INICIO APP / PORTADA POR ROL
   ========================= */

.home-app {
  display: grid;
  gap: 18px;
}

.home-flash {
  margin-bottom: 16px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 240px);
  gap: 18px;
  align-items: stretch;
  padding: 22px;
  border-radius: 26px;
  color: #fff;
  background:
    radial-gradient(circle at top right, rgba(253, 224, 127, 0.28), transparent 34%),
    linear-gradient(135deg, #243f66 0%, #44699d 58%, #6782a8 100%);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.home-hero__content {
  min-width: 0;
}

.home-hero__eyebrow,
.home-section__eyebrow {
  display: inline-flex;
  margin-bottom: 8px;
  color: rgba(255,255,255,0.76);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.home-section__eyebrow {
  color: #6f879e;
}

.home-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: .98;
  letter-spacing: -.045em;
}

.home-hero p {
  margin: 0;
  max-width: 760px;
  color: rgba(255,255,255,0.9);
  font-size: 15px;
  line-height: 1.58;
}

.home-hero__meta {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.home-hero__aside {
  min-height: 160px;
  padding: 18px;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10);
}

.home-hero__aside-label {
  color: rgba(255,255,255,.72);
  font-size: 12px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.home-hero__aside strong {
  margin-top: 10px;
  font-size: 54px;
  line-height: .9;
  letter-spacing: -.05em;
}

.home-hero__aside small {
  margin-top: 10px;
  color: rgba(255,255,255,.82);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 800;
}

.home-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.home-stat-card {
  min-width: 0;
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
  border: 1px solid rgba(68,105,157,.10);
  box-shadow: var(--shadow-md);
}

.home-stat-card span {
  display: block;
  margin-bottom: 8px;
  color: #6f879e;
  font-size: 11px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.home-stat-card strong {
  display: block;
  color: #173c7b;
  font-size: 34px;
  line-height: .95;
  font-weight: 950;
  letter-spacing: -.04em;
}

.home-stat-card small {
  display: block;
  margin-top: 9px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 750;
}

.home-stat-card--accent strong {
  color: #9b6a00;
}

.home-stat-card--danger strong {
  color: var(--danger);
}

.home-stat-card--ok strong {
  color: var(--success);
}

.home-section {
  min-width: 0;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.99) 0%, rgba(248,251,255,.98) 100%);
  border: 1px solid rgba(68,105,157,.10);
  box-shadow: var(--shadow-md);
}

.home-section--flush {
  align-self: start;
}

.home-section__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}

.home-section__header h2 {
  margin: 0;
  color: #173c7b;
  font-size: 22px;
  line-height: 1.05;
  font-weight: 950;
  letter-spacing: -.035em;
}

.home-section__header p {
  max-width: 420px;
  margin: 3px 0 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
  text-align: right;
}

.home-alert-grid,
.home-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.home-action-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-action-grid--compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-action-grid--monitor {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-alert-card,
.home-action-card {
  min-width: 0;
  border-radius: 20px;
  background: #fff;
  border: 1px solid rgba(68,105,157,.11);
  box-shadow: 0 8px 18px rgba(68,105,157,.055);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.home-alert-card:hover,
.home-action-card[href]:hover {
  transform: translateY(-2px);
  border-color: rgba(68,105,157,.22);
  box-shadow: 0 16px 30px rgba(68,105,157,.10);
}

.home-alert-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
  padding: 15px;
}

.home-alert-card__icon,
.home-action-card__icon {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: #173c7b;
  background: rgba(68,105,157,.08);
  border: 1px solid rgba(68,105,157,.12);
  font-size: 19px;
  font-weight: 950;
}

.home-alert-card strong,
.home-action-card strong {
  display: block;
  color: #173c7b;
  font-size: 15px;
  line-height: 1.15;
  font-weight: 950;
}

.home-alert-card p,
.home-action-card p {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.42;
}

.home-alert-card--danger {
  border-color: rgba(180,35,24,.18);
  background: linear-gradient(180deg, #fff 0%, rgba(255,244,244,.98) 100%);
}

.home-alert-card--warning {
  border-color: rgba(240,198,75,.30);
  background: linear-gradient(180deg, #fff 0%, rgba(255,249,229,.98) 100%);
}

.home-alert-card--calm {
  border-color: rgba(25,135,84,.14);
  background: linear-gradient(180deg, #fff 0%, rgba(240,253,244,.98) 100%);
}

.home-action-card {
  position: relative;
  min-height: 188px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-action-card--primary {
  border-color: rgba(68,105,157,.22);
  background:
    radial-gradient(circle at top right, rgba(253,224,127,.22), transparent 35%),
    linear-gradient(180deg, #fff 0%, #f5f8ff 100%);
}

.home-action-card--disabled {
  opacity: .76;
  background: linear-gradient(180deg, #fff 0%, #f4f6fa 100%);
}

.home-action-card--disabled:hover {
  transform: none;
  box-shadow: 0 8px 18px rgba(68,105,157,.055);
}

.home-action-card__cta,
.home-action-card__badge {
  margin-top: auto;
  width: fit-content;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #173c7b;
  background: rgba(68,105,157,.08);
  border: 1px solid rgba(68,105,157,.12);
  font-size: 12px;
  font-weight: 950;
}

.home-action-card__badge {
  color: #7b5a00;
  background: rgba(253,224,127,.32);
  border-color: rgba(240,198,75,.28);
}

.home-split {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr);
  gap: 18px;
  align-items: start;
}

.home-session-list,
.home-tool-list {
  display: grid;
  gap: 10px;
}

.home-session-card,
.home-tool-row {
  min-width: 0;
  padding: 12px;
  border-radius: 17px;
  display: grid;
  align-items: center;
  background: #fff;
  border: 1px solid rgba(68,105,157,.10);
}

.home-session-card {
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 12px;
}

.home-session-card:hover,
.home-tool-row[href]:hover {
  border-color: rgba(68,105,157,.22);
  box-shadow: 0 10px 20px rgba(68,105,157,.07);
}

.home-session-card__date {
  min-height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #173c7b;
  background: rgba(68,105,157,.08);
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

.home-session-card__main {
  min-width: 0;
}

.home-session-card__main strong {
  display: block;
  color: #173c7b;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-session-card__main small {
  display: block;
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.3;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-tool-row {
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
}

.home-tool-row span {
  color: #6f879e;
  font-size: 11px;
  line-height: 1;
  font-weight: 950;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.home-tool-row strong {
  color: #173c7b;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 950;
}

.home-tool-row--muted {
  background: #f5f7fb;
  opacity: .78;
}

@media (max-width: 1080px) {
  .home-stat-grid,
  .home-action-grid,
  .home-action-grid--compact,
  .home-action-grid--monitor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-alert-grid,
  .home-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .home-app {
    gap: 14px;
  }

  .home-hero {
    grid-template-columns: 1fr;
    padding: 18px;
    border-radius: 22px;
  }

  .home-hero__aside {
    min-height: auto;
  }

  .home-hero__aside strong {
    font-size: 42px;
  }

  .home-stat-grid,
  .home-action-grid,
  .home-action-grid--compact,
  .home-action-grid--monitor {
    grid-template-columns: 1fr;
  }

  .home-section {
    padding: 15px;
    border-radius: 20px;
  }

  .home-section__header {
    display: grid;
    gap: 7px;
  }

  .home-section__header p {
    max-width: none;
    text-align: left;
  }

  .home-action-card {
    min-height: 0;
  }

  .home-session-card {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .home-session-card .tag {
    grid-column: 2 / -1;
    justify-self: start;
  }
}

/* =========================
   EQUIPACIONES
   ========================= */

.equipment-hero {
  margin-bottom: 18px;
}

.equipment-stats .stat-card,
.equipment-stat-link {
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.equipment-stat-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(68,105,157,.18);
}

.equipment-filters {
  grid-template-columns: minmax(220px, 2fr) minmax(150px, 1fr) minmax(170px, 1fr) minmax(170px, 1fr) minmax(150px, 1fr) minmax(120px, .8fr) auto;
}

.equipment-filter-actions {
  align-items: end;
  justify-content: flex-start;
}

.equipment-layout {
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, .8fr);
  align-items: start;
}

.equipment-table-wrap table {
  min-width: 980px;
}

.equipment-kit,
.equipment-dates {
  display: grid;
  gap: 4px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
}

.equipment-kit strong,
.equipment-dates strong {
  color: #173c7b;
}

.equipment-note {
  max-width: 240px;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(68,105,157,.06);
  border: 1px solid rgba(68,105,157,.10);
}

.equipment-row-editor {
  min-width: 230px;
}

.equipment-row-editor summary {
  width: fit-content;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #173c7b;
  background: rgba(68,105,157,.08);
  border: 1px solid rgba(68,105,157,.12);
  font-size: 12px;
  font-weight: 900;
  list-style: none;
}

.equipment-row-editor summary::-webkit-details-marker {
  display: none;
}

.equipment-row-editor[open] summary {
  margin-bottom: 10px;
  color: #fff;
  background: var(--brand-primary);
}

.equipment-inline-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: #f7f9fc;
  border: 1px solid #e7ecf3;
}

.equipment-inline-form .field {
  gap: 5px;
}

.equipment-inline-form .field label {
  font-size: 11px;
}

.equipment-inline-form .field input,
.equipment-inline-form .field select,
.equipment-inline-form .field textarea {
  min-height: 38px;
  border-radius: 12px;
  padding: 0 10px;
  font-size: 13px;
}

.equipment-inline-form .field textarea {
  min-height: 70px;
  padding: 10px;
}

.equipment-inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.equipment-size-summary table {
  min-width: 440px;
}

.equipment-help-card {
  margin-top: 16px;
  padding: 16px;
  border-radius: 18px;
  color: #173c7b;
  background: rgba(68,105,157,.07);
  border: 1px solid rgba(68,105,157,.12);
}

.equipment-help-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.15;
}

.equipment-help-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.55;
}

@media (max-width: 1200px) {
  .equipment-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .equipment-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .equipment-filters,
  .equipment-inline-grid {
    grid-template-columns: 1fr;
  }

  .equipment-filter-actions {
    width: 100%;
  }

  .equipment-filter-actions .btn {
    flex: 1;
  }
}


/* =========================================================
   Equipaciones · Edición e importador
   ========================================================= */

.equipment-kit-edit-grid {
  grid-template-columns: .75fr 1.5fr .75fr;
}

.equipment-import-panel,
.equipment-preview-panel {
  margin-top: 18px;
}

.equipment-import-form {
  display: grid;
  gap: 18px;
}

.equipment-import-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.equipment-import-grid .field small,
.equipment-import-help p,
.check-card small {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.4;
}

.check-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-height: 74px;
  padding: 13px 14px;
  border-radius: 18px;
  border: 1px solid rgba(68,105,157,.14);
  background: rgba(68,105,157,.06);
  cursor: pointer;
}

.check-card input {
  margin-top: 4px;
}

.check-card span {
  display: grid;
  gap: 4px;
}

.equipment-import-help {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(68,105,157,.12);
  background: rgba(255,255,255,.72);
}

.equipment-import-help h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.equipment-import-help p {
  margin: 0;
}

.equipment-import-stats {
  margin-bottom: 14px;
}

.equipment-apply-form {
  display: flex;
  justify-content: flex-end;
  margin: 8px 0 14px;
}

.equipment-import-preview-wrap {
  max-height: 62vh;
  overflow: auto;
}

.equipment-import-preview-table {
  min-width: 980px;
}

.equipment-import-preview-table td {
  vertical-align: top;
}

@media (max-width: 1100px) {
  .equipment-import-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .equipment-kit-edit-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .equipment-import-grid {
    grid-template-columns: 1fr;
  }

  .equipment-apply-form {
    justify-content: stretch;
  }

  .equipment-apply-form .btn {
    width: 100%;
  }
}

/* =========================================================
   Equipaciones v4 · listado más limpio sin resumen lateral
   ========================================================= */

.equipment-layout--single {
  display: block;
}

.equipment-layout--single > .panel {
  width: 100%;
}

.equipment-table-wrap {
  overflow-x: visible;
}

.equipment-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.equipment-table th,
.equipment-table td {
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
}

.equipment-table th:nth-child(1),
.equipment-table td:nth-child(1) { width: 29%; }
.equipment-table th:nth-child(2),
.equipment-table td:nth-child(2) { width: 18%; }
.equipment-table th:nth-child(3),
.equipment-table td:nth-child(3) { width: 19%; }
.equipment-table th:nth-child(4),
.equipment-table td:nth-child(4) { width: 14%; }
.equipment-table th:nth-child(5),
.equipment-table td:nth-child(5) { width: 20%; }

.equipment-note {
  max-width: none;
}

.equipment-row-editor {
  min-width: 0;
}

@media (max-width: 1100px) {
  .equipment-table,
  .equipment-table thead,
  .equipment-table tbody,
  .equipment-table tr,
  .equipment-table th,
  .equipment-table td {
    display: block;
    width: 100% !important;
  }

  .equipment-table thead {
    display: none;
  }

  .equipment-table tr {
    padding: 14px 0;
    border-top: 1px solid #e2e8f0;
  }

  .equipment-table tbody tr:first-child {
    border-top: 0;
    padding-top: 0;
  }

  .equipment-table td {
    padding: 8px 0;
    border: 0;
  }

  .equipment-inline-form {
    padding: 10px;
  }
}

/* =========================================================
   GRATIFICACIONES
   ========================================================= */

.rewards-hero {
  margin-bottom: 18px;
}

.rewards-config-panel {
  margin-bottom: 18px;
}

.rewards-filters {
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) repeat(4, minmax(130px, .8fr)) minmax(150px, 1fr) minmax(150px, 1fr) minmax(150px, 1fr) auto;
}

.rewards-filter-actions {
  align-items: end;
  justify-content: flex-start;
}

.rewards-stats {
  margin-bottom: 18px;
}

.rewards-explain-panel {
  margin-bottom: 18px;
}

.rewards-formula-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.rewards-formula-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 18px;
  background: #f7f9fc;
  border: 1px solid #e2e8f0;
}

.rewards-formula-card strong {
  color: #173c7b;
  font-size: 14px;
}

.rewards-formula-card span {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
}

.rewards-table-wrap table,
.rewards-table {
  min-width: 1120px;
}

.rewards-table th,
.rewards-table td {
  vertical-align: top;
}

.rewards-groups {
  max-width: 340px;
  line-height: 1.45;
}

.rewards-total {
  color: #173c7b;
  font-size: 18px;
}

@media (max-width: 1400px) {
  .rewards-filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .rewards-filter-actions {
    grid-column: span 4;
  }
}

@media (max-width: 1050px) {
  .rewards-formula-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .rewards-filters,
  .rewards-formula-grid {
    grid-template-columns: 1fr;
  }

  .rewards-filter-actions {
    grid-column: auto;
    width: 100%;
  }

  .rewards-filter-actions .btn {
    flex: 1;
  }
}

/* =========================================================
   GRATIFICACIONES · Ajustes por monitor y sustituciones
   ========================================================= */

.rewards-table--adjustable {
  min-width: 1280px;
}

.rewards-adjustment-note {
  max-width: 260px;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(68,105,157,.06);
  border: 1px solid rgba(68,105,157,.10);
}

.rewards-adjustment-editor {
  margin-top: 10px;
}

.rewards-adjustment-editor summary {
  width: fit-content;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #173c7b;
  background: rgba(68,105,157,.08);
  border: 1px solid rgba(68,105,157,.12);
  font-size: 12px;
  font-weight: 900;
  list-style: none;
}

.rewards-adjustment-editor summary::-webkit-details-marker {
  display: none;
}

.rewards-adjustment-editor[open] summary {
  margin-bottom: 10px;
  color: #fff;
  background: var(--brand-primary);
}

.rewards-adjustment-form {
  display: grid;
  gap: 10px;
  min-width: 300px;
  padding: 12px;
  border-radius: 16px;
  background: #f7f9fc;
  border: 1px solid #e7ecf3;
}

.rewards-adjustment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.rewards-adjustment-form .field {
  gap: 5px;
}

.rewards-adjustment-form .field label {
  font-size: 11px;
}

.rewards-adjustment-form .field input,
.rewards-adjustment-form .field textarea {
  min-height: 38px;
  border-radius: 12px;
  padding: 0 10px;
  font-size: 13px;
}

.rewards-adjustment-form .field textarea {
  min-height: 70px;
  padding: 10px;
}

@media (max-width: 720px) {
  .rewards-adjustment-grid {
    grid-template-columns: 1fr;
  }

  .rewards-adjustment-form {
    min-width: 0;
  }
}
