﻿/* ─── Reset & Base ─── */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
}
:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --primary-light: #e8f0fe;
  --secondary: #34a853;
  --secondary-light: #e6f4ea;
  --danger: #ea4335;
  --warning: #fbbc04;
  --bg: #f0f4f8;
  --surface: #ffffff;
  --text: #202124;
  --text-secondary: #5f6368;
  --text-hint: #9aa0a6;
  --border: #dadce0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 4px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
/* ─── Dark Mode ─── */
[data-theme="dark"] {
  --bg: #111418;
  --surface: #1e2124;
  --text: #e3e5e8;
  --text-secondary: #b0b8c1;
  --text-hint: #72777e;
  --border: #2e3136;
  --primary-light: #1a2f5a;
  --secondary-light: #1a2e22;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.5);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.6);
}
[data-theme="dark"] .header { background: var(--surface); box-shadow: 0 1px 0 var(--border); }
[data-theme="dark"] .user-menu { background: #2a2d31; }
[data-theme="dark"] .user-menu-item:hover,
[data-theme="dark"] .drawer-item:hover { background: rgba(255,255,255,0.06); }
[data-theme="dark"] .drawer-content { background: var(--surface); }
[data-theme="dark"] .tab:hover { background: rgba(255,255,255,0.06); }
[data-theme="dark"] .course-header { filter: brightness(0.9); }
[data-theme="dark"] .stream-announce-btn { background: var(--surface); color: var(--text-secondary); }
[data-theme="dark"] .stream-announce-btn:hover { background: #2a2d31; }
[data-theme="dark"] .stream-item:hover { box-shadow: var(--shadow-md); background: #25282c; }
[data-theme="dark"] .activity-row:hover { background: #25282c; }
[data-theme="dark"] #activitiesList,
[data-theme="dark"] .people-card,
[data-theme="dark"] .gradebook-wrap,
[data-theme="dark"] .stream-aside-card,
[data-theme="dark"] .announcement-card { background: var(--surface); }
[data-theme="dark"] .person-item:hover { background: #25282c; }
[data-theme="dark"] .upcoming-item:hover { background: #25282c; }
[data-theme="dark"] .gb-student-col { background: var(--surface); }
[data-theme="dark"] .gb-avg-row { background: #25282c; }
[data-theme="dark"] .gb-student-row:hover,
[data-theme="dark"] .gb-student-row:hover .gb-student-col { background: #2a2d31; }
[data-theme="dark"] .gb-grade-input:focus { background: #2a2d31; color: var(--text); }
[data-theme="dark"] .act-dropdown { background: #2a2d31; }
[data-theme="dark"] .act-dropdown button:hover { background: #333; }
[data-theme="dark"] .modal { background: var(--surface); }
[data-theme="dark"] .modal-header { border-bottom-color: var(--border); }
[data-theme="dark"] input:not([type="file"]):not([type="checkbox"]),
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: #25282c; color: var(--text); border-color: var(--border);
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: var(--text-hint); }
[data-theme="dark"] .stream-textarea { background: #25282c; color: var(--text); }
[data-theme="dark"] .ann-comment-input { background: #25282c; }
[data-theme="dark"] .ann-expanded { border-top-color: var(--border); }
[data-theme="dark"] .ann-comments { border-left-color: var(--border); }
[data-theme="dark"] .sidebar-card { background: #25282c; }
[data-theme="dark"] .sidebar-input { background: #1e2124; color: var(--text); }
[data-theme="dark"] .card-banner { filter: brightness(0.88); }
[data-theme="dark"] .course-card:hover { filter: brightness(0.93); }
[data-theme="dark"] .empty-state { color: var(--text-secondary); }
[data-theme="dark"] .form-error { background: #3a1e1e; }
[data-theme="dark"] .impersonation-bar { background: #2e2000; border-color: #5a3e00; }
[data-theme="dark"] .auth-body {
  background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #16162a 100%);
}
[data-theme="dark"] .auth-card {
  background: rgba(30,33,36,0.97);
  border-color: rgba(255,255,255,0.06);
}
[data-theme="dark"] .input-group { background: #25282c; border-color: #2e3136; }
[data-theme="dark"] .input-group:focus-within {
  background: #1e2124;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(26,115,232,0.15);
}

body {
  font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
input, textarea, button { font-family: inherit; font-size: inherit; }
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle; line-height: 1;
}
.icon-btn {
  background: none; border: none; cursor: pointer; width: 40px; height: 40px;
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-secondary); transition: var(--transition);
}
.icon-btn:hover { background: rgba(0,0,0,0.06); }
.icon-btn .material-symbols-outlined { font-size: 24px; }
/* ─── Header ─── */
.header {
  position: fixed; top: 0; left: 0; right: 0; height: 64px;
  background: var(--surface);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 20px;
  box-shadow: var(--shadow-sm); z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 8px; }
.header-center { display: flex; justify-content: center; min-width: 0; padding: 0 12px; }
.header-school-name {
  font-size: 16px; font-weight: 500; color: var(--text); opacity: 0.75;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 35vw;
}
.header-logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px; border-radius: var(--radius-xs); transition: var(--transition); }
.header-logo:hover { background: rgba(0,0,0,0.04); }
.header-title { font-size: 22px; font-weight: 500; color: var(--text); letter-spacing: -0.3px; }
.header-right { display: flex; align-items: center; gap: 8px; justify-content: flex-end; position: relative; }

/* ─── Avatar ─── */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: #5f6368; color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 500; font-size: 16px; flex-shrink: 0; user-select: none;
}
.avatar-huge {
  width: 64px; height: 64px; border-radius: 50%; background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 500; font-size: 28px; flex-shrink: 0;
}

/* ─── User Menu ─── */
.user-menu {
  position: absolute; top: 52px; right: 0; background: var(--surface);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 300px;
  display: none; z-index: 300; overflow: hidden; animation: menuSlide 0.2s ease;
}
@keyframes menuSlide {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.user-menu.show { display: block; }
.user-menu-header { display: flex; align-items: center; gap: 16px; padding: 24px; }
.user-menu-info { min-width: 0; }
.user-menu-name { font-weight: 500; font-size: 16px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-email { font-size: 13px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-divider { height: 1px; background: var(--border); }
.user-menu-item {
  width: 100%; padding: 14px 24px; background: none; border: none; text-align: left;
  font-size: 14px; cursor: pointer; color: var(--text);
  display: flex; align-items: center; gap: 12px; transition: var(--transition);
}
.user-menu-item:hover { background: #f5f5f5; }
.user-menu-item .material-symbols-outlined { font-size: 20px; color: var(--text-secondary); }
/* ─── Drawer ─── */
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 200; pointer-events: none;
}
.drawer.open { pointer-events: all; }
.drawer-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4); opacity: 0; transition: opacity 0.3s;
}
.drawer.open .drawer-overlay { opacity: 1; }
.drawer-content {
  position: absolute; top: 0; left: 0; bottom: 0; width: 300px;
  background: var(--surface); transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.drawer.open .drawer-content { transform: translateX(0); }
.drawer-header { display: flex; align-items: center; gap: 12px; padding: 16px 12px; border-bottom: 1px solid var(--border); }
.drawer-title { font-size: 20px; font-weight: 500; color: var(--text); }
.drawer-body { padding: 8px; flex: 1; }
.drawer-item {
  display: flex; align-items: center; gap: 16px; padding: 12px 16px;
  font-size: 14px; font-weight: 500; color: var(--text);
  border-radius: 0 24px 24px 0; margin-right: 16px; transition: var(--transition);
}
.drawer-item.active { background: var(--primary-light); color: var(--primary); }
.drawer-item:hover { background: rgba(0,0,0,0.04); }
.drawer-item .material-symbols-outlined { font-size: 22px; }

/* ─── Main Content ─── */
.main-content { margin-top: 80px; padding: 24px 32px; max-width: 1100px; margin-left: auto; margin-right: auto; }

/* ─── Dashboard ─── */
.dashboard-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; flex-wrap: wrap; gap: 16px; }
.dashboard-topbar h2 { font-size: 28px; font-weight: 500; color: var(--text); letter-spacing: -0.5px; }
.dashboard-actions { display: flex; gap: 12px; }
.pending-band { display: flex; align-items: center; gap: 12px; background: #e8f0fe; color: #174ea6; border-radius: 10px; padding: 13px 20px; margin-bottom: 24px; font-size: 14px; }
.pending-band .material-symbols-outlined { font-size: 20px; flex-shrink: 0; }
.pending-band-urgent { color: #c5221f; }
[data-theme="dark"] .pending-band { background: rgba(26,115,232,.14); color: #8ab4f8; }
[data-theme="dark"] .pending-band-urgent { color: #f28b82; }

/* ─── Buscador de actividades ─── */
.act-search-wrap { padding: 0 0 12px; }
.act-search-wrap .input-group { margin: 0; }

/* ─── Section ─── */
.section { margin-bottom: 48px; }
.section-header { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.section-icon { font-size: 22px !important; color: var(--primary); }
.section-header h3 { font-size: 15px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.8px; }

/* ─── Empty State ─── */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-hint); }
.empty-state.small { padding: 32px 24px; }
.empty-icon { margin-bottom: 12px; }
.empty-icon .material-symbols-outlined { font-size: 48px !important; color: var(--border); }
.empty-state p { font-size: 15px; }

/* ─── Course Grid ─── */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
/* ─── Course Card ─── */
.course-card {
  display: flex; flex-direction: column; border-radius: var(--radius);
  overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease; cursor: pointer;
}
.course-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card-banner {
  background: linear-gradient(135deg, var(--card-color, #1a73e8), color-mix(in srgb, var(--card-color, #1a73e8) 75%, black));
  padding: 18px 20px 16px; min-height: 140px;
  display: flex; align-items: flex-start; justify-content: space-between;
  position: relative; overflow: hidden;
}
.card-banner-content { position: relative; z-index: 1; flex: 1; min-width: 0; padding-right: 12px; }
.card-banner h4 {
  color: white; font-size: 22px; font-weight: 600;
  margin-bottom: 5px; line-height: 1.25; word-wrap: break-word;
}
.card-banner p { color: rgba(255,255,255,0.82); font-size: 13px; }
.card-banner-deco {
  width: 76px; height: 76px; border-radius: 50%; flex-shrink: 0;
  background: rgba(0,0,0,0.12); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
  margin-top: 4px;
}
.card-banner-deco .material-symbols-outlined {
  font-size: 40px !important; color: rgba(255,255,255,0.75);
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 48;
}
.card-body {
  padding: 14px 20px; flex: 1; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border);
}
.card-stat { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.card-stat .material-symbols-outlined { font-size: 18px !important; color: var(--text-hint); }
.card-footer {
  padding: 4px 8px; display: flex; justify-content: space-between; align-items: center;
}
.card-footer-icons { display: flex; }
.card-icon-btn { color: var(--text-secondary); width: 36px; height: 36px; }
.card-icon-btn .material-symbols-outlined { font-size: 20px; }
.card-icon-btn:hover { color: var(--text); background: rgba(0,0,0,0.05); }
.card-owner-badge { font-size: 11px; font-weight: 600; color: white; background: rgba(26,115,232,0.15); padding: 3px 10px; border-radius: 100px; }
.card-copied-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #323232; color: white; padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 14px; z-index: 999; animation: toastIn 0.2s ease;
  pointer-events: none;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ─── Buttons ─── */
.btn {
  padding: 10px 24px; border-radius: 100px; font-size: 14px; font-weight: 500;
  cursor: pointer; border: none; transition: var(--transition);
  display: inline-flex; align-items: center; gap: 8px; letter-spacing: 0.2px;
}
.btn .material-symbols-outlined { font-size: 20px; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 2px 8px rgba(26,115,232,0.3); }
.btn-outline { background: var(--surface); color: var(--primary); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--primary-light); border-color: var(--primary); }
.btn-full { width: 100%; justify-content: center; }
/* ─── Auth Pages ─── */
.auth-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  position: relative; overflow: hidden;
}
.auth-body::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(102,126,234,0.25) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(118,75,162,0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(26,115,232,0.15) 0%, transparent 50%);
  animation: authBgShift 12s ease-in-out infinite alternate;
}
@keyframes authBgShift {
  0% { transform: scale(1) rotate(0deg); }
  100% { transform: scale(1.15) rotate(3deg); }
}
.auth-body::after {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(102,126,234,0.12) 0%, transparent 70%);
  top: -150px; right: -150px;
  animation: authFloat 18s ease-in-out infinite alternate;
}
@keyframes authFloat {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-80px, 80px) scale(1.2); }
}
.auth-container {
  width: 100%; max-width: 420px; padding: 16px;
  position: relative; z-index: 1;
}
.auth-card {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 48px 40px;
  box-shadow:
    0 4px 6px rgba(0,0,0,0.03),
    0 12px 30px rgba(0,0,0,0.08),
    0 30px 60px rgba(0,0,0,0.12);
  animation: cardFade 0.5s ease;
  border: 1px solid rgba(255,255,255,0.5);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.auth-card:hover {
  box-shadow:
    0 4px 6px rgba(0,0,0,0.03),
    0 12px 30px rgba(0,0,0,0.08),
    0 40px 80px rgba(0,0,0,0.18);
  transform: translateY(-2px);
}
@keyframes cardFade { from { opacity: 0; transform: translateY(24px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo h1 { font-size: 26px; font-weight: 500; margin-top: 12px; color: var(--text); }
.auth-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-link { text-align: center; font-size: 14px; color: var(--text-secondary); margin-top: 24px; }
.auth-link a { color: var(--primary); font-weight: 500; }
.auth-link a:hover { text-decoration: underline; }

/* ─── Auth Button ─── */
.auth-form .btn-full {
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.auth-form .btn-full::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.auth-form .btn-full:hover::before { opacity: 1; }
.auth-form .btn-full:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(26,115,232,0.4);
}
.auth-form .btn-full:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(26,115,232,0.3);
}
.auth-form .btn-full .material-symbols-outlined {
  font-size: 22px;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ─── Input Group ─── */
.input-group {
  display: flex; align-items: center; gap: 12px;
  border: 2px solid var(--border); border-radius: 12px;
  padding: 0 14px; transition: all 0.25s ease; background: #f8f9fa;
}
.input-group:focus-within {
  border-color: var(--primary); background: white;
  box-shadow: 0 0 0 4px rgba(26,115,232,0.12);
}
.input-icon {
  font-size: 22px !important; color: var(--text-hint);
  transition: color 0.25s ease;
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}
.input-group:focus-within .input-icon {
  color: var(--primary);
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.input-group input {
  flex: 1; padding: 14px 0; border: none; background: transparent;
  font-size: 15px; outline: none; color: var(--text);
}
.input-group input::placeholder {
  color: var(--text-hint);
  font-weight: 400;
}

/* ─── Form Error ─── */
.form-error { color: var(--danger); font-size: 13px; display: none; padding: 8px 12px; background: #fce8e6; border-radius: var(--radius-xs); }
.form-error.show { display: block; }

/* ─── Modal ─── */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); display: none;
  align-items: center; justify-content: center; z-index: 500;
  padding: 16px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius);
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: modalSlide 0.25s ease;
}
@keyframes modalSlide { from { opacity: 0; transform: translateY(20px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Upload overlay (avatar y portada de curso) ─── */
.profile-avatar-wrap { position: relative; display: inline-block; }
.upload-overlay {
  position: absolute; inset: 0; border-radius: inherit;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 4; pointer-events: none;
  opacity: 0; transition: opacity 0.2s;
}
.upload-overlay.show { opacity: 1; }
.upload-spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  animation: spin 0.75s linear infinite;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-header-left { display: flex; align-items: center; gap: 12px; }
.modal-header-icon { font-size: 24px !important; color: var(--primary); }
.modal-header h3 { font-size: 22px; font-weight: 500; color: var(--text); }
.modal-body { padding: 24px; }
.modal-desc { font-size: 14px; color: var(--text-secondary); margin-bottom: 20px; }
.warning-banner {
  display: flex; align-items: center; gap: 10px;
  background: #fef7e0; border: 1px solid #fde293; padding: 12px 16px;
  border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 20px;
}
.warning-icon { font-size: 20px !important; color: #ea8600; }
/* ─── Course Header ─── */
.course-header {
  background: linear-gradient(135deg, var(--card-color, #1a73e8), color-mix(in srgb, var(--card-color, #1a73e8) 70%, black));
  color: white; padding: 40px; border-radius: var(--radius);
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 24px; position: relative; overflow: hidden;
}
.course-header::after {
  content: ''; position: absolute; top: -30%; right: -10%;
  width: 300px; height: 300px; border-radius: 50%; background: rgba(255,255,255,0.06);
}
.course-header-info { position: relative; z-index: 1; }
.course-header h2 { font-size: 36px; font-weight: 500; margin-bottom: 4px; }
.course-section { font-size: 15px; opacity: 0.9; margin-bottom: 12px; }
.course-meta { display: flex; gap: 12px; }
.course-code-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.2); padding: 6px 14px;
  border-radius: 100px; font-size: 14px; font-weight: 500; backdrop-filter: blur(4px);
}
.course-code-badge .material-symbols-outlined { font-size: 18px !important; }
.course-owner { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.course-owner-name { font-size: 15px; font-weight: 500; }
.header-customize-btn {
  position: absolute; bottom: 12px; right: 12px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.18); color: white;
  border: 1px solid rgba(255,255,255,0.38); border-radius: 20px;
  padding: 6px 14px; font-size: 13px; font-weight: 500; cursor: pointer;
  backdrop-filter: blur(6px); transition: background 0.2s;
}
.header-customize-btn:hover { background: rgba(255,255,255,0.32); }
.header-customize-btn .material-symbols-outlined { font-size: 17px !important; }

/* ─── Tabs ─── */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.tab {
  padding: 14px 24px; background: none; border: none; font-size: 14px;
  font-weight: 500; color: var(--text-secondary); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: var(--transition); display: flex; align-items: center; gap: 8px;
}
.tab:hover { color: var(--text); background: rgba(0,0,0,0.02); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .material-symbols-outlined { font-size: 20px; }
.tab-content.hidden { display: none; }

/* ─── FAB (Floating Action Button) ─── */
.fab {
  position: fixed; bottom: 32px; right: 32px;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--primary); color: white; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(26,115,232,0.45);
  font-size: 24px; z-index: 90;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.fab:hover {
  background: var(--primary-dark);
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(26,115,232,0.55);
}
.fab .material-symbols-outlined { font-size: 28px; }

/* ─── Activity Tab Cards ─── */
.activities-list { display: flex; flex-direction: column; }
.activity-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 18px 24px;
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 12px; transition: box-shadow 0.2s;
}
.activity-card:hover { box-shadow: var(--shadow-md); }
.activity-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary); display: flex; align-items: center; justify-content: center;
  color: white; flex-shrink: 0;
}
.activity-icon .material-symbols-outlined { font-size: 20px; }
.activity-info { flex: 1; min-width: 0; }
.activity-title { font-weight: 600; font-size: 15px; color: var(--text); margin-bottom: 4px; }
.activity-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; white-space: pre-line; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.activity-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--text-hint); align-items: center; }
.activity-due { color: #ea8600; }
.activity-points-badge { color: var(--primary); font-weight: 500; }

/* ─── Stream Activity Cards (Novedades) ─── */
.stream-activity-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); margin-bottom: 16px; overflow: hidden; transition: box-shadow 0.2s;
}
.stream-activity-card:hover { box-shadow: var(--shadow-md); }
.stream-activity-header {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.stream-activity-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--secondary); display: flex; align-items: center; justify-content: center;
  color: white; flex-shrink: 0;
}
.stream-activity-icon .material-symbols-outlined { font-size: 20px; }
.stream-activity-info { flex: 1; min-width: 0; }
.stream-activity-title { font-weight: 600; font-size: 15px; color: var(--text); }
.stream-activity-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.stream-activity-body { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; }
.stream-activity-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--text-secondary); }
.stream-act-meta-item { display: flex; align-items: center; gap: 4px; }
.stream-act-btn { font-size: 13px; padding: 6px 16px; flex-shrink: 0; }
.stream-grade-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--secondary-light); color: var(--secondary); font-weight: 600;
  padding: 3px 10px; border-radius: 100px; font-size: 12px;
}

/* ─── Activity Detail Modal ─── */
.detail-meta {
  display: flex; flex-wrap: wrap; gap: 14px;
  font-size: 13px; color: var(--text-secondary);
  padding: 12px 16px; background: var(--bg); border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.student-grade-box {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 24px; background: var(--bg); border-radius: var(--radius-sm);
  margin-top: 20px;
}

/* ─── Grade Table ─── */
.grade-table-wrap { overflow-x: auto; }
.grade-table { width: 100%; border-collapse: collapse; }
.grade-table th {
  text-align: left; padding: 10px 14px;
  font-size: 12px; color: var(--text-secondary); font-weight: 600; text-transform: uppercase;
  border-bottom: 2px solid var(--border); white-space: nowrap;
}
.grade-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.grade-table tbody tr:last-child td { border-bottom: none; }
.grade-table tbody tr:hover td { background: #fafafa; }
.grade-input {
  width: 80px; padding: 6px 10px; text-align: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; outline: none; transition: border-color 0.2s;
}
.grade-input:focus { border-color: var(--primary); }
.grade-saved { font-size: 12px; color: var(--secondary); display: none; font-weight: 600; }
.grade-saved.show { display: inline; }

/* ─── Grade chip (alumno) ─── */
.grade-chip {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 12px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.grade-chip.graded  { background: #e6f4ea; color: #1e8e3e; }
.grade-chip.pending { background: var(--bg); color: var(--text-hint); border: 1px solid var(--border); }

/* ─── Attachments — Modal de creación ─── */
.att-section { border-top: 1px solid var(--border); padding-top: 14px; margin-bottom: 8px; }
.att-buttons { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.att-btn { font-size: 13px; padding: 8px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.att-btn .material-symbols-outlined { font-size: 18px; }
.link-input-area { margin-bottom: 12px; }

.att-preview-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.att-preview-card {
  width: 110px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; position: relative; background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.att-preview-thumb {
  height: 72px; display: flex; align-items: center; justify-content: center;
}
.att-preview-ext { font-size: 18px; font-weight: 700; color: white; letter-spacing: 1px; }
.link-thumb { background: var(--bg); }
.att-preview-name {
  padding: 6px 8px; font-size: 11px; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-top: 1px solid var(--border);
}
.att-preview-remove {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,0.45); border: none; color: white;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.att-preview-remove .material-symbols-outlined { font-size: 14px; }
.att-preview-remove:hover { background: rgba(0,0,0,0.7); }

/* ─── Attachments — Lista en detalle y cards ─── */
.att-list { display: flex; flex-direction: column; gap: 6px; }
.att-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); transition: background 0.15s;
}
.att-item:hover { background: var(--bg); }
.att-item-icon {
  width: 36px; height: 36px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white; letter-spacing: 0.5px;
}
.link-icon { background: var(--bg); border: 1px solid var(--border); }
.att-item-name { flex: 1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-item-open { font-size: 18px !important; color: var(--text-hint); flex-shrink: 0; }
.att-count-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: #f0f4f8; color: var(--text-secondary);
  padding: 2px 8px; border-radius: 100px; font-size: 12px;
}

/* ─── Announcement Card ─── */
.announcement-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); margin-bottom: 24px; padding: 20px; transition: box-shadow 0.2s;
}
.announcement-card:focus-within { box-shadow: var(--shadow-md); }
.announcement-form-header { display: flex; align-items: center; gap: 12px; }
.announcement-form-header input {
  flex: 1; padding: 12px 16px; border: 1px solid var(--border);
  border-radius: 100px; font-size: 14px; outline: none; cursor: pointer; transition: var(--transition);
  background: #fafafa;
}
.announcement-form-header input:focus { border-color: var(--primary); background: white; }
.announcement-form-expanded { display: none; margin-top: 16px; }
.announcement-form-expanded.show { display: block; }
.announcement-form-expanded textarea {
  width: 100%; padding: 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; outline: none;
  resize: vertical; transition: var(--transition);
}
.announcement-form-expanded textarea:focus { border-color: var(--primary); }
.announcement-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.image-name { font-size: 12px; color: var(--text-secondary); flex: 1; }
.image-preview-wrap { position: relative; display: inline-block; margin: 12px 0 4px; }
.image-preview-thumb {
  max-width: 280px; max-height: 180px; border-radius: var(--radius-sm);
  object-fit: cover; display: block; box-shadow: var(--shadow-sm);
}
.image-preview-remove {
  position: absolute; top: -8px; right: -8px;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(0,0,0,0.65); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: white;
}
.image-preview-remove .material-symbols-outlined { font-size: 14px !important; }
.announcement-form-btns { margin-left: auto; display: flex; gap: 8px; }
.announcements { display: flex; flex-direction: column; gap: 16px; }
/* ─── Announcement Post ─── */
.announcement {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 24px;
  transition: box-shadow 0.2s; animation: annFade 0.3s ease;
}
@keyframes annFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.announcement:hover { box-shadow: var(--shadow-md); }
.announcement-header { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.announcement-author { font-weight: 500; font-size: 14px; color: var(--text); }
.announcement-date { font-size: 12px; color: var(--text-hint); margin-left: auto; }
.announcement-text { font-size: 14px; line-height: 1.7; white-space: pre-wrap; color: var(--text); }
.announcement-image { margin-top: 14px; max-width: 100%; max-height: 400px; border-radius: var(--radius-sm); cursor: pointer; box-shadow: var(--shadow-sm); transition: var(--transition); }
.announcement-image:hover { opacity: 0.95; box-shadow: var(--shadow-md); }

/* ─── Announcement Expandable Card ─── */
.ann-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden; transition: box-shadow 0.2s;
  animation: annFade 0.3s ease;
}
.ann-card:hover { box-shadow: var(--shadow-md); }
.ann-stream-item { box-shadow: none !important; border-radius: 0 !important; cursor: pointer; animation: none !important; }
.ann-expand-arrow {
  font-size: 20px !important; color: var(--text-hint); flex-shrink: 0;
  transition: transform 0.22s; user-select: none;
}
.ann-card.expanded .ann-expand-arrow { transform: rotate(180deg); }
.ann-expanded { padding: 4px 20px 20px 20px; border-top: 1px solid var(--border); }
.ann-full-text { font-size: 14px; line-height: 1.75; color: var(--text); white-space: pre-wrap; padding: 14px 0 12px; }
.ann-full-img { max-width: 100%; max-height: 360px; border-radius: var(--radius-sm); display: block; margin-bottom: 16px; }
.ann-comments { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; padding-left: 8px; border-left: 3px solid var(--border); }
.ann-comment { display: flex; gap: 10px; align-items: flex-start; }
.ann-comment-body { flex: 1; }
.ann-comment-author { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.ann-comment-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.ann-comment-date { font-size: 11px; color: var(--text-hint); margin-top: 3px; }
.ann-comment-form {
  display: flex; align-items: center; gap: 10px;
  padding-top: 14px; border-top: 1px solid var(--border);
}
.ann-comment-input {
  flex: 1; padding: 8px 16px; border: 1px solid var(--border);
  border-radius: 100px; font-size: 13px; outline: none;
  background: var(--bg); color: var(--text); transition: border-color 0.2s;
}
.ann-comment-input:focus { border-color: var(--primary); }

/* ─── Stream Layout (two-column) ─── */
.stream-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 24px;
  align-items: flex-start;
}
@media (max-width: 820px) {
  .stream-layout { grid-template-columns: 1fr; }
  .stream-aside { display: none; }
}
.stream-aside { display: flex; flex-direction: column; gap: 16px; }
.stream-aside-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.stream-code-header {
  display: flex; align-items: center; padding: 14px 16px 4px;
}
.stream-code-label {
  font-size: 13px; font-weight: 600; color: var(--text); flex: 1;
}
.stream-code-value {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 12px 14px;
  font-size: 22px; font-weight: 500; color: var(--primary); letter-spacing: 1px;
}
.stream-upcoming-title {
  font-size: 13px; font-weight: 600; color: var(--text); padding: 14px 16px 8px;
}
.stream-no-upcoming {
  font-size: 13px; color: var(--text-secondary); padding: 0 16px 8px; line-height: 1.5;
}
.stream-ver-todo {
  display: block; width: 100%; text-align: right; padding: 8px 16px 12px;
  font-size: 13px; font-weight: 500; color: var(--primary);
  background: none; border: none; cursor: pointer;
}
.stream-ver-todo:hover { text-decoration: underline; }
.upcoming-item {
  padding: 8px 16px; cursor: pointer; transition: background 0.15s;
  border-top: 1px solid #f5f5f5;
}
.upcoming-item:hover { background: #f8f9fa; }
.upcoming-item-title {
  font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.upcoming-item-due { font-size: 12px; color: var(--text-secondary); }

.stream-main { display: flex; flex-direction: column; gap: 12px; }
#streamList { display: flex; flex-direction: column; gap: 20px; }
.stream-action-row { display: flex; gap: 12px; }
.stream-announce-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 24px; border: 1px solid var(--border);
  border-radius: 100px; background: var(--surface);
  font-size: 14px; font-weight: 500; color: var(--text-secondary);
  cursor: pointer; transition: var(--transition); box-shadow: var(--shadow-sm);
}
.stream-announce-btn:hover { background: #f8f9fa; border-color: var(--text-secondary); }
.stream-announce-btn .material-symbols-outlined { font-size: 18px; color: var(--text-secondary); }
.stream-form-username { font-size: 14px; font-weight: 500; color: var(--text); }
.stream-textarea {
  display: block; width: 100%; padding: 12px; margin-top: 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14px; outline: none; resize: vertical; transition: var(--transition);
}
.stream-textarea:focus { border-color: var(--primary); }

/* ─── Stream Items ─── */
.stream-item {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 16px 20px;
  transition: box-shadow 0.2s; animation: annFade 0.3s ease;
}
.stream-item:hover { box-shadow: var(--shadow-md); }
.stream-item-icon {
  width: 40px; height: 40px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: white;
}
.stream-item-icon .material-symbols-outlined { font-size: 22px !important; }
.ann-icon { background: var(--primary); }
.act-icon { background: #00897b; }
.stream-item-body { flex: 1; min-width: 0; }
.stream-item-text {
  font-size: 14px; color: var(--text); line-height: 1.5;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.stream-item-date { font-size: 12px; color: var(--text-hint); margin-top: 3px; }

/* ─── People ─── */
.people-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); margin-bottom: 24px; overflow: hidden;
}
.people-card-header {
  display: flex; align-items: center; gap: 8px; padding: 20px 24px;
  border-bottom: 1px solid #f0f0f0;
}
.people-card-header .material-symbols-outlined { font-size: 22px !important; color: var(--primary); }
.people-card-header h3 { font-size: 16px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.people-count {
  margin-left: auto; font-size: 13px; font-weight: 600; color: var(--text-secondary);
  background: #f0f0f0; padding: 2px 10px; border-radius: 100px;
}
.add-person-btn {
  margin-left: 8px; display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%; border: none; cursor: pointer;
  background: transparent; color: var(--primary); transition: background 0.18s;
}
.add-person-btn:hover { background: rgba(26,115,232,0.1); }
.add-person-btn .material-symbols-outlined { font-size: 22px !important; }
.person-item { display: flex; align-items: center; gap: 16px; padding: 14px 24px; border-bottom: 1px solid #f5f5f5; transition: var(--transition); }
.person-item:last-child { border-bottom: none; }
.person-item:hover { background: #fafafa; }
.person-info { min-width: 0; }
.person-name { font-size: 14px; font-weight: 500; color: var(--text); }
.person-email { font-size: 13px; color: var(--text-secondary); }

/* ─── Activity Flat Rows ─── */
#activitiesList { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.activity-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.12s;
}
.activity-row:last-child { border-bottom: none; }
.activity-row:hover { background: #f8f9fa; }
.activity-row-icon .material-symbols-outlined {
  font-size: 22px; color: var(--text-secondary);
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}
.activity-row-title { flex: 1; font-size: 14px; font-weight: 500; color: var(--text); }
.activity-row-date { font-size: 13px; color: var(--text-secondary); white-space: nowrap; }

/* ─── Student Activity Cards ─── */
.act-student-item {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background var(--transition);
}
.act-student-item:last-child { border-bottom: none; }
.act-student-item:hover { background: var(--bg); }
.act-thumb {
  width: 52px; height: 52px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.act-thumb .material-symbols-outlined { color: white; font-size: 26px !important; }
.act-content { flex: 1; min-width: 0; }
.act-type-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--text-hint); margin-bottom: 3px;
}
.act-item-title {
  font-size: 15px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.act-item-date { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }
.act-item-date.date-overdue { color: #b91c1c; font-weight: 500; }
[data-theme="dark"] .act-item-date.date-overdue { color: #fca5a5; }
.act-status-col { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.act-status-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; padding: 4px 12px;
  border-radius: 20px; white-space: nowrap;
}
.act-status-chip.status-pending   { background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border); }
.act-status-chip.status-graded    { background: #e6f4ea; color: #1e8e3e; }
.act-status-chip.status-overdue   { background: #fce8e6; color: #d93025; }
.act-status-chip.status-late-open { background: #e8f0fe; color: #1a73e8; }
.act-grade-text { font-size: 14px; font-weight: 700; color: var(--text); }
[data-theme="dark"] .act-student-item:hover { background: rgba(255,255,255,0.04); }
[data-theme="dark"] .act-status-chip.status-graded    { background: rgba(52,168,83,.18);  color: #81c995; }
[data-theme="dark"] .act-status-chip.status-overdue   { background: rgba(217,48,37,.18);  color: #f28b82; }
[data-theme="dark"] .act-status-chip.status-late-open { background: rgba(26,115,232,.18); color: #8ab4f8; }
[data-theme="dark"] .act-status-chip.status-pending   { background: rgba(255,255,255,0.06); }

/* ─── Activity Dropdown ─── */
.act-dropdown {
  position: absolute; background: var(--surface); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); z-index: 500; min-width: 168px;
  overflow: hidden; animation: menuSlide 0.15s ease;
}
.act-dropdown button {
  width: 100%; padding: 11px 16px; background: none; border: none;
  text-align: left; font-size: 14px; cursor: pointer; color: var(--text);
  display: flex; align-items: center; gap: 10px; transition: background 0.12s;
}
.act-dropdown button:hover { background: #f5f5f5; }
.act-dropdown button .material-symbols-outlined { font-size: 18px; color: var(--text-secondary); }

/* ─── Gradebook ─── */
.gradebook-wrap {
  width: 100%; overflow-x: auto; border-radius: var(--radius);
  box-shadow: var(--shadow-sm); background: var(--surface);
}
.gradebook { border-collapse: collapse; min-width: 100%; }
.gb-student-col {
  width: 200px; min-width: 180px; position: sticky; left: 0; z-index: 2;
  background: var(--surface); border-right: 1px solid var(--border);
}
.gb-act-col {
  min-width: 150px; width: 160px; padding: 14px 16px 10px;
  border-bottom: 2px solid var(--border); border-right: 1px solid #efefef;
  vertical-align: top; text-align: left;
}
.gb-act-date { font-size: 12px; color: var(--text-hint); margin-bottom: 4px; }
.gb-act-title {
  font-size: 13px; font-weight: 500; color: var(--primary); cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.4; margin-bottom: 4px;
}
.gb-act-title:hover { text-decoration: underline; }
.gb-act-pts { font-size: 12px; color: var(--text-secondary); }
.gb-header-row th { background: var(--surface); }
.gb-avg-row { background: #f8f9fa; border-bottom: 1px solid var(--border); }
.gb-avg-label {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px;
  font-size: 13px; color: var(--text-secondary); font-weight: 500;
}
.gb-avg-cell {
  text-align: center; font-size: 13px; color: var(--text-secondary);
  padding: 10px 16px; border-right: 1px solid #efefef;
}
.gb-student-row { border-bottom: 1px solid var(--border); transition: background 0.12s; }
.gb-student-row:hover { background: #f8f9fa; }
.gb-student-row:hover .gb-student-col { background: #f8f9fa; }
.gb-student-name {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  font-size: 14px; font-weight: 500; color: var(--text);
}
.gb-cell {
  padding: 6px 10px; border-right: 1px solid #efefef;
  vertical-align: middle; text-align: center;
}
.gb-grade-wrap { display: flex; align-items: center; gap: 3px; justify-content: center; }
.gb-grade-input {
  width: 52px; text-align: center; padding: 5px 6px;
  border: 1px solid transparent; border-radius: var(--radius-xs);
  font-size: 14px; font-weight: 500; color: var(--text); background: transparent;
  outline: none; transition: border-color 0.15s, background 0.15s;
}
.gb-grade-input:focus { border-color: var(--primary); background: white; }
.gb-grade-input.gb-saved { border-color: var(--secondary); }
.gb-grade-max { font-size: 12px; color: var(--text-hint); }
.gb-grade-display { font-size: 14px; font-weight: 500; color: var(--text); }
.gb-empty-row { text-align: center; padding: 40px; color: var(--text-secondary); font-size: 14px; }

/* ─── Activity Creator Page ─── */
.creator-page { background: #f0f4f8; min-height: 100vh; }

.creator-header {
  position: fixed; top: 0; left: 0; right: 0; height: 60px;
  background: var(--surface); display: flex; align-items: center;
  justify-content: space-between; padding: 0 20px;
  box-shadow: var(--shadow-sm); z-index: 100;
}
.creator-header-left { display: flex; align-items: center; gap: 12px; }
.creator-header-icon {
  font-size: 28px !important; color: #ea8600;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.creator-header-title { font-size: 20px; font-weight: 500; color: var(--text); }
.creator-header-right { display: flex; align-items: center; gap: 16px; }
.creator-error-inline { font-size: 13px; color: var(--danger); background: #fce8e6; padding: 6px 14px; border-radius: var(--radius-sm); }

.creator-body {
  display: flex; gap: 24px; align-items: flex-start;
  max-width: 1100px; margin: 0 auto;
  padding: 80px 24px 48px;
}
.creator-main { flex: 1; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.creator-sidebar { width: 290px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; }

.creator-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden;
}

/* Title field */
.creator-title-field { padding: 20px 24px 10px; }
.creator-title-input {
  width: 100%; border: none; border-bottom: 2px solid var(--primary);
  outline: none; font-size: 22px; font-weight: 400; color: var(--text);
  padding-bottom: 6px; background: transparent; font-family: inherit;
}
.creator-title-input::placeholder { color: var(--text-hint); }
.creator-required { font-size: 12px; color: var(--text-hint); display: block; margin-top: 5px; }
.creator-divider { height: 1px; background: var(--border); }

/* Rich editor */
.creator-editor-wrap { padding: 0 24px; }
.creator-editor {
  min-height: 130px; outline: none; font-size: 15px; line-height: 1.6;
  color: var(--text); padding: 14px 0; word-break: break-word;
}
.creator-editor:empty::before {
  content: attr(data-placeholder); color: var(--text-hint); pointer-events: none;
}
.creator-toolbar {
  display: flex; gap: 2px; padding: 8px 0 14px;
  border-top: 1px solid var(--border); margin-top: 8px;
}
.toolbar-btn {
  width: 34px; height: 34px; border: none; background: none;
  border-radius: 6px; cursor: pointer; display: flex; align-items: center;
  justify-content: center; font-size: 14px; color: var(--text-secondary);
  transition: background 0.15s; font-family: inherit;
}
.toolbar-btn:hover { background: var(--bg); color: var(--text); }
.toolbar-btn .material-symbols-outlined { font-size: 18px; }

/* Attach section */
.creator-card-section-title {
  padding: 16px 24px; font-weight: 500; font-size: 15px;
  border-bottom: 1px solid var(--border); color: var(--text);
}
.creator-att-row { display: flex; gap: 24px; padding: 20px 24px 4px; flex-wrap: wrap; }
.creator-att-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer; min-width: 60px;
}
.creator-att-circle {
  width: 56px; height: 56px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.creator-att-circle .material-symbols-outlined { font-size: 26px; color: var(--text-secondary); }
.creator-att-btn:hover .creator-att-circle { background: var(--bg); border-color: #bbb; }
.creator-att-btn > span:last-child { font-size: 12px; color: var(--text-secondary); }

.creator-link-dialog {
  display: flex; gap: 8px; align-items: center;
  padding: 12px 24px; border-top: 1px solid var(--border); margin-top: 8px;
}

/* Sidebar cards */
.sidebar-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px;
}
.sidebar-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 10px; }
.sidebar-course-name { font-size: 15px; font-weight: 500; color: var(--text); }
.sidebar-course-sub { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.sidebar-chip {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 100px;
  padding: 8px 16px; font-size: 14px; color: var(--primary); font-weight: 500;
}
.sidebar-chip .material-symbols-outlined { font-size: 18px; }
.sidebar-input-wrap { position: relative; }
.sidebar-input {
  width: 100%; border: none; border-bottom: 1px solid var(--border);
  padding: 6px 0; font-size: 14px; outline: none; background: transparent;
  color: var(--text); transition: border-color 0.2s; font-family: inherit;
}
.sidebar-input:focus { border-bottom-color: var(--primary); }
.sidebar-hint { font-size: 11px; color: var(--text-hint); margin-top: 5px; }

@media (max-width: 768px) {
  .creator-body { flex-direction: column; padding: 72px 16px 40px; }
  .creator-sidebar { width: 100%; }
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .main-content { padding: 16px; }
  .course-grid { grid-template-columns: 1fr; }
  .dashboard-topbar h2 { font-size: 22px; }
  .dashboard-actions .btn span:first-child { display: none; }
  .course-header h2 { font-size: 26px; }
  .course-header { flex-direction: column; gap: 16px; padding: 24px; }
  .auth-card { padding: 32px 24px; }
  .drawer-content { width: 280px; }
}
@media (max-width: 480px) {
  .dashboard-actions { flex-direction: column; width: 100%; }
  .dashboard-actions .btn { justify-content: center; }
  .dashboard-topbar { flex-direction: column; align-items: flex-start; }
  .course-grid { grid-template-columns: 1fr; }
}
select, .select-input {
  flex: 1; padding: 14px 0; border: none; background: transparent;
  font-size: 14px; outline: none; color: var(--text); cursor: pointer;
  appearance: none; -webkit-appearance: none;
}
.input-group:has(select) { position: relative; }
.input-group:has(select)::after {
  content: '▼'; font-size: 10px; color: var(--text-hint);
  position: absolute; right: 14px; pointer-events: none;
}
/* ─── Admin Stats ─── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.stat-card {
  background: var(--surface); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 20px;
  border-left: 4px solid var(--stat-color);
}
.stat-icon { width: 52px; height: 52px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--stat-color) 12%, white); display: flex; align-items: center; justify-content: center; }
.stat-icon .material-symbols-outlined { font-size: 28px !important; color: var(--stat-color); }
.stat-info { display: flex; flex-direction: column; }
.stat-value { font-size: 32px; font-weight: 600; color: var(--text); line-height: 1.2; }
.stat-label { font-size: 13px; color: var(--text-secondary); }

/* ─── Filter Bar ─── */
.filter-bar { margin-bottom: 24px; }
.filter-form { display: flex; gap: 12px; flex-wrap: wrap; }

/* ─── Users Table ─── */
.users-table-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.users-table { width: 100%; border-collapse: collapse; }
.users-table th { text-align: left; padding: 14px 20px; font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; background: #f8f9fa; border-bottom: 1px solid var(--border); }
.users-table td { padding: 14px 20px; font-size: 14px; color: var(--text); border-bottom: 1px solid #f0f0f0; }
.users-table tr:last-child td { border-bottom: none; }
.users-table tr:hover td { background: #fafafa; }
.td-email { color: var(--text-secondary); }
.td-date { color: var(--text-hint); font-size: 13px; }
.cb-cell { width: 44px; padding: 14px 8px 14px 16px !important; }
.row-cb, #selectAll { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }
.users-table tr.selected td { background: var(--primary-light); }

/* ─── Pagination ─── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 18px 20px; border-top: 1px solid #f0f0f0; flex-wrap: wrap; }
.page-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 10px; border-radius: var(--radius-sm); font-size: 14px; color: var(--text-secondary); border: 1px solid var(--border); background: var(--surface); text-decoration: none; transition: var(--transition); }
.page-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; pointer-events: none; }
.page-ellipsis { color: var(--text-hint); padding: 0 6px; font-size: 16px; }

/* ─── Bulk Action Bar ─── */
.bulk-bar { position: fixed; bottom: 0; left: 0; right: 0; background: #1a1c2e; color: #fff; padding: 13px 24px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; z-index: 300; transform: translateY(100%); transition: transform 0.28s cubic-bezier(0.4,0,0.2,1); box-shadow: 0 -4px 24px rgba(0,0,0,0.25); }
.bulk-bar.visible { transform: translateY(0); }
.bulk-bar-count { font-weight: 600; font-size: 14px; white-space: nowrap; background: rgba(255,255,255,0.12); padding: 5px 12px; border-radius: 20px; }
.bulk-bar-group { display: flex; align-items: center; gap: 8px; }
.bulk-bar-group label { font-size: 13px; color: rgba(255,255,255,0.65); white-space: nowrap; }
.bulk-bar-group select { background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.2); border-radius: 6px; padding: 6px 10px; font-size: 13px; cursor: pointer; }
.bulk-bar-group select option { background: #1a1c2e; color: #fff; }
.bulk-bar-apply { background: var(--primary); color: #fff; border: none; border-radius: 6px; padding: 6px 16px; font-size: 13px; cursor: pointer; font-weight: 500; transition: background 0.2s; white-space: nowrap; }
.bulk-bar-apply:hover { background: var(--primary-dark); }
.bulk-bar-sep { width: 1px; height: 28px; background: rgba(255,255,255,0.15); flex-shrink: 0; }
.bulk-bar-clear { margin-left: auto; background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.75); border: 1px solid rgba(255,255,255,0.15); border-radius: 6px; padding: 6px 12px; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 4px; transition: background 0.2s; white-space: nowrap; }
.bulk-bar-clear:hover { background: rgba(255,255,255,0.18); }
.badge-disabled { display: inline-block; font-size: 10px; font-weight: 600; color: var(--danger); background: #fce8e6; border-radius: 4px; padding: 1px 5px; margin-left: 6px; text-transform: uppercase; vertical-align: middle; }
[data-theme="dark"] .badge-disabled { background: rgba(234,67,53,0.18); }
.badge-unmatriculated { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: #b45309; background: #fef3c7; border-radius: 4px; padding: 2px 7px; vertical-align: middle; white-space: nowrap; }
[data-theme="dark"] .badge-unmatriculated { background: rgba(251,191,36,0.15); color: #fbbf24; }

/* ─── Actividades: plazo vencido ─── */
.overdue-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; border-radius: 4px; padding: 2px 8px; white-space: nowrap; vertical-align: middle; margin-left: 8px; }
.overdue-chip.overdue-closed { color: #b91c1c; background: #fee2e2; }
.overdue-chip.overdue-open  { color: #166534; background: #dcfce7; }
[data-theme="dark"] .overdue-chip.overdue-closed { background: rgba(185,28,28,.2); color: #fca5a5; }
[data-theme="dark"] .overdue-chip.overdue-open  { background: rgba(22,101,52,.2); color: #86efac; }
.submitted-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
[data-theme="dark"] .submitted-chip { color: var(--text-hint); }
.person-disabled { opacity: .55; }
.badge-disabled { font-size: 10px; font-weight: 700; letter-spacing: .5px; color: #b91c1c; background: #fee2e2; border-radius: 4px; padding: 2px 7px; white-space: nowrap; }
[data-theme="dark"] .badge-disabled { background: rgba(185,28,28,.2); color: #fca5a5; }
.activity-row.is-overdue .activity-row-date { color: #b91c1c; }
[data-theme="dark"] .activity-row.is-overdue .activity-row-date { color: #fca5a5; }

.overdue-control-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm); margin: 12px 0; }
.overdue-control-bar.is-closed { background: #fef2f2; border: 1px solid #fecaca; }
.overdue-control-bar.is-open   { background: #f0fdf4; border: 1px solid #bbf7d0; }
[data-theme="dark"] .overdue-control-bar.is-closed { background: rgba(185,28,28,.12); border-color: rgba(185,28,28,.3); }
[data-theme="dark"] .overdue-control-bar.is-open   { background: rgba(22,101,52,.12);  border-color: rgba(22,101,52,.3); }
.overdue-control-left { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.overdue-control-left.closed { color: #b91c1c; }
.overdue-control-left.open   { color: #166534; }
[data-theme="dark"] .overdue-control-left.closed { color: #fca5a5; }
[data-theme="dark"] .overdue-control-left.open   { color: #86efac; }
.overdue-control-right { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-secondary); }

.deadline-warning { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #fef2f2; border: 1px solid #fecaca; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; color: #b91c1c; margin: 16px 0 0; }
.deadline-info    { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; color: #166534; margin: 16px 0 0; }
[data-theme="dark"] .deadline-warning { background: rgba(185,28,28,.12); border-color: rgba(185,28,28,.3); color: #fca5a5; }
[data-theme="dark"] .deadline-info    { background: rgba(22,101,52,.12);  border-color: rgba(22,101,52,.3); color: #86efac; }
[data-theme="dark"] .pagination { border-top-color: var(--border); }
[data-theme="dark"] .page-btn { background: var(--surface); border-color: var(--border); color: var(--text-secondary); }
[data-theme="dark"] .page-btn:hover { background: var(--primary-light); }
[data-theme="dark"] .users-table tr.selected td { background: var(--primary-light); }

/* ─── Role Badges ─── */
.role-badge { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 100px; font-size: 12px; font-weight: 600; text-transform: capitalize; }
.role-admin { background: #fce8e6; color: #c5221f; }
.role-directivo { background: #f3e8fd; color: #9334e6; }
.role-teacher { background: #e8f0fe; color: #1a73e8; }
.role-preceptor { background: #fef7e0; color: #ea8600; }
.role-soe { background: #e0f7fa; color: #0d7377; }
.role-student { background: #e6f4ea; color: #137333; }

/* ─── Profile ─── */
.profile-header { display: flex; align-items: center; gap: 32px; background: var(--surface); border-radius: var(--radius); padding: 40px; box-shadow: var(--shadow-sm); }
.profile-avatar { flex-shrink: 0; }
.profile-info h2 { font-size: 28px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.profile-email { font-size: 14px; color: var(--text-secondary); margin-bottom: 12px; }
.profile-date { font-size: 13px; color: var(--text-hint); margin-top: 12px; }
.profile-actions { margin-top: 24px; }
.profile-action-card { background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.profile-action-card h4 { font-size: 16px; font-weight: 500; color: var(--text); }
.user-role { font-size: 12px; }

/* ─── Impersonation Bar ─── */
.impersonation-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 44px; z-index: 150;
  background: #ea8600; color: white;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  font-size: 13px; font-weight: 500; padding: 0 20px;
}
.impersonation-bar .material-symbols-outlined { font-size: 18px !important; }
.impersonation-exit {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.2); padding: 5px 14px;
  border-radius: 100px; color: white; font-weight: 600;
  transition: var(--transition); margin-left: 8px;
}
.impersonation-exit:hover { background: rgba(255,255,255,0.35); }
.impersonation-exit .material-symbols-outlined { font-size: 16px !important; }

/* ─── Danger Button ─── */
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #c5221f; box-shadow: 0 2px 8px rgba(234,67,53,0.3); }

/* ─── Admin Nav ─── */
.admin-nav {
  display: flex; gap: 4px; margin-bottom: 28px;
  border-bottom: 2px solid var(--border); padding-bottom: 0;
}
.admin-nav-item {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; font-size: 14px; font-weight: 500;
  color: var(--text-secondary); border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: var(--transition); border-radius: var(--radius-xs) var(--radius-xs) 0 0;
}
.admin-nav-item:hover { color: var(--text); background: rgba(0,0,0,0.03); }
.admin-nav-item.active { color: var(--primary); border-bottom-color: var(--primary); }
.admin-nav-item .material-symbols-outlined { font-size: 20px; }

/* ─── Admin Section Cards ─── */
.admin-section-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 32px; }
.admin-section-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border-radius: var(--radius);
  padding: 20px 24px; box-shadow: var(--shadow-sm);
  transition: var(--transition); border: 1px solid transparent;
}
.admin-section-card:hover { box-shadow: var(--shadow-md); border-color: var(--border); transform: translateY(-1px); }
.admin-section-card-icon {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.admin-section-card-icon .material-symbols-outlined { font-size: 26px !important; }
.admin-section-card-info h3 { font-size: 16px; font-weight: 500; color: var(--text); }
.admin-section-card-info p { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.admin-section-card-arrow { margin-left: auto; font-size: 22px !important; color: var(--text-hint); }

/* ─── Subjects Grid ─── */
.subjects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.subject-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.subject-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.subject-card-banner {
  height: 100px; display: flex; align-items: center; justify-content: center;
}
.subject-card-banner .material-symbols-outlined { font-size: 44px !important; color: rgba(255,255,255,0.9); }
.subject-card-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.subject-card-name { font-size: 17px; font-weight: 500; color: var(--text); }
.subject-card-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.subject-card-meta { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-hint); margin-top: 4px; }
.subject-card-meta .material-symbols-outlined { font-size: 16px !important; }

/* ─── Subject Profile ─── */
.subject-profile-header {
  display: flex; align-items: center; gap: 24px;
  background: var(--surface); border-radius: var(--radius);
  padding: 32px 36px; box-shadow: var(--shadow-sm); flex-wrap: wrap;
}
.subject-profile-icon {
  width: 72px; height: 72px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.subject-profile-icon .material-symbols-outlined { font-size: 36px !important; color: white; }
.subject-profile-info { flex: 1; min-width: 0; }
.subject-profile-info h2 { font-size: 26px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.subject-profile-desc { font-size: 14px; color: var(--text-secondary); }
.subject-profile-date { font-size: 13px; color: var(--text-hint); margin-top: 8px; }
.subject-profile-actions { display: flex; gap: 12px; flex-shrink: 0; }

/* ─── Upload Zone ─── */
.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 64px 40px; text-align: center; cursor: pointer; background: var(--surface);
  transition: var(--transition); display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary); background: var(--primary-light);
}
.upload-zone .material-symbols-outlined { font-size: 56px !important; color: var(--text-hint); }
.upload-zone h3 { font-size: 20px; font-weight: 500; color: var(--text); }
.upload-zone p { font-size: 14px; color: var(--text-secondary); }

/* ─── Import File Info ─── */
.import-file-info {
  display: flex; align-items: center; gap: 10px; background: var(--primary-light);
  border: 1px solid var(--primary); border-radius: var(--radius-sm);
  padding: 12px 18px; font-size: 14px; color: var(--primary); margin-bottom: 20px;
}
.import-file-info .material-symbols-outlined { font-size: 20px !important; }

/* ─── Import Card ─── */
.import-card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  margin-bottom: 16px; overflow: hidden; border: 2px solid transparent; transition: border-color 0.2s;
}
.import-card.active { border-color: var(--primary); }
.import-card-header {
  display: flex; align-items: center; gap: 16px; padding: 20px 24px; cursor: pointer;
}
.import-card-header input[type="checkbox"] { width: 20px; height: 20px; cursor: pointer; flex-shrink: 0; accent-color: var(--primary); }
.import-card-header .material-symbols-outlined:not(:last-child) { font-size: 28px !important; flex-shrink: 0; }
.import-card-header h3 { font-size: 16px; font-weight: 500; color: var(--text); margin-bottom: 2px; }
.import-card-header p { font-size: 13px; color: var(--text-secondary); }
.import-card-body { border-top: 1px solid var(--border); padding: 20px 24px; }

/* ─── Import Results ─── */
.import-results-banner {
  display: flex; align-items: center; gap: 12px; background: #e6f4ea;
  border: 1px solid #34a853; border-radius: var(--radius-sm); padding: 16px 20px;
  font-size: 15px; color: #137333; margin-bottom: 20px; font-weight: 500;
}
.import-results-banner .material-symbols-outlined { font-size: 24px !important; color: #34a853; }
.import-results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.import-result-card {
  background: var(--surface); border-radius: var(--radius); padding: 20px 24px;
  box-shadow: var(--shadow-sm); text-align: center; border-top: 4px solid var(--stat-color);
}
.import-result-number { font-size: 40px; font-weight: 700; color: var(--text); line-height: 1.1; }
.import-result-label { font-size: 14px; font-weight: 500; color: var(--text-secondary); margin-top: 6px; }
.import-result-detail { font-size: 12px; color: var(--text-hint); margin-top: 4px; }

/* ─── Color Picker ─── */
.color-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.color-option {
  width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent;
  cursor: pointer; transition: var(--transition); position: relative;
}
.color-option:hover { transform: scale(1.15); }
.color-option.selected { border-color: var(--text); box-shadow: 0 0 0 2px white inset; }
.color-option.selected::after {
  content: '✓'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 16px; font-weight: 700;
}

/* ─── Avatar imagen ─── */
.avatar-img { overflow: hidden; padding: 0 !important; }
.avatar-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.avatar-huge.avatar-img { border-radius: 50%; }

/* ─── Profile: avatar upload ─── */
.profile-avatar-wrap { position: relative; display: inline-block; }
.avatar-upload-btn {
  position: absolute; bottom: 0; right: 0;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: var(--shadow-sm); transition: var(--transition);
}
.avatar-upload-btn:hover { background: var(--primary-dark); transform: scale(1.1); }
.avatar-upload-btn .material-symbols-outlined { font-size: 16px !important; }
.avatar-remove-btn {
  display: block; margin-top: 8px; font-size: 12px;
  color: var(--danger); background: none; border: none;
  cursor: pointer; text-decoration: underline; text-align: center;
}
.avatar-remove-btn:hover { opacity: 0.8; }

/* ─── Pending band (dashboard) ─── */
.pending-band {
  display: flex; align-items: center; gap: 10px;
  background: #fff8e1; border: 1px solid #f9ab00;
  border-radius: var(--radius-sm); padding: 12px 18px;
  margin-bottom: 20px; font-size: 14px; color: #5f4c00;
}
[data-theme="dark"] .pending-band { background: #2a2200; border-color: #7a5c00; color: #f9d97d; }
.pending-band .material-symbols-outlined { font-size: 20px !important; color: #f9ab00; flex-shrink: 0; }
.pending-band-urgent { color: var(--danger); }
.pending-band-link {
  margin-left: auto; font-size: 13px; font-weight: 500;
  color: var(--primary); text-decoration: none; flex-shrink: 0;
}
.pending-band-link:hover { text-decoration: underline; }

/* ─── Submitted chip (docente: X/Y entregaron) ─── */
.submitted-chip {
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--primary-light); color: var(--primary);
  font-size: 12px; font-weight: 500; padding: 3px 8px;
  border-radius: 12px; white-space: nowrap;
}

/* ─── Person disabled ─── */
.person-disabled { opacity: 0.65; }
.badge-disabled {
  font-size: 10px; font-weight: 700; letter-spacing: .5px;
  background: #fce8e6; color: var(--danger); padding: 2px 8px;
  border-radius: 4px; text-transform: uppercase;
}

/* ─── Activity search wrap ─── */
.act-search-wrap { padding: 12px 0 4px; max-width: 400px; }

/* ─── Pending activities page ─── */
.pending-list { display: flex; flex-direction: column; gap: 0; }
.pending-item {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  text-decoration: none; color: inherit; transition: background .15s;
}
.pending-item:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.pending-item:last-child { border-bottom: none; border-radius: 0 0 var(--radius) var(--radius); }
.pending-item:only-child { border-radius: var(--radius); }
.pending-list { border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.pending-item:hover { background: var(--bg); }
.pending-item-overdue { border-left: 3px solid var(--danger); }
.pending-item-today { border-left: 3px solid var(--warning); }
.pending-item-icon {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.pending-item-overdue .pending-item-icon { background: #fce8e6; color: var(--danger); }
.pending-item-today .pending-item-icon { background: #fff8e1; color: var(--warning); }
.pending-item-icon .material-symbols-outlined { font-size: 20px !important; }
.pending-item-body { flex: 1; min-width: 0; }
.pending-item-course { font-size: 12px; color: var(--text-hint); margin-bottom: 2px; }
.pending-item-title { font-size: 15px; font-weight: 500; color: var(--text); }
.pending-item-desc { font-size: 13px; color: var(--text-secondary); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pending-item-right { text-align: right; flex-shrink: 0; }
.pending-due-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 10px; margin-bottom: 4px;
}
.due-today { background: #fff8e1; color: #5f4c00; }
.due-overdue { background: #fce8e6; color: var(--danger); }
.pending-due-date { font-size: 13px; color: var(--text-secondary); }

/* ─── Activity stats / histogram ─── */
.act-stats { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.act-stats-summary {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px;
}
.stat-pill {
  display: flex; flex-direction: column; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 18px; min-width: 80px;
}
[data-theme="dark"] .stat-pill { background: #25282c; }
.stat-pill-val { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.1; }
.stat-pill-lbl { font-size: 11px; color: var(--text-hint); margin-top: 4px; text-transform: uppercase; letter-spacing: .4px; }
.act-histogram {
  display: flex; align-items: flex-end; gap: 12px; height: 100px;
}
.hist-bar-wrap { display: flex; flex-direction: column; align-items: center; flex: 1; }
.hist-bar-container { width: 100%; flex: 1; display: flex; align-items: flex-end; padding-bottom: 2px; }
.hist-bar {
  width: 100%; min-height: 4px;
  background: var(--primary); border-radius: 4px 4px 0 0;
  transition: height .3s ease;
}
.hist-bar-count { font-size: 12px; font-weight: 600; color: var(--text); margin-top: 4px; }
.hist-bar-label { font-size: 11px; color: var(--text-hint); margin-top: 2px; }

/* ─── Attachment Preview Overlay (pantalla completa) ─── */
.att-preview-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,0.96);
  display: flex; flex-direction: column;
  animation: fadeIn .12s ease;
}
.att-preview-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; gap: 12px; flex-shrink: 0;
  background: rgba(0,0,0,0.55);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  backdrop-filter: blur(4px);
}
.att-preview-fname {
  font-size: 14px; font-weight: 500; color: rgba(255,255,255,0.9);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; min-width: 0;
}
.att-preview-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.25); color: rgba(255,255,255,0.85);
  text-decoration: none; font-size: 13px; background: transparent;
  cursor: pointer; white-space: nowrap; transition: background .15s;
}
.att-preview-btn:hover { background: rgba(255,255,255,0.1); color: white; }
.att-preview-btn .material-symbols-outlined { font-size: 16px !important; }
.att-preview-close {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.08); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.7); flex-shrink: 0; transition: background .15s;
}
.att-preview-close:hover { background: rgba(255,255,255,0.18); color: white; }
.att-preview-close .material-symbols-outlined { font-size: 20px !important; }
.att-preview-body { flex: 1; overflow: hidden; display: flex; }
.att-preview-frame { width: 100%; height: 100%; border: none; display: block; background: white; }

/* ─── Attachment preview: loading + no-support states ─── */
.att-preview-body { position: relative; }
.att-preview-loading {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; color: rgba(255,255,255,0.55); font-size: 14px;
  background: rgba(0,0,0,0.85);
  pointer-events: none;
}
.att-preview-spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: rgba(255,255,255,0.75);
  animation: att-spin .75s linear infinite;
}
@keyframes att-spin { to { transform: rotate(360deg); } }
.att-preview-no-support {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; color: rgba(255,255,255,0.55); text-align: center;
  padding: 40px; width: 100%; height: 100%;
}
.att-preview-no-support .material-symbols-outlined { font-size: 52px !important; color: rgba(255,255,255,0.2); }
.att-preview-no-support p { font-size: 15px; font-weight: 500; color: rgba(255,255,255,0.65); }
.att-preview-no-support-sub {
  font-size: 13px; color: rgba(255,255,255,0.35); max-width: 380px; line-height: 1.5;
}

/* ─── Teacher activity detail modal (wide) ─── */
.modal.modal-detail {
  max-width: min(1100px, 95vw);
  width: 95vw;
  display: flex;
  flex-direction: column;
  max-height: 92vh;
  overflow: hidden;
}
.modal.modal-detail .modal-header { flex-shrink: 0; }
.modal.modal-detail .modal-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 24px;
}

/* ─── Grade table ─── */
.grade-table-wrap { overflow-x: auto; margin-top: 12px; }
.grade-table {
  width: 100%; border-collapse: collapse; table-layout: fixed;
  font-size: 13px;
}
.grade-table thead th {
  text-align: left; padding: 8px 10px;
  border-bottom: 2px solid var(--border);
  color: var(--text-secondary); font-weight: 600;
  white-space: nowrap; position: sticky; top: 0;
  background: var(--surface); z-index: 1;
}
.grade-table tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.grade-table tbody tr:last-child td { border-bottom: none; }
.grade-table tbody tr:hover td { background: var(--hover-bg); }

.gt-col-student  { width: 26%; }
.gt-col-grade    { width: 10%; }
.gt-col-feedback { width: 34%; }
.gt-col-sub      { width: 30%; }

/* Student cell */
.gt-student-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.gt-student-name {
  font-weight: 500; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gt-student-email {
  font-size: 11.5px; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 1px;
}

/* Grade cell */
.gt-grade-wrap { display: flex; align-items: center; gap: 4px; }
.gt-pts-max { font-size: 11px; color: var(--text-secondary); }
.grade-table .grade-input {
  width: 64px; text-align: center;
  padding: 4px 6px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-primary); font-size: 14px;
}
.grade-table .grade-input:focus { outline: none; border-color: var(--primary); }

/* Feedback cell */
.grade-table .feedback-input {
  width: 100%; resize: vertical;
  padding: 6px 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-primary); font-size: 12.5px;
  font-family: inherit; line-height: 1.45;
}
.grade-table .feedback-input:focus { outline: none; border-color: var(--primary); }

/* Submission cell */
.gt-sub-delivered { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gt-sub-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 600; border-radius: 20px;
  padding: 2px 9px; width: fit-content;
}
.gt-sub-badge .material-symbols-outlined { font-size: 13px !important; }
.gt-sub-ok   { background: #e6f4ea; color: #1e7e34; }
.gt-sub-pending { background: #fef3cd; color: #856404; }
.gt-sub-date {
  font-size: 11px; color: var(--text-secondary);
  display: flex; align-items: center; gap: 2px;
}
.gt-sub-text {
  font-size: 11.5px; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 220px;
}
.gt-sub-file {
  display: flex; align-items: center; gap: 3px;
  font-size: 11px; color: var(--primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 220px; text-decoration: none;
}
.gt-sub-file:hover { text-decoration: underline; }
.gt-sub-file .material-symbols-outlined { font-size: 13px !important; flex-shrink: 0; }

/* Summary line above table */
.gt-summary {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-secondary);
  margin-top: 16px; flex-wrap: wrap;
}
.gt-summary-val { font-weight: 700; }
.gt-summary-sep { color: var(--border); }

/* Dark mode overrides */
@media (prefers-color-scheme: dark) {
  .gt-sub-ok      { background: #1a3a22; color: #6fcf7a; }
  .gt-sub-pending { background: #3a2e0a; color: #f5c842; }
  .grade-table thead th { background: var(--surface); }
}
