/* ==========================================================================
   Estudio Jimenil · sistema de diseño
   ========================================================================== */

:root {
  --font-ui: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;

  --bg: #f6f2ff;
  --bg-warm: #fff7f2;
  --surface: rgba(255, 255, 255, .82);
  --surface-strong: #ffffff;
  --surface-soft: #f2edff;
  --text: #241f38;
  --muted: #726b8a;
  --line: rgba(57, 43, 110, .12);

  --brand: #7451ff;
  --brand-2: #f06a9a;
  --brand-3: #16b8a6;
  --brand-soft: rgba(116, 81, 255, .13);
  --pink-soft: rgba(240, 106, 154, .14);
  --teal-soft: rgba(22, 184, 166, .13);
  --danger: #d84a63;
  --danger-soft: rgba(216, 74, 99, .12);

  --radius-lg: 26px;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 50px -30px rgba(52, 31, 120, .55);
  --shadow-soft: 0 12px 30px -22px rgba(52, 31, 120, .45);
  --ring: rgba(116, 81, 255, .28);

  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--line);
  --bs-secondary-color: var(--muted);
  --bs-tertiary-bg: var(--surface-soft);
  --bs-secondary-bg: #eae3ff;
  --bs-link-color: var(--brand);
  --bs-link-hover-color: #5c3be0;
}

