@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');/* Global styles */.paralelo-counter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1.5px solid transparent;
}

.pill-icon {
  flex-shrink: 0;
  opacity: 0.8;
}

.paralelo-counter-pill.available {
  background-color: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.paralelo-counter-pill.available:hover {
  background-color: #dcfce7;
  border-color: #86efac;
}

.paralelo-counter-pill.moderate {
  background-color: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.paralelo-counter-pill.warning {
  background-color: #fff7ed;
  border-color: #ffedd5;
  color: #9a3412;
}

.paralelo-counter-pill.critical {
  background-color: #fef2f2;
  border-color: #fee2e2;
  color: #991b1b;
  animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.pill-text {
  white-space: nowrap;
}


*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.1), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.12), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
}

html, body {
  margin: 0;
  padding: 0;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.access-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #f8fafc;
  color: #1e293b;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.access-gate__card {
  width: min(100%, 410px);
  padding: 32px;
  border: 1px solid #dbe4f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-lg);
}

.access-gate__card h1 { margin: 14px 0 8px; font-size: 24px; }
.access-gate__card p { margin: 0 0 24px; color: #64748b; line-height: 1.55; }
.access-gate__card form { display: grid; gap: 8px; }
.access-gate__card label { font-size: 13px; font-weight: 700; }
.access-gate__card input {
  width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1;
  border-radius: 8px; font: inherit;
}
.access-gate__card button { justify-content: center; margin-top: 8px; }
.access-gate__message { margin: 16px 0 0 !important; font-size: 13px; }

.planificador-container {
  /* FS: 2026-04-06: FORCE_REBUILD_1712419000 */
  display: flex;
  flex-direction: column;
  height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background-color: #f8fafc;
  /* Refined slate background */
  color: #1e293b;
  /* Darker slate for better legibility */
}

/* Custom Scrollbar System */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
  background-clip: content-box;
}

