/* ============================================
   Cualti CRM - Estilos personalizados
   Complementan Tailwind. Branding consistente.
   ============================================ */

:root {
  /* Paleta inspirada en el branding de Cualti */
  --c-primary: #2E5266;       /* Teal oscuro - títulos y nav */
  --c-primary-dark: #1F3A47;
  --c-accent: #F47C20;        /* Naranja Cualti (logo) */
  --c-accent-dark: #D9690F;
  --c-cream: #F2EFE7;         /* Crema - fondos suaves */
  --c-warm: #FDFBF6;
  --c-border: #E5E0D5;
  --c-text: #1F2937;
  --c-muted: #6B7280;

  /* Temperaturas del lead */
  --temp-frio: #93C5FD;
  --temp-tibio: #FBBF24;
  --temp-caliente: #F97316;
  --temp-muy-caliente: #DC2626;
}

* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--c-warm);
  color: var(--c-text);
}

/* ---------- Tipografía display ---------- */
.font-display {
  font-family: 'Playfair Display', Georgia, serif;
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: #454B55;        /* Gris grafito claro - contrasta con la naranja */
  color: #fff;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: 0.5rem;
  color: rgba(255,255,255,0.96);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
}
.sidebar-link:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.sidebar-link.active {
  background: rgba(244, 124, 32, 0.22);
  color: #fff;
  border-left: 3px solid var(--c-accent);
  padding-left: calc(1rem - 3px);
}

/* ---------- Kanban columns ---------- */
.kanban-board {
  display: flex;
  gap: 1rem;
  padding: 1rem 0.5rem 2rem;
  overflow-x: auto;
  min-height: calc(100vh - 14rem);
  scrollbar-width: thin;
}

.kanban-column {
  flex: 0 0 320px;
  background: var(--c-cream);
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 12rem);
}

.kanban-column-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-column-header h3 {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--c-primary);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.kanban-column-count {
  background: rgba(46, 82, 102, 0.1);
  color: var(--c-primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
}

.kanban-column-body {
  padding: 0.75rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  scrollbar-width: thin;
}

.kanban-column-body.drag-over {
  background: rgba(199, 81, 70, 0.05);
}

/* ---------- Lead cards ---------- */
.lead-card {
  background: white;
  border-radius: 0.5rem;
  padding: 0.75rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  border: 1px solid transparent;
  cursor: grab;
  transition: all 0.15s ease;
}
.lead-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-color: var(--c-border);
}
.lead-card:active {
  cursor: grabbing;
}
.lead-card.dragging {
  opacity: 0.45;
  transform: rotate(1.5deg);
}

.lead-card-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--c-text);
  margin-bottom: 0.25rem;
}

.lead-card-meta {
  font-size: 0.75rem;
  color: var(--c-muted);
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 0.5rem;
}

.lead-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  color: var(--c-muted);
  padding-top: 0.5rem;
  border-top: 1px solid #F3F0E8;
}

