/* ==========================================================================
   Carro Digital Móvil - Estilo Vistoso, Colorido y Táctil
   Diseñado para pantallas de aula, celulares y tablets de profesores
   Estilo de Mariano: Colores vivos, alto contraste, botones y tarjetas XXL
   ========================================================================== */

:root {
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Fondo y Neutros */
  --color-bg: #f8fafc;
  --color-card-bg: #ffffff;
  --color-text-main: #090d16;
  --color-text-muted: #475569;
  --color-border: #e2e8f0;

  /* Colores Saturados y de Alto Contraste */
  --emerald-600: #059669;
  --emerald-500: #10b981;
  --emerald-400: #34d399;
  --emerald-100: #d1fae5;

  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-100: #dbeafe;

  --indigo-700: #4338ca;
  --indigo-600: #4f46e5;
  --indigo-500: #6366f1;
  --indigo-100: #e0e7ff;

  --purple-600: #7c3aed;
  --purple-500: #8b5cf6;

  --amber-600: #d97706;
  --amber-500: #f59e0b;
  --amber-100: #fef3c7;

  --red-700: #b91c1c;
  --red-600: #dc2626;
  --red-500: #ef4444;
  --red-100: #fee2e2;

  /* Sombras Táctiles y Relieve */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-pill: 9999px;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 6px 12px -2px rgba(0, 0, 0, 0.08), 0 3px 6px -3px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 14px 24px -4px rgba(0, 0, 0, 0.12), 0 8px 12px -6px rgba(0, 0, 0, 0.08);
  --shadow-hero: 0 16px 32px -6px rgba(5, 150, 105, 0.25);
  --shadow-button: 0 4px 10px rgba(0, 0, 0, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text-main);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==================== BARRA SUPERIOR (TOPBAR) ==================== */
.topbar {
  background: linear-gradient(135deg, #090d16 0%, #1e293b 100%);
  color: #ffffff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 2px solid rgba(255, 255, 255, 0.08);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: #ffffff;
}

.topbar-school-logo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #38bdf8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  background: #ffffff;
  flex-shrink: 0;
}

.topbar-icon {
  font-size: 32px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.topbar-titles h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.topbar-date {
  font-size: 13px;
  color: #94a3b8;
  font-weight: 600;
  display: block;
  margin-top: 1px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sync-badge {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #a7f3d0;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.sync-dot {
  width: 9px;
  height: 9px;
  background-color: var(--emerald-500);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--emerald-400);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.nav-link-btn {
  background: linear-gradient(135deg, var(--blue-600) 0%, var(--indigo-600) 100%);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
  white-space: nowrap;
}

.nav-text-short {
  display: none;
}

.nav-text-full {
  display: inline;
}

.nav-link-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.45);
}

.nav-link-btn.secondary {
  background: rgba(255, 255, 255, 0.15);
  box-shadow: none;
}

.nav-link-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ==================== CONTENEDOR PRINCIPAL ==================== */
.main-content {
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

/* ==================== HERO BANNER DEL CARRO ==================== */
.cart-hero {
  background: linear-gradient(135deg, #065f46 0%, #047857 50%, #059669 100%);
  color: #ffffff;
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-hero);
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
}

.cart-hero::before {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* Variación Hero: Disponible */
.cart-hero.status-disponible {
  background: linear-gradient(135deg, #064e3b 0%, #059669 60%, #10b981 100%);
  box-shadow: 0 16px 36px -6px rgba(16, 185, 129, 0.35);
}

/* Variación Hero: En uso */
.cart-hero.status-en-uso {
  background: linear-gradient(135deg, #1e1b4b 0%, #1d4ed8 60%, #3b82f6 100%);
  box-shadow: 0 16px 36px -6px rgba(37, 99, 235, 0.35);
}

/* Variación Hero: Ocupado total */
.cart-hero.status-ocupado {
  background: linear-gradient(135deg, #31104b 0%, #4338ca 60%, #6366f1 100%);
  box-shadow: 0 16px 36px -6px rgba(99, 102, 241, 0.35);
}

@media (min-width: 960px) {
  .cart-hero {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.cart-hero-main {
  flex: 1;
  max-width: 680px;
}

.cart-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.pulse-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #facc15;
  box-shadow: 0 0 10px #facc15;
  animation: pulse-dot 1.5s infinite;
}

.cart-hero.status-disponible .pulse-indicator {
  background: #34d399;
  box-shadow: 0 0 10px #34d399;
}

.cart-hero-title {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin-bottom: 8px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cart-hero-subtitle {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  margin-bottom: 18px;
}

/* Barra de Capacidad */
.cart-capacity-bar {
  background: rgba(0, 0, 0, 0.22);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.capacity-track {
  height: 14px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
  display: flex;
  overflow: hidden;
  margin-bottom: 10px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.capacity-fill {
  height: 100%;
  transition: width 0.4s ease;
}

.capacity-fill.libres { background: #10b981; }
.capacity-fill.en-uso { background: #38bdf8; }
.capacity-fill.baja { background: #f87171; }

.capacity-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  font-weight: 700;
}

.cap-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==================== BOTONES DE ACCIÓN XXL ==================== */
.cart-hero-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

@media (min-width: 640px) {
  .cart-hero-actions {
    flex-direction: row;
  }
}

@media (min-width: 960px) {
  .cart-hero-actions {
    flex-direction: column;
    width: 320px;
    flex-shrink: 0;
  }
}

.btn-hero-action {
  border: none;
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.btn-hero-action:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

.btn-hero-action:active {
  transform: translateY(0) scale(0.99);
}

.hero-action-icon {
  font-size: 36px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.hero-action-text strong {
  display: block;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.hero-action-text small {
  display: block;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.9;
  margin-top: 2px;
}

/* Botón 1: Prestar Carro (Esmeralda Saturado) */
.btn-hero-action.btn-lend {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: 2px solid #34d399;
}

/* Botón 2: Devolver al Carro (Violeta / Indigo) */
.btn-hero-action.btn-return {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
  border: 2px solid #818cf8;
}

.action-counter-pill {
  margin-left: auto;
  background: #facc15;
  color: #78350f;
  font-size: 16px;
  font-weight: 900;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0,0,0,0.25);
  animation: bounce-pill 2s infinite;
}

@keyframes bounce-pill {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ==================== BANNER DE SESIÓN ACTIVA ==================== */
.active-session-banner {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #ffffff;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.25);
  border-left: 6px solid #fbbf24;
}

.active-session-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.session-badge {
  background: #fbbf24;
  color: #78350f;
  font-size: 12px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.session-details {
  font-size: 16px;
  font-weight: 800;
}

.session-timer {
  font-size: 14px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: var(--radius-md);
}

.btn-fast-return {
  background: #ffffff;
  color: #1d4ed8;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: all 0.15s ease;
}

.btn-fast-return:hover {
  background: #eff6ff;
  transform: scale(1.04);
}

/* ==================== ESTRUCTURA DEL CARRO: BANDEJAS ==================== */
.cart-shelves-container {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.cart-shelf {
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--color-border);
  position: relative;
}

.shelf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f1f5f9;
}

.shelf-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.shelf-icon {
  font-size: 26px;
}

.shelf-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--color-text-main);
  letter-spacing: -0.3px;
}

.shelf-badge {
  background: #e2e8f0;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.shelf-stats {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-muted);
}

/* Grilla de Slots */
.shelf-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (min-width: 540px) {
  .shelf-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 820px) {
  .shelf-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (min-width: 1180px) {
  .shelf-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
  }
}

/* Grilla Especial Extras (Notebook Profe y Proyector) */
.extras-grid {
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .extras-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==================== TARJETA DE CADA SLOT / NETBOOK ==================== */
.slot-card {
  border-radius: var(--radius-lg);
  padding: 16px 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 160px;
  position: relative;
  box-shadow: 0 4px 8px rgba(0,0,0,0.06);
  user-select: none;
}

.slot-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 10px 20px rgba(0,0,0,0.12);
}

.slot-card:active {
  transform: translateY(0) scale(0.98);
}

.slot-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.slot-num-badge {
  font-size: 13px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  letter-spacing: -0.2px;
}

.slot-status-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
}

.slot-card-main {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 10px;
}

.slot-icon {
  font-size: 30px;
  line-height: 1;
}

.slot-name {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.slot-action-prompt {
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  text-align: center;
  margin-top: 8px;
  transition: all 0.15s ease;
}

/* 1. SLOT LIBRE (Esmeralda Vibrante) */
.slot-card.slot-libre {
  background: #f0fdf4;
  border: 3px solid #10b981;
  color: #064e3b;
}

.slot-card.slot-libre .slot-num-badge {
  background: #d1fae5;
  color: #047857;
}

.slot-card.slot-libre .slot-status-pill {
  background: #10b981;
  color: #ffffff;
}

.slot-ready-desc {
  font-size: 13px;
  font-weight: 600;
  color: #059669;
}

.slot-card.slot-libre .prompt-lend {
  background: #10b981;
  color: #ffffff;
}

.slot-card.slot-libre:hover .prompt-lend {
  background: #059669;
}

/* 2. SLOT EN USO (Azul Cobalto Eléctrico) */
.slot-card.slot-en-uso {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  border: 3px solid #60a5fa;
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.slot-card.slot-en-uso .slot-num-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.slot-card.slot-en-uso .slot-status-pill {
  background: #fbbf24;
  color: #78350f;
}

.slot-usage-info {
  margin-bottom: 6px;
}

.slot-course-badge {
  background: #ffffff;
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 900;
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.slot-teacher-name {
  font-size: 13px;
  font-weight: 700;
  color: #dbeafe;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-timer-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  color: #fef08a;
  width: fit-content;
}

.slot-card.slot-en-uso .prompt-return {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.slot-card.slot-en-uso:hover .prompt-return {
  background: #ffffff;
  color: #1d4ed8;
}

/* 3. SLOT CON FALLA / DE BAJA (Rojo Carmesí Intenso) */
.slot-card.slot-baja {
  background: #fef2f2;
  border: 3px solid #ef4444;
  color: #7f1d1d;
}

.slot-card.slot-baja .slot-num-badge {
  background: #fee2e2;
  color: #b91c1c;
}

.slot-card.slot-baja .slot-status-pill {
  background: #ef4444;
  color: #ffffff;
}

.slot-fault-text {
  font-size: 13px;
  font-weight: 700;
  color: #b91c1c;
  background: #fee2e2;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  line-height: 1.25;
}

.slot-card.slot-baja .prompt-repair {
  background: #ef4444;
  color: #ffffff;
}

.slot-card.slot-baja:hover .prompt-repair {
  background: #b91c1c;
}

/* ==================== MODALES TÁCTILES ==================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 99999;
  padding: 28px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-overlay.active {
  display: flex;
  animation: modalOverlayFade 0.2s ease forwards;
}

@keyframes modalOverlayFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-xl);
  max-width: 580px;
  width: 100%;
  margin: auto;
  position: relative;
  z-index: 100000;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  transform: scale(0.96);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 2px solid var(--color-border);
}

.modal-box.modal-lg {
  max-width: 660px;
}

.modal-overlay.active .modal-box {
  transform: scale(1);
}

.modal-header {
  padding: 22px 26px;
  color: #ffffff;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
}

.modal-header.header-emerald {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.modal-header.header-indigo {
  background: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);
}

.modal-header.header-blue {
  background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
}

.modal-header.header-red {
  background: linear-gradient(135deg, #b91c1c 0%, #ef4444 100%);
}

.modal-title-with-icon {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal-header-icon {
  font-size: 34px;
  line-height: 1;
}

.modal-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.modal-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  margin-top: 2px;
}

.modal-close-x {
  background: rgba(0, 0, 0, 0.2);
  border: none;
  color: #ffffff;
  font-size: 28px;
  line-height: 1;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.modal-close-x:hover {
  background: rgba(0, 0, 0, 0.35);
}

/* Secciones dentro del formulario del modal */
.form-section {
  padding: 20px 26px;
  border-bottom: 1px solid #f1f5f9;
}

.form-label-strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: var(--color-text-main);
  margin-bottom: 12px;
}

/* Ayuda de formulario */
.form-help-text {
  font-size: 13.5px;
  color: #64748b;
  margin: -6px 0 12px 0;
  line-height: 1.4;
}

/* Tarjeta y Stepper Gigante de Cantidad de PCs */
.qty-stepper-card {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  text-align: center;
}

.qty-stepper-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.btn-stepper {
  width: 62px;
  height: 62px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2.5px solid transparent;
  transition: all 0.15s ease;
  user-select: none;
  flex-shrink: 0;
}

.btn-stepper .stepper-symbol {
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
}

.btn-stepper-minus {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

.btn-stepper-minus:hover,
.btn-stepper-minus:active {
  background: #ef4444;
  color: #ffffff;
  border-color: #b91c1c;
  transform: scale(1.06);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

.btn-stepper-plus {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}

.btn-stepper-plus:hover,
.btn-stepper-plus:active {
  background: #22c55e;
  color: #ffffff;
  border-color: #16a34a;
  transform: scale(1.06);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.35);
}

.qty-stepper-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.stepper-number-input {
  width: 125px;
  font-size: 42px;
  font-weight: 900;
  text-align: center;
  color: #0f172a;
  background: #ffffff;
  border: 2.5px solid #3b82f6;
  border-radius: 14px;
  padding: 4px 6px;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
  transition: all 0.15s ease;
  outline: none;
}

.stepper-number-input:focus {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25);
  transform: scale(1.02);
}

/* Ocultar flechitas por defecto de inputs type number */
.stepper-number-input::-webkit-outer-spin-button,
.stepper-number-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.stepper-number-input[type=number] {
  -moz-appearance: textfield;
}

.qty-stepper-sublabel {
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #64748b;
  margin-top: 4px;
}

.qty-availability-hint {
  font-size: 13.5px;
  font-weight: 700;
  color: #15803d;
  margin-top: 12px;
}

.qty-availability-hint strong {
  font-size: 15px;
  color: #166534;
}

/* Atajos rápidos en 1 toque debajo del número */
.qty-quick-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #cbd5e1;
}

.qty-quick-label {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  margin-right: 2px;
}

.btn-qty-shortcut {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 800;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-qty-shortcut:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.btn-qty-shortcut.active {
  background: #10b981;
  color: #ffffff;
  border-color: #059669;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

/* Toggles de Extras (Docente y Proyector) */
.extras-toggles-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 520px) {
  .extras-toggles-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.toggle-card {
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.toggle-card input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: #10b981;
  margin-right: 12px;
  cursor: pointer;
}

.toggle-card-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-icon {
  font-size: 24px;
}

.toggle-card-content strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--color-text-main);
}

.toggle-card-content small {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
}

/* Campos de Formulario */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-md);
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

.form-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-input-lg {
  font-size: 16px;
  padding: 14px 18px;
}

/* Chips rápidos de docentes y cursos (Escuela 4-014) */
.quick-chips-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.chips-label {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 2px;
}

.profe-chip {
  background: #eff6ff;
  border: 1.5px solid #93c5fd;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  color: #1e40af;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.profe-chip:hover,
.profe-chip:active {
  background: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.3);
}

.quick-course-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.course-chip {
  background: #ecfdf5;
  border: 1.5px solid #6ee7b7;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 800;
  color: #065f46;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.course-chip:hover,
.course-chip:active {
  background: #059669;
  color: #ffffff;
  border-color: #047857;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(5, 150, 105, 0.3);
}

.course-chip.space-chip {
  background: #f5f3ff;
  border-color: #c4b5fd;
  color: #5b21b6;
}

.course-chip.space-chip:hover,
.course-chip.space-chip:active {
  background: #6366f1;
  color: #ffffff;
  border-color: #4f46e5;
  box-shadow: 0 3px 8px rgba(99, 102, 241, 0.3);
}

/* Modal Actions & Botones Gigantes */
.modal-actions-sticky {
  padding: 20px 26px;
  background: #f8fafc;
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-actions {
  padding: 20px 26px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  background: #f8fafc;
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
}

.btn-giant {
  width: 100%;
  border: none;
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
  transition: all 0.2s ease;
}

.btn-giant:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

.btn-giant.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
}

.btn-giant.btn-indigo {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff;
}

.btn-large {
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 800;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.btn-large.success {
  background: #10b981;
  color: #ffffff;
}

.btn-large.danger {
  background: #ef4444;
  color: #ffffff;
}

.btn-large.cancel {
  background: #e2e8f0;
  color: #475569;
}

.btn-large.cancel:hover {
  background: #cbd5e1;
}

/* ==================== ESTILOS CUERPO DE DEVOLUCIÓN ==================== */
.devolver-body {
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lent-summary-card {
  background: #eff6ff;
  border: 2px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.lent-summary-icon {
  font-size: 32px;
}

.lent-summary-info h3 {
  font-size: 16px;
  font-weight: 800;
  color: #1e40af;
}

.lent-summary-info p {
  font-size: 14px;
  color: #2563eb;
  font-weight: 600;
}

.return-all-highlight {
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}

.return-note {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 8px;
  font-weight: 600;
}

/* Sección de reporte de falla al devolver */
.report-fault-section {
  border: 2px solid #fed7aa;
  background: #fff7ed;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.fault-section-header {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: #9a3412;
  font-size: 14px;
  user-select: none;
}

.fault-section-content {
  padding: 16px 18px;
  border-top: 1px solid #fed7aa;
  background: #ffffff;
}

.fault-explainer {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 12px;
}

.quick-fault-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.fault-chip {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.fault-chip:hover {
  background: #fecaca;
}

/* Modal Info Box (Detalle de sesión) */
.modal-info-box {
  background: #f1f5f9;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 20px 26px;
  font-size: 15px;
  line-height: 1.6;
}

.modal-info-box.alert-box {
  background: #fef2f2;
  border: 2px solid #fecaca;
}

/* ==================== VISTA HISTORIAL Y REPORTES ==================== */
.history-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.month-selector-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.month-selector-label {
  font-size: 15px;
  font-weight: 800;
  color: var(--color-text-main);
}

.month-input {
  font-size: 15px;
  font-weight: 700;
  padding: 8px 14px;
  border: 2px solid #cbd5e1;
  border-radius: var(--radius-md);
  font-family: inherit;
  outline: none;
}

.btn-export {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

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

/* Tarjetas de Métricas */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.metric-card {
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-md);
}

.metric-card.purple {
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
}

.metric-card.blue {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
}

.metric-card.green {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.metric-icon {
  font-size: 38px;
  line-height: 1;
}

.metric-info h3 {
  font-size: 14px;
  font-weight: 700;
  opacity: 0.9;
}

.metric-value {
  font-size: 32px;
  font-weight: 900;
  line-height: 1.1;
  margin-top: 4px;
}

/* Secciones y Tablas */
.section-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.section-title {
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 800;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 2px solid #e2e8f0;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

.badge-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 800;
}

.badge-status.active {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-status.ok {
  background: #d1fae5;
  color: #065f46;
}

.badge-status.baja {
  background: #fee2e2;
  color: #991b1b;
}

/* Gestión de Dispositivos en Historial */
.devices-mgmt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.device-mgmt-card {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.device-mgmt-card.is-baja {
  border-color: #fca5a5;
  background: #fef2f2;
}

.device-mgmt-name {
  font-size: 16px;
  font-weight: 800;
}

.btn-toggle-status {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-toggle-status.to-baja {
  background: #fee2e2;
  color: #991b1b;
}

.btn-toggle-status.to-ok {
  background: #d1fae5;
  color: #065f46;
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  background: #1e293b;
  color: #ffffff;
  padding: 14px 22px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slide-toast 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-left: 5px solid #3b82f6;
}

.toast.success { border-left-color: #10b981; }
.toast.error { border-left-color: #ef4444; }

@keyframes slide-toast {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==================== OPTIMIZACIÓN RESPONSIVA PARA CELULAR ==================== */
@media (max-width: 640px) {
  /* Barra superior compacta */
  .topbar {
    padding: 10px 12px;
    gap: 8px;
  }

  .topbar-school-logo {
    width: 36px;
    height: 36px;
    border-width: 1.5px;
  }

  .topbar-titles h1 {
    font-size: 15px;
    line-height: 1.15;
  }

  .topbar-date {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
  }

  .topbar-actions {
    gap: 8px;
  }

  .sync-badge {
    padding: 4px 8px;
    font-size: 11px;
  }

  .nav-link-btn {
    padding: 8px 12px;
    font-size: 12.5px;
  }

  .nav-text-full {
    display: none;
  }

  .nav-text-short {
    display: inline;
  }

  /* Contenido principal */
  .main-content {
    padding: 14px 10px 32px;
  }

  /* Hero del Carro */
  .cart-hero {
    padding: 18px 14px;
    border-radius: 18px;
    gap: 16px;
  }

  .cart-hero-badge {
    font-size: 11px;
    padding: 4px 10px;
  }

  .cart-hero-title {
    font-size: 21px;
    letter-spacing: -0.3px;
  }

  .cart-hero-subtitle {
    font-size: 13px;
    margin-top: 4px;
  }

  .cart-capacity-bar {
    margin-top: 14px;
  }

  .capacity-legend {
    gap: 10px;
    font-size: 12.5px;
  }

  /* Botones del Hero */
  .btn-hero-action {
    padding: 14px 14px;
    gap: 12px;
  }

  .hero-action-icon {
    font-size: 26px;
  }

  .hero-action-text strong {
    font-size: 15px;
  }

  .hero-action-text small {
    font-size: 11.5px;
  }

  /* Bandejas */
  .cart-shelf {
    padding: 14px 10px;
    border-radius: 16px;
  }

  .shelf-header {
    padding: 4px 4px 12px 4px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .shelf-title {
    font-size: 16px;
  }

  .shelf-badge {
    font-size: 11px;
  }

  .shelf-stats {
    font-size: 12px;
  }

  /* Grilla de slots: 2 columnas perfectas para celular */
  .shelf-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .slot-card {
    padding: 12px 8px;
    min-height: 140px;
    border-radius: 14px;
  }

  .slot-num-badge {
    font-size: 11px;
    padding: 2px 6px;
  }

  .slot-status-pill {
    font-size: 9.5px;
    padding: 2px 6px;
  }

  .slot-icon {
    font-size: 24px;
  }

  .slot-name {
    font-size: 14px;
  }

  .slot-ready-desc {
    font-size: 11px;
  }

  .slot-action-prompt {
    font-size: 11.5px;
    padding: 5px 4px;
  }

  /* Modales en Celular: ocupan pantalla cómoda con scroll vertical interno */
  .modal-overlay {
    padding: 8px;
  }

  .modal-box {
    max-height: 94vh;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
  }

  .modal-header {
    padding: 14px 16px;
  }

  .modal-title {
    font-size: 18px;
  }

  .modal-subtitle {
    font-size: 12.5px;
  }

  .modal-box form,
  .devolver-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
  }

  .form-section {
    padding: 14px 16px;
  }

  .modal-actions-sticky,
  .modal-actions {
    padding: 14px 16px;
  }

  .btn-giant {
    padding: 14px 16px;
    font-size: 15px;
  }

  /* Stepper en celular */
  .qty-stepper-card {
    padding: 14px 12px;
  }

  .btn-stepper {
    width: 52px;
    height: 52px;
    border-radius: 12px;
  }

  .btn-stepper .stepper-symbol {
    font-size: 28px;
  }

  .stepper-number-input {
    width: 95px;
    font-size: 34px;
    border-radius: 10px;
  }

  .btn-qty-shortcut {
    padding: 5px 9px;
    font-size: 12px;
  }

  /* Chips en celular */
  .course-chip,
  .profe-chip {
    padding: 5px 9px;
    font-size: 12px;
  }

  /* Historial en celular */
  .history-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .metrics-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .history-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
