/* ═══════════════════════════════════════════════════════════
   Control Escolar — style.css
   Mobile-first · Premium · Dark blue institutional palette
   ═══════════════════════════════════════════════════════════ */

/* ─── Variables ─────────────────────────────────────────── */
:root {
  --edcp-primary:     #FFFFFF; /* White sidebar */
  --edcp-primary-lt:  #F8FAFC;
  --edcp-accent:      #0284C7; /* Elegant Azure Blue */
  --edcp-accent-lt:   #38BDF8;
  --edcp-gold:        #F59E0B;
  --edcp-success:     #10B981;
  --edcp-warning:     #F59E0B;
  --edcp-danger:      #EF4444;
  --edcp-bg:          #F1F5F9; /* Very light cool grey */
  --edcp-surface:     #FFFFFF;
  --edcp-border:      #E2E8F0;
  --edcp-txt:         #0F172A;
  --edcp-txt-muted:   #64748B;
  --edcp-sidebar-w:   240px;
  --edcp-radius:      14px;
  --edcp-radius-sm:   8px;
  --edcp-shadow:      0 2px 14px rgba(15,23,42,.05);
  --edcp-shadow-lg:   0 8px 28px rgba(15,23,42,.12);
  --edcp-trans:       .22s cubic-bezier(.4,0,.2,1);
  --edcp-font:        'Inter', system-ui, -apple-system, sans-serif;
}

/* ─── Reset + AISLAMIENTO DEL TEMA ───────────────────────── */
/*
 * Este bloque usa !important estratégicamente para SOBREPONERSE a cualquier
 * CSS que el tema activo de WordPress pueda heredar a los elementos del plugin.
 * Cubre los casos más comunes: inputs negros, links colorados, headings sin estilo.
 */
.edcp-wrap *,
.edcp-wrap *::before,
.edcp-wrap *::after {
  box-sizing: border-box !important;
  margin: 0;
  padding: 0;
}
.edcp-wrap {
  font-family: var(--edcp-font) !important;
  color: var(--edcp-txt) !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
  -webkit-font-smoothing: antialiased !important;
  background: var(--edcp-bg) !important;
}

/* Forzar reset estricto de textos para que no herede colores del tema */
.edcp-wrap p, 
.edcp-wrap span, 
.edcp-wrap div, 
.edcp-wrap a {
  font-family: inherit !important;
}
.edcp-wrap p { margin-bottom: 0.5rem !important; }

/* ── Inputs, selects, textareas ─────────────────────────── */
/* El tema NO debe aplicar fondo negro, colores raros ni bordes a nuestros campos */
.edcp-wrap input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="color"]):not([type="range"]),
.edcp-wrap select,
.edcp-wrap textarea,
.edcp-wrap .edcp-input,
.edcp-wrap .edcp-select,
.edcp-wrap .edcp-textarea {
  background-color: #ffffff !important;
  color: #1E293B !important;
  border: 1.5px solid #E2E8F0 !important;
  border-radius: 8px !important;
  font-family: var(--edcp-font) !important;
  font-size: 13.5px !important;
  line-height: 1.5 !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}
.edcp-wrap input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):focus,
.edcp-wrap select:focus,
.edcp-wrap textarea:focus {
  border-color: #3B82F6 !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1) !important;
  background: #ffffff !important;
}
.edcp-wrap input::placeholder,
.edcp-wrap textarea::placeholder {
  color: #94A3B8 !important;
  opacity: 1 !important;
}

/* ── Botones: borramos todo lo que el tema inyecta ─────────── */
.edcp-wrap button:not(.edcp-btn),
.edcp-wrap .edcp-btn {
  font-family: var(--edcp-font) !important;
  cursor: pointer !important;
  outline: none !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}

