/* ═══════════════════════════════════════════════════════════
   Docente 2.0 — Design System
   CEB 5/4 "Profr. Rafael Ramírez"
   ═══════════════════════════════════════════════════════════ */

/* ── Variables ───────────────────────────────────────────── */
:root {
  --d2-sidebar-w:      240px;
  --d2-sidebar-bg:     #0f172a;
  --d2-sidebar-border: rgba(255,255,255,0.06);
  --d2-accent:         #6366f1;
  --d2-accent-light:   rgba(99,102,241,0.12);
  --d2-accent-hover:   #4f46e5;
  --d2-green:          #059669;
  --d2-green-light:    rgba(5,150,105,0.1);
  --d2-amber:          #d97706;
  --d2-surface:        #ffffff;
  --d2-bg:             #f1f5f9;
  --d2-border:         #e2e8f0;
  --d2-text:           #0f172a;
  --d2-text-muted:     #64748b;
  --d2-text-light:     #94a3b8;
  --d2-radius:         14px;
  --d2-radius-sm:      9px;
  --d2-shadow:         0 1px 3px rgba(0,0,0,0.07), 0 4px 16px rgba(0,0,0,0.04);
  --d2-shadow-md:      0 4px 20px rgba(0,0,0,0.10);
  --d2-transition:     0.18s ease;
  --d2-header-h:       58px;
  --d2-tab-h:          52px;
}

/* ── Reset base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--d2-bg);
  color: var(--d2-text);
  line-height: 1.5;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }

/* ════════════════════════════════════════════════════════════
   LOGIN OVERLAY
   ════════════════════════════════════════════════════════════ */
.d2-login-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 60%, #0f172a 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  transition: opacity 0.28s ease;
}
.d2-login-overlay.fade-out { opacity: 0; pointer-events: none; }
.d2-login-overlay.hidden { display: none !important; }

/* Decorative background circle */
.d2-login-overlay::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
  border-radius: 50%;
  top: -100px; right: -80px;
  pointer-events: none;
}

.d2-login-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  width: 100%; max-width: 400px;
  backdrop-filter: blur(20px);
  position: relative; z-index: 1;
}

.d2-login-brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 1.75rem;
}
.d2-login-brand-name {
  font-size: 0.9rem; font-weight: 800; color: #e0e7ff;
  letter-spacing: -0.01em;
}
.d2-login-brand-sub {
  font-size: 0.65rem; color: #475569; font-weight: 500;
}

.d2-login-title {
  color: #f8fafc; font-size: 1.4rem; font-weight: 800;
  letter-spacing: -0.02em; margin-bottom: 0.3rem;
}
.d2-login-sub {
  color: #64748b; font-size: 0.82rem; margin-bottom: 1.5rem;
  line-height: 1.4;
}

.d2-login-error {
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.25);
  color: #fca5a5;
  font-size: 0.8rem; font-weight: 500;
  padding: 0.65rem 0.85rem;
  border-radius: 9px;
  margin-bottom: 1rem;
  display: none;
}
.d2-login-error.show { display: block; }

.d2-login-form { display: flex; flex-direction: column; gap: 1rem; }

.d2-field label {
  display: block; font-size: 0.72rem; font-weight: 700;
  color: #64748b; margin-bottom: 0.4rem;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.d2-field-wrap { position: relative; }
.d2-field-wrap svg {
  position: absolute; left: 0.85rem; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: #475569; pointer-events: none;
}
.d2-field-wrap input {
  width: 100%;
  padding: 0.72rem 0.85rem 0.72rem 2.65rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #f8fafc;
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.d2-field-wrap input::placeholder { color: #334155; }
.d2-field-wrap input:focus {
  outline: none;
  border-color: var(--d2-accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.18);
}

.d2-login-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0.8rem 1rem;
  background: var(--d2-accent); color: #fff;
  border-radius: 11px; border: none;
  font-size: 0.9rem; font-weight: 700;
  cursor: pointer; margin-top: 0.25rem;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}
.d2-login-btn svg { width: 17px; height: 17px; }
.d2-login-btn:hover:not(:disabled) {
  background: var(--d2-accent-hover);
  box-shadow: 0 4px 16px rgba(99,102,241,0.35);
}
.d2-login-btn:active:not(:disabled) { transform: scale(0.98); }
.d2-login-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.d2-login-back {
  display: block; text-align: center; margin-top: 1.5rem;
  font-size: 0.78rem; color: #334155;
  text-decoration: none; transition: color 0.15s;
}
.d2-login-back:hover { color: #64748b; }

/* ════════════════════════════════════════════════════════════
   APP LAYOUT  (sidebar + main)
   ════════════════════════════════════════════════════════════ */

/* ── Sidebar ─────────────────────────────────────────────── */
.d2-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--d2-sidebar-w);
  background: var(--d2-sidebar-bg);
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform var(--d2-transition);
  border-right: 1px solid var(--d2-sidebar-border);
}

.d2-sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--d2-sidebar-border);
  flex-shrink: 0;
}
.d2-brand-logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--d2-accent), #818cf8);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.82rem; font-weight: 900; color: #fff;
  flex-shrink: 0; letter-spacing: -0.03em;
}
.d2-brand-info { min-width: 0; }
.d2-brand-name {
  font-size: 0.88rem; font-weight: 800; color: #f8fafc;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.d2-brand-sub {
  font-size: 0.65rem; font-weight: 600; color: #475569;
  text-transform: uppercase; letter-spacing: 0.06em;
}

