/* Colores semánticos independientes del color de marca. */
.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;
}
:root {
  --index-excelente: #65b64a;
  --index-promedio: #e8bd36;
  --index-bajo: #f18c39;
  --index-insuficiente: #f05868;
}
[data-theme="Tatami verde"] {
  --index-excelente: #5ccf7c;
}
[data-theme="Cerezo"] {
  --index-excelente: #72bd73;
}
[data-theme="Dojo de arena"] {
  --index-excelente: #83b453;
}
[data-theme="CYBER JAPAN"] {
  --index-excelente: #61ff8c;
  --index-promedio: #ffdd50;
  --index-bajo: #ff973f;
  --index-insuficiente: #ff4c69;
}
.index-excelente {
  --index-color: var(--index-excelente);
}
.index-promedio {
  --index-color: var(--index-promedio);
}
.index-bajo {
  --index-color: var(--index-bajo);
}
.index-insuficiente {
  --index-color: var(--index-insuficiente);
}
.index-meter i {
  background: var(--index-color);
  box-shadow: 0 0 10px color-mix(in srgb, var(--index-color) 45%, transparent);
}
.index-ring .fill {
  stroke: var(--index-color);
}
.index-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  min-width: 110px;
  padding: 6px 0;
}
.index-cell .meter {
  width: 100%;
  height: 7px;
}
.index-cell .chip {
  margin-top: 1px;
}
.index-cell .index-caption {
  font-size: 12px;
  color: var(--third);
}
.belt-text {
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  line-height: 1.3;
  white-space: normal;
}
.belt-text > .belt {
  width: 96px;
  height: 17px;
  border-radius: 3px;
  box-shadow:
    inset 0 2px #ffffff35,
    inset 0 -3px #0005,
    0 3px 8px #0003;
}
.belt-text > .belt.sm {
  width: 70px;
  height: 14px;
}
.belt-text > .belt.lg {
  width: 120px;
  height: 21px;
}
.belt-text .belt u {
  width: 3px;
}
.belt-text > span {
  font-size: 14px;
}
.khan-belt > svg {
  width: 100px;
  height: 53px;
}
.attendance-legend {
  display: flex;
  gap: 10px 18px;
  flex-wrap: wrap;
  margin: 20px 0 8px;
  font-size: 13px;
  color: var(--sub);
}
.attendance-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.attendance-legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--status);
  box-shadow: 0 0 9px color-mix(in srgb, var(--status) 35%, transparent);
}
.payment-aldia {
  --status: #45bd83;
}
.payment-mora {
  --status: #f05d71;
}
.payment-pronto {
  --status: #e8bd36;
}
.attendance-legend .present {
  --status: #5e9eff;
}
.tiles.attendance-tiles {
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 16px;
}
.attendance-tiles .student-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  min-width: 0;
  padding: 19px;
  border: 1px solid color-mix(in srgb, var(--status) 65%, var(--line));
  border-top-width: 3px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--status) 12%, var(--panel)),
    var(--panel) 80%
  );
  color: var(--tx);
  border-radius: 15px;
  box-shadow:
    inset 0 1px #ffffff0a,
    0 9px 24px #0000000c;
  transition:
    background 0.2s,
    border-color 0.2s,
    box-shadow 0.2s,
    transform 0.2s;
}
.attendance-tiles .student-tile[hidden] {
  display: none;
}
.attendance-tiles .student-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--status) 12%, transparent);
}
.attendance-tiles .student-tile:focus-visible {
  outline: 3px solid var(--acento);
  outline-offset: 4px;
}
.attendance-tiles .student-tile.marked {
  color: var(--tx);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, #438eea 22%, var(--panel)),
    color-mix(in srgb, #438eea 6%, var(--panel))
  );
  border-color: #5e9eff;
}
.attendance-tiles .student-tile.marked:is(.payment-mora, .payment-pronto) {
  border: 2px solid var(--status);
  border-top-width: 3px;
  padding: 19px 18px 18px;
}
.tile-person {
  display: flex;
  gap: 11px;
  align-items: flex-start;
}
.tile-person .avatar {
  width: 39px;
  height: 39px;
  font-size: 15px;
  flex: none;
}
.tile-person > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.tile-person b {
  display: block;
  font-size: 16px;
  line-height: 1.35;
  margin-bottom: 5px;
}
.tile-person small {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--sub);
}
.marked .tile-person small {
  color: #84b7ff;
}
.tile-person > .ico {
  flex: none;
  color: var(--status);
  margin: 2px 0 0;
}
.marked .tile-person > .ico {
  color: #80b9ff;
}
.tile-grade {
  min-height: 51px;
  display: flex;
  align-items: center;
  padding-left: 50px;
}
.tile-grade .belt-text {
  gap: 6px;
}
.tile-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding-top: 13px;
  border-top: 1px solid color-mix(in srgb, var(--status) 20%, var(--line));
}
.tile-metric {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.tile-metric > small {
  color: var(--sub);
  font-size: 12px;
}
.tile-metric > b {
  font-size: 23px;
  font-weight: 750;
  line-height: 1.15;
}
.tile-metric > b em {
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  color: var(--sub);
}
.tile-metric .meter {
  margin: 2px 0;
  height: 5px;
  width: 100%;
}
.tile-metric .metric-detail {
  font-size: 11px;
  color: var(--sub);
}
.tile-payment {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--status);
  background: color-mix(in srgb, var(--status) 10%, var(--panel));
}
.tile-payment b {
  font-size: 12px;
}
.tile-payment > small {
  margin-left: auto;
  font-size: 11px;
  color: var(--sub);
}
[data-mode="claro"] .tile-payment {
  color: color-mix(in srgb, var(--status) 52%, #11221c);
}
[data-mode="claro"] .marked .tile-person small {
  color: #245899;
}
[data-mode="claro"] .index-caption {
  color: var(--sub);
}
@media (max-width: 600px) {
  .tiles.attendance-tiles {
    grid-template-columns: 1fr;
  }
  .attendance-tiles .student-tile {
    padding: 18px;
    gap: 14px;
  }
  .tile-person b {
    font-size: 17px;
  }
  .tile-grade {
    padding-left: 50px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .attendance-tiles .student-tile {
    transition: none;
  }
  .attendance-tiles .student-tile:hover {
    transform: none;
  }
}

/* Densidad de operación: lectura rápida, sin perder grado ni alertas. */
.payment-aldia {
  --status: #29e68a;
}
.payment-mora {
  --status: #ff4058;
}
.payment-pronto {
  --status: #ffda38;
}
.attendance-tiles .student-tile {
  gap: 11px;
  padding: 14px;
  border-color: var(--status);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--status) 20%, var(--panel)),
    var(--panel)
  );
  box-shadow:
    inset 0 0 18px color-mix(in srgb, var(--status) 9%, transparent),
    0 0 12px color-mix(in srgb, var(--status) 14%, transparent);
}
.attendance-tiles .student-tile.marked {
  box-shadow:
    inset 0 0 20px #438eea1a,
    0 0 12px #438eea24;
}
.attendance-tiles .student-tile.marked:is(.payment-mora, .payment-pronto) {
  padding: 14px 13px 13px;
  box-shadow:
    inset 0 0 18px #438eea1a,
    0 0 13px color-mix(in srgb, var(--status) 25%, transparent);
}
.tile-person b {
  font-size: 15px;
}
.tile-person .avatar {
  width: 32px;
  height: 32px;
  font-size: 13px;
}
.tile-grade {
  min-height: 40px;
  padding-left: 43px;
}
.tile-grade .belt {
  width: 88px;
  height: 16px;
}
.tile-metrics {
  padding-top: 9px;
  gap: 12px;
}
.tile-metric {
  gap: 3px;
}
.tile-metric > b {
  font-size: 21px;
}
.tile-metric .metric-detail {
  font-size: 10px;
}
.tile-payment {
  padding: 7px 8px;
}
.metric-short {
  display: none;
}
.attendance-controls {
  position: sticky;
  top: 76px;
  z-index: 6;
  background: var(--panel);
  padding: 9px 0;
  box-shadow: 0 9px 12px color-mix(in srgb, var(--panel) 80%, transparent);
}
.attendance-controls .btn {
  min-height: 44px;
}
.attendance-controls input {
  flex: 1;
  min-width: 140px;
}
[data-mode="claro"] .payment-aldia {
  --status: #119957;
}
[data-mode="claro"] .payment-pronto {
  --status: #d9a300;
}
[data-mode="claro"] .payment-mora {
  --status: #e72c48;
}
@media (max-width: 600px) {
  .tiles.attendance-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  [data-view="asistencia"] .main > .card {
    padding: 12px;
  }
  .attendance-tiles .student-tile {
    padding: 10px;
    gap: 8px;
    border-radius: 11px;
  }
  .attendance-tiles .student-tile.marked:is(.payment-mora, .payment-pronto) {
    padding: 10px 9px 9px;
  }
  .tile-person {
    gap: 5px;
    align-items: flex-start;
  }
  .tile-person .avatar {
    display: none;
  }
  .tile-person b {
    font-size: 14px;
    min-height: 36px;
    margin: 0;
    line-height: 1.3;
  }
  .tile-person small {
    font-size: 11px;
    margin-top: 3px;
  }
  .tile-person > .ico {
    width: 16px;
    height: 16px;
  }
  .attendance-origin,
  .metric-long {
    display: none;
  }
  .metric-short {
    display: inline;
  }
  .tile-grade {
    padding: 0;
    min-height: 34px;
  }
  .tile-grade .belt {
    width: 78px;
    height: 15px;
  }
  .tile-grade .belt-text {
    gap: 4px;
  }
  .tile-grade .belt-text > span {
    font-size: 11px;
  }
  .tile-metrics {
    padding-top: 7px;
    gap: 9px;
  }
  .tile-metric > small {
    font-size: 10px;
    white-space: nowrap;
  }
  .tile-metric > b {
    font-size: 19px;
  }
  .tile-metric > b em {
    font-size: 10px;
  }
  .tile-metric .metric-detail {
    display: none;
  }
  .tile-payment {
    padding: 5px 6px;
    gap: 4px;
  }
  .tile-payment > small {
    display: none;
  }
  .tile-payment b {
    font-size: 10px;
  }
  .tile-payment > .ico {
    width: 11px;
    height: 11px;
  }
  .attendance-legend {
    gap: 7px 12px;
    font-size: 11px;
  }
  .attendance-controls {
    top: 112px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    padding: 8px 0;
  }
  .attendance-controls input {
    grid-column: 1/-1;
    width: 100%;
  }
  .attendance-controls .btn {
    font-size: 12px;
    padding: 9px 7px;
    gap: 5px;
  }
  .attendance-controls .btn .ico {
    width: 15px;
    height: 15px;
  }
}