/* ── Headings: tamaños, colores y márgenes del plugin ─────── */
.edcp-wrap h1,
.edcp-wrap h2,
.edcp-wrap h3,
.edcp-wrap h4,
.edcp-wrap h5,
.edcp-wrap h6 {
  font-family: var(--edcp-font) !important;
  color: var(--edcp-txt) !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ── Links: sin subrayado, sin colores raros ─────────────── */
.edcp-wrap a {
  text-decoration: none !important;
  color: inherit !important;
}
.edcp-wrap a:hover,
.edcp-wrap a:visited,
.edcp-wrap a:focus {
  color: inherit !important;
  text-decoration: none !important;
  outline: none !important;
}

/* ── Párrafos y listas ───────────────────────────────────── */
.edcp-wrap p { color: inherit !important; }
.edcp-wrap ul,
.edcp-wrap ol {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ── Imágenes ────────────────────────────────────────────── */
.edcp-wrap img {
  max-width: 100% !important;
  height: auto !important;
  border: none !important;
  box-shadow: none !important;
}

/* ── Tablas ────────────────────────────────────────────── */
.edcp-wrap table {
  border-collapse: collapse !important;
  border-spacing: 0 !important;
}

/* ── Select: flecha nativa con icono CSS ─────────────────── */
.edcp-wrap select.edcp-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%2364748B' d='M4 6l4 4 4-4'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 16px !important;
  padding-right: 34px !important;
}

/* ── Campos readonly ─────────────────────────────────────── */
.edcp-wrap .edcp-readonly-field {
  background: var(--edcp-bg) !important;
  cursor: default !important;
  opacity: .8 !important;
}

/* ═══════════════════════════════════════════════════════════
   LAYOUT SHELL
   ═══════════════════════════════════════════════════════════ */
.edcp-shell {
  display: flex !important;
  height: 100vh !important;
  width: 100vw !important;
  background: var(--edcp-bg) !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 999999 !important;
  overflow: hidden !important;
}

/* ─── Sidebar ─────────────────────────────────────────────── */
.edcp-sidebar {
  width: var(--edcp-sidebar-w) !important;
  background: var(--edcp-primary) !important;
  border-right: 1px solid var(--edcp-border) !important;
  display: flex !important;
  flex-direction: column !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  height: 100vh !important;
  z-index: 200 !important;
  transition: transform var(--edcp-trans) !important;
  overflow-y: auto !important;
  scrollbar-width: none !important;
}
.edcp-sidebar::-webkit-scrollbar { display: none; }

.edcp-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px;
  border-bottom: 1px solid var(--edcp-border);
  text-decoration: none;
}
.edcp-sidebar__logo {
  width: 36px;
  height: 36px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.edcp-sidebar__logo svg { width: 24px; height: 24px; fill: var(--edcp-accent); }
.edcp-sidebar__brand-text { line-height: 1.2; }
.edcp-sidebar__brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--edcp-txt);
  display: block;
}
.edcp-sidebar__brand-sub {
  font-size: 10px;
  color: var(--edcp-txt-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.edcp-sidebar__nav { padding: 16px 12px; flex: 1; }
.edcp-sidebar__section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--edcp-txt-muted);
  opacity: 0.7;
  padding: 4px 8px 8px;
  margin-top: 8px;
}

.edcp-nav-item {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 10px 12px !important;
  border-radius: var(--edcp-radius-sm) !important;
  color: var(--edcp-txt-muted) !important;
  text-decoration: none !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  transition: all var(--edcp-trans) !important;
  margin-bottom: 4px !important;
  cursor: pointer !important;
  border: none !important;
  background: transparent !important;
  width: 100% !important;
  text-align: left !important;
}
.edcp-nav-item:hover {
  background: var(--edcp-bg) !important;
  color: var(--edcp-txt) !important;
}
.edcp-nav-item.active {
  background: #F0F9FF !important; /* light sky blue bg */
  color: var(--edcp-accent) !important;
  box-shadow: inset 3px 0 0 var(--edcp-accent) !important;
}
.edcp-nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: .85;
}
.edcp-nav-item.active svg { opacity: 1; }

.edcp-sidebar__footer {
  padding: 12px;
  border-top: 1px solid var(--edcp-border);
}
.edcp-sidebar__footer .edcp-nav-item {
  color: var(--edcp-danger) !important;
  opacity: 0.85;
}
.edcp-sidebar__footer .edcp-nav-item:hover {
  background: rgba(239,68,68,.1) !important;
  color: var(--edcp-danger) !important;
  opacity: 1;
}

/* toggle (hidden on desktop) */
.edcp-sidebar-toggle {
  display: none !important;
  background: var(--edcp-surface) !important;
  color: var(--edcp-txt) !important;
}
.edcp-sidebar-toggle svg { width: 20px; height: 20px; stroke: var(--edcp-txt); }
.edcp-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 199;
}

/* ─── Main Area ───────────────────────────────────────────── */
.edcp-main {
  margin-left: var(--edcp-sidebar-w) !important;
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
  height: 100vh !important;
  overflow: hidden !important;
}

/* ─── Header ─────────────────────────────────────────────── */
.edcp-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 100 !important;
  background: var(--edcp-surface) !important;
  border-bottom: 1px solid var(--edcp-border) !important;
  padding: 0 20px !important;
  height: 64px !important;
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  box-shadow: 0 1px 8px rgba(0,0,0,.05) !important;
  flex-shrink: 0 !important;
}