.d2-sidebar-user {
  padding: 0.85rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--d2-sidebar-border);
  flex-shrink: 0;
}
.d2-sidebar-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #059669, #34d399);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 900; color: #fff;
  flex-shrink: 0;
}
.d2-sidebar-user-row {
  display: flex; align-items: center; gap: 9px;
}
.d2-sidebar-uname {
  font-size: 0.78rem; font-weight: 700; color: #e2e8f0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.d2-sidebar-urole {
  font-size: 0.65rem; color: #475569; font-weight: 500;
}

.d2-nav {
  flex: 1; overflow-y: auto; padding: 0.85rem 0.75rem;
  display: flex; flex-direction: column; gap: 2px;
}
.d2-nav::-webkit-scrollbar { width: 3px; }
.d2-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }

.d2-nav-label {
  font-size: 0.6rem; font-weight: 800; color: #475569;
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 0.6rem 0.6rem 0.3rem;
}

.d2-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 0.62rem 0.75rem; border-radius: 10px;
  color: #64748b; font-size: 0.82rem; font-weight: 500;
  cursor: pointer;
  transition: background var(--d2-transition), color var(--d2-transition);
  user-select: none;
  border: none; width: 100%; text-align: left;
}
.d2-nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7; transition: opacity var(--d2-transition); }
.d2-nav-item:hover { background: rgba(255,255,255,0.05); color: #e2e8f0; }
.d2-nav-item:hover svg { opacity: 1; }
.d2-nav-item.active {
  background: var(--d2-accent-light);
  color: #a5b4fc;
  font-weight: 700;
  border: 1px solid rgba(99,102,241,0.18);
}
.d2-nav-item.active svg { opacity: 1; }

.d2-nav-sep {
  height: 1px;
  background: var(--d2-sidebar-border);
  margin: 0.5rem 0.75rem;
}

.d2-sidebar-bottom {
  flex-shrink: 0; padding: 0.75rem;
  border-top: 1px solid var(--d2-sidebar-border);
}
.d2-btn-logout {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 0.55rem 0.75rem; border-radius: 9px;
  color: #f87171; font-size: 0.8rem; font-weight: 600;
  transition: background var(--d2-transition);
}
.d2-btn-logout svg { width: 15px; height: 15px; }
.d2-btn-logout:hover { background: rgba(248,113,113,0.1); }

/* ── Sidebar collapse toggle ─────────────────────────────── */
.d2-btn-collapse {
  margin-left: auto; flex-shrink: 0;
  width: 28px; height: 28px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: #475569;
  transition: background var(--d2-transition), color var(--d2-transition), transform var(--d2-transition);
}
.d2-btn-collapse svg { width: 16px; height: 16px; }
.d2-btn-collapse:hover { background: rgba(255,255,255,0.08); color: #e2e8f0; }

/* Collapsed state */
.d2-sidebar.collapsed {
  width: 56px;
}
.d2-sidebar.collapsed .d2-brand-info,
.d2-sidebar.collapsed .d2-sidebar-user,
.d2-sidebar.collapsed .d2-nav-label,
.d2-sidebar.collapsed .d2-nav-item span,
.d2-sidebar.collapsed .d2-btn-logout span,
.d2-sidebar.collapsed #d2-nav-materias { display: none; }
.d2-sidebar.collapsed .d2-nav-item { justify-content: center; padding: 0.62rem; }
.d2-sidebar.collapsed .d2-nav-item svg { width: 20px; height: 20px; opacity: 0.75; }
.d2-sidebar.collapsed .d2-btn-logout { justify-content: center; padding: 0.55rem; }
.d2-sidebar.collapsed .d2-btn-logout svg { width: 18px; height: 18px; }
.d2-sidebar.collapsed .d2-btn-collapse { transform: rotate(180deg); }
.d2-sidebar.collapsed .d2-sidebar-brand { justify-content: center; padding: 1rem 0.75rem; }
.d2-main.sidebar-collapsed { margin-left: 56px; }

/* ── Sub-navegación Captura ──────────────────────────────── */
.d2-subnav {
  display: flex; gap: 6px;
  padding: 6px 1rem 0;
  background: var(--d2-surface);
  border-bottom: 1px solid var(--d2-border);
}
.d2-subnav-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 8px 8px 0 0;
  font-size: 0.78rem; font-weight: 600;
  color: var(--d2-text-muted);
  border: 1px solid transparent; border-bottom: none;
  transition: background var(--d2-transition), color var(--d2-transition);
  background: transparent;
}
.d2-subnav-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.d2-subnav-btn:hover { background: var(--d2-bg); color: var(--d2-text); }
.d2-subnav-btn.active {
  background: var(--d2-bg);
  color: var(--d2-accent);
  border-color: var(--d2-border);
  font-weight: 700;
}

/* ── Main area ───────────────────────────────────────────── */
.d2-main {
  margin-left: var(--d2-sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
  transition: margin-left var(--d2-transition);
}

.d2-topbar {
  height: var(--d2-header-h);
  background: var(--d2-surface);
  border-bottom: 1px solid var(--d2-border);
  display: flex; align-items: center; gap: 1rem;
  padding: 0 1.5rem;
  position: sticky; top: 0; z-index: 50;
  flex-shrink: 0;
}
.d2-btn-hamburger {
  display: none; flex-direction: column; gap: 4px;
  width: 32px; height: 32px; align-items: center; justify-content: center;
  border-radius: 8px; flex-shrink: 0;
  transition: background var(--d2-transition);
}
.d2-btn-hamburger span {
  display: block; width: 18px; height: 2px;
  background: var(--d2-text-muted); border-radius: 2px;
}
.d2-btn-hamburger:hover { background: var(--d2-bg); }
.d2-topbar-title { flex: 1; }
.d2-topbar-title h1 {
  font-size: 0.97rem; font-weight: 800; color: var(--d2-text);
  letter-spacing: -0.01em;
}
.d2-topbar-title p {
  font-size: 0.72rem; color: var(--d2-text-muted); margin-top: 1px;
}
.d2-topbar-right {
  display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0;
}
.d2-topbar-badge {
  font-size: 0.65rem; font-weight: 800;
  background: var(--d2-accent-light); color: #a5b4fc;
  padding: 3px 10px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: 0.06em;
  border: 1px solid rgba(99,102,241,0.15);
}

.d2-content {
  flex: 1; padding: 1.5rem;
  display: flex; flex-direction: column; gap: 1.25rem;
}

/* Module panels */
.d2-module { display: none; flex-direction: column; gap: 1rem; }
.d2-module.active { display: flex; animation: d2-fadein 0.2s ease; }
@keyframes d2-fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ════════════════════════════════════════════════════════════
   PAGE HEADER
   ════════════════════════════════════════════════════════════ */
.d2-page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.d2-page-header h2 {
  font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em;
  color: var(--d2-text);
}
.d2-page-header p {
  font-size: 0.8rem; color: var(--d2-text-muted); margin-top: 3px;
}

/* ════════════════════════════════════════════════════════════
   CARDS
   ════════════════════════════════════════════════════════════ */
.d2-card {
  background: var(--d2-surface);
  border: 1px solid var(--d2-border);
  border-radius: var(--d2-radius);
  box-shadow: var(--d2-shadow);
  overflow: hidden;
}
.d2-card-header {
  display: flex; align-items: center; gap: 10px;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--d2-border);
}
.d2-card-icon {
  width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.d2-card-icon svg { width: 17px; height: 17px; }
.d2-card-icon.indigo { background: var(--d2-accent-light); color: var(--d2-accent); }
.d2-card-icon.green  { background: var(--d2-green-light); color: var(--d2-green); }
.d2-card-icon.amber  { background: rgba(217,119,6,0.1); color: var(--d2-amber); }
.d2-card-icon.blue   { background: #eff6ff; color: #2563eb; }
.d2-card-title {
  font-size: 0.9rem; font-weight: 700; color: var(--d2-text);
  flex: 1;
}
.d2-card-body { padding: 1.25rem; }

/* ── Calendario — toggle de vista ───────────────────────── */
.d2-cal-toggle {
  display: flex; gap: 3px;
  background: var(--d2-bg); border-radius: 9px; padding: 3px;
  border: 1px solid var(--d2-border);
}
.d2-cal-tbtn {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 7px;
  font-size: 0.72rem; font-weight: 600;
  color: var(--d2-text-muted);
  transition: background var(--d2-transition), color var(--d2-transition), box-shadow var(--d2-transition);
  white-space: nowrap;
}
.d2-cal-tbtn svg { width: 13px; height: 13px; flex-shrink: 0; }
.d2-cal-tbtn:hover { color: var(--d2-text); background: var(--d2-surface); }
.d2-cal-tbtn.active {
  background: var(--d2-surface); color: var(--d2-accent);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  font-weight: 700;
}

/* ════════════════════════════════════════════════════════════
   STATS GRID
   ════════════════════════════════════════════════════════════ */
.d2-stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
}
@media (max-width: 1100px) { .d2-stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .d2-stats-grid { grid-template-columns: 1fr 1fr; } }

.d2-stat {
  background: var(--d2-surface);
  border: 1px solid var(--d2-border);
  border-radius: var(--d2-radius);
  box-shadow: var(--d2-shadow);
  padding: 1.1rem 1.25rem;
  display: flex; align-items: center; gap: 0.9rem;
}
.d2-stat-icon {
  width: 42px; height: 42px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.d2-stat-icon svg { width: 20px; height: 20px; }
.d2-stat-val  { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.d2-stat-lbl  { font-size: 0.72rem; color: var(--d2-text-muted); margin-top: 3px; font-weight: 500; }

/* ════════════════════════════════════════════════════════════
   TAB BAR  (inside modules)
   ════════════════════════════════════════════════════════════ */
.d2-tabs-wrap {
  background: var(--d2-surface);
  border: 1px solid var(--d2-border);
  border-radius: var(--d2-radius);
  box-shadow: var(--d2-shadow);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: sticky; top: var(--d2-header-h); z-index: 40;
}
.d2-tabs-wrap::-webkit-scrollbar { display: none; }
.d2-tabs { display: flex; padding: 0.3rem; gap: 0.1rem; min-width: max-content; }
.d2-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0.5rem 0.9rem; border-radius: 9px;
  font-size: 0.8rem; font-weight: 600; color: var(--d2-text-muted);
  white-space: nowrap; cursor: pointer;
  transition: background var(--d2-transition), color var(--d2-transition);
  border: none;
}
.d2-tab svg { width: 14px; height: 14px; flex-shrink: 0; }
.d2-tab:hover { background: var(--d2-accent-light); color: var(--d2-accent); }
.d2-tab.active {
  background: var(--d2-accent); color: #fff;
  box-shadow: 0 2px 8px rgba(99,102,241,0.30);
}
.d2-tab.active:hover { background: var(--d2-accent-hover); }

/* ════════════════════════════════════════════════════════════
   IFRAME WRAPPER  (un iframe por módulo, chrome oculto)
   ════════════════════════════════════════════════════════════ */
.d2-iframe-wrap {
  background: var(--d2-surface);
  border: 1px solid var(--d2-border);
  border-radius: var(--d2-radius);
  overflow: hidden;
  box-shadow: var(--d2-shadow);
  position: relative;
  min-height: 600px;
}
.d2-iframe-wrap iframe {
  width: 100%; display: block; border: none;
  height: calc(100vh - var(--d2-header-h) - var(--d2-tab-h) - 4rem);
  min-height: 560px;
}
/* Loading state before iframe is ready */
.d2-iframe-loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--d2-surface);
  color: var(--d2-text-muted); font-size: 0.82rem; font-weight: 500;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.d2-iframe-loading.hidden { opacity: 0; pointer-events: none; }
@keyframes d2-spin { to { transform: rotate(360deg); } }
.d2-spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--d2-border);
  border-top-color: var(--d2-accent);
  animation: d2-spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════
   INFORMACIÓN GENERAL
   ════════════════════════════════════════════════════════════ */
.d2-profile-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #1e1b4b 100%);
  border-radius: var(--d2-radius);
  padding: 2rem 1.75rem;
  display: flex; align-items: center; gap: 1.5rem;
  box-shadow: var(--d2-shadow-md);
  flex-wrap: wrap;
}
.d2-profile-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--d2-accent), #818cf8);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 900; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(99,102,241,0.4);
  border: 3px solid rgba(255,255,255,0.15);
}
.d2-profile-name {
  font-size: 1.2rem; font-weight: 800; color: #f8fafc;
  letter-spacing: -0.02em;
}
.d2-profile-role { font-size: 0.75rem; color: #64748b; margin-top: 3px; }
.d2-profile-chips {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 0.6rem;
}
.d2-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.68rem; font-weight: 700;
  padding: 3px 10px; border-radius: 20px; border: 1px solid;
}
.d2-chip.indigo { background: rgba(99,102,241,0.15); color: #a5b4fc; border-color: rgba(99,102,241,0.25); }
.d2-chip.green  { background: rgba(5,150,105,0.15); color: #34d399; border-color: rgba(5,150,105,0.25); }
.d2-chip.slate  { background: rgba(148,163,184,0.1); color: #94a3b8; border-color: rgba(148,163,184,0.2); }

.d2-info-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0;
}
.d2-info-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 0.85rem 0; border-bottom: 1px solid var(--d2-border);
}
.d2-info-row:last-child { border-bottom: none; padding-bottom: 0; }
.d2-info-ico {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--d2-bg); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--d2-text-muted);
}
.d2-info-ico svg { width: 14px; height: 14px; }
.d2-info-lbl { font-size: 0.68rem; color: var(--d2-text-light); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.d2-info-val { font-size: 0.88rem; font-weight: 700; color: var(--d2-text); margin-top: 1px; }

.d2-quicklinks {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.75rem;
}
.d2-quicklink {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 1rem 0.75rem; border-radius: var(--d2-radius-sm);
  border: 1px solid var(--d2-border); background: var(--d2-bg);
  font-size: 0.75rem; font-weight: 600; color: var(--d2-text-muted);
  text-align: center; cursor: pointer;
  transition: all var(--d2-transition);
}
.d2-quicklink:hover {
  background: var(--d2-accent-light); color: var(--d2-accent);
  border-color: rgba(99,102,241,0.25);
  transform: translateY(-1px); box-shadow: var(--d2-shadow);
}
.d2-quicklink-icon {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--d2-surface); display: flex; align-items: center; justify-content: center;
  box-shadow: var(--d2-shadow);
}
.d2-quicklink-icon svg { width: 18px; height: 18px; }

