/* ============================================================
   AULA VIRTUAL IEIRNUSEFA — Hoja de estilos principal
   Paleta basada en identidad institucional
   ============================================================ */

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

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

:root {
  --primary: #0e2a47;
  --primary-dark: #091d33;
  --accent: #1d5670;
  --accent-light: #2a7a9b;
  --sidebar-bg: #0a1e36;
  --sidebar-text: #8ba5be;
  --sidebar-active: #ffffff;
  --sidebar-hover: rgba(255,255,255,0.08);
  --sidebar-active-bg: rgba(255,255,255,0.12);
  --bg: #f0f4f8;
  --bg-card: #ffffff;
  --fg: #1a2b3c;
  --fg-secondary: #4a6478;
  --fg-muted: #8096a8;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(14,42,71,0.06);
  --shadow-md: 0 4px 12px rgba(14,42,71,0.08);
  --shadow-lg: 0 8px 24px rgba(14,42,71,0.12);
  --blue: #2563eb;
  --blue-bg: rgba(37,99,235,0.08);
  --green: #16a34a;
  --green-bg: rgba(22,163,74,0.08);
  --amber: #d97706;
  --amber-bg: rgba(217,119,6,0.08);
  --red: #dc2626;
  --red-bg: rgba(220,38,38,0.08);
  --purple: #7c3aed;
  --purple-bg: rgba(124,58,237,0.08);
}

html { height: 100%; }
body {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100%;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  padding: 24px 20px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-brand img {
  width: 48px; height: 48px;
  border-radius: 12px;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.sidebar-brand-text h2 {
  font-size: 0.92rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.sidebar-brand-text p {
  font-size: 0.7rem;
  color: var(--sidebar-text);
  opacity: 0.7;
  line-height: 1.3;
  margin-top: 2px;
}

/* Sede selector in sidebar */
.sidebar-sede {
  margin: 16px 14px 8px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-sede svg {
  width: 16px; height: 16px;
  stroke: var(--accent-light);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.sidebar-sede select {
  background: transparent;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  flex: 1;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.sidebar-sede select option { background: var(--sidebar-bg); color: #fff; }

/* Nav */
.sidebar-nav { padding: 8px 10px; flex: 1; }

.nav-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.3);
  padding: 16px 10px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--sidebar-text);
  font-size: 0.87rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.nav-link:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--sidebar-active-bg); color: var(--sidebar-active); font-weight: 600; }
.nav-link.nav-disabled { opacity: 0.35; pointer-events: none; cursor: default; }
.nav-link svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}
.nav-link .badge {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--blue);
  color: #fff;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-footer .avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-footer .user-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: #fff;
}

.sidebar-footer .user-role {
  font-size: 0.7rem;
  color: var(--sidebar-text);
}

/* ---------- Main ---------- */
.main { flex: 1; margin-left: 260px; min-width: 0; }

.topbar {
  position: sticky;
  top: 0; z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--fg);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Search box */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  height: 40px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  max-width: 320px;
  width: 100%;
}

.search-box svg {
  width: 16px; height: 16px;
  stroke: var(--fg-muted);
  fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}

.search-box input {
  border: none; outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--fg);
  width: 100%;
}
.search-box input::placeholder { color: var(--fg-muted); }

.btn-mobile-menu {
  display: none;
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.btn-mobile-menu svg {
  width: 20px; height: 20px;
  stroke: var(--fg); fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.content { padding: 28px; }

/* ---------- Hero / Welcome ---------- */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 60%, var(--accent-light) 100%);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  color: #fff;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.hero::after {
  content: '';
  position: absolute;
  top: -60%; right: -10%;
  width: 350px; height: 350px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  pointer-events: none;
}

.hero h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: 6px; position: relative; z-index:1; }
.hero p { font-size: 0.92rem; opacity: 0.85; position: relative; z-index:1; max-width: 500px; }

.hero-motto {
  font-style: italic;
  font-size: 0.88rem;
  opacity: 0.7;
  margin-top: 4px;
}

.hero-logo {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.hero-logo img {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
}

/* ---------- Quick Access ---------- */
.quick-access {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  text-decoration: none;
  color: var(--fg);
  font-family: inherit;
}
.quick-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
  text-decoration: none;
}

.quick-btn .qicon {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
}
.quick-btn .qicon svg {
  width: 24px; height: 24px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.quick-btn span { font-size: 0.82rem; font-weight: 600; }

/* ---------- Section heading ---------- */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-head h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--fg);
}