/* Search bar */
.edcp-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.edcp-search__input {
  width: 100%;
  height: 40px;
  border: 1.5px solid var(--edcp-border);
  border-radius: 10px;
  padding: 0 14px 0 40px;
  font-family: var(--edcp-font);
  font-size: 13.5px;
  color: var(--edcp-txt);
  background: var(--edcp-bg);
  transition: all var(--edcp-trans);
  outline: none;
}
.edcp-search__input:focus {
  border-color: var(--edcp-accent-lt);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.edcp-search__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--edcp-txt-muted);
  pointer-events: none;
}
.edcp-search__dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--edcp-surface);
  border: 1.5px solid var(--edcp-border);
  border-radius: var(--edcp-radius-sm);
  box-shadow: var(--edcp-shadow-lg);
  overflow: hidden;
  display: none;
  z-index: 500;
  max-height: 320px;
  overflow-y: auto;
}
.edcp-search__dropdown.open { display: block; animation: edcpDropIn .15s ease; }

.edcp-search__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--edcp-trans);
  border-bottom: 1px solid var(--edcp-border);
}
.edcp-search__item:last-child { border-bottom: none; }
.edcp-search__item:hover { background: var(--edcp-bg); }
.edcp-search__item-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--edcp-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.edcp-search__item-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--edcp-txt);
}
.edcp-search__item-sub {
  font-size: 11px;
  color: var(--edcp-txt-muted);
}
.edcp-search__loading, .edcp-search__empty {
  padding: 14px;
  text-align: center;
  color: var(--edcp-txt-muted);
  font-size: 13px;
}

.edcp-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.edcp-notif-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  color: var(--edcp-txt-muted);
  transition: all var(--edcp-trans);
}
.edcp-notif-btn:hover { background: var(--edcp-bg); color: var(--edcp-txt); }
.edcp-notif-btn svg { width: 20px; height: 20px; display: block; }
.edcp-notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--edcp-danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 4px;
  min-width: 16px;
  text-align: center;
  line-height: 14px;
}

.edcp-user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 10px;
  transition: background var(--edcp-trans);
  background: none;
  border: none;
  font-family: var(--edcp-font);
}
.edcp-user-menu:hover { background: var(--edcp-bg); }
.edcp-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--edcp-border);
}
.edcp-user-info { text-align: left; }
.edcp-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--edcp-txt);
  line-height: 1.2;
}
.edcp-user-role {
  font-size: 11px;
  color: var(--edcp-txt-muted);
}

.edcp-logout-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--edcp-border);
  background: none;
  font-family: var(--edcp-font);
  font-size: 13px;
  font-weight: 500;
  color: var(--edcp-txt-muted);
  cursor: pointer;
  transition: all var(--edcp-trans);
}
.edcp-logout-btn:hover {
  border-color: var(--edcp-danger);
  color: var(--edcp-danger);
  background: rgba(239,68,68,.05);
}
.edcp-logout-btn svg { width: 15px; height: 15px; }

/* ─── Page Content ───────────────────────────────────────── */
.edcp-content {
  padding: 24px 24px 40px !important;
  flex: 1 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

.edcp-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
}
.edcp-page-title {
  font-size: 24px !important;
  font-weight: 800 !important;
  color: var(--edcp-txt) !important;
  line-height: 1.2 !important;
  margin: 0 !important;
}
.edcp-page-subtitle {
  font-size: 14px;
  color: var(--edcp-txt-muted);
  margin-top: 3px;
}

/* ─── Stats Cards ─────────────────────────────────────────── */
.edcp-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.edcp-stat-card {
  background: var(--edcp-surface);
  border-radius: var(--edcp-radius);
  padding: 18px 20px;
  border: 1px solid var(--edcp-border);
  box-shadow: var(--edcp-shadow);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all var(--edcp-trans);
}
.edcp-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--edcp-shadow-lg);
}
.edcp-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.edcp-stat-icon svg { width: 22px; height: 22px; }
.edcp-stat-icon--blue { background: rgba(37,99,235,.1); color: var(--edcp-accent); }
.edcp-stat-icon--green { background: rgba(16,185,129,.1); color: var(--edcp-success); }
.edcp-stat-icon--gold { background: rgba(245,158,11,.1); color: var(--edcp-gold); }
.edcp-stat-icon--red { background: rgba(239,68,68,.1); color: var(--edcp-danger); }
.edcp-stat-label {
  font-size: 12px;
  color: var(--edcp-txt-muted);
  font-weight: 500;
}
.edcp-stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--edcp-txt);
  line-height: 1;
  margin-top: 2px;
}