/* ════════════════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════════════════ */
.d2-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0.52rem 1.1rem; border-radius: 9px;
  font-size: 0.82rem; font-weight: 600;
  transition: all var(--d2-transition);
  border: 1px solid transparent;
}
.d2-btn svg { width: 15px; height: 15px; }
.d2-btn-primary { background: var(--d2-accent); color: #fff; }
.d2-btn-primary:hover { background: var(--d2-accent-hover); box-shadow: 0 2px 8px rgba(99,102,241,0.3); }
.d2-btn-secondary { background: var(--d2-surface); color: var(--d2-text); border-color: var(--d2-border); }
.d2-btn-secondary:hover { background: var(--d2-bg); }

/* ════════════════════════════════════════════════════════════
   MOBILE SIDEBAR OVERLAY
   ════════════════════════════════════════════════════════════ */
.d2-sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 99;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(2px);
}
.d2-sidebar-overlay.active { display: block; }

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════ */
@media (max-width: 860px) {
  .d2-sidebar { transform: translateX(-100%); }
  .d2-sidebar.open { transform: translateX(0); box-shadow: 4px 0 32px rgba(0,0,0,0.25); }
  .d2-main { margin-left: 0; }
  .d2-btn-hamburger { display: flex; }
  .d2-content { padding: 1rem; }
}
@media (max-width: 520px) {
  .d2-login-card { padding: 2rem 1.25rem; }
  .d2-stats-grid { grid-template-columns: 1fr 1fr; }
  .d2-content { padding: 0.75rem; }
  .d2-iframe-wrap iframe { min-height: 480px; }
}