.section-head a {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ---------- Cards grid ---------- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
.card a { text-decoration: none; color: inherit; display: block; }
.card a:hover { text-decoration: none; }

.card-banner { height: 6px; }

.card-body { padding: 18px 20px; }

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.card-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.card-icon svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.card-title { font-size: 0.95rem; font-weight: 700; color: var(--fg); }
.card-subtitle { font-size: 0.78rem; color: var(--fg-muted); margin-top: 2px; }
.card-desc { font-size: 0.82rem; color: var(--fg-secondary); line-height: 1.5; margin-bottom: 12px; }

.card-meta {
  display: flex; align-items: center; gap: 14px;
  font-size: 0.76rem; color: var(--fg-muted);
}
.card-meta svg {
  width: 14px; height: 14px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.card-meta-item { display: flex; align-items: center; gap: 4px; }

/* ---------- Material list ---------- */
.material-list { display: flex; flex-direction: column; gap: 8px; }

.material-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: background 0.15s, border-color 0.15s;
}
.material-row:hover { background: #f8fafc; border-color: var(--accent); }

.material-row a { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; text-decoration: none; color: inherit; }

.micon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.micon svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.micon.pdf    { background: var(--red-bg);    color: var(--red); }
.micon.video  { background: var(--blue-bg);   color: var(--blue); }
.micon.doc    { background: var(--green-bg);  color: var(--green); }
.micon.link   { background: var(--amber-bg);  color: var(--amber); }
.micon.task   { background: var(--purple-bg); color: var(--purple); }
.micon.eval   { background: var(--blue-bg);   color: var(--blue); }
.micon.guia   { background: var(--green-bg);  color: var(--green); }

.material-info { flex: 1; min-width: 0; }
.material-name { font-size: 0.88rem; font-weight: 600; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.material-meta { font-size: 0.75rem; color: var(--fg-muted); margin-top: 2px; }

.badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-new   { background: var(--green-bg); color: var(--green); }
.badge-pend  { background: var(--amber-bg); color: var(--amber); }
.badge-admin { background: var(--purple-bg); color: var(--purple); }

/* ---------- Announcements ---------- */
.announcement {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
}

.announcement-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.announcement .avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700;
  flex-shrink: 0;
}

.announcement .author { font-size: 0.84rem; font-weight: 600; color: var(--fg); }
.announcement .date { font-size: 0.72rem; color: var(--fg-muted); }
.announcement .body { font-size: 0.88rem; color: var(--fg-secondary); line-height: 1.6; }
.announcement .body strong { color: var(--fg); }

/* ---------- Sede cards ---------- */
.sede-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.sede-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.sede-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.sede-marker {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--blue-bg);
  color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sede-marker svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.sede-name { font-size: 0.92rem; font-weight: 700; color: var(--fg); }
.sede-type { font-size: 0.74rem; color: var(--fg-muted); }

/* ---------- Admin ---------- */
/* Login page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg);
}

.login-card {
  width: 100%; max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 32px;
}

.login-logo {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 28px;
}
.login-logo img {
  width: 52px; height: 52px;
  border-radius: 12px;
  object-fit: contain;
  background: #fff;
  box-shadow: var(--shadow-md);
}
.login-logo h1 { font-size: 1.1rem; font-weight: 800; color: var(--fg); }
.login-logo p { font-size: 0.78rem; color: var(--fg-muted); margin-top: 2px; }

/* Forms */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg-secondary);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg);
  color: var(--fg);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29,86,112,0.1);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236b8499' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-textarea { min-height: 100px; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); text-decoration: none; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--accent); }

.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-light); }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; }

.btn-outline {
  background: #fff;
  color: var(--fg);
  border: 1px solid var(--border-strong);
}
.btn-outline:hover { background: var(--bg); }

.btn-sm { padding: 6px 14px; font-size: 0.82rem; }

.btn-block { width: 100%; }

.btn svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* Alert */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 18px;
}
.alert-error { background: var(--red-bg); color: var(--red); border: 1px solid rgba(220,38,38,0.15); }
.alert-success { background: var(--green-bg); color: var(--green); border: 1px solid rgba(22,163,74,0.15); }
.alert-info { background: var(--blue-bg); color: var(--blue); border: 1px solid rgba(37,99,235,0.15); }

/* Admin table */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}

.admin-table th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--fg-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--fg-secondary);
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #fafbfc; }

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

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
}

