/* ==========================================================================
   Interfaz Independiente para Celular (movil.html)
   Diseño mobile-first, acciones con una sola mano, cero tablas horizontales
   ========================================================================== */

body.movil-view {
  padding-bottom: 78px;
  background: var(--bg);
}

.movil-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
}

.movil-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.movil-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 18px;
  font-weight: 600;
}

.movil-group-badge {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.movil-group-num {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent);
  line-height: 1;
}

.movil-date-input {
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-muted);
  font-size: 13px;
  font-weight: 500;
}

.movil-top-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.movil-top-actions .btn {
  min-height: 42px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
}

/* Barra compacta de conteos */
.movil-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 10px 14px 4px;
}

.movil-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 4px;
  text-align: center;
}

.movil-stat strong {
  display: block;
  font-size: 18px;
  line-height: 1.1;
}

.movil-stat span {
  font-size: 11px;
  color: var(--text-secondary);
}

.movil-stat.presente strong { color: var(--presente); }
.movil-stat.retardo strong { color: var(--retardo); }
.movil-stat.ausente strong { color: var(--ausente); }

/* Vistas por pestaña */
.movil-tab-panel {
  padding: 10px 14px 20px;
}

.movil-search-wrap {
  margin-bottom: 10px;
}

.movil-search {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  font-size: 16px;
  outline: none;
}

.movil-search:focus {
  border-color: var(--accent);
}

.movil-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.movil-filter-chip {
  flex-shrink: 0;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.movil-filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #FFFFFF;
}

/* Lista vertical de estudiantes (sin tablas horizontales) */
.movil-student-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.movil-student-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}

.movil-student-item.status-presente {
  border-left: 4px solid var(--presente);
}

.movil-student-item.status-retardo {
  border-left: 4px solid var(--retardo);
}

.movil-student-item.status-ausente {
  border-left: 4px solid var(--ausente);
}

.movil-student-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.movil-student-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.movil-student-sub {
  margin-top: 3px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.movil-status-badge {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--pendiente-bg);
  color: var(--text-secondary);
}

.movil-status-badge.presente { background: var(--presente-bg); color: var(--presente); }
.movil-status-badge.retardo { background: var(--retardo-bg); color: var(--retardo); }
.movil-status-badge.ausente { background: var(--ausente-bg); color: var(--ausente); }

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

.movil-status-btn {
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.movil-status-btn.presente.selected {
  background: var(--presente);
  border-color: var(--presente);
  color: #FFFFFF;
}

.movil-status-btn.retardo.selected {
  background: var(--retardo);
  border-color: var(--retardo);
  color: #FFFFFF;
}

.movil-status-btn.ausente.selected {
  background: var(--ausente);
  border-color: var(--ausente);
  color: #FFFFFF;
}

/* Pestaña Escáner móvil */
.movil-scanner-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 16px;
}

.movil-scanner-input {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 2px solid var(--accent);
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 18px;
  background: var(--surface);
  outline: none;
  margin-bottom: 12px;
}

.movil-scan-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.movil-scan-actions button {
  min-height: 44px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
}

/* Pestaña Historial móvil */
.movil-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.movil-history-btn {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  text-align: left;
}

.movil-history-btn.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.movil-utility-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.movil-utility-stack .btn {
  min-height: 46px;
  font-size: 15px;
  border-radius: 12px;
}

/* Barra de navegación inferior fija (al alcance del pulgar) */
.movil-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 120;
  height: 66px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.movil-nav-btn {
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.movil-nav-btn.active {
  color: var(--accent);
}

.movil-nav-indicator {
  width: 24px;
  height: 3px;
  border-radius: 999px;
  background: transparent;
}

.movil-nav-btn.active .movil-nav-indicator {
  background: var(--accent);
}