[data-bs-theme="dark"] {
  --bg: #120f1e;
  --bg-warm: #1a1322;
  --surface: rgba(31, 26, 48, .82);
  --surface-strong: #211b35;
  --surface-soft: #2a2244;
  --text: #f3efff;
  --muted: #aaa2c6;
  --line: rgba(255, 255, 255, .09);
  --brand: #9b82ff;
  --brand-2: #ff8fb3;
  --brand-3: #35d0bd;
  --brand-soft: rgba(155, 130, 255, .16);
  --pink-soft: rgba(255, 143, 179, .13);
  --teal-soft: rgba(53, 208, 189, .12);
  --danger: #ff7d92;
  --danger-soft: rgba(255, 125, 146, .13);
  --shadow: 0 28px 55px -30px rgba(0, 0, 0, .8);
  --shadow-soft: 0 14px 32px -22px rgba(0, 0, 0, .7);
  --ring: rgba(155, 130, 255, .35);

  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--line);
  --bs-secondary-color: var(--muted);
  --bs-tertiary-bg: var(--surface-soft);
  --bs-secondary-bg: #2f2750;
  --bs-link-color: var(--brand);
  --bs-link-hover-color: #b8a5ff;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--text);
  background:
    radial-gradient(900px 520px at 85% -10%, var(--pink-soft), transparent 65%),
    radial-gradient(850px 520px at 8% 2%, var(--brand-soft), transparent 60%),
    radial-gradient(700px 480px at 55% 110%, var(--teal-soft), transparent 65%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, .display-font {
  font-family: var(--font-display);
  letter-spacing: -.02em;
}

a { text-decoration: none; }

::selection { background: var(--brand); color: #fff; }

:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

.text-muted { color: var(--muted) !important; }
.text-gradient {
  background: linear-gradient(110deg, var(--brand), var(--brand-2) 60%, var(--brand-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --------------------------------------------------------------------------
   Barra lateral
   -------------------------------------------------------------------------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 1045;
  width: 278px;
  display: flex; flex-direction: column;
  padding: 1.1rem .9rem 1rem;
  background: color-mix(in srgb, var(--surface-strong) 78%, transparent);
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform .25s ease;
  scrollbar-width: thin;
}
.sidebar.open { transform: none; }

.sidebar-brand {
  display: flex; align-items: center; gap: .72rem;
  padding: .3rem .45rem 1rem;
  color: var(--text);
}
.sidebar-brand:hover { color: var(--text); }
.brand-mark {
  width: 44px; height: 44px; flex: 0 0 44px;
  display: grid; place-items: center;
  border-radius: 15px;
  color: #fff; font-size: 1.3rem;
  background: linear-gradient(140deg, var(--brand), var(--brand-2));
  box-shadow: 0 12px 24px -12px rgba(116, 81, 255, .8);
}
.brand-avatar {
  width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: 15px; object-fit: cover;
  box-shadow: 0 12px 24px -12px rgba(116, 81, 255, .8);
}
.brand-avatar-sm {
  width: 36px; height: 36px; flex: 0 0 36px;
  border-radius: 12px; object-fit: cover;
  box-shadow: 0 8px 16px -10px rgba(116, 81, 255, .8);
}
.brand-title { font-family: var(--font-display); font-size: 1.08rem; line-height: 1.1; }
.brand-sub { font-size: .72rem; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }

/* Reproductor de música relajante */
.music-dock {
  display: flex; align-items: center; gap: .5rem;
  margin: 0 .25rem .9rem;
  padding: .45rem .5rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  transition: border-color .18s, box-shadow .18s;
}
.music-dock.playing { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.music-play, .music-next {
  display: grid; place-items: center;
  border: none; background: transparent; color: var(--brand);
  border-radius: 10px; cursor: pointer; transition: all .16s;
}
.music-play { width: 34px; height: 34px; flex: 0 0 34px; font-size: 1.1rem; background: var(--brand-soft); }
.music-next { width: 28px; height: 28px; flex: 0 0 28px; font-size: .85rem; }
.music-play:hover, .music-next:hover { background: var(--brand); color: #fff; }
.music-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.music-title { font-size: .78rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-sub { font-size: .65rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yt-audio-host { position: fixed; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }

.nav-section {
  margin: 1rem .55rem .35rem;
  font-size: .68rem; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted);
}

.sidebar .nav { gap: .2rem; }
.sidebar .nav-link {
  display: flex; align-items: center; gap: .62rem;
  padding: .58rem .72rem;
  border-radius: 13px;
  color: var(--text);
  font-size: .9rem; font-weight: 600;
  transition: background .18s, color .18s, transform .18s;
}
.sidebar .nav-link i { font-size: 1.02rem; color: var(--muted); transition: color .18s; }
.sidebar .nav-link:hover { background: var(--brand-soft); transform: translateX(2px); }
.sidebar .nav-link:hover i { color: var(--brand); }
.sidebar .nav-link.active {
  background: linear-gradient(120deg, var(--brand), #9a7cff 90%);
  color: #fff;
  box-shadow: 0 12px 24px -16px rgba(116, 81, 255, .9);
}
.sidebar .nav-link.active i { color: #fff; }
.nav-count {
  margin-left: auto;
  font-size: .7rem; font-weight: 700;
  padding: .12rem .45rem; border-radius: 99px;
  background: var(--surface-soft); color: var(--muted);
}
.nav-link.active .nav-count { background: rgba(255,255,255,.22); color: #fff; }

.sidebar .nav-sub {
  margin: .15rem 0 .35rem .82rem;
  padding-left: .55rem;
  border-left: 1px solid var(--line);
}
.sidebar .nav-sub .nav-link {
  font-size: .82rem; font-weight: 500;
  padding: .38rem .6rem;
}
.sidebar .nav-sub .nav-link .dot { width: 7px; height: 7px; flex: 0 0 7px; }
.sidebar .nav-sub .nav-link.active {
  background: var(--brand-soft); color: var(--brand);
  box-shadow: none;
}
.sidebar .nav-sub .nav-link.active i { color: var(--brand); }
.sidebar .nav-sub .nav-link.subir { color: var(--muted); font-weight: 600; }
.sidebar .nav-sub .nav-link.subir:hover { color: var(--brand); }
.subject-row { display: flex; align-items: center; gap: .2rem; padding-right: .15rem; }
.nav-toggle {
  flex: 0 0 30px; width: 30px; height: 30px;
  display: grid; place-items: center;
  border: none; background: transparent;
  color: var(--muted); border-radius: 9px;
  font-size: .78rem; cursor: pointer;
  transition: background .18s, color .18s, transform .18s;
}
.nav-toggle:hover { background: var(--brand-soft); color: var(--brand); }
.nav-toggle[aria-expanded="true"] i { transform: rotate(180deg); }
.nav-toggle i { transition: transform .18s; }

.sidebar-card {
  margin-top: auto;
  padding: .9rem;
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--brand-soft), var(--pink-soft));
  border: 1px solid var(--line);
  font-size: .78rem;
  color: var(--muted);
}
.sidebar-card strong { display: block; color: var(--text); font-size: .84rem; margin-bottom: .2rem; }

.theme-toggle {
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  margin-top: .7rem;
  padding: .48rem .7rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: .78rem; font-weight: 600;
  cursor: pointer; width: 100%;
  transition: background .18s, color .18s;
}
.theme-toggle:hover { background: var(--brand-soft); color: var(--brand); }

.menu-backdrop {
  position: fixed; inset: 0; z-index: 1040;
  background: rgba(14, 8, 35, .5);
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.menu-backdrop.show { opacity: 1; pointer-events: auto; }

.topbar { display: none; }

/* --------------------------------------------------------------------------
   Contenido
   -------------------------------------------------------------------------- */
.main-wrap { min-height: 100vh; }
.main-content {
  width: 100%; max-width: 1480px;
  margin: 0 auto;
  padding: 2rem 1.6rem 3.5rem;
}
.page { animation: rise .45s ease both; }

.page-type-icon {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 13px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 1.35rem;
  margin-right: .2rem;
}

.login-wrap { display: grid; place-items: center; min-height: 70vh; }
.login-card { width: 100%; max-width: 520px; padding: 2rem; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.login-brand { text-align: center; margin-bottom: 1.5rem; }
.login-brand h1 { font-size: 1.6rem; margin: .5rem 0 .2rem; }
.login-brand p { color: var(--muted); margin: 0; }
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .8rem; margin-bottom: 1.2rem; }
.user-tile {
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  padding: .8rem .5rem; border-radius: var(--radius); border: 1.5px solid var(--line);
  background: var(--surface-strong); color: var(--text); cursor: pointer; transition: all .16s;
}
.user-tile:hover, .user-tile.selected { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.user-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.user-avatar-placeholder {
  display: grid; place-items: center; font-weight: 800; font-size: 1.4rem;
  background: var(--brand-soft); color: var(--brand);
}
.user-name { font-size: .85rem; font-weight: 700; }
.user-badge { font-size: .65rem; padding: .1rem .4rem; border-radius: 99px; background: var(--brand-soft); color: var(--brand); }
.user-admin-list { display: flex; flex-direction: column; gap: .8rem; }
.user-admin-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem;
  padding: .7rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft);
}

.gantt-panel { overflow-x: auto; }
.gantt-board {
  display: grid;
  gap: 0;
  min-width: max-content;
}
.gantt-corner { background: var(--surface-soft); border-radius: 6px 0 0 0; }
.gantt-day-head {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  font-size: .6rem; color: var(--muted); padding: .25rem .1rem; border-left: 1px solid var(--line);
  min-height: 34px; position: relative;
}
.gantt-day-head.has-cards { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.gantt-day-head.is-exam { color: var(--danger); font-weight: 800; }
.gantt-day-num { font-weight: 700; line-height: 1; }
.gantt-day-mon { font-size: .55rem; text-transform: uppercase; }
.gantt-label {
  display: flex; flex-direction: column; gap: .1rem; min-width: 0;
  padding: .35rem .4rem;
  border-top: 1px solid var(--line);
}
.gantt-subject { font-size: .95rem; font-weight: 800; line-height: 1.1; }
.gantt-exam { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-cell {
  min-height: 34px; border-left: 1px solid var(--line); border-top: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .1rem;
  font-size: .7rem; color: #fff;
  overflow: hidden;
}
.gantt-cell.filled { opacity: .9; }
.gantt-cell.exam-day { background: color-mix(in srgb, var(--danger) 14%, transparent); }
.gantt-cell i { color: var(--danger); font-size: .75rem; }
.gantt-cell-topic {
  font-size: .55rem; line-height: 1; color: #fff; font-weight: 700;
  text-align: center; padding: 0 .1rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 100%;
  display: block;
}
.gantt-legend { display: flex; flex-wrap: wrap; gap: .8rem; font-size: .74rem; color: var(--muted); }
.gantt-legend-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--brand); }
.gantt-legend-cards { background: color-mix(in srgb, var(--brand) 10%, transparent); border: 1px solid var(--line); }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .page { animation: none; }
  * { scroll-behavior: auto !important; }
}

.breadcrumb { --bs-breadcrumb-divider-color: var(--muted); font-size: .82rem; margin-bottom: 1rem; }
.breadcrumb a { color: var(--muted); font-weight: 600; }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb-item.active { color: var(--brand); font-weight: 600; }

.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end;
  justify-content: space-between; gap: 1rem;
  margin-bottom: 1.4rem;
}
.page-head-main { display: flex; align-items: center; gap: .9rem; }
.page-icon {
  width: 52px; height: 52px; flex: 0 0 52px;
  display: grid; place-items: center;
  border-radius: 17px;
  color: #fff;
  font-size: 1.35rem;
  background: linear-gradient(140deg, var(--c, var(--brand)), color-mix(in srgb, var(--c, var(--brand)) 60%, #fff));
  box-shadow: 0 14px 28px -16px var(--c, var(--brand));
}
.page-title { margin: 0; font-size: clamp(1.6rem, 2.4vw, 2.15rem); font-weight: 700; }
.page-sub { margin: .18rem 0 0; color: var(--muted); font-size: .9rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }

.section-head {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: .8rem;
  margin: 2rem 0 1rem;
}
.section-head h2 { margin: 0; font-size: 1.35rem; }
.section-head .hint { color: var(--muted); font-size: .82rem; }

/* --------------------------------------------------------------------------
   Botones
   -------------------------------------------------------------------------- */
.btn {
  --bs-btn-border-radius: 13px;
  border-radius: 13px;
  font-weight: 700;
  font-size: .86rem;
  padding: .58rem 1rem;
  transition: transform .16s, box-shadow .16s, background .16s, color .16s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn-sm { border-radius: 11px; padding: .4rem .72rem; font-size: .77rem; }

.btn-primary, .btn-brand {
  background: linear-gradient(120deg, var(--brand), #9d7dff);
  border: none; color: #fff;
  box-shadow: 0 12px 24px -16px rgba(116, 81, 255, .95);
}
.btn-primary:hover, .btn-brand:hover,
.btn-primary:focus, .btn-brand:focus {
  background: linear-gradient(120deg, #6542ee, #8f6cff);
  color: #fff;
}
.btn-soft {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line);
}
.btn-soft:hover { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.btn-outline-primary {
  color: var(--brand); border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
  background: transparent;
}
.btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-success {
  background: linear-gradient(120deg, var(--brand-3), #3dd6a3);
  border: none; color: #083b35;
}
.btn-success:hover { background: linear-gradient(120deg, #10a796, #2fc391); color: #052e29; }
.btn-info { background: #3b8ee5; border: none; }
.btn-outline-danger {
  color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 32%, transparent);
}
.btn-outline-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border: none; color: var(--muted); }
.btn-ghost:hover { color: var(--brand); background: var(--brand-soft); }

.btn-icon {
  width: 38px; height: 38px; padding: 0;
  display: inline-grid; place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: .95rem;
  transition: all .16s;
}
.btn-icon:hover { color: var(--brand); border-color: transparent; background: var(--brand-soft); transform: translateY(-1px); }
.btn-icon.danger:hover { color: var(--danger); background: var(--danger-soft); }
.btn-icon:disabled { opacity: .3; cursor: not-allowed; transform: none; }
.btn-icon:disabled:hover { color: var(--muted); background: var(--surface); transform: none; }

/* --------------------------------------------------------------------------
   Tarjetas y paneles
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
  transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card-deal, .card:hover.card-deal { transform: none; }
.card-body { padding: 1.2rem; }

.panel {
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}
.panel.pad-lg { padding: 1.6rem; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .6rem; margin-bottom: 1rem;
}
.panel-title { margin: 0; font-size: 1.08rem; font-weight: 700; }
.panel-title i { color: var(--brand); margin-right: .3rem; }

.empty-state {
  text-align: center;
  padding: 2.6rem 1.2rem;
  border: 1px dashed color-mix(in srgb, var(--brand) 28%, transparent);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--surface), transparent);
  color: var(--muted);
}
.empty-state .empty-icon {
  display: inline-grid; place-items: center;
  width: 58px; height: 58px; margin-bottom: .8rem;
  border-radius: 18px;
  font-size: 1.5rem;
  background: var(--brand-soft); color: var(--brand);
}
.empty-state h3 { font-size: 1.1rem; color: var(--text); margin-bottom: .35rem; }
.empty-state p { margin: 0 auto; max-width: 38ch; font-size: .88rem; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }

/* --------------------------------------------------------------------------
   Portada
   -------------------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 1.6rem;
  padding: 2.1rem;
  border-radius: 32px;
  border: 1px solid var(--line);
  background:
    radial-gradient(600px 300px at 100% 0%, var(--pink-soft), transparent 70%),
    linear-gradient(135deg, color-mix(in srgb, var(--brand) 10%, transparent), transparent 55%),
    var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.hero::after {
  content: '';
  position: absolute; right: -80px; top: -90px;
  width: 280px; height: 280px; border-radius: 50%;
  background: linear-gradient(140deg, var(--brand-2), var(--brand));
  opacity: .13; filter: blur(4px);
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  align-self: flex-start;
  font-size: .72rem; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--brand);
  padding: .35rem .65rem; border-radius: 99px;
  background: var(--brand-soft);
  margin-bottom: .85rem;
}
.hero h1 {
  font-size: clamp(2rem, 4vw, 3.05rem);
  line-height: 1.03; font-weight: 700;
  margin: 0 0 .8rem;
}
.hero p { color: var(--muted); font-size: .98rem; max-width: 48ch; margin-bottom: 1.3rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.5rem; }

.stat-grid { display: flex; flex-wrap: wrap; gap: .55rem; }
.stat {
  min-width: 92px;
  padding: .6rem .85rem;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 64%, transparent);
}
.stat-value { font-family: var(--font-display); font-size: 1.32rem; font-weight: 700; line-height: 1; }
.stat-label { display: block; margin-top: .25rem; font-size: .7rem; color: var(--muted); font-weight: 600; }

.focus-card {
  position: relative; z-index: 1;
  align-self: stretch;
  display: flex; flex-direction: column;
  padding: 1.3rem;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
}
.focus-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .8rem; }
.focus-head h2 { font-size: 1.05rem; margin: 0; }
.focus-head .badge {
  background: var(--brand-soft); color: var(--brand);
  font-size: .68rem; font-weight: 800; letter-spacing: .04em;
  border-radius: 99px; padding: .3rem .55rem;
}
.focus-list { display: flex; flex-direction: column; gap: .45rem; }
.focus-item {
  display: flex; align-items: flex-start; gap: .55rem;
  padding: .6rem .7rem;
  border-radius: 13px;
  background: var(--surface-soft);
  font-size: .82rem;
  line-height: 1.3;
}
.focus-item strong { display: block; font-size: .83rem; }
.focus-item small { color: var(--muted); font-size: .72rem; }
.focus-empty { text-align: center; padding: 1.4rem .6rem; color: var(--muted); font-size: .86rem; }
.focus-empty .big { display: block; font-size: 1.9rem; margin-bottom: .35rem; }
.focus-link { margin-top: auto; padding-top: .85rem; font-size: .78rem; font-weight: 700; color: var(--brand); display: inline-flex; align-items: center; gap: .3rem; }
.focus-link:hover { color: var(--brand-2); }

/* --------------------------------------------------------------------------
   Asignaturas
   -------------------------------------------------------------------------- */
.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 1rem;
}
.subject-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  padding: 1.15rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.subject-card::before {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 5px;
  background: var(--c, var(--brand));
}
.subject-card::after {
  content: '';
  position: absolute; right: -46px; top: -46px;
  width: 130px; height: 130px; border-radius: 50%;
  background: var(--c, var(--brand)); opacity: .09;
  transition: transform .3s;
}
.subject-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--c, var(--brand)) 35%, transparent);
}
.subject-card:hover::after { transform: scale(1.25); }
.subject-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; margin-bottom: .8rem; }
.subject-avatar {
  position: relative; z-index: 1;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 15px;
  font-family: var(--font-display); font-size: 1.25rem; font-weight: 700;
  color: #fff; background: var(--c, var(--brand));
  box-shadow: 0 12px 24px -14px var(--c, var(--brand));
}
.subject-name { font-size: 1.08rem; font-weight: 700; margin: 0 0 .25rem; position: relative; z-index: 1; }
.subject-name a { color: var(--text); }
.subject-name a:hover { color: var(--c, var(--brand)); }
.subject-meta { color: var(--muted); font-size: .78rem; position: relative; z-index: 1; }
.subject-next {
  position: relative; z-index: 1;
  margin: .9rem 0 1rem;
  padding: .55rem .65rem;
  border-radius: 12px;
  background: var(--surface-soft);
  font-size: .75rem;
  color: var(--muted);
}
.subject-next strong { color: var(--text); }
.subject-actions { display: flex; gap: .4rem; margin-top: auto; position: relative; z-index: 1; }
.subject-actions .btn { flex: 1; }

.count-pill {
  display: inline-flex; align-items: center; gap: .28rem;
  padding: .2rem .5rem; border-radius: 99px;
  background: var(--surface-soft); color: var(--muted);
  font-size: .7rem; font-weight: 700;
}

/* --------------------------------------------------------------------------
   Exámenes
   -------------------------------------------------------------------------- */
.exam-list { display: flex; flex-direction: column; gap: .7rem; }
.exam-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: .9rem;
  padding: .9rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.exam-row:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c, var(--brand)) 35%, transparent); box-shadow: var(--shadow); }
.date-badge {
  flex: 0 0 56px; width: 56px; height: 60px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 16px;
  background: var(--brand-soft); color: var(--brand);
  line-height: 1;
}
.date-badge .d { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; }
.date-badge .m { font-size: .64rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; margin-top: .2rem; }
.exam-main { flex: 1 1 190px; min-width: 0; }
.exam-title { font-size: .98rem; font-weight: 700; margin: 0 0 .2rem; }
.exam-title a { color: var(--text); }
.exam-title a:hover { color: var(--brand); }
.exam-meta { color: var(--muted); font-size: .76rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.exam-actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.countdown {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .22rem .55rem; border-radius: 99px;
  font-size: .7rem; font-weight: 800;
  background: var(--teal-soft); color: #0b8a7b;
}
[data-bs-theme="dark"] .countdown { color: var(--brand-3); }
.countdown.urgente { background: var(--danger-soft); color: var(--danger); }
.countdown.pasado { background: var(--surface-soft); color: var(--muted); }

/* --------------------------------------------------------------------------
   Formularios
   -------------------------------------------------------------------------- */
.form-card { position: sticky; top: 1.2rem; }
.form-label { font-size: .8rem; font-weight: 700; margin-bottom: .35rem; }
.form-control, .form-select {
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  padding: .58rem .8rem;
  font-size: .87rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--ring);
  background: var(--surface-strong);
  color: var(--text);
}
.form-control::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.form-text { color: var(--muted); font-size: .73rem; }
.input-group .btn { border-radius: 0 13px 13px 0; }
.input-group .form-control { border-radius: 13px 0 0 13px; }

.file-drop {
  display: flex; flex-wrap: wrap; align-items: center; gap: .55rem;
  padding: .55rem;
  border: 1px dashed color-mix(in srgb, var(--brand) 32%, transparent);
  border-radius: 15px;
  background: color-mix(in srgb, var(--brand) 4%, transparent);
}
.file-drop .form-control { border: none; background: transparent; flex: 1 1 210px; padding-left: .3rem; }
.file-drop .form-control:focus { box-shadow: none; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

/* --------------------------------------------------------------------------
   Temas y documentos
   -------------------------------------------------------------------------- */
.topic-list { display: flex; flex-direction: column; gap: .5rem; }
.topic-row {
  display: flex; align-items: center; gap: .8rem;
  padding: .7rem .8rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 55%, transparent);
}
.topic-index {
  width: 28px; height: 28px; flex: 0 0 28px;
  display: grid; place-items: center;
  border-radius: 9px;
  font-size: .7rem; font-weight: 800;
  background: var(--brand-soft); color: var(--brand);
}
.topic-main { flex: 1 1 150px; min-width: 0; }
.topic-name { font-size: .88rem; font-weight: 600; margin: 0 0 .3rem; }
.weight-bar { height: 6px; border-radius: 99px; background: var(--surface-soft); overflow: hidden; }
.weight-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.topic-weight { font-size: .74rem; font-weight: 800; color: var(--brand); white-space: nowrap; }

.topic-tree { display: flex; flex-direction: column; gap: .75rem; }
.topic-node.estudiado .topic-name,
.topic-node.estudiado .topic-weight { text-decoration: line-through; opacity: .55; }
.subtopic-list {
  margin: .35rem 0 .35rem 2.2rem;
  padding-left: .6rem;
  border-left: 2px solid var(--line);
  display: flex; flex-direction: column; gap: .35rem;
}
.subtopic-row {
  display: flex; align-items: center; gap: .5rem;
  font-size: .84rem;
}
.subtopic-row.estudiado .subtopic-name { text-decoration: line-through; opacity: .55; }
.subtopic-bullet { color: var(--muted); font-weight: 700; }
.subtopic-name { flex: 1 1 auto; }
.subtopic-add { display: flex; gap: .35rem; margin-top: .35rem; }
.subtopic-add .form-control { flex: 1 1 auto; }
.topic-check { margin: 0; display: flex; align-items: center; }

.topic-tree { display: flex; flex-direction: column; gap: .35rem; }
.tree-topic { display: flex; flex-direction: column; gap: .25rem; }
.tree-line {
  display: flex; align-items: center; gap: .45rem;
  padding: .25rem .35rem;
  border-radius: 8px;
}
.tree-line:hover { background: var(--surface-soft); }
.tree-line-sub { margin-left: 1.4rem; }
.tree-check { margin: 0; }
.tree-bullet { color: var(--muted); font-weight: 800; }
.tree-name { flex: 1 1 auto; font-size: .88rem; font-weight: 600; }
.tree-weight { font-size: .72rem; font-weight: 700; color: var(--brand); white-space: nowrap; }
.tree-weight-btn {
  border: 1px dashed transparent;
  background: transparent;
  padding: .1rem .35rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
}
.tree-weight-btn:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}
.tree-weight-btn i { font-size: .65rem; opacity: .65; }
.move-form { display: inline-flex; margin: 0; }
.tree-topic.estudiado .tree-name,
.tree-topic.estudiado .tree-weight { text-decoration: line-through; opacity: .55; }
.tree-subtopic.estudiado .tree-name { text-decoration: line-through; opacity: .55; }
.tree-subtopic-add { margin-left: 1.4rem; display: flex; gap: .35rem; margin-top: .2rem; }
.tree-subtopic-add .form-control { flex: 1 1 auto; }

.doc-list { display: flex; flex-direction: column; gap: .45rem; }
.doc-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem;
  padding: .65rem .75rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 50%, transparent);
}
.doc-icon {
  width: 40px; height: 40px; flex: 0 0 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  font-size: 1.08rem;
  background: var(--brand-soft); color: var(--brand);
}
.doc-info { flex: 1 1 170px; min-width: 0; }
.doc-name { font-size: .85rem; font-weight: 700; margin: 0 0 .12rem; word-break: break-word; }
.doc-meta { font-size: .71rem; color: var(--muted); }
.doc-actions { display: flex; gap: .3rem; }

.doc-group { padding: 1.1rem; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-soft); margin-bottom: 1rem; }
.doc-group-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .9rem; }
.doc-group-title { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: 1.05rem; }
.doc-exam { border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem; margin-bottom: .8rem; background: color-mix(in srgb, var(--surface-strong) 45%, transparent); }
.doc-exam:last-child { margin-bottom: 0; }
.doc-exam-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem; margin-bottom: .7rem; }
.doc-exam-title { font-size: .9rem; font-weight: 700; }
.doc-exam-title a { color: var(--text); }
.doc-exam-title a:hover { color: var(--brand); }