.modal h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--fg);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* Empty state */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--fg-muted);
}
.empty svg {
  width: 48px; height: 48px;
  stroke: var(--fg-muted); fill: none;
  stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0.4;
  margin: 0 auto 12px;
  display: block;
}
.empty p { font-size: 0.88rem; }

/* Back button */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 18px;
}
.back-link svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
}

.stat-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.stat-value { font-size: 1.4rem; font-weight: 800; color: var(--fg); font-variant-numeric: tabular-nums; }
.stat-label { font-size: 0.78rem; color: var(--fg-muted); margin-top: 1px; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }

.tab-link {
  padding: 10px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg-muted);
  background: none; border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s;
}
.tab-link:hover { color: var(--fg); }
.tab-link.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}
.sidebar-overlay.active { display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: 280px; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .btn-mobile-menu { display: inline-flex; }
  .content { padding: 20px 16px; }
  .topbar { padding: 12px 16px; }
  .hero { padding: 24px 20px; flex-direction: column; text-align: center; }
  .hero h2 { font-size: 1.2rem; }
  .hero-logo { width: 80px; height: 80px; }
  .hero-logo img { width: 64px; height: 64px; }
  .cards-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .quick-access { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .search-box { max-width: 100%; }
  .topbar h1 { font-size: 1rem; }
}

/* ---------- Aula: navegación y vistas ---------- */
.page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}
.page-intro h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--fg);
  margin: 2px 0 5px;
}
.page-intro p {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--fg-muted);
  max-width: 720px;
}
.eyebrow {
  display: inline-block;
  font-size: 0.68rem;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.page-count {
  flex: 0 0 auto;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--fg-secondary);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.selection-card {
  max-width: 760px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.selection-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--blue-bg);
  color: var(--blue);
}
.selection-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.selection-card h3 { font-size: 1rem; font-weight: 750; color: var(--fg); margin-bottom: 3px; }
.selection-card p { color: var(--fg-muted); font-size: 0.8rem; line-height: 1.45; }
.selection-form {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.sede-card-link { display: block; color: inherit; text-decoration: none; }
.sede-card-link:hover { text-decoration: none; border-color: var(--accent); }
.sede-description { margin-top: 8px; color: var(--fg-secondary); font-size: 0.78rem; line-height: 1.5; }
.class-open { margin-left: auto; color: var(--accent); font-weight: 700; white-space: nowrap; }
.material-list-large { gap: 10px; }
.material-list-large .material-row { align-items: flex-start; padding: 16px 18px; }
.material-description { margin-top: 5px; color: var(--fg-secondary); font-size: 0.78rem; line-height: 1.45; }
.material-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.announcement-list { display: flex; flex-direction: column; gap: 12px; }
.announcement-featured { border-color: rgba(194,122,26,0.35); box-shadow: 0 6px 20px rgba(194,122,26,0.06); }
.announcement-head-copy { min-width: 0; }
.announcement-content { margin-top: 7px; }
.class-header { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.class-header h2 { font-size: 1.3rem; font-weight: 800; color: var(--fg); }
.class-header p { font-size: 0.82rem; color: var(--fg-muted); margin-top: 3px; }
.class-description { max-width: 800px; margin-bottom: 20px; color: var(--fg-secondary); font-size: 0.88rem; line-height: 1.6; }
.empty-large { padding: 78px 24px; background: var(--bg-card); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); }
.empty-large h3 { color: var(--fg); font-size: 1rem; margin-bottom: 5px; }
.empty-large p { color: var(--fg-muted); }

@media (max-width: 768px) {
  .page-intro { align-items: flex-start; flex-direction: column; margin-bottom: 18px; }
  .page-intro h2 { font-size: 1.3rem; }
  .page-count { align-self: flex-start; }
  .selection-card { align-items: flex-start; padding: 16px; }
  .selection-form { padding: 18px; }
  .class-header { align-items: flex-start; }
  .material-list-large .material-row { flex-wrap: wrap; }
  .material-actions { width: 100%; justify-content: flex-start; margin-left: 56px; }
  .material-actions .btn { margin-left: 0; }
  .announcement-head { align-items: flex-start; }
  .announcement-head .badge { margin-left: auto; }
  .class-open { display: none; }
}

/* ============================================================
   DASHBOARD — Nuevo diseño estilo mockup
   ============================================================ */

/* Topbar extras */
.topbar-context {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--fg-muted);
  white-space: nowrap;
}
.topbar-context svg {
  width: 14px; height: 14px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}