/* ════════════════════════════════════════════════════════════
   PRINT  (reportes de tutorías)
   ════════════════════════════════════════════════════════════ */
@media print {
  .d2-sidebar, .d2-topbar, .d2-tabs-wrap, .d2-login-overlay { display: none !important; }
  .d2-main { margin-left: 0 !important; }
  .d2-content { padding: 0 !important; }
}

/* ═══════════════════════════════════════════════════════════
   WIDGET SEMANA ESCOLAR (igual que acceso.html)
   ═══════════════════════════════════════════════════════════ */
.semana-actual {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  border-radius: 1.25rem;
  padding: 1.5rem 1.75rem;
  position: relative; overflow: hidden;
}
.semana-actual::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 90% 50%, rgba(56,132,192,0.15) 0%, transparent 60%);
  pointer-events: none;
}
.semana-actual-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 0.75rem;
  margin-bottom: 1.1rem; position: relative;
}
.semana-actual-badge {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: rgba(56,132,192,0.2);
  border: 1px solid rgba(56,132,192,0.4);
  color: #93c5fd;
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  padding: 0.3rem 0.875rem; border-radius: 9999px;
  white-space: nowrap; align-self: flex-start;
}
.dot-live {
  width: 6px; height: 6px;
  background: #4ade80; border-radius: 50%;
  animation: d2-dot-pulse 2s infinite; flex-shrink: 0;
}
@keyframes d2-dot-pulse {
  0%, 100% { opacity:1; transform:scale(1); }
  50%       { opacity:.5; transform:scale(1.4); }
}
.semana-actual-num {
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 1.3rem; font-weight: 800; color: #fff;
}
.semana-actual-rango { font-size: 0.78rem; color: rgba(255,255,255,0.45); margin-top: 0.15rem; }
.semana-actual-parcial {
  display: inline-block; margin-top: 0.3rem;
  font-size: 0.7rem; font-weight: 700;
  color: #fbbf24;
  background: rgba(251,191,36,0.12);
  border: 1px solid rgba(251,191,36,0.3);
  padding: 0.15rem 0.6rem; border-radius: 9999px;
}
.semana-actual-items { display: flex; flex-direction: column; gap: 0.45rem; position: relative; }
.semana-item {
  display: flex; align-items: center; gap: 0.65rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 0.6rem;
  padding: 0.55rem 0.8rem;
  font-size: 0.84rem;
}
.semana-item-icon { font-size: 0.95rem; flex-shrink: 0; line-height: 1; }
.semana-item-text { color: rgba(255,255,255,0.85); flex: 1; min-width: 0; }
.semana-item-cat {
  font-size: 0.64rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.4px;
  padding: 0.15rem 0.5rem; border-radius: 9999px; flex-shrink: 0;
}
.cat-evaluacion  { background: rgba(99,102,241,0.25);  color: #a5b4fc; }
.cat-reunion     { background: rgba(234,179,8,0.25);   color: #fde047; }
.cat-restriccion { background: rgba(239,68,68,0.25);   color: #fca5a5; }
.cat-control     { background: rgba(20,184,166,0.25);  color: #5eead4; }
.cat-academico   { background: rgba(56,132,192,0.25);  color: #93c5fd; }
.cat-festivo     { background: rgba(249,115,22,0.25);  color: #fdba74; }
.cat-vacaciones  { background: rgba(16,185,129,0.25);  color: #6ee7b7; }
.cat-cumple      { background: rgba(236,72,153,0.25);  color: #f9a8d4; }
.semana-vacia-msg {
  color: rgba(255,255,255,0.4); font-size: 0.84rem;
  font-style: italic; padding: 0.2rem 0;
}
.semana-cumples-box {
  margin-top: 0.6rem;
  padding: 0.55rem 0.9rem;
  background: rgba(236,72,153,0.08);
  border: 1px solid rgba(236,72,153,0.2);
  border-radius: 0.75rem;
  display: flex; align-items: center; gap: 0.6rem;
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
}
.semana-cumples-box b { color: #f9a8d4; font-weight: 700; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; }
.cumple-nombres { color: rgba(255,255,255,0.9); font-weight: 500; }
