/* ========================================================
   COMPONENTES DE GESTIÓN: CURSOS, TABLAS, TIENDA Y MODALES
   ======================================================== */

/* BARRA DE FILTROS Y ACCIONES DE LISTA */
.management-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  background: var(--bg-surface);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.search-filter-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 280px;
}

.search-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
}

.search-input:focus {
  border-color: var(--brand-gold);
}

.course-select {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
}

/* TARJETAS DE CURSOS ESCOLARES */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.course-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-bounce);
  position: relative;
  overflow: hidden;
}

.course-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-blue);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.course-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.course-card-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
}

.course-card-school {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.course-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  text-align: center;
}

.course-stat-col {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.course-stat-val {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 800;
}

.course-stat-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

/* ZONA DE CARGA MASIVA (DRAG & DROP Y PEGAR PLANILLA) */
.bulk-dropzone {
  border: 2px dashed rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.6);
  padding: 1.75rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
}

.bulk-dropzone:hover,
.bulk-dropzone.dragover {
  border-color: var(--brand-gold);
  background: rgba(245, 158, 11, 0.08);
}

.bulk-textarea {
  width: 100%;
  height: 140px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.4;
  outline: none;
  resize: vertical;
}

.bulk-textarea:focus {
  border-color: var(--brand-gold);
}

.bulk-preview-table-wrapper {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-top: 1rem;
}

/* TABLA ELEGANTE DE ESTUDIANTES */
.table-responsive-wrapper {
  overflow-x: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.bme-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.bme-table th {
  background: rgba(15, 23, 42, 0.7);
  padding: 1rem 1.2rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
  border-bottom: 1px solid var(--border-subtle);
}

.bme-table td {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.92rem;
  vertical-align: middle;
}

.bme-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.student-row-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.student-row-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e293b, #475569);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--brand-gold);
  border: 1px solid var(--border-subtle);
}

.nfc-id-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: rgba(15, 23, 42, 0.8);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  color: #94a3b8;
}

/* HISTORIAL CONTABLE / TRANSACCIONES */
.history-feed {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.history-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.2rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.history-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.history-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.history-icon-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.history-details h4 {
  font-size: 0.92rem;
  font-weight: 700;
}

.history-details p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.history-amount {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  text-align: right;
}

.history-amount.positive { color: var(--brand-emerald); }
.history-amount.negative { color: var(--brand-rose); }

/* TIENDA DE RECOMPENSAS Y CANJE ESCOLAR */
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.reward-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  transition: var(--transition-bounce);
  position: relative;
  overflow: hidden;
}

.reward-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-gold);
  box-shadow: var(--shadow-gold);
}

.reward-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}

.reward-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.15);
  color: var(--brand-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.reward-card h3 {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.reward-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.reward-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.85rem;
}

.reward-price {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 800;
}

/* MODALES */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 29, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2rem;
  max-width: 540px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.modal-header h2 {
  font-size: 1.3rem;
  font-weight: 800;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.25rem;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.btn-close-modal:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

.form-group {
  margin-bottom: 1.15rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
}

.form-control:focus {
  border-color: var(--brand-gold);
}

/* HERO */
.hero-banner {
  text-align: center;
  padding: 3.5rem 1rem 2.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--brand-gold-light);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 720px;
  margin: 0 auto 2rem;
}

.hero-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.hero-metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
}

.hero-metric-val {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--brand-gold);
  line-height: 1;
  margin-bottom: 0.35rem;
}

.hero-metric-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
}

@media (max-width: 640px) {
  .hero-title {
    font-size: 1.9rem;
  }
  .hero-metrics-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================================
   SITIO DE INICIO: BANNER DE DESPLIEGUE, PASO A PASO Y PILARES
   ======================================================== */

.deploy-status-banner {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem auto 2.5rem;
  max-width: 1000px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
}

.deploy-status-banner.blank-mode {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(15, 23, 42, 0.8) 100%);
}