/* --------------------------------------------------------------------------
   Calendario
   -------------------------------------------------------------------------- */
.calendar-card { padding: 1.1rem; }
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: 1rem; }
.cal-title { display: flex; align-items: baseline; gap: .5rem; margin: 0; font-size: 1.35rem; }
.cal-title small { font-family: var(--font-ui); font-size: .78rem; font-weight: 600; color: var(--muted); }
.cal-nav { display: flex; align-items: center; gap: .35rem; }
.cal-nav .btn { padding: .42rem .7rem; }
.cal-legend { display: flex; flex-wrap: wrap; gap: .8rem; font-size: .74rem; color: var(--muted); margin-top: .8rem; }
.cal-legend span { display: inline-flex; align-items: center; gap: .3rem; }

.cal-wrap { overflow-x: auto; padding-bottom: .25rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(104px, 1fr)); gap: 6px; }
.cal-grid.head { margin-bottom: 5px; }
.cal-dow {
  font-size: .67rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); text-align: center; font-weight: 800;
  padding: .25rem 0;
}
.dia {
  min-height: 124px;
  display: flex; flex-direction: column; gap: .28rem;
  padding: .4rem;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 58%, transparent);
  transition: background .15s, border-color .15s, transform .15s;
}
.dia.otro-mes { opacity: .45; background: var(--surface-soft); }
.dia.hoy {
  border: 1.5px solid var(--brand);
  background: color-mix(in srgb, var(--brand) 7%, var(--surface-strong));
  box-shadow: 0 6px 18px -12px var(--brand);
}
.dia.sombra {
  background: var(--brand-soft);
  border-color: var(--brand);
  transform: scale(1.01);
}
.cal-grid.cal-week .dia { min-height: 420px; }
.dia-cab { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.dia-num {
  width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: 8px;
  font-size: .76rem; font-weight: 800; color: var(--muted);
}
.dia.hoy .dia-num { background: var(--brand); color: #fff; }
.badge-examen {
  font-size: .58rem; font-weight: 800;
  padding: .1rem .32rem; border-radius: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.badge-evento {
  font-size: .58rem; font-weight: 800;
  padding: .1rem .32rem; border-radius: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.ficha {
  position: relative;
  padding: .3rem .38rem .26rem;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(155deg, var(--c, var(--brand)), color-mix(in srgb, var(--c, var(--brand)) 65%, #1b1233));
  box-shadow: 0 4px 10px -6px rgba(20, 10, 45, .65);
  cursor: grab;
  user-select: none;
}
.ficha:active { cursor: grabbing; }
.ficha.arrastrando { opacity: .35; }
.ficha-tema { display: block; font-size: .69rem; font-weight: 800; line-height: 1.15; word-break: break-word; }
.ficha-meta { display: block; font-size: .58rem; opacity: .85; line-height: 1.2; margin-top: .08rem; }
.ficha-comentario {
  display: block;
  font-size: .62rem; font-style: italic;
  line-height: 1.25; margin-top: .12rem;
  padding: .12rem .28rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--c, var(--brand)) 25%, rgba(255,255,255,.7));
  color: color-mix(in srgb, var(--c, var(--brand)) 75%, #000);
  font-weight: 700;
  word-break: break-word;
}
.ficha-asignatura {
  display: block;
  font-size: .72rem; font-weight: 900; line-height: 1.15;
  margin-bottom: .12rem;
  text-transform: uppercase; letter-spacing: .04em;
}
.ficha-tema-select {
  display: block;
  width: 100%;
  margin: .12rem 0;
  padding: .18rem .3rem;
  border: none; border-radius: 6px;
  background: rgba(255, 255, 255, .22);
  color: #fff;
  font-size: .69rem; font-weight: 800;
  cursor: pointer;
}
.ficha-tema-select:focus { outline: 2px solid rgba(255,255,255,.6); }
.ficha-tema-select option { color: #000; background: #fff; }
.ficha-acc { display: flex; gap: .14rem; margin-top: .22rem; }
.mini {
  border: none; border-radius: 6px;
  background: rgba(255, 255, 255, .22);
  color: #fff;
  font-size: .58rem; line-height: 1;
  padding: .16rem .28rem;
  cursor: pointer;
  transition: background .15s;
}
.mini:hover { background: rgba(255, 255, 255, .45); }
.mini-claro {
  background: var(--surface-soft) !important;
  color: var(--muted) !important;
}
.mini-claro:hover { background: var(--brand-soft) !important; color: var(--brand) !important; }

.legend-list { display: flex; flex-direction: column; }
.legend-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  padding: .55rem 0;
  border-bottom: 1px dashed var(--line);
  font-size: .83rem;
}
.legend-row:last-child { border-bottom: none; }
.legend-exam {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .2rem .5rem;
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: .76rem;
}
.legend-exam a { color: var(--text); font-weight: 600; }

.link-list { display: flex; flex-direction: column; }
.link-row {
  display: flex; align-items: center; gap: .8rem;
  padding: .7rem .4rem;
  border-bottom: 1px dashed var(--line);
}
.link-row:last-child { border-bottom: none; }
.link-favicon {
  width: 28px; height: 28px; flex: 0 0 28px;
  border-radius: 8px;
  background: var(--surface-soft);
}
.link-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.link-title { font-size: .9rem; font-weight: 700; color: var(--text); }
.link-title:hover { color: var(--brand); }
.link-url { font-size: .72rem; color: var(--muted); word-break: break-all; }
.link-actions { display: flex; gap: .3rem; }
.music-tag {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .15rem .5rem; border-radius: 99px;
  background: var(--brand-soft); color: var(--brand);
  border: 1px solid transparent;
  font-size: .68rem; font-weight: 700; white-space: nowrap;
  cursor: pointer;
}
.music-tag.off { background: transparent; border: 1px dashed var(--line); color: var(--muted); }
.music-tag.off:hover { color: var(--brand); border-color: var(--brand); }
.link-filters { display: flex; flex-wrap: wrap; gap: .4rem; }
.filter-pill {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .3rem .7rem; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); font-size: .78rem; font-weight: 600;
}
.filter-pill span { font-size: .68rem; opacity: .8; }
.filter-pill:hover { color: var(--brand); border-color: var(--brand); }
.filter-pill.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.legend-exam a:hover { color: var(--brand); }

.aviso {
  position: fixed; left: 50%; bottom: 26px;
  transform: translate(-50%, 16px);
  z-index: 1080;
  padding: .62rem 1.1rem;
  border-radius: 13px;
  background: var(--text); color: var(--bg);
  font-size: .84rem; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s;
  box-shadow: var(--shadow);
}
.aviso.visible { opacity: 1; transform: translate(-50%, 0); }
.aviso-error { background: var(--danger); color: #fff; }

/* --------------------------------------------------------------------------
   Plan
   -------------------------------------------------------------------------- */
.timeline { position: relative; padding-left: 1.6rem; }
.timeline::before {
  content: ''; position: absolute; left: .48rem; top: .4rem; bottom: .4rem;
  width: 2px; border-radius: 2px;
  background: linear-gradient(var(--brand), var(--brand-2), var(--brand-3));
  opacity: .35;
}
.timeline-day { position: relative; margin-bottom: 1rem; }
.timeline-day::before {
  content: ''; position: absolute; left: -1.42rem; top: .55rem;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--brand);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--brand-soft);
}
.timeline-day.hoy::before { background: var(--brand-2); }
.timeline-card {
  padding: .85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.timeline-date { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.timeline-date strong { font-size: .9rem; }
.timeline-date small { color: var(--muted); font-size: .73rem; }
.timeline-items { display: flex; flex-wrap: wrap; gap: .35rem; }
.timeline-item {
  display: inline-flex; align-items: center; gap: .34rem;
  padding: .3rem .55rem;
  border-radius: 9px;
  font-size: .76rem; font-weight: 600;
  background: var(--surface-soft);
}
.timeline-item .dot { width: 7px; height: 7px; flex-basis: 7px; }

/* --------------------------------------------------------------------------
   Configuración
   -------------------------------------------------------------------------- */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .8rem; }
.theme-option {
  display: block; width: 100%; text-align: left;
  padding: .85rem;
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.theme-option:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.theme-option.seleccionado {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--ring);
}
.theme-option strong { display: block; font-size: .88rem; margin-bottom: .15rem; }
.theme-option span { font-size: .74rem; color: var(--muted); }
.theme-preview {
  display: grid; grid-template-columns: 30px 1fr;
  gap: 4px; height: 66px; margin-bottom: .6rem;
  padding: 5px; border-radius: 11px; overflow: hidden;
  background: #f6f2ff;
}
.theme-preview .p-side { border-radius: 6px; background: linear-gradient(160deg, #7451ff, #a78bff); }
.theme-preview .p-body { display: flex; flex-direction: column; gap: 4px; }
.theme-preview .p-line { height: 10px; border-radius: 4px; background: #ffffff; }
.theme-preview .p-line.short { width: 62%; }
.theme-preview.dark { background: #16121f; }
.theme-preview.dark .p-line { background: #302850; }
.theme-preview.dark .p-side { background: linear-gradient(160deg, #9b82ff, #ff8fb3); }

.setting-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .7rem; padding: .8rem 0; border-bottom: 1px dashed var(--line);
}
.setting-row:last-child { border-bottom: none; }
.setting-row .label { font-size: .84rem; font-weight: 700; }
.setting-row .sub { font-size: .74rem; color: var(--muted); }
.setting-value { font-size: .8rem; font-weight: 700; color: var(--brand); }

.data-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(115px, 1fr)); gap: .55rem; }
.data-item {
  padding: .7rem .8rem;
  border-radius: 13px;
  background: var(--surface-soft);
}
.data-item b { display: block; font-family: var(--font-display); font-size: 1.3rem; line-height: 1; }
.data-item span { font-size: .68rem; color: var(--muted); font-weight: 700; }
.path-box {
  display: block;
  padding: .65rem .8rem;
  border-radius: 11px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .72rem;
  color: var(--muted);
  word-break: break-all;
  margin-top: .35rem;
}

/* --------------------------------------------------------------------------
   Avisos, footer y errores
   -------------------------------------------------------------------------- */
.alert {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-size: .85rem;
  padding: .75rem 1rem;
  display: flex; align-items: center; gap: .55rem;
}
.alert i { font-size: 1rem; }
.alert-success { background: var(--teal-soft); border-color: color-mix(in srgb, var(--brand-3) 30%, transparent); }
.alert-success i { color: var(--brand-3); }
.alert-error, .alert-danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.alert-error i, .alert-danger i { color: var(--danger); }
.alert-info { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 24%, transparent); }
.alert-info i { color: var(--brand); }
.alert .btn-close { margin-left: auto; }

.footer {
  margin-top: 2.5rem; padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: .74rem;
  color: var(--muted);
}

.error-page { text-align: center; padding: 4rem 1rem; }
.error-code {
  font-family: var(--font-display); font-size: clamp(5rem, 14vw, 9rem);
  line-height: 1; font-weight: 700;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.error-page h1 { font-size: 1.5rem; margin-bottom: .5rem; }
.error-page p { color: var(--muted); margin-bottom: 1.4rem; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (min-width: 992px) {
  .sidebar { transform: none; }
  .main-wrap { padding-left: 278px; }
  .menu-backdrop, .topbar { display: none !important; }
}
@media (max-width: 991.98px) {
  .topbar {
    position: sticky; top: 0; z-index: 1030;
    display: flex; align-items: center; gap: .6rem;
    padding: .55rem .8rem;
    background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
  }
  .topbar .brand-mark { width: 36px; height: 36px; flex-basis: 36px; border-radius: 12px; font-size: 1rem; }
  .topbar-title { font-family: var(--font-display); font-size: .98rem; }
  .main-content { padding: 1.35rem 1rem 3rem; }
  .hero { grid-template-columns: 1fr; padding: 1.5rem; border-radius: 26px; }
  .page-head { align-items: flex-start; }
  .form-card { position: static; }
}
@media (max-width: 575.98px) {
  .hero h1 { font-size: 2rem; }
  .stat { flex: 1 1 40%; }
  .exam-row { align-items: flex-start; }
  .exam-actions { width: 100%; }
  .exam-actions .btn { flex: 1; }
  .subject-grid { grid-template-columns: 1fr; }
  .cal-grid { grid-template-columns: repeat(7, minmax(88px, 1fr)); }
}

.problema-card {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-top: .25rem;
  padding: .22rem .45rem;
  border-radius: 8px;
  border: none;
  background: linear-gradient(155deg, var(--c, var(--brand)), color-mix(in srgb, var(--c, var(--brand)) 65%, #1b1233));
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform .12s, box-shadow .12s;
  box-shadow: 0 4px 10px -6px rgba(20, 10, 45, .65);
}
.problema-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px -6px rgba(20, 10, 45, .75);
}
.problema-card i { color: #fff; flex-shrink: 0; }
.problema-titulo {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}
.problema-card.done {
  opacity: .55;
  text-decoration: line-through;
}