/* ---------- Temperature badges ---------- */
.temp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}
.temp-frio { background: #DBEAFE; color: #1E40AF; }
.temp-tibio { background: #FEF3C7; color: #92400E; }
.temp-caliente { background: #FFEDD5; color: #9A3412; }
.temp-muy-caliente { background: #FEE2E2; color: #991B1B; }

.temp-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ---------- Program tags ---------- */
.program-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.7rem;
  font-weight: 500;
  background: var(--c-cream);
  color: var(--c-primary);
}
.program-tag.lic { background: #DBEAFE; color: #1E40AF; }
.program-tag.pg { background: #DCFCE7; color: #14532D; }
.program-tag.dip { background: #FAE8FF; color: #6B21A8; }
.program-tag.curso { background: #FFEDD5; color: #9A3412; }
.program-tag.taller { background: #FEF3C7; color: #92400E; }
.program-tag.sin-definir { background: #F3F4F6; color: #6B7280; border: 1px dashed #D1D5DB; }

/* ---------- Origin icons ---------- */
.origin-icon {
  width: 14px;
  height: 14px;
  display: inline-block;
}

/* ---------- KPI cards (dashboard) ---------- */
.kpi-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1.25rem;
  border: 1px solid var(--c-border);
  transition: all 0.15s ease;
}
.kpi-card:hover {
  border-color: var(--c-accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.kpi-label {
  font-size: 0.75rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.kpi-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--c-primary);
  line-height: 1;
}
.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.5rem;
}
.kpi-delta.up { color: #15803D; }
.kpi-delta.down { color: #B91C1C; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: var(--c-accent);
  color: white;
}
.btn-primary:hover {
  background: var(--c-accent-dark);
}
.btn-ghost {
  background: transparent;
  color: var(--c-primary);
  border: 1px solid var(--c-border);
}
.btn-ghost:hover {
  background: var(--c-cream);
}

/* ---------- Inputs ---------- */
.input {
  width: 100%;
  padding: 0.5rem 0.875rem;
  border: 1px solid var(--c-border);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background: white;
  transition: border-color 0.15s;
}
.input:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(199, 81, 70, 0.1);
}

/* ---------- Modal (lead detail) ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(31, 41, 55, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
}
.modal-card {
  background: white;
  border-radius: 0.75rem;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-hidden { display: none; }

/* ---------- Top header ---------- */
.topbar {
  background: white;
  border-bottom: 1px solid var(--c-border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ---------- Mobile sidebar toggle ---------- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 39;
}
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 80%;
    max-width: 300px;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar.open ~ .sidebar-overlay,
  .sidebar-overlay.show { display: block; }

  .kanban-column { flex: 0 0 280px; }

  /* Barra superior: que envuelva y apriete en móvil */
  .topbar {
    padding: 0.625rem 1rem;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
  }
  .topbar > div { min-width: 0; }
  .topbar .btn { padding: 0.4rem 0.7rem; font-size: 0.8rem; }

  /* Menos padding lateral en contenido */
  .p-6 { padding: 1rem !important; }

  /* Modales y wizard ocupan casi toda la pantalla */
  .modal-card, .wizard-card { max-width: 100% !important; }
  .modal-backdrop { padding: 0.5rem !important; }

  /* KPIs y grids muy apretados → mínimo 2 columnas legibles */
  .data-table { font-size: 0.8rem; }
}

/* ---------- Scrollbar styling ---------- */
.kanban-board::-webkit-scrollbar,
.kanban-column-body::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}
.kanban-board::-webkit-scrollbar-thumb,
.kanban-column-body::-webkit-scrollbar-thumb {
  background: rgba(46, 82, 102, 0.2);
  border-radius: 4px;
}
.kanban-board::-webkit-scrollbar-track,
.kanban-column-body::-webkit-scrollbar-track {
  background: transparent;
}

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--c-muted);
  font-size: 0.75rem;
  border: 2px dashed var(--c-border);
  border-radius: 0.5rem;
  margin-top: 0.5rem;
}

/* ---------- Tablas (Cobranza, Alumnos) ---------- */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: white;
  font-size: 0.875rem;
}
.data-table thead th {
  background: #FAF7F0;
  text-align: left;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-muted);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 1;
}
.data-table tbody td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #F3F0E8;
  vertical-align: middle;
}
.data-table tbody tr {
  cursor: pointer;
  transition: background 0.1s ease;
}
.data-table tbody tr:hover {
  background: #FBF8F1;
}

/* ---------- Status pills (cobranza) ---------- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  white-space: nowrap;
}
.status-al-corriente { background: #DCFCE7; color: #14532D; }
.status-mora-corta   { background: #FEF3C7; color: #92400E; }
.status-cartera-vencida { background: #FEE2E2; color: #991B1B; }
.status-finalizado   { background: #E0E7FF; color: #3730A3; }
.status-baja         { background: #F3F4F6; color: #6B7280; }
.status-graduado     { background: #DBEAFE; color: #1E40AF; }
.status-exalumno     { background: #DBEAFE; color: #1E40AF; }
.status-titulado     { background: #EDE9FE; color: #5B21B6; }
.status-pendiente    { background: #FEF3C7; color: #92400E; }
.status-activo       { background: #DCFCE7; color: #14532D; }

/* Estados de lead */
.estado-lead    { background: #F3F4F6; color: #4B5563; }
.estado-activo  { background: #FEF3C7; color: #92400E; }
.estado-perdido { background: #FEE2E2; color: #991B1B; }
.estado-ganado  { background: #D1FAE5; color: #065F46; }

/* Paginación */
.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.125rem;
  border-top: 1px solid var(--c-border);
  background: white;
  font-size: 0.8125rem;
  color: var(--c-muted);
}
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.page-btn {
  width: 32px;
  height: 32px;
  border-radius: 0.375rem;
  border: 1px solid var(--c-border);
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-primary);
  font-size: 1rem;
  transition: all 0.15s;
}
.page-btn:hover:not(:disabled) {
  border-color: var(--c-accent);
  color: var(--c-accent);
}
.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Selection action bar (sticky bottom) */
.selection-bar {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--c-primary);
  color: white;
  padding: 0.75rem 1rem 0.75rem 1.25rem;
  border-radius: 0.875rem;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  gap: 0.875rem;
  z-index: 30;
  animation: slideUp 0.2s ease;
}
@keyframes slideUp {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}
.selection-bar-count {
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
}
.selection-bar-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.selection-bar-btn:hover { background: rgba(255,255,255,0.25); }
.selection-bar-btn.danger {
  background: rgba(220, 38, 38, 0.85);
}
.selection-bar-btn.danger:hover { background: #DC2626; }
.selection-bar-clear {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0 0.25rem;
}
.selection-bar-clear:hover { color: white; }

/* Reportes - estilos de gráficas en CSS */
.report-card {
  background: white;
  border: 1px solid var(--c-border);
  border-radius: 0.75rem;
  padding: 1.25rem;
}
.report-card-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--c-primary);
  margin-bottom: 0.25rem;
}
.report-card-sub {
  font-size: 0.7rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

/* Horizontal bar (ranking) */
.hbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  padding: 0.375rem 0;
}
.hbar-label {
  flex: 0 0 130px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hbar-track {
  flex: 1;
  height: 18px;
  background: #F3F0E8;
  border-radius: 4px;
  overflow: hidden;
}
.hbar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-primary), var(--c-accent));
  border-radius: 4px;
  transition: width 0.4s ease;
}
.hbar-value {
  flex: 0 0 auto;
  font-weight: 700;
  color: var(--c-primary);
  font-size: 0.8125rem;
  min-width: 60px;
  text-align: right;
}

