/* ============================================================
   MIRZAKHANI — DESIGN SYSTEM GLOBAL
   Plataforma Virtual UNA PUNO
   Desarrollado por: Carlos Llano | kchimbo.elite.com
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

/* ── CSS Variables — Mirzakhani Design System ── */
:root {
  /* ── Un único acento discreto: naranja vivo (identidad Mirzakhani) ── */
  --primary:        #E8521A;
  --primary-dark:   #C4430E;
  --primary-deeper: #9C3610;
  --primary-light:  #F2794A;
  --accent:         #E8521A;
  --accent-light:   #F9C9B5;

  /* ── Mismo acento para botones ── */
  --accent-orange:      #E8521A;
  --accent-orange-dark: #C4430E;

  /* ── Light Mode Backgrounds ── */
  --bg:             #F4F4F4;
  --bg-warm:        #EBEBEB;
  --bg-surface:     #FFFFFF;
  --bg-card:        #FFFFFF;

  /* ── Course / Padlet palette ── */
  --padlet-orange:  #F97316;
  --padlet-amber:   #F59E0B;
  --padlet-emerald: #10B981;
  --padlet-blue:    #3B82F6;
  --padlet-indigo:  #6366F1;
  --padlet-purple:  #8B5CF6;
  --padlet-rose:    #F43F5E;

  /* ── Sidebar ── */
  --sidebar-bg:     #18181B;
  --sidebar-width:  260px;

  /* ── Typography ── */
  --text-primary:   #09090B;
  --text-secondary: #52525B;
  --text-muted:     #A1A1AA;
  --text-white:     #FAFAFA;

  /* ── Borders ── */
  --border:         #E4E4E7;
  --border-strong:  #D4D4D8;

  /* ── Semantic ── */
  --success:        #22C55E;
  --warning:        #F59E0B;
  --danger:         #EF4444;
  --info:           #3B82F6;

  /* ── Shadows ── */
  --shadow-sm:      0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md:      0 3px 8px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg:      0 10px 20px -3px rgba(0, 0, 0, 0.09), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-xl:      0 20px 30px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.05);

  /* ── Radius ── */
  --radius-sm:      6px;
  --radius-md:      8px;
  --radius-lg:      12px;
  --radius-xl:      16px;
  --radius-full:    9999px;

  /* ── Motion ── */
  --transition:     all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow:all 0.38s cubic-bezier(0.4, 0, 0.2, 1);

  /* ── Font ── */
  --font:           'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:      'Space Mono', 'Courier New', monospace;
}