/* ─── Category Cards Grid ─────────────────────────────────── */
.edcp-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--edcp-txt);
  margin-bottom: 14px;
}
.edcp-cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.edcp-cat-card {
  background: var(--edcp-surface) !important;
  border-radius: var(--edcp-radius) !important;
  padding: 20px 18px !important;
  border: 1.5px solid var(--edcp-border) !important;
  box-shadow: var(--edcp-shadow) !important;
  cursor: pointer !important;
  transition: all var(--edcp-trans) !important;
  position: relative !important;
  text-decoration: none !important;
  display: block !important;
  text-align: left !important;
}
.edcp-cat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--edcp-shadow-lg);
  border-color: var(--edcp-accent-lt);
}
.edcp-cat-card.active {
  border-color: var(--edcp-accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12), var(--edcp-shadow-lg);
}
.edcp-cat-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}
.edcp-cat-card__icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.edcp-cat-card__icon svg { width: 24px; height: 24px; }
.edcp-cat-badge {
  background: #FFF7ED;
  color: #C2410C;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid #FED7AA;
}
.edcp-cat-badge--new { background: #ECFDF5; color: #065F46; border-color: #A7F3D0; }
.edcp-cat-card__name {
  font-size: 15px;
  font-weight: 700;
  color: var(--edcp-txt);
  margin-bottom: 4px;
}
.edcp-cat-card__desc {
  font-size: 12px;
  color: var(--edcp-txt-muted);
  line-height: 1.5;
}

/* ─── Activity Table ──────────────────────────────────────── */
.edcp-card {
  background: var(--edcp-surface);
  border-radius: var(--edcp-radius);
  border: 1px solid var(--edcp-border);
  box-shadow: var(--edcp-shadow);
  overflow: hidden;
  margin-bottom: 24px;
}
.edcp-card__header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--edcp-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.edcp-card__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--edcp-txt);
}
.edcp-card__body { padding: 0; }

.edcp-table {
  width: 100%;
  border-collapse: collapse;
}
.edcp-table th {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--edcp-txt-muted);
  background: var(--edcp-bg);
  border-bottom: 1px solid var(--edcp-border);
  text-align: left;
  white-space: nowrap;
}
.edcp-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--edcp-border);
  font-size: 13.5px;
  color: var(--edcp-txt);
  vertical-align: middle;
}
.edcp-table tr:last-child td { border-bottom: none; }
.edcp-table tbody tr {
  transition: background var(--edcp-trans);
}
.edcp-table tbody tr:hover { background: rgba(37,99,235,.025); }

.edcp-user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.edcp-user-cell img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--edcp-border);
}
.edcp-user-cell__name { font-weight: 600; font-size: 13px; }
.edcp-user-cell__sub { font-size: 11px; color: var(--edcp-txt-muted); }