/* Donut chart via conic-gradient */
.donut {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}
.donut::after {
  content: '';
  position: absolute;
  inset: 28px;
  background: white;
  border-radius: 50%;
}
.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
  text-align: center;
  font-weight: 700;
}
.donut-center-num {
  font-size: 1.5rem;
  color: var(--c-primary);
}
.donut-center-label {
  font-size: 0.65rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  font-size: 0.8125rem;
}
.donut-legend-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.donut-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
.donut-legend-label {
  flex: 1;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.donut-legend-val {
  font-weight: 600;
  color: var(--c-muted);
  font-size: 0.75rem;
}

/* Vertical bars (trend) */
.vbars {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  height: 140px;
}
.vbar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}
.vbar-track {
  width: 100%;
  height: 110px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
}
.vbar-fill {
  width: 80%;
  background: linear-gradient(180deg, var(--c-accent), var(--c-primary));
  border-radius: 4px 4px 0 0;
  transition: height 0.3s ease;
  position: relative;
}
.vbar-fill .vbar-num {
  position: absolute;
  top: -1.25rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--c-primary);
}
.vbar-label {
  font-size: 0.65rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* Mini stats row */
.mini-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.875rem;
}
.mini-stat {
  background: var(--c-cream);
  padding: 0.75rem 0.875rem;
  border-radius: 0.5rem;
}
.mini-stat-label {
  font-size: 0.65rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.mini-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-primary);
  margin-top: 0.125rem;
}

/* Checkbox column */
.checkbox-cell {
  width: 36px;
  padding: 0 0 0 1rem !important;
}
.row-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--c-accent);
}

/* Importador */
.import-dropzone {
  border: 2px dashed var(--c-border);
  border-radius: 0.75rem;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  background: var(--c-cream);
  transition: all 0.15s ease;
}
.import-dropzone:hover, .import-dropzone.dragover {
  border-color: var(--c-accent);
  background: #FFF7F2;
}