/* ── Dark Mode ── */
[data-theme="dark"],
body.dark {
  --bg:             #09090B;
  --bg-warm:        #18181B;
  --bg-surface:     #1C1C1F;
  --bg-card:        #27272A;

  --sidebar-bg:     #111113;

  --text-primary:   #FAFAFA;
  --text-secondary: #A1A1AA;
  --text-muted:     #71717A;

  --border:         #27272A;
  --border-strong:  #3F3F46;

  --shadow-sm:      0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md:      0 3px 8px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg:      0 10px 20px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-xl:      0 20px 30px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -5px rgba(0, 0, 0, 0.4);
}

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; }
button { cursor: pointer; font-family: var(--font); border: none; outline: none; }
input, textarea, select { font-family: var(--font); border: none; outline: none; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-warm); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ── Background Pattern (curved lines) ── */
.bg-pattern {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-pattern svg {
  position: absolute;
  opacity: 0.035;
}
.bg-pattern .bp-1 { top: -10%; right: -5%; width: 600px; }
.bg-pattern .bp-2 { bottom: -5%; left: -10%; width: 500px; }
.bg-pattern .bp-3 { top: 40%; left: 30%; width: 400px; }

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.025em;
}
h1 { font-size: 2.2rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

.text-primary   { color: var(--primary) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-white     { color: var(--text-white) !important; }
.text-success   { color: var(--success) !important; }
.text-danger    { color: var(--danger) !important; }
.text-center    { text-align: center; }
.fw-600         { font-weight: 600; }
.fw-700         { font-weight: 700; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
  white-space: nowrap;
}
.btn:active:not(:disabled) {
  transform: scale(0.96);
  transition: transform 0.1s ease;
}
.btn-primary {
  background: var(--accent-orange);
  color: white;
  box-shadow: 0 4px 15px rgba(196,67,14,0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(196,67,14,0.45);
  background: var(--accent-orange-dark);
}
.btn-primary:active:not(:disabled) { transform: scale(0.96); }

.btn-outline {
  background: white;
  border: 1px solid var(--accent-orange);
  color: var(--accent-orange);
}
.btn-outline:hover {
  background: var(--accent-orange) !important;
  color: white !important;
  transform: translateY(-2px);
}
.btn-outline:hover svg {
  stroke: white !important;
}

.btn-danger {
  background: linear-gradient(135deg, #E74C3C, #C0392B);
  color: white;
  box-shadow: 0 4px 15px rgba(231,76,60,0.3);
}
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(231,76,60,0.4); }

.btn-success {
  background: linear-gradient(135deg, #2ECC71, #27AE60);
  color: white;
  box-shadow: 0 4px 15px rgba(39,174,96,0.3);
}
.btn-success:hover { transform: translateY(-2px); }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 30px; font-size: 1rem; }
.btn-full { width: 100%; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: var(--radius-sm); }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.badge-primary { background: rgba(156,54,16,0.08); color: var(--primary); }
.badge-success { background: rgba(39,174,96,0.12); color: var(--success); }
.badge-danger  { background: rgba(231,76,60,0.12); color: var(--danger); }
.badge-warning { background: rgba(243,156,18,0.12); color: var(--warning); }
.badge-info    { background: rgba(41,128,185,0.12); color: var(--info); }
.badge-pdf     { background: rgba(231,76,60,0.1); color: #C0392B; }
.badge-video   { background: rgba(155,89,182,0.1); color: #8E44AD; }

/* ── Form Elements (Compact & Unified Typography) ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}
.form-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1px;
}
.form-input {
  padding: 8px 12px;
  height: 38px;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0F172A;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
  box-sizing: border-box;
}
textarea.form-input {
  height: auto;
  min-height: 64px;
  padding: 8px 12px;
  line-height: 1.4;
  resize: vertical;
}
.form-input:focus {
  border-color: var(--primary);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(196,67,14, 0.12);
  outline: none;
}
.form-input.error { border-color: var(--danger); }

.form-select {
  padding: 8px 34px 8px 12px;
  height: 38px;
  background-color: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #0F172A;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  box-sizing: border-box;
}
.form-select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(196,67,14, 0.12);
}

/* ── Gradient Text ── */
.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Section Header ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-title .icon-wrap {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: white;
  flex-shrink: 0;
}

/* ── Tab Pills ── */
.tab-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 6px;
  background: var(--bg-warm);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.tab-pill {
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  background: transparent;
  border: none;
}
.tab-pill:hover { color: var(--primary); background: rgba(156,54,16,0.06); }
.tab-pill.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(156,54,16,0.3);
}

/* ── Material Cards ── */
.material-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.material-card {
  background: white;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.material-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
.material-card-thumb {
  width: 100%;
  height: 120px;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  position: relative;
  overflow: hidden;
}
.material-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.material-card-type {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.type-pdf { background: #E74C3C; color: white; }
.type-video { background: #8E44AD; color: white; }
.material-card-body { padding: 12px; }
.material-card-week {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.material-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

/* ── Progress Bar ── */
.progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, #10B981, #059669);
  transition: width 0.8s ease;
}
.progress-bar-fill.green { background: linear-gradient(90deg, #2ECC71, #27AE60); }
.progress-bar-fill.yellow { background: linear-gradient(90deg, #F39C12, #E67E22); }

/* ── Unified Ultra-Modern KPI Ribbon ── */
.kpi-ribbon {
  background: white;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 12px 24px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  flex-wrap: wrap;
}
.kpi-pill {
  display: flex;
  align-items: center;
  gap: 12px;
}
.kpi-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.kpi-content {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.kpi-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.02em;
  line-height: 1;
}
.kpi-lbl {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.kpi-sep {
  width: 1px;
  height: 22px;
  background: #E2E8F0;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .kpi-ribbon {
    gap: 12px;
    padding: 12px 16px;
  }
  .kpi-sep {
    display: none;
  }
}

/* ── Alert / Toast ── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 16px;
  border: 1px solid transparent;
}
.alert-danger { background: rgba(231,76,60,0.08); border-color: rgba(231,76,60,0.2); color: #C0392B; }
.alert-success { background: rgba(39,174,96,0.08); border-color: rgba(39,174,96,0.2); color: #1E8449; }
.alert-warning { background: rgba(243,156,18,0.08); border-color: rgba(243,156,18,0.2); color: #9A6A00; }
.alert-info { background: rgba(41,128,185,0.08); border-color: rgba(41,128,185,0.2); color: #1A5276; }

/* ── Toast Notification ── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  color: white;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  pointer-events: all;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast-success { background: linear-gradient(135deg, #2ECC71, #27AE60); }
.toast-error   { background: linear-gradient(135deg, #E74C3C, #C0392B); }
.toast-warning { background: linear-gradient(135deg, #F39C12, #E67E22); }
.toast-info    { background: linear-gradient(135deg, #3498DB, #2980B9); }

@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; pointer-events: none; }
}

/* ── Modal (Ventanas Flotantes Minimalistas) ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal-box {
  background: #FFFFFF;
  border-radius: 16px;
  width: 100%;
  max-width: 540px;
  max-height: 86vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(226, 232, 240, 0.8);
  transform: translateY(10px) scale(0.98);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}
.modal-overlay.open .modal-box {
  transform: translateY(0) scale(1);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #E2E8F0;
  background: #F8FAFC;
}
.modal-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0F172A;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  color: #64748B;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.modal-close:hover {
  background: #FEF2F2;
  color: #EF4444;
  border-color: #FCA5A5;
}
.modal-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.modal-footer {
  padding: 12px 18px;
  border-top: 1px solid #E2E8F0;
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* ── Loading Spinner ── */
.spinner {
  width: 40px; height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  gap: 16px;
}
.loading-text { font-weight: 600; color: var(--text-secondary); }

/* ── Table ── */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th {
  padding: 12px 16px;
  background: var(--bg-warm);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  white-space: nowrap;
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-primary);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-warm); }
.data-table .td-actions { display: flex; gap: 6px; align-items: center; }

/* ── Utilities ── */
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center{ align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.gap-16      { gap: 16px; }
.gap-24      { gap: 24px; }
.mt-8        { margin-top: 8px; }
.mt-16       { margin-top: 16px; }
.mt-24       { margin-top: 24px; }
.mb-8        { margin-bottom: 8px; }
.mb-16       { margin-bottom: 16px; }
.mb-24       { margin-bottom: 24px; }
.p-16        { padding: 16px; }
.p-24        { padding: 24px; }
.w-full      { width: 100%; }
.hidden      { display: none !important; }
.block       { display: block !important; }

/* ── Human-Crafted Minimal Board Header ── */
.board-header {
  flex-shrink: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  flex-wrap: wrap;
  gap: 10px;
}
.board-header-info h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.board-header-info p {
  display: none;
}
.board-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(232,82,26, 0.1);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Modern Segmented Control Pills for Filters */
.tipo-filter-wrap {
  display: inline-flex;
  align-items: center;
  background: #E2E8F0;
  padding: 3px;
  border-radius: var(--radius-full);
  gap: 2px;
  margin-bottom: 0;
}
.tipo-btn {
  padding: 5px 14px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: #64748B;
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tipo-btn:hover {
  color: var(--text-primary);
}
.tipo-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* ── Padlet Board Layout System (Independent Column Scroll) ── */
#adminClasesBoard,
#clasesContent,
#adminResumenesBoard,
#studentResumenesBoard {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

#adminPreguntasBoard {
  overflow-y: auto !important;
  padding-bottom: 50px;
}

.padlet-board-container {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 20px;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  height: 100%;
  padding: 4px 0 8px 0;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.padlet-column {
  flex: 0 0 320px;
  min-width: 300px;
  max-width: 340px;
  background: #F3F4F6;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  overflow: hidden;
}
.padlet-column-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  flex-shrink: 0;
}
.padlet-column-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}
.padlet-column-count {
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--bg-warm);
  color: var(--text-secondary);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}
.padlet-column-body {
  padding: 12px 12px 36px 12px;
  overflow-y: auto !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
  max-height: 100%;
}
.padlet-column-body::-webkit-scrollbar {
  width: 5px;
}
.padlet-column-body::-webkit-scrollbar-thumb {
  background: #D1D5DB;
  border-radius: 4px;
}
.padlet-column-body::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

.padlet-post-footer {
  display: none !important;
}

/* Padlet Post Card */
.padlet-post-card {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid #E5E7EB;
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: visible !important;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
.padlet-post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  border-color: var(--border-strong);
}
.padlet-post-card.has-open-menu {
  z-index: 9999 !important;
}
.padlet-post-top {
  height: 5px;
  width: 100%;
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
}
.padlet-post-inner {
  padding: 14px 16px;
}
.padlet-post-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.padlet-post-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  margin: 10px 0;
}
.padlet-post-preview {
  background: #F9FAFB;
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  border: 1px dashed #D1D5DB;
}
.padlet-post-footer {
  display: none !important;
}
/* Padlet Column Add Button (+) */
.padlet-column-add-btn {
  width: 100%;
  padding: 8px;
  background: rgba(255,255,255,0.7);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 12px;
}
.padlet-column-add-btn:hover {
  background: white;
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* Padlet Three Dots Button (⋮) */
.padlet-post-more-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.1rem;
}
.padlet-post-more-btn:hover {
  background: var(--bg-warm);
  color: var(--text-primary);
}

/* Padlet Context Dropdown Menu */
.padlet-options-menu {
  position: absolute;
  top: 32px;
  right: 6px;
  background: white;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.2), 0 2px 6px rgba(0, 0, 0, 0.05);
  width: 220px;
  z-index: 99999 !important;
  padding: 6px;
  display: none;
  animation: fadeInFast 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}
.padlet-options-menu.open {
  display: block !important;
}
@keyframes fadeInFast {
  from { opacity: 0; transform: translateY(-6px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.padlet-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.padlet-menu-item:hover {
  background: #F3F4F6;
  color: var(--primary);
}
.padlet-menu-item.danger {
  color: #EF4444;
}
.padlet-menu-item.danger:hover {
  background: #FEE2E2;
  color: #DC2626;
}
.padlet-menu-divider {
  height: 1px;
  background: #E5E7EB;
  margin: 4px 0;
}

/* Padlet Floating Action Button (+ Publicar) */
.padlet-fab-publish {
  display: none !important;
}
.padlet-fab-publish:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 14px 32px rgba(245, 158, 11, 0.5);
  background: #FBBF24;
}
.padlet-fab-publish:active {
  transform: translateY(0) scale(1);
}

/* Padlet Add Course Minimal Dashed Card */
.padlet-add-column-card {
  flex: 0 0 280px !important;
  min-width: 260px !important;
  max-width: 320px !important;
  flex-shrink: 0 !important;
  height: 100%;
  border: 2px dashed #CBD5E1 !important;
  border-radius: var(--radius-lg);
  background: rgba(248, 250, 252, 0.7) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}
.padlet-add-column-card:hover {
  background: white !important;
  border-color: var(--primary) !important;
  box-shadow: 0 4px 16px rgba(196,67,14, 0.12);
}
.padlet-add-course-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #64748B;
  font-weight: 800;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: color 0.2s ease;
  padding: 20px;
}
.padlet-add-column-card:hover .padlet-add-course-inner {
  color: var(--primary);
}
.add-course-plus-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: white;
  border: 1.5px dashed #94A3B8;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}
.padlet-add-column-card:hover .add-course-plus-icon {
  border-color: var(--primary);
  background: rgba(232,82,26, 0.08);
  color: var(--primary);
}

/* ── Dev Info Box ── */
.dev-info {
  background: linear-gradient(135deg, var(--bg-surface), var(--bg-warm));
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: center;
}
.dev-info .dev-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.dev-info .dev-email {
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 500;
  word-break: break-all;
}
.dev-info .dev-year {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Section Views Overflow Controls ── */
#section-simulacro,
#section-repasos,
#section-avance,
#section-pagos {
  overflow-y: auto !important;
  max-height: 100% !important;
  padding-bottom: 60px !important;
}

#examActive {
  overflow-y: visible !important;
  padding-bottom: 60px !important;
}

/* ── Compact Viewport-Fit Active Exam Navigator ── */
.question-navigator {
  display: flex !important;
  gap: 6px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding: 6px 8px !important;
  margin-top: 6px !important;
  margin-bottom: 10px !important;
  scroll-behavior: smooth !important;
  -webkit-overflow-scrolling: touch;
  max-width: 100% !important;
  box-sizing: border-box !important;
  background: #F8FAFC !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 12px !important;
}
.question-navigator::-webkit-scrollbar {
  height: 4px;
}
.question-navigator::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}
.q-nav-dot {
  flex: 0 0 28px !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 8px !important;
  border: 1px solid #E2E8F0 !important;
  background: white !important;
  color: #64748B !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  user-select: none;
}
.q-nav-dot:hover {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}
.q-nav-dot.answered {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
  color: #059669 !important;
}
.q-nav-dot.current {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
  border-color: var(--primary) !important;
  color: white !important;
  box-shadow: 0 2px 8px rgba(196,67,14, 0.35) !important;
  transform: scale(1.05) !important;
}

/* ── Exam Question & Options Card (Compact Fit) ── */
.question-card {
  background: white !important;
  border: 1.5px solid #E2E8F0 !important;
  border-radius: 16px !important;
  padding: 16px 20px !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.02) !important;
  margin-bottom: 12px !important;
}
.question-number-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 3px 10px !important;
  border-radius: 20px !important;
  background: rgba(232,82,26, 0.08) !important;
  color: var(--primary) !important;
  font-size: 0.74rem !important;
  font-weight: 800 !important;
  margin-bottom: 10px !important;
  line-height: 1.2 !important;
}
.question-text {
  font-size: 0.98rem !important;
  font-weight: 700 !important;
  color: #0F172A !important;
  line-height: 1.45 !important;
  margin-bottom: 12px !important;
}
.question-options {
  display: flex !important;
  flex-direction: column !important;
  gap: 7px !important;
}
.option-btn {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  padding: 8px 12px !important;
  border-radius: 10px !important;
  border: 1px solid #E2E8F0 !important;
  background: white !important;
  color: #334155 !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  text-align: left !important;
  cursor: pointer !important;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.option-btn:hover {
  border-color: var(--primary) !important;
  background: rgba(232,82,26, 0.02) !important;
  transform: translateX(2px);
}
.option-btn.selected {
  border-color: var(--primary) !important;
  background: rgba(232,82,26, 0.06) !important;
  color: var(--primary) !important;
  box-shadow: 0 2px 8px rgba(196,67,14, 0.1) !important;
}
.option-letter {
  width: 24px !important;
  height: 24px !important;
  border-radius: 6px !important;
  background: #F1F5F9 !important;
  color: #64748B !important;
  font-size: 0.78rem !important;
  font-weight: 800 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  transition: all 0.15s ease !important;
}
.option-btn:hover .option-letter {
  background: rgba(232,82,26, 0.12) !important;
  color: var(--primary) !important;
}
.option-btn.selected .option-letter {
  background: var(--primary) !important;
  color: white !important;
}

/* ── Responsive Mobile System & Typography ── */
* {
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

h1, h2, h3, h4, h5, h6, p, span, label, div, a {
  overflow-wrap: break-word;
  word-break: break-word;
}

@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }
  h1 { font-size: 1.5rem; line-height: 1.25; }
  h2 { font-size: 1.25rem; line-height: 1.3; }
  h3 { font-size: 1.05rem; }

  .board-header {
    padding: 2px 0 6px 0 !important;
    margin-top: 2px !important;
    margin-bottom: 4px !important;
  }

  /* Modals Mobile */
  .modal-overlay {
    padding: 8px !important;
  }
  .modal-box {
    width: 98% !important;
    max-width: 100% !important;
    max-height: 90vh !important;
    border-radius: 14px !important;
    margin: 0 auto !important;
  }
  .modal-header {
    padding: 12px 14px !important;
  }
  .modal-title {
    font-size: 0.88rem !important;
    line-height: 1.3 !important;
    word-break: break-word !important;
  }
  .modal-body {
    padding: 12px 14px !important;
    gap: 10px !important;
  }
  .modal-footer {
    padding: 10px 14px !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .modal-footer .btn {
    flex: 1 1 auto !important;
    justify-content: center !important;
  }
  .form-inline-row {
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
  }
  .form-group {
    width: 100% !important;
  }
  .form-input, .form-select, .form-textarea {
    width: 100% !important;
    font-size: 16px !important; /* Prevents auto-zoom on mobile safari/chrome */
    box-sizing: border-box !important;
  }

  /* Responsive Table Wrapper */
  .table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    width: 100% !important;
    margin-bottom: 12px;
  }
  .data-table {
    min-width: 520px;
  }
  .data-table th, .data-table td {
    padding: 8px 10px !important;
    font-size: 0.78rem !important;
  }
  .td-actions {
    flex-wrap: wrap !important;
    gap: 4px !important;
  }
  .td-actions .btn {
    padding: 4px 8px !important;
    font-size: 0.72rem !important;
  }
}

@media (max-width: 480px) {
  .toast-container {
    top: 10px !important;
    right: 10px !important;
    left: 10px !important;
    width: auto !important;
  }
  .toast {
    max-width: 100% !important;
    font-size: 0.82rem !important;
    padding: 10px 14px !important;
  }
}