/* ─── Badges de estatus ───────────────────────────────────── */
.edcp-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.edcp-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.edcp-badge--activo    { background: #ECFDF5; color: #065F46; }
.edcp-badge--activo::before { background: #10B981; }
.edcp-badge--suspendido{ background: #FFF7ED; color: #92400E; }
.edcp-badge--suspendido::before { background: #F59E0B; }
.edcp-badge--cancelado { background: #FEF2F2; color: #991B1B; }
.edcp-badge--cancelado::before { background: #EF4444; }

/* ─── Buttons ─────────────────────────────────────────────── */
.edcp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-family: var(--edcp-font);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--edcp-trans);
  text-decoration: none;
  white-space: nowrap;
}
.edcp-btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.edcp-btn--primary {
  background: var(--edcp-accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
}
.edcp-btn--primary:hover {
  background: var(--edcp-primary);
  box-shadow: 0 4px 16px rgba(37,99,235,.35);
  transform: translateY(-1px);
}
.edcp-btn--secondary {
  background: var(--edcp-surface);
  color: var(--edcp-txt);
  border: 1.5px solid var(--edcp-border);
}
.edcp-btn--secondary:hover {
  background: var(--edcp-bg);
  border-color: var(--edcp-accent-lt);
}
.edcp-btn--danger {
  background: var(--edcp-danger);
  color: #fff;
}
.edcp-btn--danger:hover { background: #DC2626; }
.edcp-btn--sm { padding: 6px 12px; font-size: 12px; }
.edcp-btn--full { width: 100%; }
.edcp-btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ─── Forms ───────────────────────────────────────────────── */
.edcp-form-group { margin-bottom: 16px; }
.edcp-label {
  display: block !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  color: var(--edcp-txt) !important;
  margin-bottom: 6px !important;
}
.edcp-input, .edcp-select, .edcp-textarea {
  width: 100% !important;
  padding: 10px 14px !important;
  border: 1.5px solid var(--edcp-border);
  border-radius: 8px;
  font-family: var(--edcp-font);
  font-size: 13.5px;
  color: var(--edcp-txt);
  background: var(--edcp-surface);
  transition: all var(--edcp-trans);
  outline: none;
}
.edcp-input:focus, .edcp-select:focus, .edcp-textarea:focus {
  border-color: var(--edcp-accent-lt);
  box-shadow: 0 0 0 3px rgba(37,99,235,.08);
}
.edcp-input::placeholder { color: var(--edcp-txt-muted); }
.edcp-textarea { resize: vertical; min-height: 80px; }
.edcp-input--search { padding-left: 38px !important; }
.edcp-input-icon-wrap { position: relative; }
.edcp-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--edcp-txt-muted);
  pointer-events: none;
}

/* Predictive dropdown inside forms */
.edcp-predict-wrap { position: relative; }
.edcp-predict-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--edcp-surface);
  border: 1.5px solid var(--edcp-border);
  border-top: none;
  border-radius: 0 0 var(--edcp-radius-sm) var(--edcp-radius-sm);
  box-shadow: var(--edcp-shadow-lg);
  z-index: 400;
  display: none;
  max-height: 260px;
  overflow-y: auto;
}
.edcp-predict-dropdown.open { display: block; }
.edcp-predict-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--edcp-trans);
  border-bottom: 1px solid rgba(0,0,0,.04);
}
.edcp-predict-item:hover, .edcp-predict-item.highlighted { background: rgba(37,99,235,.06); }
.edcp-predict-item:last-child { border-bottom: none; }
.edcp-predict-avatar {
  width: 30px;
  height: 30px;
  background: var(--edcp-accent);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.edcp-predict-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--edcp-txt);
}
.edcp-predict-sub { font-size: 11px; color: var(--edcp-txt-muted); }
.edcp-predict-loading, .edcp-predict-empty {
  padding: 12px 14px;
  text-align: center;
  color: var(--edcp-txt-muted);
  font-size: 12px;
}

/* ─── File list ───────────────────────────────────────────── */
.edcp-file-list { padding: 0; }
.edcp-file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--edcp-border);
  transition: background var(--edcp-trans);
}
.edcp-file-item:last-child { border-bottom: none; }
.edcp-file-item:hover { background: var(--edcp-bg); }
.edcp-file-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(37,99,235,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--edcp-accent);
}
.edcp-file-icon svg { width: 20px; height: 20px; }
.edcp-file-icon--pdf { background: rgba(239,68,68,.1); color: var(--edcp-danger); }
.edcp-file-icon--img { background: rgba(16,185,129,.1); color: var(--edcp-success); }
.edcp-file-info { flex: 1; min-width: 0; }
.edcp-file-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--edcp-txt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.edcp-file-meta { font-size: 11px; color: var(--edcp-txt-muted); margin-top: 2px; }
.edcp-file-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.edcp-file-suspension {
  background: #FFF7ED;
  border: 1px solid #FED7AA;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: #92400E;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.edcp-file-suspension svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ─── Upload drop zone ────────────────────────────────────── */
.edcp-dropzone {
  border: 2px dashed var(--edcp-border);
  border-radius: var(--edcp-radius);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--edcp-trans);
}
.edcp-dropzone:hover, .edcp-dropzone.drag-over {
  border-color: var(--edcp-accent-lt);
  background: rgba(37,99,235,.04);
}
.edcp-dropzone svg {
  width: 40px;
  height: 40px;
  color: var(--edcp-txt-muted);
  margin: 0 auto 10px;
  display: block;
}
.edcp-dropzone h4 { font-size: 14px; font-weight: 600; color: var(--edcp-txt); }
.edcp-dropzone p  { font-size: 12px; color: var(--edcp-txt-muted); margin-top: 4px; }