.import-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}
.import-table th, .import-table td {
  padding: 0.5rem 0.625rem;
  border-bottom: 1px solid var(--c-border);
  text-align: left;
}
.import-table th {
  background: #FAF7F0;
  font-weight: 600;
  font-size: 0.65rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.import-table .map-select {
  width: 100%;
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--c-border);
  border-radius: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  background: white;
  color: var(--c-primary);
}
.import-table .map-select.unmapped {
  color: var(--c-muted);
  border-color: #E5E7EB;
}

.import-summary {
  background: var(--c-cream);
  padding: 1rem 1.125rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}
.import-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
}
.import-summary-row .num {
  font-weight: 700;
  color: var(--c-primary);
}
.import-summary-row.warn .num { color: #D97706; }
.import-summary-row.err .num { color: #DC2626; }

/* Termómetro de temperatura 1-10 */
.temp-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}
.temp-1, .temp-2, .temp-3 { background: #DBEAFE; color: #1E40AF; }
.temp-4, .temp-5, .temp-6 { background: #FEF3C7; color: #92400E; }
.temp-7, .temp-8 { background: #FFEDD5; color: #9A3412; }
.temp-9, .temp-10 { background: #FEE2E2; color: #991B1B; }

.temp-bar {
  display: inline-block;
  width: 60px;
  height: 6px;
  background: #E5E7EB;
  border-radius: 999px;
  overflow: hidden;
  vertical-align: middle;
}
.temp-bar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2563EB 0%, #F59E0B 50%, #DC2626 100%);
  border-radius: 999px;
}

.temp-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  background: linear-gradient(90deg, #DBEAFE 0%, #FEF3C7 50%, #FEE2E2 100%);
  border-radius: 999px;
  outline: none;
}
.temp-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--c-accent);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.temp-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--c-accent);
  cursor: pointer;
}

/* Timeline del historial */
.timeline {
  position: relative;
  padding-left: 1.25rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0.4rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: var(--c-border);
}
.timeline-event {
  position: relative;
  padding: 0.5rem 0 0.5rem 0.75rem;
}
.timeline-event::before {
  content: '';
  position: absolute;
  left: -1.2rem;
  top: 0.875rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-accent);
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--c-accent);
}
.timeline-event.evento-capturado::before { background: #6B7280; box-shadow: 0 0 0 2px #6B7280; }
.timeline-event.evento-a_prospecto::before { background: #D97706; box-shadow: 0 0 0 2px #D97706; }
.timeline-event.evento-movido_etapa::before { background: #2563EB; box-shadow: 0 0 0 2px #2563EB; }
.timeline-event.evento-temp_cambiada::before { background: #EC4899; box-shadow: 0 0 0 2px #EC4899; }
.timeline-event.evento-perdido::before { background: #DC2626; box-shadow: 0 0 0 2px #DC2626; }
.timeline-event.evento-reactivado::before { background: #D97706; box-shadow: 0 0 0 2px #D97706; }
.timeline-event.evento-ganado::before { background: #16A34A; box-shadow: 0 0 0 2px #16A34A; }

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ---------- Avatar circle (alumnos) ---------- */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8125rem;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 1.25rem;
}

/* ---------- Plan de pagos (modal) ---------- */
.plan-row {
  display: grid;
  grid-template-columns: 1.5rem 1fr auto auto auto;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: 0.5rem;
  align-items: center;
  font-size: 0.875rem;
  border: 1px solid transparent;
}
.plan-row.pagado { background: #F0FDF4; border-color: #BBF7D0; }
.plan-row.pendiente { background: #FFFBEB; border-color: #FDE68A; }
.plan-row.vencido { background: #FEF2F2; border-color: #FECACA; }
.plan-row.futuro { background: white; border-color: var(--c-border); }

.plan-icon {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
}
.plan-icon.pagado { background: #16A34A; }
.plan-icon.pendiente { background: #D97706; }
.plan-icon.vencido { background: #DC2626; }
.plan-icon.futuro { background: #9CA3AF; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--c-border);
  background: white;
}
.tab {
  padding: 0.875rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--c-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tab:hover { color: var(--c-primary); }
.tab.active {
  color: var(--c-accent);
  border-bottom-color: var(--c-accent);
}

/* ---------- Grade cell ---------- */
.grade-cell {
  font-weight: 600;
  text-align: center;
}
.grade-cell.bad { color: #DC2626; }
.grade-cell.warn { color: #D97706; }
.grade-cell.ok { color: var(--c-text); }
.grade-cell.good { color: #16A34A; }
.grade-cell.empty { color: #D1D5DB; }

/* =====================================================
   MOBILE-FIRST: Portal del maestro
   ===================================================== */

.mobile-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--c-warm);
  display: flex;
  flex-direction: column;
  position: relative;
}

@media (min-width: 768px) {
  body.mobile-page {
    background: linear-gradient(135deg, #2E5266 0%, #1F3A47 100%);
    min-height: 100vh;
  }
  .mobile-shell {
    margin: 2rem auto;
    border-radius: 1.5rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25), 0 0 0 8px rgba(255,255,255,0.05);
    overflow: hidden;
    min-height: calc(100vh - 4rem);
    max-height: calc(100vh - 4rem);
  }
}

.mobile-header {
  background: var(--c-primary);
  color: white;
  padding: 1.25rem 1.25rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 10;
}
.mobile-header.with-back {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mobile-back-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.mobile-back-btn:hover { background: rgba(255,255,255,0.2); }

.mobile-greeting {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
}
.mobile-name {
  font-size: 1.4rem;
  font-weight: 700;
  margin-top: 0.125rem;
}
.mobile-subtitle {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.65);
  margin-top: 0.25rem;
}

/* ---------- Class cards (dashboard maestro) ---------- */
.clase-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1rem 1.125rem;
  border: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.clase-card:active {
  transform: scale(0.98);
}
.clase-card:hover {
  border-color: var(--c-accent);
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.clase-card.completa {
  background: #F0FDF4;
  border-color: #BBF7D0;
}
.clase-card.en-curso {
  border-color: var(--c-accent);
  border-width: 2px;
  background: linear-gradient(180deg, white 0%, #FFF7F2 100%);
  box-shadow: 0 2px 12px rgba(199, 81, 70, 0.12);
}

.clase-time {
  flex-shrink: 0;
  text-align: center;
  min-width: 56px;
  padding: 0.5rem 0;
  border-right: 1px solid var(--c-border);
  padding-right: 1rem;
}
.clase-time-start {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-primary);
  line-height: 1;
}
.clase-time-end {
  font-size: 0.7rem;
  color: var(--c-muted);
  margin-top: 0.25rem;
}

.clase-info {
  flex: 1;
  min-width: 0;
}
.clase-materia {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--c-text);
  margin-bottom: 0.125rem;
}
.clase-meta {
  font-size: 0.75rem;
  color: var(--c-muted);
}

.clase-status {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}
.clase-status.pendiente { background: #FEF3C7; color: #92400E; }
.clase-status.completa { background: #DCFCE7; color: #14532D; }
.clase-status.en-curso { background: var(--c-accent); color: white; }

/* ---------- Progress bar ---------- */
.progress-track {
  height: 6px;
  background: rgba(255,255,255,0.15);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.75rem;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #FCD34D, var(--c-accent));
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* ---------- Pase de lista: alumno row ---------- */
.alumno-row {
  background: white;
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.alumno-row.marcado {
  border-color: #BBF7D0;
}

.attend-btns {
  display: flex;
  gap: 0.375rem;
  flex-shrink: 0;
}
.attend-btn {
  width: 44px;
  height: 44px;
  border-radius: 0.5rem;
  border: 2px solid var(--c-border);
  background: white;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-muted);
}
.attend-btn:hover { border-color: var(--c-primary); }
.attend-btn:active { transform: scale(0.92); }

.attend-btn.active.presente {
  background: #16A34A;
  color: white;
  border-color: #16A34A;
}
.attend-btn.active.ausente {
  background: #DC2626;
  color: white;
  border-color: #DC2626;
}
.attend-btn.active.retardo {
  background: #D97706;
  color: white;
  border-color: #D97706;
}

/* ---------- Sticky save button ---------- */
.mobile-footer {
  position: sticky;
  bottom: 0;
  background: white;
  border-top: 1px solid var(--c-border);
  padding: 0.875rem 1rem;
  display: flex;
  gap: 0.5rem;
  z-index: 10;
}
.mobile-footer .btn-primary {
  flex: 1;
  justify-content: center;
  padding: 0.875rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
}
.mobile-footer .btn-ghost {
  padding: 0.875rem 1.125rem;
}

/* ---------- Empty (todo marcado) state ---------- */
.attend-summary {
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 0.75rem;
  padding: 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: #14532D;
}

/* ---------- Counter chips (header pase de lista) ---------- */
.attend-counters {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.875rem;
}
.counter-chip {
  flex: 1;
  background: rgba(255,255,255,0.12);
  padding: 0.5rem 0.625rem;
  border-radius: 0.5rem;
  text-align: center;
}
.counter-chip-num {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
}
.counter-chip-label {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}
.counter-chip.green .counter-chip-num { color: #86EFAC; }
.counter-chip.red .counter-chip-num { color: #FCA5A5; }
.counter-chip.yellow .counter-chip-num { color: #FCD34D; }

/* ---------- Bulk actions ---------- */
.bulk-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: var(--c-cream);
  border-bottom: 1px solid var(--c-border);
}
.bulk-btn {
  flex: 1;
  padding: 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid var(--c-border);
  background: white;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--c-muted);
  cursor: pointer;
}
.bulk-btn:hover { color: var(--c-primary); border-color: var(--c-primary); }

/* =====================================================
   WIZARD DE INSCRIPCIÓN
   ===================================================== */

.wizard-card {
  max-width: 640px;
  width: 100%;
  background: white;
  border-radius: 0.875rem;
  display: flex;
  flex-direction: column;
  max-height: 92vh;
  overflow: hidden;
}

.wizard-header {
  padding: 1.125rem 1.5rem 0.875rem;
  border-bottom: 1px solid var(--c-border);
}

.wizard-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.wizard-stepper {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.875rem;
}
.wizard-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--c-muted);
}
.wizard-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--c-cream);
  color: var(--c-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.7rem;
  flex-shrink: 0;
}
.wizard-step.active .wizard-step-num {
  background: var(--c-accent);
  color: white;
}
.wizard-step.done .wizard-step-num {
  background: #16A34A;
  color: white;
}
.wizard-step.active { color: var(--c-text); font-weight: 600; }
.wizard-step.done { color: #16A34A; }

.wizard-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.wizard-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--c-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--c-warm);
  gap: 0.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
}
.form-grid .full { grid-column: 1 / -1; }

.form-field label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-muted);
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.form-field .input { width: 100%; }
.form-field.error .input { border-color: #DC2626; }
.form-field .error-msg {
  font-size: 0.7rem;
  color: #DC2626;
  margin-top: 0.25rem;
  display: none;
}
.form-field.error .error-msg { display: block; }

.radio-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
}
.radio-card {
  border: 2px solid var(--c-border);
  border-radius: 0.625rem;
  padding: 0.875rem 1rem;
  cursor: pointer;
  transition: all 0.15s ease;
  background: white;
}
.radio-card:hover { border-color: var(--c-primary); }
.radio-card.selected {
  border-color: var(--c-accent);
  background: linear-gradient(180deg, white, #FFF7F2);
  box-shadow: 0 2px 8px rgba(199, 81, 70, 0.08);
}
.radio-card-title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--c-text);
  margin-bottom: 0.125rem;
}
.radio-card-sub {
  font-size: 0.75rem;
  color: var(--c-muted);
}

.summary-box {
  background: var(--c-cream);
  border-radius: 0.625rem;
  padding: 1rem 1.125rem;
  margin-bottom: 1rem;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.375rem 0;
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.summary-row:last-child { border-bottom: none; }
.summary-label { color: var(--c-muted); }
.summary-value { font-weight: 600; color: var(--c-text); }

.beca-toggle {
  background: var(--c-cream);
  border: 1px solid var(--c-border);
  border-radius: 0.625rem;
  padding: 0.875rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}
.beca-toggle input { transform: scale(1.2); }