/* Hero eyebrow (date) */
.hero-eyebrow {
  font-size: 0.78rem;
  font-weight: 500;
  opacity: 0.7;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

/* Dashboard two-column grid */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

.dash-main { min-width: 0; }
.dash-aside { min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.dash-section { margin-bottom: 28px; }
.dash-section .section-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-section .section-head h3 svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Clases de hoy ---------- */
.today-classes {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.today-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.today-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.today-time {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 0 0 70px;
  text-align: center;
}
.today-hour {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.today-range {
  font-size: 0.7rem;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}

.today-bar {
  width: 4px;
  height: 48px;
  border-radius: 4px;
  flex-shrink: 0;
}

.today-info {
  flex: 1;
  min-width: 0;
}
.today-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 2px;
}
.today-docente {
  font-size: 0.78rem;
  color: var(--fg-muted);
  margin-bottom: 6px;
}

.today-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.today-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
  max-width: 160px;
}
.today-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}
.today-progress-pct {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.today-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.today-icon svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Recursos destacados ficticios ---------- */
.featured-resources {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.featured-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: background 0.15s, border-color 0.15s;
}
.featured-card:hover {
  background: #f8fafc;
  border-color: var(--accent);
}

.featured-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.featured-icon svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.featured-info { flex: 1; min-width: 0; }
.featured-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.featured-meta {
  font-size: 0.75rem;
  color: var(--fg-muted);
  margin-top: 2px;
}

/* ---------- Panel lateral (aside) ---------- */
.aside-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.aside-card h4 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 4px;
}

.aside-subtitle {
  font-size: 0.76rem;
  color: var(--fg-muted);
  margin-bottom: 16px;
}

/* Progreso circular */
.progress-ring-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 16px;
}
.progress-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.progress-ring-bg {
  fill: none;
  stroke: var(--bg);
  stroke-width: 10;
}
.progress-ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}
.progress-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.progress-ring-pct {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--fg);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.progress-ring-text {
  font-size: 0.68rem;
  color: var(--fg-muted);
  margin-top: 2px;
}

.progress-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  text-align: center;
}
.pstat { display: flex; flex-direction: column; }
.pstat-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.pstat-label {
  font-size: 0.68rem;
  color: var(--fg-muted);
  margin-top: 1px;
}

/* Frase motivacional */
.aside-quote {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  border-color: transparent;
}
.aside-quote .quote-icon {
  width: 32px; height: 32px;
  margin-bottom: 10px;
  opacity: 0.5;
}
.aside-quote .quote-icon svg {
  width: 32px; height: 32px;
  fill: none; stroke: currentColor;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.aside-quote p {
  font-size: 0.84rem;
  line-height: 1.6;
  font-style: italic;
  opacity: 0.9;
}

/* Próximas actividades */
.activities-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
.activity-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.activity-info { flex: 1; min-width: 0; }
.activity-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.activity-date {
  font-size: 0.7rem;
  color: var(--fg-muted);
  margin-top: 1px;
}
.activity-badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Clases mini en aside */
.aside-classes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.aside-class-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}
.aside-class-link:hover { background: var(--bg); text-decoration: none; }
.aside-class-dot {
  width: 10px; height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.aside-class-info { display: flex; flex-direction: column; min-width: 0; }
.aside-class-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aside-class-meta {
  font-size: 0.7rem;
  color: var(--fg-muted);
}

/* ---------- Dashboard responsive ---------- */
@media (max-width: 1024px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
  .dash-aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

/* ====== Noticias institucionales ====== */
.news-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
.news-photo {
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--bg-hover);
}
.news-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.news-photo:hover img {
  transform: scale(1.04);
}

.news-video {
  margin-bottom: 18px;
}
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.news-video-caption {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.news-video-icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--blue-bg);
  color: var(--blue);
}
.news-video-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.news-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.news-info-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.news-info-card strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--fg);
}
.news-info-card span {
  font-size: 0.78rem;
  color: var(--fg-muted);
}
.news-info-icon {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}
.news-info-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 768px) {
  .dash-aside {
    grid-template-columns: 1fr;
  }
  .today-card { padding: 12px 14px; }
  .today-time { flex: 0 0 58px; }
  .today-hour { font-size: 0.78rem; }
  .today-icon { width: 36px; height: 36px; }
  .today-icon svg { width: 18px; height: 18px; }
  .topbar-context { display: none; }
  .search-box { display: none; }
  .news-gallery { grid-template-columns: 1fr; }
  .news-info-grid { grid-template-columns: 1fr; }
}