.deploy-status-banner.configured-mode {
  border-color: rgba(245, 158, 11, 0.4);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(15, 23, 42, 0.8) 100%);
}

.deploy-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
}

.deploy-badge-pill.green {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.deploy-badge-pill.gold {
  background: rgba(245, 158, 11, 0.2);
  color: var(--brand-gold-light);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* SECCIONES DEL SITIO DE INICIO */
.landing-content-section {
  max-width: 1100px;
  margin: 3.5rem auto;
  padding: 0 1rem;
}

.section-header-centered {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-header-centered h2 {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.section-header-centered p {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 650px;
  margin: 0 auto;
}

/* PASO A PASO (6 PASOS DEL SISTEMA) */
.guide-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.guide-step-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  position: relative;
  transition: var(--transition-bounce);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.guide-step-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-gold);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.guide-step-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.guide-step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-gold), #d97706);
  color: #0f172a;
  font-weight: 900;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.4);
}

.guide-step-icon {
  font-size: 1.8rem;
}

.guide-step-card h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.guide-step-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  flex: 1;
}

.guide-step-tag {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

/* TRES PILARES PEDAGÓGICOS */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.pillar-card {
  background: linear-gradient(180deg, var(--bg-surface) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2rem 1.75rem;
  text-align: center;
  transition: var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.pillar-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-3px);
}

.pillar-card.pillar-decimas:hover { border-color: var(--color-decimas); }
.pillar-card.pillar-feria:hover { border-color: var(--color-clp); }
.pillar-card.pillar-merito:hover { border-color: var(--color-puntos); }

.pillar-icon-box {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.pillar-card h3 {
  font-size: 1.3rem;
  font-weight: 800;
}

.pillar-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* GUÍA POR ROLES */
.roles-tabs-nav {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.role-tab-btn {
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.role-tab-btn:hover {
  color: var(--text-primary);
  background: #334155;
}

.role-tab-btn.active {
  background: var(--brand-gold);
  color: #0f172a;
  border-color: var(--brand-gold);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.role-pane {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow-md);
  animation: fadeIn 0.3s ease;
}

.role-pane.active {
  display: block;
}

/* CAJA DE ESTADO VACÍO (EMPTY STATE) */
.empty-state-box {
  text-align: center;
  padding: 3.5rem 2rem;
  background: var(--bg-surface);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-xl);
  max-width: 600px;
  margin: 2rem auto;
}

.empty-state-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  opacity: 0.85;
}

.empty-state-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.empty-state-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 1.75rem;
}

/* ========================================================
   AUTOCOMPLETADO MINEDUC & AGENCIA DE EDUCACIÓN
   ======================================================== */
.mineduc-dropdown-container {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #0f172a;
  border: 1px solid var(--brand-blue);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  z-index: 1050;
  max-height: 310px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--brand-blue) transparent;
}

.mineduc-dropdown-container::-webkit-scrollbar {
  width: 6px;
}
.mineduc-dropdown-container::-webkit-scrollbar-thumb {
  background: var(--brand-blue);
  border-radius: 4px;
}

.mineduc-suggestion-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mineduc-suggestion-item:last-child {
  border-bottom: none;
}

.mineduc-suggestion-item:hover,
.mineduc-suggestion-item.selected {
  background: rgba(59, 130, 246, 0.15);
}

.mineduc-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.mineduc-item-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.mineduc-item-rbd-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  background: rgba(59, 130, 246, 0.2);
  color: var(--brand-blue);
  border: 1px solid rgba(59, 130, 246, 0.4);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  white-space: nowrap;
}

.mineduc-item-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.mineduc-meta-comuna {
  color: var(--text-muted);
}

.mineduc-meta-dep {
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
}

.mineduc-dropdown-footer {
  padding: 0.65rem 1rem;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mineduc-dropdown-footer a {
  color: var(--brand-blue);
  text-decoration: underline;
  cursor: pointer;
}


