/* Dashboard Elite Connect */
.dashboard-body {
  background: #f0f2f5;
  min-height: 100vh;
}

.dash-topbar {
  background: var(--primary);
  color: white;
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.dash-topbar-inner {
  width: min(1400px, 96%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.dash-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dash-badge {
  background: rgba(233,69,96,0.9);
  font-size: 0.75rem;
  padding: 0.25rem 0.7rem;
  border-radius: 50px;
  font-weight: 600;
}

.dash-user {
  font-size: 0.9rem;
  opacity: 0.85;
  margin-right: 0.8rem;
}

.dash-layout {
  display: flex;
  width: min(1400px, 96%);
  margin: 0 auto;
  min-height: calc(100vh - 56px);
}

.dash-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: white;
  border-right: 1px solid #e5e7eb;
  padding: 1.2rem 0.8rem;
  display: flex;
  flex-direction: column;
}

.dash-nav {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}

.dash-nav-item {
  background: transparent;
  border: none;
  text-align: left;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--text);
  transition: background 0.2s, color 0.2s;
  font-family: inherit;
}

.dash-nav-item:hover {
  background: #f3f4f6;
}

.dash-nav-item.active {
  background: #ffeaea;
  color: var(--secondary);
  font-weight: 600;
}

.dash-sidebar-footer {
  padding: 0.8rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.dash-main {
  flex: 1;
  padding: 1.5rem 1.8rem 3rem;
  overflow-x: auto;
}

.dash-section {
  display: none;
}

.dash-section.active {
  display: block;
}

.dash-title {
  font-size: 1.6rem;
  color: var(--primary);
  margin-bottom: 0.3rem;
}

.dash-subtitle {
  color: var(--muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

/* KPIs */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.8rem;
}

.kpi-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--secondary);
}

.kpi-card.gold { border-left-color: var(--gold); }
.kpi-card.blue { border-left-color: var(--accent); }
.kpi-card.green { border-left-color: #10b981; }

.kpi-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.kpi-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* Panels */
.dash-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

@media (max-width: 900px) {
  .dash-row { grid-template-columns: 1fr; }
  .dash-sidebar { width: 180px; }
}

.dash-panel {
  background: white;
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
}

.dash-panel h3 {
  font-size: 1rem;
  margin-bottom: 0.9rem;
  color: var(--primary);
}

.list-compact {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}

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

.list-item .meta {
  color: var(--muted);
  font-size: 0.8rem;
}

/* Tables */
.table-wrap {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.dash-table th {
  background: var(--primary);
  color: white;
  text-align: left;
  padding: 0.75rem 1rem;
  white-space: nowrap;
}

.dash-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}

.dash-table tr:hover td {
  background: #fafafa;
}

/* Status badges */
.badge-status {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-nuevo, .badge-pendiente { background: #fef3c7; color: #92400e; }
.badge-contactado, .badge-confirmada { background: #dbeafe; color: #1e40af; }
.badge-visito, .badge-realizada { background: #d1fae5; color: #065f46; }
.badge-inscrito, .badge-activo { background: #dcfce7; color: #166534; }
.badge-graduado { background: #e0e7ff; color: #3730a3; }
.badge-baja, .badge-cancelada, .badge-descartado { background: #fee2e2; color: #991b1b; }

/* Progress bar */
.progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  width: 80px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 0.4rem;
}

.progress-fill {
  height: 100%;
  background: var(--secondary);
  border-radius: 4px;
}

/* Tabs */
.dash-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.dash-tab {
  background: white;
  border: 1px solid #e5e7eb;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
}

.dash-tab.active {
  background: var(--secondary);
  color: white;
  border-color: var(--secondary);
}

.dash-tab-content {
  display: none;
}

.dash-tab-content.active {
  display: block;
}

.filtros {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.filtros select {
  padding: 0.5rem 0.8rem;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
}

.hint {
  margin-top: 0.8rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Maestros cards */
.cards-maestros {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.maestro-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.3rem;
  box-shadow: var(--shadow);
}

.maestro-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
  color: var(--primary);
}

.maestro-card .esp {
  color: var(--secondary);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.maestro-card .info {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 700px) {
  .dash-layout {
    flex-direction: column;
  }
  .dash-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    flex-direction: row;
    overflow-x: auto;
    padding: 0.6rem;
  }
  .dash-nav {
    flex-direction: row;
  }
  .dash-nav-item {
    white-space: nowrap;
  }
  .dash-sidebar-footer { display: none; }
}

/* === CRUD additions === */
.sec-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.toolbar {
  margin-bottom: 0.8rem;
}

.btn-sm {
  padding: 0.45rem 1rem !important;
  font-size: 0.88rem !important;
}

.btn-icon {
  background: transparent;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  margin-right: 0.25rem;
  transition: background 0.15s;
}

.btn-icon:hover { background: #f3f4f6; }
.btn-icon.danger:hover { background: #fee2e2; color: #991b1b; }

.btn-reset-data {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.35);
  color: rgba(255,255,255,0.85);
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  margin-right: 0.6rem;
  font-family: inherit;
}
.btn-reset-data:hover { background: rgba(255,255,255,0.1); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.modal-overlay[hidden] { display: none; }

.modal-box {
  background: white;
  border-radius: 12px;
  width: min(520px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.3rem;
  border-bottom: 1px solid #eee;
}
.modal-header h2 { font-size: 1.15rem; color: var(--primary); margin: 0; }
.modal-close {
  background: none; border: none; font-size: 1.5rem;
  cursor: pointer; color: #888; line-height: 1;
}
.modal-close:hover { color: #333; }

#modal-form { padding: 1.2rem 1.3rem; }
#modal-fields .form-group { margin-bottom: 0.9rem; }
#modal-fields label {
  display: block; font-size: 0.85rem; font-weight: 600;
  margin-bottom: 0.3rem; color: var(--primary);
}
#modal-fields input,
#modal-fields select,
#modal-fields textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
}
#modal-fields input:focus,
#modal-fields select:focus,
#modal-fields textarea:focus {
  outline: none; border-color: var(--secondary);
}
#modal-fields textarea { min-height: 70px; resize: vertical; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.2rem;
  padding-top: 0.8rem;
  border-top: 1px solid #eee;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--primary);
  color: white;
  padding: 0.8rem 1.3rem;
  border-radius: 8px;
  font-size: 0.9rem;
  z-index: 1100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  animation: fadeIn 0.25s ease;
}
.toast[hidden] { display: none; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.maestro-card .card-actions {
  margin-top: 0.8rem;
  display: flex;
  gap: 0.3rem;
}
.plantel-card .card-actions {
  margin-top: 0.7rem;
}
