/* ============================================================
   ADMIN - Estilos específicos del panel
   ============================================================ */

/* ---- Paleta propia del Admin (minimal, dark) ---- */
.admin-page {
  --primary: #05ad98;
  --primary-dark: #048a79;
  --primary-light: rgba(5, 173, 152, 0.16);
  --primary-rgb: 5, 173, 152;

  --secondary: #bbbfbf;
  --secondary-dark: #878787;
  --secondary-light: rgba(187, 191, 191, 0.14);
  --secondary-rgb: 187, 191, 191;

  --admin-sidebar-bg: #0b1514;
  --admin-sidebar-border: rgba(255,255,255,0.06);
}

/* ---- Layout ---- */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

/* ---- Admin Sidebar ---- */
.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--admin-sidebar-bg);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--admin-sidebar-border);
}

.sidebar-logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--admin-sidebar-border);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.admin-nav {
  padding: 16px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font);
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: white;
}

.nav-item.active {
  background: rgba(var(--primary-rgb), 0.20);
  border: 1px solid rgba(var(--primary-rgb), 0.22);
  color: white;
}

.sidebar-foot {
  padding: 16px 12px;
  border-top: 1px solid var(--admin-sidebar-border);
}

/* ---- Main ---- */
.admin-main {
  flex: 1;
  padding: 32px 36px;
  min-width: 0;
  max-width: 860px;
}

/* ---- Header ---- */
.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
}

.admin-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.admin-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.825rem;
  color: var(--secondary);
  background: rgba(var(--secondary-rgb), 0.14);
  border: 1px solid rgba(var(--secondary-rgb), 0.18);
  padding: 6px 12px;
  border-radius: 20px;
  flex-shrink: 0;
}

/* ---- Tabs ---- */
.tab-section {
  display: none;
}

.tab-section.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Cards ---- */
.section-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.card-icon--curricular {
  background: rgba(var(--primary-rgb), 0.18);
  border: 1px solid rgba(var(--primary-rgb), 0.20);
}

.card-icon--extracurricular {
  background: rgba(var(--secondary-rgb), 0.14);
  border: 1px solid rgba(var(--secondary-rgb), 0.18);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.card-header .badge {
  margin-left: auto;
  flex-shrink: 0;
}

/* ---- Form ---- */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.char-count {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.5;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
  background: var(--surface-2);
}

.form-input:focus {
  border-color: rgba(var(--primary-rgb), 0.65);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.16);
  background: var(--surface);
}

.form-textarea {
  width: 100%;
  min-height: 360px;
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.875rem;
  color: var(--text-primary);
  outline: none;
  resize: vertical;
  line-height: 1.6;
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
  background: var(--surface-2);
}

.form-textarea:focus {
  border-color: rgba(var(--primary-rgb), 0.65);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.16);
  background: var(--surface);
}

/* ---- Actions ---- */
.card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  margin-top: 4px;
}

/* ---- Info Box ---- */
.info-box {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid rgba(var(--secondary-rgb), 0.55);
  border-radius: var(--radius-md);
}

.info-box-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  line-height: 1;
  padding-top: 2px;
}

.info-box-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.info-box-list {
  list-style: disc;
  padding-left: 16px;
}

.info-box-list li {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 3px;
  line-height: 1.5;
}

/* ---- Preview Modal ---- */
.preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.preview-dialog {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.preview-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.preview-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px;
  border-radius: 6px;
  transition: background 0.15s;
}

.preview-close:hover {
  background: var(--border-light);
}

.preview-content {
  padding: 22px;
  overflow-y: auto;
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--text-primary);
  white-space: pre-wrap;
  font-family: 'Georgia', serif;
}

.preview-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
  font-family: var(--font);
  font-style: italic;
}

/* ---- Responsive ---- */
@media (max-width: 800px) {
  .admin-sidebar {
    width: 200px;
  }
  .admin-main {
    padding: 20px;
  }
}

@media (max-width: 600px) {
  .admin-layout {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    height: auto;
    position: static;
  }
  .admin-nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 8px;
  }
  .sidebar-foot {
    display: none;
  }
}