/* ─── Modal ───────────────────────────────────────────────── */
.edcp-modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0,0,0,.5) !important;
  backdrop-filter: blur(4px) !important;
  z-index: 100000 !important;
  display: none;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity .22s, visibility .22s !important;
}
.edcp-modal-backdrop.open {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}
/* El modal usa flex-column: header fijo, body scrollea, footer fijo */
.edcp-modal {
  background: #FFFFFF !important;
  border-radius: var(--edcp-radius) !important;
  width: 100% !important;
  max-width: 520px !important;
  max-height: calc(100vh - 40px) !important;
  display: flex !important;
  flex-direction: column !important;
  box-shadow: 0 20px 60px rgba(0,0,0,.25) !important;
  overflow: hidden !important;
  color: #0F172A !important;
  font-family: var(--edcp-font) !important;
}
.edcp-modal-backdrop.open .edcp-modal {
  transform: none !important;
}
.edcp-modal__header {
  padding: 18px 20px !important;
  border-bottom: 1px solid #E2E8F0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: #FFFFFF !important;
  border-radius: var(--edcp-radius) var(--edcp-radius) 0 0 !important;
  flex-shrink: 0 !important;         /* NUNCA se comprime — siempre visible */
}
.edcp-modal__title { font-size: 16px !important; font-weight: 700 !important; color: #0F172A !important; }
.edcp-modal__close {
  background: none !important;
  border: none !important;
  cursor: pointer !important;
  padding: 4px !important;
  color: var(--edcp-txt-muted) !important;
  border-radius: 6px !important;
  transition: all .22s !important;
  flex-shrink: 0 !important;
}
.edcp-modal__close:hover { background: var(--edcp-bg) !important; color: var(--edcp-txt) !important; }
.edcp-modal__close svg { width: 18px !important; height: 18px !important; display: block !important; }
/* El body es el único que scrollea internamente */
.edcp-modal__body {
  padding: 20px !important;
  overflow-y: auto !important;       /* SCROLL interno */
  flex: 1 1 auto !important;         /* ocupa todo el espacio disponible */
  -webkit-overflow-scrolling: touch !important;
}
.edcp-modal__body .edcp-label { display: block !important; font-size: 12.5px !important; font-weight: 600 !important; color: #1E293B !important; margin-bottom: 6px !important; }
.edcp-modal__footer {
  padding: 14px 20px !important;
  border-top: 1px solid #E2E8F0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  background: #FFFFFF !important;
  border-radius: 0 0 var(--edcp-radius) var(--edcp-radius) !important;
  flex-shrink: 0 !important;         /* NUNCA se comprime — siempre visible */
}

/* ─── Toast / Alerts ──────────────────────────────────────── */
.edcp-toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.edcp-toast {
  background: var(--edcp-surface);
  border-radius: 10px;
  border-left: 4px solid var(--edcp-accent);
  padding: 12px 16px;
  box-shadow: var(--edcp-shadow-lg);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--edcp-txt);
  min-width: 260px;
  max-width: 360px;
  pointer-events: all;
  animation: edcpToastIn .3s ease;
}
.edcp-toast--success { border-color: var(--edcp-success); }
.edcp-toast--error   { border-color: var(--edcp-danger); }
.edcp-toast--warning { border-color: var(--edcp-warning); }

/* ─── Skeleton Loader ─────────────────────────────────────── */
.edcp-skeleton {
  background: linear-gradient(90deg, var(--edcp-border) 25%, #e8eef4 50%, var(--edcp-border) 75%);
  background-size: 200% 100%;
  animation: edcpSkeleton 1.5s infinite;
  border-radius: 6px;
}
.edcp-skeleton-text { height: 14px; margin-bottom: 8px; }
.edcp-skeleton-text--short { width: 40%; }
.edcp-skeleton-text--medium { width: 65%; }

/* ─── Login Page ──────────────────────────────────────────── */
.edcp-login-page {
  min-height: 100vh;
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.edcp-login-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 24px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.06);
  border: 1px solid #E2E8F0;
  position: relative;
  z-index: 1;
}
.edcp-login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.edcp-login-logo-icon {
  width: 60px;
  height: 60px;
  background: var(--edcp-primary);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}
.edcp-login-logo-icon svg { width: 32px; height: 32px; fill: #fff; }
.edcp-login-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--edcp-txt);
  text-align: center;
}
.edcp-login-sub {
  font-size: 13px;
  color: var(--edcp-txt-muted);
  text-align: center;
  margin-top: 4px;
}
.edcp-login-tabs {
  display: flex;
  background: var(--edcp-bg);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 24px;
  gap: 4px;
}
.edcp-login-tab {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: none;
  font-family: var(--edcp-font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--edcp-txt-muted);
  transition: all var(--edcp-trans);
}
.edcp-login-tab.active {
  background: var(--edcp-surface);
  color: var(--edcp-txt);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.edcp-error-msg {
  background: #FEF2F2;
  border-left: 3px solid var(--edcp-danger);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: #991B1B;
  margin-bottom: 14px;
  display: none;
}
.edcp-error-msg.visible { display: block; }
.edcp-success-msg {
  background: #ECFDF5;
  border-left: 3px solid var(--edcp-success);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: #065F46;
  margin-bottom: 14px;
  display: none;
}
.edcp-success-msg.visible { display: block; }

/* ─── Perfil ──────────────────────────────────────────────── */
.edcp-profile-hero {
  background: var(--edcp-surface);
  border: 1px solid var(--edcp-border);
  box-shadow: var(--edcp-shadow);
  border-radius: var(--edcp-radius);
  padding: 28px 24px;
  display: flex !important;
  align-items: center !important;
  gap: 20px !important;
  margin-bottom: 24px !important;
  color: var(--edcp-txt) !important;
}
.edcp-profile-avatar-wrap { position: relative; }
.edcp-profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--edcp-bg);
  object-fit: cover;
}
.edcp-profile-name { font-size: 22px; font-weight: 800; color: var(--edcp-txt); }
.edcp-profile-role { font-size: 13.5px; color: var(--edcp-accent); font-weight: 600; margin-top: 3px; }
.edcp-profile-meta {
  display: flex;
  gap: 20px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.edcp-profile-meta-item { font-size: 12px; color: var(--edcp-txt-muted); }
.edcp-profile-meta-val  { font-weight: 600; color: var(--edcp-txt); }

.edcp-readonly-field {
  background: var(--edcp-bg);
  border-color: transparent;
  color: var(--edcp-txt-muted);
  cursor: not-allowed;
}

.edcp-profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}
@media (min-width: 992px) {
  .edcp-profile-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ─── Paginación ──────────────────────────────────────────── */
.edcp-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid var(--edcp-border);
  font-size: 13px;
  color: var(--edcp-txt-muted);
}
.edcp-pagination__pages { display: flex; gap: 4px; }
.edcp-page-btn {
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--edcp-border);
  border-radius: 6px;
  background: none;
  font-family: var(--edcp-font);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--edcp-trans);
  color: var(--edcp-txt-muted);
}
.edcp-page-btn:hover { background: var(--edcp-bg); color: var(--edcp-txt); }
.edcp-page-btn.active {
  background: var(--edcp-accent);
  border-color: var(--edcp-accent);
  color: #fff;
  font-weight: 700;
}
.edcp-page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ─── Filtros ─────────────────────────────────────────────── */
.edcp-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
}
.edcp-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.edcp-admin-tab-btn {
  background: transparent;
  border: 1px solid var(--edcp-border);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: #475569 !important;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--edcp-trans);
}
.edcp-admin-tab-btn:hover {
  background: rgba(37,99,235,0.05);
  color: var(--edcp-accent) !important;
}
.edcp-admin-tab-btn.active {
  background: var(--edcp-accent);
  color: #fff !important;
  border-color: var(--edcp-accent);
  box-shadow: 0 4px 12px rgba(37,99,235,0.2);
}