/* Firefox Support */
* {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.planificador-header {
  padding: 16px 24px;
  background-color: #fff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm); /* Subordinate Elevation for Main Header */
}

.academic-load {
  display: inline-flex;
  align-items: center;
  margin-left: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.academic-load--building {
  color: #1d4ed8;
  background: #dbeafe;
}

.academic-load--healthy {
  color: #047857;
  background: #d1fae5;
}

.academic-load--over-limit {
  color: #b91c1c;
  background: #fee2e2;
}

.academic-load--unknown {
  color: #92400e;
  background: #fef3c7;
}

.credits-section {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.credit-item {
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 400;
  color: #64748b;
  /* Softer slate for secondary text */
}

.credit-link {
  text-decoration: none;
  color: #4F46E5;
  /* Brand Indigo */
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
  font-weight: 500;
}

.credit-link:hover {
  text-decoration: underline;
}

.franjas-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 8px;
}

.franja-item {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 11px;
  background: white;
}

.franja-item:hover {
  border-color: #3b82f6; /* Sync with brand blue logic */
  background-color: #f8fafc;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md); /* Decommissioned purple glow for Global Sovereignty */
}

.franja-item.selected {
  border-color: #3b82f6;
  background-color: #eff6ff;
  box-shadow: var(--shadow-md);
}

.franja-item input[type="checkbox"] {
  margin-right: 6px;
  transform: scale(0.9);
}

.franja-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.franja-name {
  font-weight: 500;
  color: #333;
}

.franja-time {
  color: #666;
  font-size: 9px;
}

.header-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.header-info h1 {
  margin: 0;
  font-size: 28.1px;
  /* Forced refire of CSS hash */
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  color: #0f172a;
  letter-spacing: -0.05em;
  line-height: 1;
}

.title-container {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-logo-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-logo-icon img {
  width: 100%;
  height: 100%;
}

.external-link-icon {
  width: 14px;
  height: 14px;
  margin-left: 4px;
  opacity: 0.6;
  flex-shrink: 0;
}

.author-link {
  text-decoration: none;
  color: #555;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.author-link:hover {
  text-decoration: underline;
  color: #0066cc;
}

.linkedin-icon {
  width: 16px;
  height: 16px;
}

.planificador-content {
  display: grid;
  grid-template-columns: 400px 1fr;
  grid-template-rows: 1fr; /* Authoritative Row Stretch */
  gap: 0;
  flex: 1;
  min-height: 0; /* Authoritative Flex-Height Hardening */
  height: 100%; /* Vertical Sovereignty Restoration */
  overflow: hidden;
}

.panel-izquierdo {
  background-color: #fff; /* Solid White Restoration for Material Contrast */
  border-right: 1px solid rgba(0, 0, 0, 0.05);
  overflow: hidden; /* Decommission redundant scroll for industrial-grade sovereignty */
  padding: 0 12px; /* Geometric Purity Restoration: Removed top offset for flush sticky header */
  box-shadow: var(--shadow-md); /* Vertical Sovereignty Hardening */
  z-index: 10; /* Elevation Sync */
  height: 100%; 
}

.panel-derecho {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: #f8fafc;
  overflow-y: auto;
}

.panel-seleccion {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Decommission redundant parent scroll */
  position: relative;
}

.stats-container {
  background-color: #e9ecef;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 15px;
}

.selectors-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* Balanced 2-column grid for legibility */
  gap: 10px; /* Increased gap for better visual separation */
  margin: 0; /* Material Purity Sync: Decommissioned internal margins */
  width: 100%;
  min-width: 0;
}

/* Glass Discovery Header System */
.selectors-container {
  /* Absolute Symmetry Sovereignty: Balanced 8px pure-offset */
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: #fff;
  padding: 8px 12px; 
  margin: 0 -12px; /* Flush to horizontal edges only */
  border-bottom: 1px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 12px; /* Industrial-grade internal spacing */
}

/* Hardened child normalization to prevent optical asymmetry */
.selectors-container > * {
  margin: 0 !important;
}

.filter-item-full {
  grid-column: span 2;
  min-width: 0;
}


.filter-item-full input,
.filter-item input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 13px;
  background-color: #fff; /* Solid Control Restoration */
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  color: #0f172a;
}

.filter-item-full input:hover,
.filter-item input:hover {
  background-color: rgba(255, 255, 255, 0.85); /* Slightly higher clarity on hover */
  border-color: #3b82f6;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.filter-item-full input:focus,
.filter-item input:focus {
  outline: none;
  border-color: #3b82f6;
  background-color: rgba(255, 255, 255, 0.5); /* High-fidelity focus clarity */
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Custom Select Premium System */
.custom-select-container {
  position: relative;
  width: 100%;
  min-width: 0;
}

.custom-select-trigger {
  width: 100%;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 13px;
  background-color: #fff; /* Solid Control Sync */
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: #0f172a;
  user-select: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.custom-select-trigger:focus {
  outline: none;
  border-color: #3b82f6;
  background-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.custom-select-trigger:hover {
  background-color: rgba(255, 255, 255, 0.85); /* Slightly higher clarity on hover */
  border-color: #3b82f6;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.custom-select-trigger span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== UNIFIED BRAND & INTEGRATED PROFILE SYSTEM ===== */
.planificador-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: white;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  z-index: 100;
  height: 64px;
  box-sizing: border-box;
}

.header-main-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.branding-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.branding-text h1 {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 24px;
  font-weight: 400;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0;
}

.header-author-link {
  display: flex;
  align-items: baseline;
  gap: 1px;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 15px;
  color: #64748b; /* Color for 'por' from popup */
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
  top: -0.5px; /* Moved up for better optical alignment with larger title */
  white-space: nowrap;
}

.header-author-link .author-name {
  color: #0f172a; /* Targeted color for 'poliapps' */
  margin-left: 3px;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.beacons-icon {
  width: 16px;
  height: 16px;
  margin-left: 4px; /* Move slightly to the right */
  border-radius: 4px;
  flex-shrink: 0;
}

.header-right-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Manual Sync Pill */
.btn-manual-sync-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 999px;
  color: #475569;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'JetBrains Mono', monospace;
}

.btn-manual-sync-pill:hover {
  background: #f1f5f9;
  border-color: #3b82f6; /* System Blue Fix */
  color: #3b82f6;
  transform: translateY(-1px);
}

.btn-manual-sync-pill.synced {
  color: #10b981; /* System Emerald-500 */
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

/* The All-in-One Student Profile Card */
.student-profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 6px 6px 12px;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  min-width: fit-content;
}

.student-profile-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

.student-profile-card.autosave-on {
  border-color: rgba(59, 130, 246, 0.2); /* System Blue-500 */
  background: rgba(59, 130, 246, 0.02);
}

.student-profile-card.autosave-on:hover {
  border-color: #3b82f6;
}

.profile-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.student-avatar-small {
  position: relative;
  width: 32px;
  height: 32px;
  background: #f1f5f9;
  color: #64748b;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.student-avatar-small.has-photo {
  padding: 0;
  overflow: hidden;
  background: white;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.student-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.autosave-on .student-avatar-small {
  background: white;
  color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.sync-active-icon.pulsing svg {
  animation: cloud-pulse-active 2s infinite ease-in-out;
}

@keyframes cloud-pulse-active {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.7; filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.5)); }
  100% { transform: scale(1); opacity: 1; }
}

.student-info {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  margin-right: 8px;
}

.student-name-small {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.student-id-small {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #64748b;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.student-carrera-small {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 500;
  margin-top: -1px;
  max-width: 155px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-card-right {
  background: #f1f5f9;
  padding: 6px 10px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
}

.autosave-on .profile-card-right {
  background: #3b82f6;
  color: white;
}

.persistence-toggle-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.persistence-toggle-hint.active {
  color: white;
}

.beacons-icon {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

.custom-select-trigger .placeholder {
  color: #64748b;
}

.custom-select-arrow {
  width: 16px;
  height: 16px;
  color: #64748b;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.is-open .custom-select-arrow {
  transform: rotate(180deg);
}

.custom-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  margin-top: 8px;
  background-color: #fff; /* Material Sovereignty Restoration */
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  z-index: 100;
  box-shadow: var(--shadow-lg); /* Definitive Dropdown Elevation */
  padding: 8px;
  max-height: 280px;
  overflow-y: auto;
  animation: dropdownScaleIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: top center;
}

/* Consistent dropdown anchoring for all grid items */
.selectors-grid .filter-item .custom-select-dropdown {
  left: 0;
  right: 0;
  width: 100%;
}

.custom-select-options-list {
  max-height: 250px;
  overflow-y: auto;
}

.custom-select-separator {
  height: 1px;
  background-color: #e2e8f0;
  margin: 4px 6px;
}

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

.custom-select-option {
  padding: 10px 16px;
  border-radius: 0;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.custom-select-option:hover {
  background-color: #f1f5f9;
  color: #1e293b;
}

.custom-select-label {
  flex: 1;
  overflow: visible; /* Legibility Restoration: No more 'Complementa...' artifacts */
  white-space: nowrap;
}

.custom-select-option.selected {
  background-color: transparent; /* Minimalist Sovereignty Restoration */
  color: #0f172a; /* Authoritative Dark Slate */
  font-weight: 600;
}

.custom-select-checkbox {
  width: 17px;
  height: 17px;
  border: 1.5px solid #cbd5e1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center; /* Authoritative Geometric Centering */
  flex-shrink: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: #fff;
}

.custom-select-checkbox.checked {
  background-color: #3b82f6; /* Authoritative Brand Blue Sync */
  border-color: #3b82f6;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); /* Premium Elevation Glow */
}

.custom-select-checkbox svg {
  width: 11px;
  height: 11px;
  display: block;
  /* Geometric Sovereignty: No manual offsets to prevent sub-pixel drift */
  aspect-ratio: 1/1;
  overflow: visible;
}

.custom-select-no-options {
  padding: 8px 12px;
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
}

.active-filters-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px; /* Added some margin top to separate from selectors */
  margin-bottom: 12px;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: white;
}

.badge-type { background-color: #10b981; }
.badge-franja { background-color: #3b82f6; }
.badge-modalidad { background-color: #6366f1; } /* Synchronicity Restoration: Authoritative Indigo Frequency */

.badge button {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  display: flex;
  align-items: center;
}

.badge button:hover {
  color: white;
}

.selector-toolbar {
  display: flex;
  gap: 6px;
  margin: 0; /* Material Purity Sync: Decommissioned internal margins */
  padding: 0;
  border: none;
}

.btn-toolbar {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  font-family: 'JetBrains Mono', monospace;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-toolbar:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.btn-collapse {
  background-color: #64748b;
  color: white;
}

.btn-collapse:hover {
  background-color: #475569;
  box-shadow: 0 4px 8px rgba(100, 116, 139, 0.25);
}


.selector-toolbar .btn-clear {
  background-color: #ef4444;
  color: white;
}

.selector-toolbar .btn-clear:hover {
  background-color: #dc2626;
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.25);
}

.options-section {
  margin-bottom: 20px;
}

.btn-clear {
  background-color: #ef4444;
  color: white;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
}

.btn-clear:hover {
  background-color: #dc2626;
}


.materias-list {
  flex: 1;
  min-height: 0; /* Authoritative Flex-Containment Hardening */
  overflow-y: auto; /* Isolated Scrolling Sovereignty */
  overflow-x: hidden;
  padding: 8px 4px 32px 4px;
  margin-top: 0;
}

.materia-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 16px;
  background-color: white;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.materia-card:hover {
  border-color: #3b82f6; /* Harmonized Brand Blue */
  transform: translateY(-4px); /* Professional Interaction Lift */
  box-shadow: 0 12px 20px -8px rgba(0, 0, 0, 0.15);
}

.materia-card.seleccionada {
  border-color: #3b82f6;
  background-color: #f8fafc;
}

.materia-card.seleccionada .materia-header {
  background-color: #f1f5f9;
  border-left: 4px solid #3b82f6;
}

.materia-header {
  padding: 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fafafa;
}

.materia-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.materia-name-display {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.materia-code-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
  margin-left: 4px;
}

.materia-meta-display {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.meta-tag {
  color: #3b82f6;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
}

.meta-separator {
  color: #cbd5e1;
}

.meta-paralelos {
  color: #64748b;
  font-weight: 500;
}

.meta-credits {
  color: #0f766e;
  font-weight: 600;
}

.collapse-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.collapse-icon.is-expanded {
  transform: rotate(90deg);
}

.conflict-icon {
  flex-shrink: 0;
  margin-right: 8px;
  color: #ef4444;
}

.paralelos-container {
  padding: 10px;
}

.paralelo-item {
  display: flex;
  align-items: flex-start;
  padding: 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  background-color: white;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.paralelo-item:hover {
  border-color: #cbd5e1;
  background-color: #f8fafc;
  transform: translateX(2px);
}

.paralelo-item.selected {
  background-color: #eff6ff;
  border-color: #3b82f6;
}

.paralelo-item.has-conflict {
  background-color: #fff1f2;
  border-color: #fecaca;
}

.paralelo-item.has-conflict:hover {
  background-color: #ffe4e6;
  border-color: #ef4444;
}

/* Custom Checkbox Sovereignty Sync */
.hidden-checkbox {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.custom-checkbox-container {
  padding-top: 2px;
  margin-right: 12px;
}

.custom-checkbox-frame {
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: white;
}

.custom-checkbox-frame.checked {
  background-color: #3b82f6;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); /* Premium Elevation Glow Sync */
}

.custom-checkbox-frame svg {
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-checkbox-frame.checked svg {
  opacity: 1;
  transform: scale(1);
}

/* Custom Radio Sovereignty Sync */
.custom-radio-container {
  padding-top: 2px;
  margin-right: 12px;
  flex-shrink: 0;
}

.custom-radio-frame {
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e1;
  border-radius: 50%; /* Authoritative Circle Restoration */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: white;
}

.custom-radio-frame.checked {
  border-color: #3b82f6;
  background-color: #3b82f6; /* Chromatic Inversion */
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.radio-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: white; /* Chromatic Inversion */
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-radio-frame.checked .radio-dot {
  opacity: 1;
  transform: scale(1);
}

.custom-radio-frame.disabled {
  background-color: #f1f5f9;
  border-color: #e2e8f0;
  cursor: not-allowed;
}

.paralelo-info {
  flex: 1;
  min-width: 0;
}

.paralelo-item-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 2px;
}

.paralelo-id {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}

.paralelo-profesor {
  display: none; /* Decommissioned in favor of hardened meta-row-field */
}

.tab-separator {
  color: #cbd5e1;
  margin: 0 4px;
}

.paralelo-campus {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  opacity: 0.85;
}

.paralelo-campus svg {
  color: #94a3b8;
}

.paralelo-details {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 6px;
}

.horario-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
}

.horario-entry-layered {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  background-color: #f8fafc;
  border-radius: 8px;
  border: 1px solid #f1f5f9;
}

.horario-entry {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.horario-time-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  background-color: #f1f5f9;
  color: #475569;
  padding: 2px 10px;
  border-radius: 100px;
  border: 1px solid #e2e8f0;
  display: inline-flex;
  align-items: center;
  width: max-content;
  white-space: nowrap;
}

.horario-location-detail {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  padding-left: 4px;
  line-height: 1.2;
}

.horario-location-icon {
  color: #94a3b8;
  flex-shrink: 0;
}

.tab-separator {
  margin: 0 4px;
  color: #cbd5e1;
}

.selected .horario-pill {
  background-color: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.2);
  color: #2563eb;
}

.horario-text {
  font-size: 11px;
  color: #888;
  margin-top: 4px;
}

.practicos-disponibles {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #e2e8f0;
  margin-bottom: 8px;
}

.practicos-title {
  margin: 0 0 10px 0;
  color: #3b82f6;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.paralelo-practico {
  display: flex;
  align-items: flex-start;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin: 6px 0;
  cursor: pointer;
  background-color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.paralelo-practico.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.paralelo-practico.selected {
  background-color: #e8f5e8;
  border-color: #4caf50;
}

.paralelo-practico input[type="radio"] {
  margin-right: 6px;
  margin-top: 1px;
}

.conflict-details {
  display: flex;
  align-items: flex-start; /* Sovereign Top-Baseline Restoration */
  gap: 4px;
  font-size: 10px;
  color: #d32f2f;
  margin-top: 8px; /* Extensive buffer for vertical rhythm sovereignty */
  margin-left: 10px; /* Longitudinal alignment recalibration */
}

.conflict-text {
  position: relative;
  left: -4px; /* Aggressive horizontal label shift as requested */
}

.conflict-icon {
  margin-top: 0.5px; /* Quantum baseline synchronization */
}

/* Schedule Header Elevation Sync */
.schedule-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 16px 20px;
  background-color: #fff; /* Solid Material Restoration */
  border-radius: 20px;
  box-shadow: var(--shadow-md); /* Authoritative Solid Elevation */
  border: 1px solid #e2e8f0;
  z-index: 5; /* Lowered priority to allow grid headers to stay on top */
}

.schedule-header h2 {
  margin: 0;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 24px;
  font-weight: 400;
  color: #0f172a;
}

/* Schedule Grid Styles */
#horario-clases {
  padding: 24px; /* Synchronized 24px Geometric Rhythm */
}

.horario-grid {
  display: grid;
  grid-template-columns: 115px repeat(5, minmax(0, 1fr)); /* Force Strict Symmetric Slicing */
  gap: 1px;
  background-color: #ddd;
  border: 1px solid #ddd;
  width: 100%;
  min-width: 600px;
}

.horario-grid>div {
  background-color: white;
  padding: 8px;
  min-height: 60px;
  display: flex;
  align-items: flex-start; /* Sovereign Baseline Restoration */
}

.dia-header,
.hora-header,
.hora-column {
  font-size: 13px; /* Authoritative Typographic Synchronization */
  font-weight: bold;
  background-color: #f8f9fa !important;
  text-align: center;
  color: #475569; /* Authoritative Slate Guide */
  padding-left: 12px; /* Geometric Breathing Room Sync */
  padding-right: 12px;
  position: sticky;
  z-index: 10;
}

.dia-header {
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 0 rgba(0,0,0,0.1);
}

.hora-header {
  top: 0;
  left: 0;
  z-index: 30; /* Highest priority: intersection of top and left */
  box-shadow: 1px 1px 0 rgba(0,0,0,0.1);
}

.hora-column {
  left: 0;
  z-index: 15;
  box-shadow: 1px 0 0 rgba(0,0,0,0.1);
}

.clase {
  position: relative;
  border-radius: 8px; /* Premium Geometric Sync */
  padding: 10px;
  cursor: pointer;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  user-select: none;
}

.clase:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
  z-index: 10;
  filter: brightness(1.05); /* Interactive Highlighting */
}

/* Metadata Hierarchy Sovereignty */
.materia-name {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.35; /* Increased for multi-line clarity and descender sovereignty */
  color: #1e293b;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: left;
}

.materia-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.meta-row {
  font-family: 'Inter', sans-serif;
  font-size: 10px; /* Symmetric Scale Restoration */
  font-weight: 500;
  color: #475569;
  opacity: 0.85;
  line-height: 1.1; /* Baseline Synchronization */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-row-location-layered {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 1px;
  min-height: 32px; /* Geometric Sovereignty: Reserved space for 3-row maximum */
}

.location-primary {
  display: flex;
  align-items: baseline; /* Absolute Vertical Synchronization */
  gap: 4px;
  width: 100%;
  font-size: 10px;
  line-height: 1.2;
  margin-bottom: 2px;
}

.location-primary .meta-label {
  margin-right: 4px; /* Synchronized Metadata Gap */
}

.location-aula-layered {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding-left: 14px;
  font-size: 10px;
  color: #64748b;
}

.location-bloque-row {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  padding-left: 14px;
  font-size: 10px;
  color: #64748b;
}

.location-aula-text {
  white-space: normal;
  word-wrap: break-word;
  font-size: 10px;
  line-height: 1.1;
  font-weight: 500;
}

.location-secondary {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
  line-height: 1.1;
  color: #64748b;
  font-weight: 700;
  text-transform: uppercase;
  padding-left: 14px;
  margin-top: 2px;
}

.meta-row-field {
  display: flex;
  align-items: baseline; /* Absolute Vertical Synchronization */
  gap: 4px;
  font-size: 10px;
  line-height: 1.1;
  color: #64748b;
  position: relative;
}

.meta-icon {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  color: #64748b;
  align-self: center; /* Absolute symmetry for single-line grids */
}

.meta-row-profesor .meta-icon {
  align-self: flex-start; /* Supresses center-dropping on multi-line expansion */
}

.meta-label {
  flex-shrink: 0;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 10px; /* Synchronized for absolute symmetry */
  color: #475569;
}

.meta-value {
  flex-shrink: 1;
  font-weight: 500;
}

.meta-row-profesor .meta-value {
  white-space: normal; /* Identity Restoration */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden; /* Critical for geometric ellipsis generation */
  text-overflow: ellipsis;
  font-size: 10px;
  line-height: 1.1;
  margin-bottom: 2px;
}

.meta-row.time {
  margin-top: auto; /* Absolute Bottom-Anchoring Restoration */
  padding-top: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: #475569; /* Chromatic Symmetry Restoration */
  opacity: 0.85;
}

.time-icon {
  color: #64748b; /* Synchronized Secondary Accent */
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  align-self: center; /* Single-line absolute positioning symmetry */
}

.meta-row.quincena {
  color: #3b82f6; /* Informational Accent */
  font-weight: 700;
}

/* Exam Conflict Sovereignty */
.examen-item.conflict {
  background-color: #fef2f2 !important;
  border: 2px solid #ef4444 !important;
  animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.examen-item.conflict .materia-name {
  color: #991b1b;
}

.examen-item.conflict .meta-row {
  color: #b91c1c;
}

/* Exam Schedule Styles */
#horario-examenes {
  padding: 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  /* Inherits panel-derecho background for chromatic sync */
}

.examenes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.examen-card {
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 12px; /* Modernized geometric sync */
  padding: 12px;
  background-color: white;
  box-shadow: var(--shadow-sm); /* Component Elevation Restoration */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.examen-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.examen-header {
  font-weight: bold;
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid #eee;
}

.examen-item {
  position: relative;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 8px;
  font-size: 13px;
  cursor: pointer;
  padding: 10px;
  background-color: white;
  display: flex;
  flex-direction: column;
  height: auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  min-width: 0;       /* Prevent flex/grid overflow */
  width: 100%;
  box-sizing: border-box;
}
.examen-item:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
  z-index: 10;
  filter: brightness(1.05);
  background-color: #f8f9fa;
}

/* Conflict styles */
.examen-item.conflict {
  background-color: #ffebee !important;
  border: 2px solid #f44336 !important;
  box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3) !important;
  animation: pulse-conflict 2s infinite;
}

.examen-item.conflict:hover {
  background-color: #ffcdd2 !important;
}

@keyframes pulse-conflict {
  0% {
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
  }

  50% {
    box-shadow: 0 4px 16px rgba(244, 67, 54, 0.5);
  }

  100% {
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
  }
}

/* Conflict alert banner */
.conflict-alert {
  background-color: #ffebee;
  border: 1px solid #f44336;
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 15px;
  color: #d32f2f;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
}

.conflict-alert .warning-icon {
  font-size: 13px;
  background-color: white; /* Glass discovery baseline */
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== PREMIUM TAB SYSTEM SOVEREIGNTY ===== */
.schedule-tabs-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: #fff;
}

.schedule-tabs-header {
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 12px;
}

.view-tabs-header {
  background-color: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  padding: 0 12px;
}

.tab-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tab-group.horizontal-scroll {
  overflow-x: auto;
  scrollbar-width: none;
}

.tab-group.horizontal-scroll::-webkit-scrollbar {
  display: none;
}

.tab-item-wrapper {
  display: flex;
  align-items: center;
  position: relative;
}

.tab-btn {
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.tab-btn:hover {
  color: #1e293b;
  background-color: rgba(15, 23, 42, 0.04);
}

.tab-btn.active {
  color: #3b82f6; /* Authoritative Brand Blue sync */
  border-bottom-color: #3b82f6;
  font-weight: 600;
  background-color: #fff;
}

.view-tab {
  font-size: 13px;
  padding: 8px 24px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.02em;
}

.view-tab.active {
  border-bottom-color: #10b981; /* Symmetrical Emerald for View Separation */
  color: #059669;
}

/* Tab Action Buttons */
.btn-add-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  margin-left: 8px;
  background-color: white;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  color: #3b82f6;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-add-tab:hover {
  background-color: #f1f5f9;
  border-color: #3b82f6;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-remove-tab {
  padding: 4px;
  margin-left: -8px;
  margin-right: 8px;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.btn-remove-tab:hover {
  color: #ef4444;
  background-color: #fee2e2;
}

.tab-content-area {
  flex: 1;
  min-height: 0;
  overflow: visible; /* Restore height propagation for authoritative scroll */
  display: flex;
  flex-direction: column;
}

.loading-tab-state {
  padding: 24px;
}


/* ===== SOPORTE / KO-FI MODAL ===== */
.support-button {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(245, 158, 11, 0.08);
  /* Amber background */
  color: #f59e0b;
  /* Amber text */
  padding: 8px 16px;
  border-radius: 9999px;
  /* Rounded pill shape */
  border: 1px solid rgba(245, 158, 11, 0.2);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  font-family: 'JetBrains Mono', monospace;
  transition: all 0.3s ease;
  margin-top: 10px;
}

.support-button:hover {
  background-color: rgba(245, 158, 11, 0.15);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.support-button:active {
  transform: translateY(0);
}

.support-icon {
  width: 18px;
  height: 18px;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

.modal-container {
  background-color: white;
  width: 95%;
  max-width: 400px;
  /* Perfect for Ko-fi widget width */
  height: 80vh;
  border-radius: 30px;
  box-shadow: var(--shadow-lg);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  padding: 24px 20px 10px 20px;
  text-align: center;
  background: white;
  position: relative;
}

.modal-title {
  margin: 0 0 6px 0;
  font-size: 18px;
  font-weight: 800;
  color: #111;
}

.modal-subtitle {
  font-size: 13px;
  color: #64748b;
  margin: 0;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #f1f3f4;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #666;
  z-index: 10;
  transition: all 0.2s ease;
  font-weight: bold;
}

.modal-close:hover {
  background-color: #e2e8f0;
  color: #0f172a;
  transform: rotate(90deg);
}

.modal-content {
  flex: 1;
  width: 100%;
}

.kofi-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.modal-footer {
  padding: 15px;
  text-align: center;
  background-color: white;
  border-top: 1px solid #f1f5f9;
}

.power-text {
  font-size: 11px;
  color: #94a3b8;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  .modal-container {
    height: 90vh;
    border-radius: 30px 30px 0 0;
    position: absolute;
    bottom: 0;
  }
}

/* ===== BANNER DE CONSERVAR HORARIO ===== */
.keep-schedule-banner {
  background-color: #fff9db;
  border: 1px solid #fcc419;
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-md);
  animation: bannerSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 5px solid #fcc419;
}

.banner-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.banner-icon {
  font-size: 20px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.banner-text {
  flex: 1;
}

.banner-text strong {
  display: block;
  font-size: 14px;
  color: #856404;
  margin-bottom: 2px;
}

.banner-text p {
  margin: 0;
  font-size: 12px;
  color: #937105;
  line-height: 1.4;
}

.banner-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-download-pdf {
  font-family: 'JetBrains Mono', monospace;
  background-color: #10b981; /* Premium Emerald Sync */
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Authoritative Neutral Base Sync */
}

.btn-download-pdf:hover {
  background-color: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(16, 185, 129, 0.25); /* High-Fidelity Emerald Sync */
}

.btn-keep {
  background-color: #fcc419;
  color: #453000;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-keep:hover {
  background-color: #fab005;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-discard {
  background-color: white;
  color: #fa5252;
  border: 1px solid #ffa8a8;
  padding: 7px 15px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-discard:hover {
  background-color: #fff5f5;
  border-color: #fa5252;
}

@keyframes bannerSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Premium Notification Manifest */
:root {
  --notif-warning-bg: #fff9f0;
  --notif-warning-border: #ff9800;
  --notif-warning-text: #f57c00;
  
  --notif-error-bg: #fff5f5;
  --notif-error-border: #f44336;
  --notif-error-text: #d32f2f;
  
  --notif-info-bg: #f5faff;
  --notif-info-border: #2196f3;
  --notif-info-text: #1976d2;
}

.notification-premium {
  background: #ffffff;
  border-radius: 12px;
  padding: 12px 16px;
  max-width: 380px; /* Increased slightly to prevent cropping */
  box-shadow: 
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  animation: slideInPremium 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border-width: 1px;
  border-style: solid;
  min-width: 300px;
}

.notification-premium.warning {
  background-color: var(--notif-warning-bg);
  border-color: var(--notif-warning-border);
  color: var(--notif-warning-text);
}

.notification-premium.error {
  background-color: var(--notif-error-bg);
  border-color: var(--notif-error-border);
  color: var(--notif-error-text);
}

.notification-premium.info {
  background-color: var(--notif-info-bg);
  border-color: var(--notif-info-border);
  color: var(--notif-info-text);
}

.notification-icon-container {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px; /* Slightly more compact */
  height: 24px;
}

.notification-body {
  flex: 1;
  padding-top: 4px;
}

.notification-message {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 500;
  white-space: pre-line;
}

.structured-notification {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.structured-notification .meta-row {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.4;
  font-size: 11px;
}

.structured-notification .meta-label {
  flex-shrink: 0;
  min-width: 70px;
}

.notification-main-title {
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
  color: inherit;
}

.conflict-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 16px;
  row-gap: 4px;
  margin-top: 8px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Specific styling for when it's inside the side panel cards */
.paralelo-item .conflict-comparison {
  margin: 10px 0 4px 0;
  background: #ffffff;
  border-color: #fca5a5; /* Light red border for conflict focus */
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Same-subject is a selection rule, not a time overlap. Keep it visually
 * aligned with the app's compact alert controls without forcing it into the
 * two-column comparison grid used for schedule and exam conflicts. */
.same-subject-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 0 4px;
  padding: 9px 10px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff7f7;
  color: #7f1d1d;
}

.same-subject-notice__icon {
  display: grid;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #fee2e2;
  color: #e11d48;
}

.same-subject-notice__title,
.same-subject-notice__body {
  margin: 0;
}

.same-subject-notice__title {
  color: #be123c;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.25;
}

.same-subject-notice__body {
  margin-top: 3px;
  color: #64748b;
  font-size: 10px;
  line-height: 1.42;
}

.same-subject-notice__body strong {
  color: #475569;
  font-weight: 800;
}

.comparison-header {
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.8;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.comparison-date {
  grid-column: 1 / span 2;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  padding: 4px;
  background: rgba(15, 23, 42, 0.05);
  color: #475569;
  border-radius: 4px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.comparison-date.type-exam,
.comparison-date.type-class {
  background: rgba(15, 23, 42, 0.05); /* Unified background */
  color: #475569;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.comparison-date svg {
  color: #ef4444; /* Use the conflict red only for the icons to highlight the 'clash' */
}

.comparison-subject {
  font-size: 11px;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  white-space: normal;
  line-height: 1.2;
}

.conflict-area {
  margin-top: 8px;
}

.conflict-brief-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: #fff1f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: fit-content;
}

.conflict-brief-toggle:hover {
  background: #ffe4e6;
  border-color: #fda4af;
}

.conflict-toggle-text {
  font-size: 10px;
  font-weight: 700;
  color: #e11d48;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.conflict-area .conflict-icon {
  color: #e11d48;
}

.chevron-icon {
  color: #e11d48;
  transition: transform 0.2s ease;
  margin-left: 2px;
}

.chevron-icon.rotated {
  transform: rotate(180deg);
}

.comparison-parallel {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  display: flex;
  gap: 4px;
}

.comparison-parallel::before {
  content: "PARALELO:";
  opacity: 0.6;
}

.comparison-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  padding-top: 4px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  margin-top: 2px;
}

.notification-close {
  flex-shrink: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  margin-top: -2px;
  margin-right: -6px;
  border-radius: 10px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
}

.notification-close:hover {
  background: rgba(0, 0, 0, 0.06);
  opacity: 1;
  transform: rotate(90deg);
}

@keyframes slideInPremium {
  from {
    transform: translateX(120%) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

/* Persistence Indicator Manifest */
.persistence-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(226, 232, 240, 0.6);
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  transition: all 0.3s ease;
  margin-left: auto; /* Push to the right in the header gutter */
}

.persistence-dot-container {
  position: relative;
  width: 8px;
  height: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.persistence-dot {
  width: 6px;
  height: 6px;
  background-color: #10b981; /* Sovereign Success Green */
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.persistence-dot.pulsing {
  animation: pulseHeartbeat 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.persistence-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

@keyframes pulseHeartbeat {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  }
  70% {
    transform: scale(1.4);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.persistence-indicator:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(16, 185, 129, 0.3);
  transform: translateY(-1px);
}

/* Sovereignty Controls Grouping */
.persistence-controls-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.persistence-indicator {
  cursor: pointer;
  border: 1px solid rgba(226, 232, 240, 0.6);
  outline: none;
}

.persistence-indicator.disabled {
  background: rgba(248, 250, 252, 0.5);
  border-color: rgba(226, 232, 240, 0.4);
}

.persistence-dot.disabled {
  background-color: #94a3b8; /* Muted Slate */
  animation: none;
}

.btn-manual-save {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.15);
}

.btn-manual-save:hover:not(:disabled) {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.2);
}

.btn-manual-save:active:not(:disabled) {
  transform: translateY(0);
}

.btn-manual-save.saved {
  background: #10b981;
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.15);
  cursor: default;
}

.btn-manual-save:disabled {
  opacity: 1; /* Keep visibility high during saved state */
}