.edcp-filter-label {
  font-size: 12px;
  color: #1e293b !important;
  font-weight: 500;
  white-space: nowrap;
}
.edcp-select--sm {
  height: 36px;
  padding: 0 30px 0 10px;
  font-size: 12.5px;
  border-radius: 7px;
  min-width: 130px;
}
.edcp-input--sm {
  height: 36px;
  padding: 0 12px;
  font-size: 12.5px;
  border-radius: 7px;
}

/* ─── Empty state ─────────────────────────────────────────── */
.edcp-empty {
  text-align: center;
  padding: 48px 20px;
}
.edcp-empty svg {
  width: 56px;
  height: 56px;
  color: var(--edcp-border);
  margin: 0 auto 12px;
  display: block;
}
.edcp-empty h4 { font-size: 15px; font-weight: 600; color: var(--edcp-txt); }
.edcp-empty p  { font-size: 13px; color: var(--edcp-txt-muted); margin-top: 4px; }

/* ─── Loading spinner ─────────────────────────────────────── */
.edcp-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--edcp-border);
  border-top-color: var(--edcp-accent);
  border-radius: 50%;
  animation: edcpSpin .7s linear infinite;
  margin: 0 auto;
}

/* ─── Tab bar (mobile alumno) ─────────────────────────────── */
.edcp-tabbar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--edcp-surface);
  border-top: 1px solid var(--edcp-border);
  z-index: 150;
  padding: 6px 0 env(safe-area-inset-bottom);
  box-shadow: 0 -4px 20px rgba(0,0,0,.08);
}
.edcp-tabbar__inner {
  display: flex;
  justify-content: space-around;
}
.edcp-tabbar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  border: none;
  background: none;
  cursor: pointer;
  text-decoration: none;
  color: var(--edcp-txt-muted);
  transition: color var(--edcp-trans);
  font-family: var(--edcp-font);
  font-size: 10px;
  font-weight: 500;
}
.edcp-tabbar__item svg { width: 20px; height: 20px; }
.edcp-tabbar__item.active { color: var(--edcp-accent); }

/* ─── Select2 Customization ───────────────────────────────── */
.select2-container {
  z-index: 100005 !important;
}
.select2-container .select2-selection--multiple {
  min-height: 40px !important;
  border: 1px solid var(--edcp-border) !important;
  border-radius: 8px !important;
  background-color: var(--edcp-surface) !important;
  padding: 2px 8px !important;
  font-family: var(--edcp-font) !important;
  font-size: 14px !important;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
  background-color: var(--edcp-bg) !important;
  border: 1px solid var(--edcp-border) !important;
  border-radius: 6px !important;
  color: var(--edcp-text) !important;
  padding: 2px 6px !important;
  margin-top: 6px !important;
  font-size: 13px !important;
}
.select2-container--default.select2-container--focus .select2-selection--multiple {
  border-color: var(--edcp-accent) !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15) !important;
}
.select2-dropdown {
  border: 1px solid var(--edcp-border) !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1) !important;
  font-family: var(--edcp-font) !important;
  font-size: 14px !important;
  z-index: 100005 !important;
}
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background-color: var(--edcp-accent) !important;
}

/* ─── Animations ──────────────────────────────────────────── */
@keyframes edcpDropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes edcpToastIn {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes edcpSkeleton {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@keyframes edcpSpin {
  to { transform: rotate(360deg); }
}
@keyframes edcpFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.edcp-anim-in { animation: edcpFadeIn .3s ease both; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — Mobile First
   ═══════════════════════════════════════════════════════════ */

/* ─── Tablet ≤ 1024px ─────────────────────────────────────── */
@media (max-width: 1024px) {
  .edcp-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .edcp-cat-grid   { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Mobile ≤ 768px ──────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --edcp-sidebar-w: 0px; }

  .edcp-sidebar {
    transform: translateX(-240px) !important;
    width: 240px !important;
  }
  .edcp-sidebar.open { transform: translateX(0) !important; }
  .edcp-sidebar-overlay.open { display: block !important; }
  .edcp-sidebar-toggle { display: inline-flex !important; font-weight: 600 !important; }
  .edcp-sidebar-overlay { z-index: 99999999 !important; }
  .edcp-sidebar { z-index: 999999999 !important; }

  .edcp-main { margin-left: 0; padding-bottom: 70px; }

  .edcp-header {
    padding: 0 14px !important;
    height: 56px !important;
  }
  .edcp-user-info { display: none; }
  .edcp-logout-btn span { display: none; }
  .edcp-logout-btn { padding: 8px; }

  .edcp-content { padding: 16px 14px 90px; }

  .edcp-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .edcp-cat-grid   { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .edcp-page-title { font-size: 19px; }

  .edcp-tabbar { display: flex; align-items: stretch; }

  .edcp-login-card { padding: 28px 20px; }
  .edcp-profile-hero { flex-direction: column; text-align: center; }
  .edcp-profile-meta { justify-content: center; }

  .edcp-table th, .edcp-table td { padding: 10px 12px; }
  .edcp-table th:nth-child(3),
  .edcp-table td:nth-child(3) { display: none; }

  .edcp-modal { border-radius: var(--edcp-radius) var(--edcp-radius) 0 0 !important; }
  .edcp-modal-backdrop { align-items: center !important; padding: 12px !important; }
}

/* ─── Small mobile ≤ 480px ────────────────────────────────── */
@media (max-width: 480px) {
  .edcp-stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .edcp-stat-card  { padding: 14px 12px; }
  .edcp-stat-value { font-size: 22px; }
  .edcp-cat-grid   { grid-template-columns: 1fr; }

  .edcp-search { max-width: none; }

  .edcp-table th:nth-child(4),
  .edcp-table td:nth-child(4) { display: none; }

  /* Corregir layout de lista de archivos en móvil */
  .edcp-file-item {
    flex-wrap: wrap;
    padding: 12px 14px;
    gap: 8px;
  }
  .edcp-file-info {
    min-width: calc(100% - 50px);
  }
  .edcp-file-actions {
    width: 100%;
    justify-content: flex-start;
    padding-left: 48px;
    margin-top: 4px;
    flex-wrap: wrap;
  }
}
