@font-face {
  font-family: 'Open Sans';
  src: url('../fonts/OpenSans-Regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Open Sans';
  src: url('../fonts/OpenSans-Semibold.ttf') format('truetype');
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --purple: #8b2ce2;
  --purple-dark: #7a2d8c;
  --violet: #b66af4;
  --indigo: #7e97d9;
  --gradient: linear-gradient(115deg, #b66af4, #7e97d9);
  --action-gradient: linear-gradient(120deg, #6a4ff0, #9b7bff);
  --text: #2b2b2b;
  --muted: #7b7b7b;
  --stroke: #e6e6e6;
  --soft: #f2f2f2;
  --surface: #fff;
  --soft-purple: #f5effc;
  --danger: #d63546;
  --radius: 18px;
  --sidebar-width: 240px;
  font-family: 'Open Sans', sans-serif;
  font-synthesis: none;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: #fff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; min-width: 320px; }
body { margin: 0; min-width: 320px; background: #fff; }
body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
button, input, select, textarea, a { outline-offset: 4px; }
:focus-visible { outline: 3px solid #a47add; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
a { color: var(--purple); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
svg { display: inline-block; flex: 0 0 auto; width: 20px; height: 20px; vertical-align: middle; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -.025em; line-height: 1.3; }
h1 { font-size: 28px; margin-bottom: 8px; }
h2 { font-size: 19px; margin-bottom: 14px; }
h3 { font-size: 16px; margin-bottom: 7px; }
p { margin-bottom: 14px; }
small, .small { font-size: 12px; }
strong, b { font-weight: 600; }
hr { margin: 22px 0; border: 0; border-top: 1px solid var(--stroke); }
.muted { color: var(--muted); }
.hidden, [hidden] { display: none !important; }
.full { grid-column: 1 / -1; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* The original artwork and fonts are shared by desktop and mobile. */
.auth-screen {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  min-height: 100vh;
  min-height: 100dvh;
  padding: 7vh max(48px, calc((100vw - 1260px) / 2));
  gap: 8vw;
  align-items: center;
  overflow: hidden;
  background: #fff;
}
.auth-screen::before {
  content: '';
  position: absolute;
  z-index: 0;
  inset: 0 47% 0 0;
  background: #92a4d2 url('../images/bglogin.png') center top / 100% 122% no-repeat;
}
.auth-brand { z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 26px; padding: 0 24px 90px 0; color: white; }
.auth-logo { width: 290px; max-width: 100%; height: auto; }
.auth-brand h1 { max-width: 360px; font-size: 32px; line-height: 1.35; letter-spacing: -.025em; margin-bottom: 12px; }
.auth-brand p { max-width: 360px; font-size: 15px; line-height: 1.8; color: #fcf8ff; }
.auth-brand .eyebrow { color: #fff; }
.auth-card { position: relative; z-index: 1; width: 100%; max-width: 420px; margin: 0 auto; padding: 38px 0; }
.auth-card > .auth-logo { width: 185px; margin: 0 auto 24px; }
.auth-card h1 { margin-bottom: 8px; font-size: 29px; }
.auth-card h2 { font-size: 27px; margin-bottom: 8px; }
.auth-card > p { margin-bottom: 28px; color: var(--muted); }
.auth-card form { display: grid; gap: 19px; }
.auth-card .field { gap: 9px; }
.auth-card input { min-height: 54px; border-radius: 18px; }
.auth-card .btn { width: 100%; min-height: 52px; border-radius: 18px; }
.auth-card .form-error { margin: 0; }
.auth-switch { display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 25px; color: var(--muted); font-size: 13px; }
.auth-switch button { padding: 0; background: none; border: 0; font-weight: 600; color: var(--purple); }
.auth-footer { margin-top: 28px; text-align: center; color: var(--muted); font-size: 11px; line-height: 1.8; }
.auth-footer a { display: inline; }
.auth-forgot { justify-self: end; background: none; border: 0; color: var(--purple); font-size: 12px; padding: 0; }

/* Desktop navigation extends the application's purple mobile tab bar. */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 25px 17px 20px;
  border-right: 1px solid var(--stroke);
  background: #fff;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; justify-content: center; margin: 0 8px 28px; padding: 0 7px; min-height: 90px; }
.brand img { width: 176px; height: auto; }
.brand:hover { text-decoration: none; }
.sidebar nav { display: flex; flex-direction: column; gap: 6px; }
.sidebar .eyebrow { margin: 16px 14px 9px; font-size: 10px; color: #99929d; }
.nav-link { display: flex; align-items: center; width: 100%; min-height: 46px; gap: 12px; padding: 11px 14px; border: 0; border-radius: 13px; background: transparent; text-align: left; color: #68636b; font-size: 13px; font-weight: 600; transition: background .16s ease, color .16s ease; }
.nav-link:hover { background: #f8f4fc; color: var(--purple); text-decoration: none; }
.nav-link.active, .nav-link[aria-current='page'] { background: var(--soft-purple); color: var(--purple); }
.nav-link.active .nav-icon { color: var(--purple); }
.material-icon { display: inline-block; width: 24px; height: 24px; flex-shrink: 0; vertical-align: middle; fill: currentColor; pointer-events: none; }
.nav-icon { display: inline-flex; width: 21px; height: 21px; align-items: center; justify-content: center; flex: 0 0 21px; font-size: 19px; }
.sidebar-footer { margin-top: auto; padding: 27px 5px 0; }
.sidebar-footer .panel { border: 0; padding: 15px; background: #f8f5fb; border-radius: 14px; }
.sidebar-footer p { color: var(--muted); font-size: 11px; margin: 7px 0 0; }
.sidebar-footer .btn { width: 100%; margin-top: 10px; }
.sidebar-footer > p { text-align: center; font-size: 10px; }
.mobile-nav { display: none; }
.main-content { width: calc(100% - var(--sidebar-width)); max-width: 1500px; min-height: 100vh; margin-left: var(--sidebar-width); padding: 30px 38px 45px; }
.topbar { display: flex; gap: 13px; align-items: center; margin-bottom: 30px; min-height: 48px; }
.avatar { display: grid; place-items: center; flex: 0 0 46px; width: 46px; height: 46px; border: 2px solid var(--stroke); border-radius: 50%; background: #fff; font-size: 22px; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar > .material-icon { width: 26px; height: 26px; color: var(--purple); }
.welcome { flex: 1; min-width: 0; }
.welcome h1, .welcome h2, .welcome strong { display: block; margin: 0 0 2px; font-size: 17px; letter-spacing: -.02em; }
.welcome p, .welcome small { display: block; max-width: 100%; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.topbar-actions > .muted { font-size: 12px; margin-right: 12px; }
.topbar .icon-btn { border: 2px solid var(--stroke); background: white; color: var(--purple); }

.btn { display: inline-flex; gap: 8px; justify-content: center; align-items: center; min-height: 42px; padding: 11px 17px; border: 1px solid transparent; border-radius: 14px; background: var(--soft); color: var(--text); font-size: 12px; font-weight: 600; line-height: 1.35; white-space: nowrap; text-decoration: none; transition: background .16s ease, transform .16s ease, box-shadow .16s ease; }
.btn:hover { text-decoration: none; background: #eae6ee; }
.btn:active { transform: translateY(1px); }
.btn.primary, .btn-primary { color: #fff; background: var(--action-gradient); box-shadow: 0 3px 8px #7954e315; }
.btn.primary:hover, .btn-primary:hover { box-shadow: 0 4px 14px #7954e33a; filter: brightness(1.035); }
.btn.secondary { background: var(--soft); color: var(--text); }
.btn.ghost { border-color: var(--stroke); background: #fff; }
.btn.ghost:hover { background: #f9f6fc; border-color: #cfb9e5; }
.btn.danger { color: var(--danger); background: #fff0f1; }
.btn.danger:hover { background: #ffe3e7; }
.btn.small { min-height: 34px; padding: 7px 11px; border-radius: 11px; font-size: 11px; }
.btn.icon-btn, .icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; min-width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 13px; border: 1px solid transparent; background: var(--soft); font-size: 17px; }
.btn svg { width: 16px; height: 16px; }
.btn .nav-icon { width: 16px; height: 16px; flex-basis: 16px; }
.btn-link { padding: 0; border: 0; background: transparent; color: var(--purple); font-size: 12px; font-weight: 600; }

.hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 163px; margin-bottom: 28px; padding: 30px 34px; overflow: hidden; border-radius: 20px; background: var(--gradient); color: #fff; }
.hero::after { content: ''; position: absolute; width: 200px; height: 200px; right: 40px; top: -115px; border: 1px solid #ffffff28; border-radius: 50%; pointer-events: none; }
.hero-copy { position: relative; z-index: 1; max-width: 640px; }
.hero h1, .hero h2 { margin: 0 0 9px; color: #fff; font-size: 26px; font-weight: 600; }
.hero p { margin: 0; max-width: 580px; font-size: 13px; line-height: 1.8; color: #f5f3ff; }
.hero .eyebrow { color: #faf3ff; margin-bottom: 10px; font-size: 10px; }
.hero .btn { background: #fff; color: var(--purple); margin-top: 17px; }
.hero-icon { display: grid; place-items: center; position: relative; flex: 0 0 72px; width: 72px; height: 72px; border-radius: 20px; background: #fffffff5; font-size: 32px; }
.hero-icon svg { width: 31px; height: 31px; color: var(--purple); }
.eyebrow { display: block; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-heading h2, .section-heading h3 { margin-bottom: 0; }
.section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.section-heading a { font-size: 11px; font-weight: 600; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 26px; align-items: start; }
.dashboard-grid > *, .dashboard-aside, .dashboard-grid section { min-width: 0; }
.shortcut-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.shortcut-card { display: flex; align-items: center; gap: 15px; min-height: 108px; padding: 20px 17px; border: 2px solid var(--stroke); border-radius: 18px; background: #fff; color: var(--text); text-align: left; transition: border-color .18s, box-shadow .18s, transform .18s; }
.shortcut-card:hover { border-color: #c4a4e4; box-shadow: 0 5px 16px #342c4708; transform: translateY(-2px); text-decoration: none; }
.shortcut-icon { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border-radius: 14px; background: #efeafe; font-size: 23px; }
.shortcut-icon svg { width: 23px; height: 23px; color: var(--purple); }
.shortcut-card:nth-child(2) .shortcut-icon { background: #eaf7ff; }
.shortcut-card:nth-child(3) .shortcut-icon { background: #effff1; }
.shortcut-card:nth-child(4) .shortcut-icon { background: #fff1f1; }
.shortcut-card:nth-child(5) .shortcut-icon { background: #f3e8ff; }
.shortcut-card:nth-child(6) .shortcut-icon { background: #eaf2ff; }
.shortcut-card:nth-child(7) .shortcut-icon { background: #fff8e7; }
.shortcut-card:nth-child(8) .shortcut-icon { background: #f3f1f8; }
.shortcut-copy { min-width: 0; }
.shortcut-copy h3, .shortcut-copy strong { display: block; font-size: 13px; font-weight: 600; margin: 0 0 5px; letter-spacing: -.015em; }
.shortcut-copy p, .shortcut-copy small { display: block; color: var(--muted); font-size: 10px; line-height: 1.65; margin: 0; }
.shortcut-card > svg:last-child { width: 15px; color: #c2b8cd; margin-left: auto; }
.dashboard-aside { display: grid; gap: 20px; }
.panel { border: 1.5px solid var(--stroke); border-radius: 18px; background: #fff; padding: 22px; }
.panel > :last-child { margin-bottom: 0; }
.panel > .section-heading { margin-bottom: 19px; }
.panel > .section-heading h2 { font-size: 16px; }
.panel + .panel { margin-top: 20px; }
.dashboard-aside > .panel + .panel { margin-top: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0 0 26px; }
.stat-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; min-height: 100px; padding: 18px 19px; border: 1px solid var(--stroke); border-radius: 17px; background: #fff; }
.stat-card strong { display: block; margin: 5px 0 2px; font-size: 26px; line-height: 1.2; letter-spacing: -.03em; }
.stat-card span, .stat-card p { margin: 0; color: var(--muted); font-size: 11px; }
.stat-card > svg { position: absolute; right: 18px; top: 21px; color: #a88fbd; width: 19px; height: 19px; }
.stat-card .stat-icon { position: absolute; right: 17px; top: 21px; }
.stat-icon .material-icon { width: 21px; height: 21px; color: #a88fbd; }

.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin: 3px 0 27px; }
.page-heading h1 { margin: 0 0 5px; }
.page-heading p { margin: 0; font-size: 12px; color: var(--muted); }
.page-heading .eyebrow { margin-bottom: 7px; }
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.breadcrumb { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 18px; font-size: 11px; color: var(--muted); }
.breadcrumb svg { width: 12px; height: 12px; }
.filters { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 23px; }
.filters .field { min-width: 170px; flex: 1; }
.filters .search-field { flex: 1 1 250px; }
.filters select { min-width: 160px; width: auto; max-width: 100%; min-height: 43px; }
.filters .tabs { margin: 0; }
.search-field { position: relative; display: flex; align-items: center; min-width: 0; }
.search-field > svg { position: absolute; left: 14px; width: 17px; height: 17px; color: #8a8193; pointer-events: none; }
.search-field input { width: 100%; padding-left: 42px; min-height: 44px; border-radius: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border: 1px solid var(--stroke); border-radius: 11px; background: white; font-size: 11px; line-height: 1.3; color: #68626c; }
.chip.active { background: var(--soft-purple); border-color: #d9bdec; color: var(--purple); }
.tabs { display: inline-flex; align-items: center; min-width: 265px; gap: 5px; padding: 5px; border: 1px solid #88818a; border-radius: 18px; background: #fff; margin-bottom: 20px; }
.tab { flex: 1; min-height: 39px; padding: 10px 20px; border: 0; border-radius: 13px; color: #6b6b6b; font-size: 12px; font-weight: 600; background: transparent; text-align: center; white-space: nowrap; }
.tab.active, .tab[aria-selected='true'] { background: var(--gradient); color: #fff; }
.tab:hover:not(.active) { background: #f7f3fb; }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.item-card { position: relative; display: flex; flex-direction: column; min-width: 0; border: 2px solid var(--stroke); border-radius: 18px; background: #fff; overflow: hidden; transition: border-color .16s; }
.item-card:hover { border-color: #d6c5e2; }
.item-cover { display: flex; align-items: center; justify-content: center; height: 130px; min-height: 90px; background: #f0eafa; color: #845fa5; font-size: 35px; overflow: hidden; }
.item-cover .material-icon, .cover-placeholder .material-icon { width: 38px; height: 38px; }
.item-cover img { width: 100%; height: 100%; object-fit: cover; }
.item-cover > svg { width: 33px; height: 33px; }
.item-body { flex: 1; padding: 18px; min-width: 0; }
.item-body > h3 { margin-bottom: 8px; font-size: 16px; overflow-wrap: anywhere; }
.item-body > h3 a { color: var(--text); }
.item-body > p { margin: 0 0 10px; font-size: 12px; color: var(--muted); line-height: 1.7; overflow-wrap: anywhere; }
.item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 11px; margin: 9px 0 0; font-size: 11px; color: var(--muted); }
.item-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.item-meta svg { width: 13px; height: 13px; }
.item-footer { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; padding: 12px 17px; border-top: 1px solid #efecf1; }
.item-footer .btn { min-height: 33px; border-radius: 10px; padding: 7px 10px; font-size: 11px; }
.item-footer .icon-btn { width: 33px; min-width: 33px; height: 33px; }
.item-footer > .badge { margin-right: auto; }
.badge { display: inline-flex; align-items: center; justify-content: center; padding: 5px 9px; border-radius: 9px; background: #f3ecfc; color: var(--purple); font-size: 10px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.badge.green, .badge.success { color: #0b8f3a; background: #eaf7ef; }
.badge.blue { color: #2a73ae; background: #eaf5ff; }
.badge.red { color: #d73838; background: #fff0f0; }
.badge.teal { color: #118d8f; background: #e6f8f8; }
.badge.gray { background: var(--soft); color: #6c6c6c; }
.badge.lesson { background: #8b2ce2; color: #fff; }
.badge.plan { background: #23bfc2; color: #fff; }
.badge.exam { background: #0b8f3a; color: #fff; }
.badge.event { background: #f04646; color: #fff; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; grid-column: 1 / -1; text-align: center; min-height: 255px; padding: 35px 25px; border: 1.5px dashed #e0d9e6; border-radius: 18px; background: #fdfbff; }
.empty-state > svg, .empty-state > .empty-icon { width: 45px; height: 45px; margin-bottom: 18px; color: #b29bca; font-size: 38px; }
.empty-icon .material-icon { width: 100%; height: 100%; }
.empty-state h2, .empty-state h3 { margin-bottom: 8px; font-size: 16px; }
.empty-state p { max-width: 350px; margin: 0 0 19px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.empty-state .btn { margin-top: 2px; }
.dashboard-aside .empty-state { min-height: 184px; padding: 25px 15px; border: 0; background: #faf8fd; border-radius: 13px; }
.dashboard-aside .empty-state p { font-size: 11px; margin-bottom: 0; }
.dashboard-aside .empty-state h3 { font-size: 13px; }
.dashboard-aside .empty-state > svg { width: 30px; height: 30px; margin-bottom: 11px; }

.calendar-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 23px; align-items: start; }
.calendar { padding: 22px; border: 1.5px solid var(--stroke); border-radius: 18px; background: #fff; }
.calendar-header { display: flex; align-items: center; justify-content: space-between; gap: 13px; margin-bottom: 21px; }
.calendar-header h2, .calendar-header h3 { margin: 0; font-size: 17px; text-transform: capitalize; }
.calendar-header > div { display: flex; gap: 6px; align-items: center; }
.calendar-header .icon-btn { width: 33px; min-width: 33px; height: 33px; min-height: 33px; border-radius: 10px; }
.calendar-week, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-week { margin-bottom: 9px; }
.calendar-week > * { padding: 8px 0; text-align: center; font-size: 11px; font-weight: 600; color: #8b818f; }
.calendar-grid { gap: 6px; }
.calendar-day { position: relative; min-width: 0; min-height: 65px; padding: 12px 7px 16px; border: 1px solid transparent; border-radius: 12px; background: #fff; text-align: center; font-size: 13px; }
.calendar-day:hover { background: #f6effd; }
.calendar-day.today { border-color: #bb86e2; color: var(--purple); }
.calendar-day.selected { background: var(--gradient); color: #fff; font-weight: 600; border-color: transparent; }
.calendar-day.outside { color: #c6c2c9; }
.day-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--purple); margin: 0 2px; }
.calendar-day > .day-dot { position: absolute; left: calc(50% - 2px); bottom: 10px; margin: 0; }
.calendar-day.selected .day-dot { background: #fff; }
.calendar-day .dots { display: flex; justify-content: center; position: absolute; bottom: 8px; left: 0; right: 0; }
.calendar .legend { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 9px 18px; border-top: 1px solid var(--stroke); margin-top: 18px; padding-top: 16px; font-size: 10px; color: var(--muted); }
.agenda-list { display: grid; gap: 12px; }
.agenda-date { margin: 14px 0 2px; color: #716576; font-size: 11px; font-weight: 600; text-transform: capitalize; }
.agenda-item { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 16px 14px; border: 1.5px solid var(--stroke); border-radius: 16px; background: #fff; color: var(--text); text-align: left; }
button.agenda-item { width: 100%; }
.agenda-item:hover { border-color: #d1bbdf; text-decoration: none; }
.agenda-time { flex: 0 0 43px; padding-top: 2px; font-size: 11px; font-weight: 600; color: #706379; }
.agenda-time small { display: block; font-size: 10px; color: var(--muted); }
.agenda-marker { align-self: stretch; flex: 0 0 3px; min-height: 34px; border-radius: 5px; background: var(--purple); }
.agenda-body { min-width: 0; flex: 1; }
.agenda-body h3, .agenda-body strong { display: block; font-size: 12px; margin: 0 0 4px; overflow-wrap: anywhere; }
.agenda-body p { color: var(--muted); font-size: 10px; margin: 0; }
.agenda-body .badge { font-size: 9px; margin-top: 7px; padding: 3px 6px; }
.agenda-item > .badge { font-size: 9px; }
.dashboard-aside .agenda-item { border: 0; border-radius: 0; padding: 13px 0; }
.dashboard-aside .agenda-item + .agenda-item { border-top: 1px solid #f0edf3; }

.table-wrap { max-width: 100%; border: 1.5px solid var(--stroke); border-radius: 18px; background: white; overflow-x: auto; }
.table, .table-wrap table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; }
.table th, .table-wrap th { padding: 14px 18px; background: #faf8fc; border-bottom: 1px solid var(--stroke); font-size: 10px; letter-spacing: .025em; color: #81758b; font-weight: 600; text-transform: uppercase; white-space: nowrap; }
.table td, .table-wrap td { padding: 15px 18px; border-bottom: 1px solid #efedf1; vertical-align: middle; }
.table tr:last-child td, .table-wrap tr:last-child td { border-bottom: 0; }
.table tbody tr:hover, .table-wrap tbody tr:hover { background: #fdfbff; }
.table .page-actions { flex-wrap: nowrap; }
.table .icon-btn { width: 33px; min-width: 33px; height: 33px; min-height: 33px; border-radius: 10px; }
.table .avatar { display: inline-grid; width: 32px; height: 32px; margin-right: 9px; vertical-align: middle; font-size: 14px; }

input, select, textarea { width: 100%; min-width: 0; color: var(--text); background: white; border: 1.5px solid var(--stroke); border-radius: 13px; padding: 11px 13px; min-height: 44px; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: #cfc4d7; }
input:focus, select:focus, textarea:focus { border-color: #b281d4; box-shadow: 0 0 0 3px #b281d415; }
input::placeholder, textarea::placeholder { color: #aba3b1; }
input[type='file'] { padding: 9px; font-size: 11px; }
input[type='file']::file-selector-button { border: 0; border-radius: 7px; background: #f0e8f8; padding: 7px 9px; margin-right: 10px; color: #744890; font: inherit; cursor: pointer; }
input[type='color'] { width: 54px; padding: 4px; }
input[type='checkbox'], input[type='radio'] { width: 17px; min-height: 17px; height: 17px; margin: 0; accent-color: var(--purple); border-radius: 4px; flex: 0 0 17px; }
input[readonly] { background: #f9f7fb; color: #76677f; }
textarea { min-height: 112px; resize: vertical; line-height: 1.6; }
select { padding-right: 28px; }
label { font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .field > span:first-child { font-size: 11px; font-weight: 600; color: #574b61; }
.field-help { font-size: 10px; color: var(--muted); line-height: 1.65; margin: 0; }
.form-error { border: 1px solid #efc2ca; background: #fff2f4; color: #a72a43; border-radius: 12px; padding: 12px 14px; font-size: 12px; margin: 0 0 15px; }
.form-error:empty { display: none; }
.form-success { border: 1px solid #bedcc9; background: #f0faf4; color: #277446; border-radius: 12px; padding: 12px 14px; font-size: 12px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 9px; padding: 5px 0; font-size: 12px; line-height: 1.6; }
.checkbox-row input { margin-top: 2px; }
.checkbox-row + .checkbox-row { margin-top: 5px; }
.form-section { grid-column: 1 / -1; border-top: 1px solid var(--stroke); margin-top: 4px; padding-top: 20px; }
.form-section h3 { margin-bottom: 13px; font-size: 14px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 28px; background: #28183770; backdrop-filter: blur(4px); }
.modal { display: flex; flex-direction: column; width: 100%; max-width: 720px; max-height: calc(100dvh - 56px); border: 1px solid #eee7f3; border-radius: 22px; background: white; box-shadow: 0 24px 100px #25153429; overflow: hidden; animation: modal-in .18s ease-out; }
.modal.wide { max-width: 950px; }
.modal.narrow { max-width: 470px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; flex: 0 0 auto; gap: 18px; padding: 23px 26px; border-bottom: 1px solid #eeeaf2; }
.modal-header h2 { margin: 0; font-size: 20px; }
.modal-header p { margin: 5px 0 0; font-size: 11px; color: var(--muted); }
.modal-header .icon-btn { flex: 0 0 34px; width: 34px; height: 34px; min-height: 34px; min-width: 34px; border-radius: 11px; color: #766780; }
.modal-body { padding: 25px 26px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.modal-footer { flex: 0 0 auto; display: flex; justify-content: flex-end; align-items: center; gap: 9px; padding: 18px 26px; border-top: 1px solid #eeeaf2; background: #fdfbff; }
.modal > form { display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.modal-body > :last-child { margin-bottom: 0; }
.modal-footer .muted { margin-right: auto; font-size: 10px; }
.materials, .slot-list { display: grid; gap: 10px; }
.material-row { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--stroke); border-radius: 12px; background: #fcfaff; font-size: 11px; }
.material-row > a { min-width: 0; overflow-wrap: anywhere; }
.material-row > span { flex: 1; overflow-wrap: anywhere; }
.material-row .icon-btn { margin-left: auto; flex: 0 0 30px; min-height: 30px; height: 30px; min-width: 30px; width: 30px; }
.slot-card { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) 34px; gap: 9px; align-items: end; padding: 13px; border: 1px solid var(--stroke); border-radius: 14px; background: #fcfaff; }
.slot-card .icon-btn { width: 34px; min-width: 34px; height: 42px; }
.question-card { padding: 19px; border: 1.5px solid var(--stroke); border-radius: 15px; background: #fff; margin-bottom: 15px; }
.question-card > .section-heading { margin-bottom: 13px; }
.question-card h3 { font-size: 14px; }
.question-card .field + .field { margin-top: 11px; }
.question-card .options { display: grid; gap: 8px; margin: 13px 0; }
.question-card .option { display: flex; align-items: center; gap: 8px; }
.question-card .option > span { width: 22px; flex: 0 0 22px; color: #96879f; font-size: 11px; }
.detail-section { margin-bottom: 25px; }
.detail-section > h3 { font-size: 13px; color: #675571; margin-bottom: 11px; }
.detail-section > p { white-space: pre-wrap; line-height: 1.9; font-size: 13px; overflow-wrap: anywhere; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px; margin-bottom: 25px; }
.detail-grid > div { padding: 13px 16px; background: #f8f5fc; border-radius: 12px; min-width: 0; overflow-wrap: anywhere; }
.detail-grid small { display: block; margin-bottom: 4px; color: #8b7b95; font-size: 10px; }
.detail-grid strong { font-size: 12px; }
.detail-image { width: 100%; max-height: 280px; object-fit: cover; border-radius: 15px; margin-bottom: 22px; }

.note-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 22px; }
.note-card { position: relative; padding: 22px; min-height: 192px; border: 1px solid #0000000e; border-radius: 18px; background: #fff2ac; overflow-wrap: anywhere; }
.note-card h3 { font-size: 15px; margin-bottom: 12px; }
.note-card p { font-size: 13px; line-height: 1.85; white-space: pre-wrap; }
.note-card small { color: #60584b; font-size: 10px; }
.note-card .page-actions { margin-top: 20px; justify-content: flex-end; }
.note-card .btn { background: #ffffff80; }
.calculator { width: 100%; max-width: 390px; padding: 24px; border: 1.5px solid var(--stroke); border-radius: 20px; background: white; margin: 0 auto; }
.calc-display { display: block; width: 100%; min-height: 94px; overflow: hidden; padding: 20px 15px; margin-bottom: 16px; border: 1px solid #e7ddee; border-radius: 15px; background: #faf7fe; color: #644779; text-align: right; font-size: 31px; font-variant-numeric: tabular-nums; }
.calc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.calc-grid button { min-height: 57px; border: 0; border-radius: 14px; background: #f5f1f8; color: #695574; font-size: 19px; }
.calc-grid button:hover { background: #eadef3; }
.calc-grid button.operator { background: #ead7fa; color: var(--purple); }
.calc-grid button.equals { background: var(--gradient); color: white; }
.calc-grid button.zero, .calc-grid button.wide { grid-column: span 2; }
.help-grid, .settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 21px; }
.help-card { padding: 24px; border: 1.5px solid var(--stroke); border-radius: 18px; background: white; }
.help-card h3 { font-size: 16px; }
.help-card p { color: var(--muted); font-size: 12px; line-height: 1.85; }
.help-card > svg { width: 27px; height: 27px; margin-bottom: 16px; color: var(--purple); }
.help-card a { font-size: 12px; font-weight: 600; }
details { border: 1px solid var(--stroke); border-radius: 13px; margin-bottom: 11px; padding: 15px 17px; }
summary { cursor: pointer; color: #574361; font-size: 12px; font-weight: 600; }
details p { margin: 13px 0 0; color: var(--muted); font-size: 12px; line-height: 1.85; }
.settings-grid .panel + .panel { margin-top: 0; }
.settings-grid .panel p { color: var(--muted); font-size: 12px; }
.settings-grid .panel form { display: grid; gap: 14px; }
.tutorial-frame { width: 100%; min-height: 65vh; border: 0; }
.toast-container { position: fixed; z-index: 200; right: 25px; bottom: 25px; display: grid; gap: 10px; max-width: min(400px, calc(100vw - 40px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border: 1px solid #dcc8ea; border-radius: 14px; background: white; box-shadow: 0 8px 35px #3a204026; color: #57336a; font-size: 12px; animation: modal-in .2s ease-out; }
.toast.error { border-color: #eeb7c1; color: #a52d47; }
.toast.success { border-color: #bbdbc7; color: #287349; }
.loading { display: flex; align-items: center; justify-content: center; min-height: 200px; gap: 12px; color: var(--muted); font-size: 12px; }
.spinner { display: inline-block; width: 22px; height: 22px; border: 2px solid #eaddf4; border-top-color: var(--purple); border-radius: 50%; animation: spin .7s linear infinite; }
.print-sheet { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Shared screen components used by the content and tools modules. */
.auth-card form.form-grid { grid-template-columns: 1fr; }
.auth-card .form-error:empty { display: none; }
.auth-card .btn.auth-forgot { display: block; width: auto; min-height: 0; border: 0; background: transparent; border-radius: 0; margin: 17px 0 0 auto; padding: 0; font-size: 11px; }
.auth-card .auth-switch .btn { width: auto; min-height: 0; margin: 0; padding: 0; border: 0; background: transparent; color: var(--purple); font-size: 13px; }
.nav-section-label { margin: 1px 14px 15px; color: #998aa3; font-size: 9px; letter-spacing: .11em; }
.sidebar .nav-icon { color: inherit; opacity: .8; }
.sidebar .active .nav-icon { color: var(--purple); opacity: 1; }
.sidebar .brand { min-height: 78px; margin-bottom: 18px; }
.sidebar .brand img { width: 158px; }
.sidebar .nav-link { min-height: 40px; padding-top: 9px; padding-bottom: 9px; }
.sidebar nav { gap: 4px; }
.sidebar-footer { padding-top: 18px; }
.sidebar-footer .nav-link { min-height: 38px; padding-top: 8px; padding-bottom: 8px; }
.sidebar-note { margin: 20px 9px 0; padding: 16px 12px 0; border-top: 1px solid var(--stroke); }
.sidebar-note strong { display: block; font-size: 10px; color: #8c729d; }
.sidebar-note span { display: block; margin-top: 4px; color: #ada0b5; font-size: 10px; }
.welcome > span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.topbar-date { font-size: 11px; color: #9a8da3; margin-right: 13px; }
.stat-card { color: var(--text); }
.stat-card:hover { border-color: #d3b8e4; text-decoration: none; }
.shortcut-arrow { align-self: flex-start; margin-left: auto; color: #bcb0c6; font-size: 15px; }
.shortcut-arrow .material-icon { width: 16px; height: 16px; }
.text-link .material-icon, .tool-link .material-icon, .back-link .material-icon { width: 16px; height: 16px; }
.back-link .material-icon { margin-right: 3px; }
.tip-card { display: flex; align-items: flex-start; gap: 12px; padding: 20px; background: #f8f4fc; border-radius: 16px; }
.tip-card > span { font-size: 21px; }
.tip-card > span .material-icon { width: 23px; height: 23px; color: var(--purple); }
.tip-card strong { display: block; font-size: 12px; color: #7b558f; }
.tip-card p { margin: 7px 0 0; font-size: 10px; color: #9b89a5; line-height: 1.8; }
.dashboard-aside .full.btn { width: 100%; margin-top: 17px; }
.text-button { display: inline; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; }
.text-button:hover { color: var(--purple); }
.text-link { font-size: 11px; font-weight: 600; }
.danger-text { color: var(--danger) !important; }
.item-cover { width: 100%; border: 0; }
.item-footer { justify-content: space-between; }
.item-footer > div { display: flex; align-items: center; gap: 6px; }
.item-body > .item-meta:first-child { margin: 0 0 11px; }
.card-description { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-field > span { position: absolute; left: 14px; top: 7px; color: #93849f; font-size: 23px; pointer-events: none; }
.result-count { margin-left: auto; font-size: 10px; white-space: nowrap; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 24px 0 0; font-size: 11px; color: var(--muted); }
.agenda-time > span { display: block; font-size: 10px; font-weight: 400; color: var(--muted); }
.agenda-body > .badge:first-child { margin: 0 0 7px; }
.agenda-item > .icon-btn { width: 28px; min-width: 28px; height: 29px; min-height: 29px; border-radius: 9px; }
.kind-lessons { background: #8b2ce2; }
.kind-plans { background: #23bfc2; }
.kind-events { background: #f04646; }
.kind-exams { background: #0b8f3a; }
.calendar-layout { grid-template-columns: minmax(310px, .9fr) minmax(0, 1.1fr); }
.calendar-layout > .panel + .panel { margin-top: 0; }
.calendar-layout > aside.panel { padding: 19px; }
.calendar-layout > aside.panel .calendar { border: 0; padding: 0; }
.calendar-layout > aside.panel > .btn { width: 100%; margin-top: 18px; }
.calendar-header > strong { text-transform: capitalize; font-size: 16px; }
.calendar-legend { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--stroke); }
.calendar-legend > span { display: inline-flex; align-items: center; gap: 5px; font-size: 9px; color: var(--muted); }
.calendar-legend .agenda-marker { display: inline-block; width: 6px; height: 6px; min-height: 0; flex-basis: 6px; align-self: center; border-radius: 50%; }
.cover-editor { display: flex; align-items: center; gap: 17px; padding: 17px; border: 1px solid var(--stroke); border-radius: 14px; background: #fcfaff; }
.cover-editor strong { font-size: 12px; }
.cover-editor p { margin: 3px 0 10px; font-size: 10px; }
.cover-preview, .cover-placeholder { width: 83px; height: 83px; border-radius: 13px; object-fit: cover; }
.cover-placeholder { display: grid; place-items: center; background: #f0e6f8; font-size: 30px; }
.cover-editor .btn { min-height: 33px; padding: 8px 12px; font-size: 10px; }
.detail-cover { max-width: 100%; max-height: 260px; object-fit: contain; border-radius: 14px; margin: 0 auto 24px; }
.preserve-lines { white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-grid { align-items: start; }
.detail-grid > .badge { width: fit-content; }
.detail-grid > p { margin: 0; font-size: 12px; }
.slot-card { display: block; padding: 16px; margin-bottom: 12px; }
.slot-card > .section-heading { margin-bottom: 12px; }
.slot-card > .section-heading strong { font-size: 11px; text-transform: capitalize; }
.slot-card > strong { display: block; margin-bottom: 10px; font-size: 12px; text-transform: capitalize; }
.slot-card > p { font-size: 11px; margin: 8px 0 0; line-height: 1.8; }
.slot-card > p .btn { margin-left: 10px; min-height: 29px; padding: 6px 9px; font-size: 10px; }
.slot-item { margin-top: 12px; padding-top: 12px; border-top: 1px solid #e8e0ee; }
.slot-item .form-grid { grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr)); gap: 9px; }
.slot-item > .btn { margin-top: 9px; min-height: 29px; padding: 6px 9px; font-size: 10px; }
details[open] > .form-grid { margin-top: 17px; }
.recovery-code { border: 1px dashed #b88acf; background: #faf5fd; padding: 17px; border-radius: 12px; text-align: center; font-family: monospace; font-size: 19px; letter-spacing: .12em; color: #743b94; overflow-wrap: anywhere; }
.card { padding: 23px; border: 1.5px solid var(--stroke); border-radius: 18px; background: #fff; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 19px; }
.section-header h1, .section-header h2, .section-header h3 { margin-bottom: 6px; }
.section-header p { margin: 0; font-size: 12px; }
.page-header { margin: 3px 0 27px; }
.back-link { display: inline-block; margin-bottom: 11px; font-size: 11px; font-weight: 600; }
.btn-secondary { background: var(--soft); color: var(--text); }
.card-actions, .modal-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.card-actions { margin-top: 15px; }
.modal-actions { border-top: 1px solid var(--stroke); margin-top: 20px; padding-top: 18px; }
.form-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 17px; }
.form-field > label { color: #675571; font-size: 11px; font-weight: 600; }
.checkbox-label { display: flex; gap: 9px; align-items: center; margin-top: 15px; font-size: 12px; }
.tools-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.tool-card, .tutorial-card { display: flex; flex-direction: column; align-items: flex-start; text-align: left; color: var(--text); transition: border-color .16s, transform .16s; }
.tool-card:hover, .tutorial-card:hover { transform: translateY(-2px); border-color: #cab0e2; text-decoration: none; }
.tool-icon { display: inline-flex; width: 52px; height: 52px; align-items: center; justify-content: center; font-size: 26px; margin-bottom: 18px; border-radius: 16px; background: #f2e8fc; }
.tool-icon .material-icon { width: 28px; height: 28px; color: var(--purple); }
.note-heading .material-icon { width: 18px; height: 18px; }
.material-row > span .material-icon { width: 18px; height: 18px; margin-right: 4px; color: var(--purple); }
.tool-card:nth-child(2) .tool-icon, .tutorial-card:nth-child(2n) .tool-icon { background: #eaf7ff; }
.tool-card:nth-child(3) .tool-icon, .tutorial-card:nth-child(3n) .tool-icon { background: #fff6dc; }
.tool-card h2 { font-size: 17px; margin-bottom: 9px; }
.tool-card p, .tutorial-card p { font-size: 11px; line-height: 1.8; margin-bottom: 20px; }
.tool-link { display: block; margin-top: auto; color: var(--purple); font-size: 11px; font-weight: 600; }
.tutorial-card h3 { font-size: 14px; }
.calculator-display { padding: 15px 17px; background: #faf6fe; border: 1px solid #e5d8ef; border-radius: 15px; margin-bottom: 17px; }
.calculator-display > label { font-size: 10px; }
.calculator-expression { border: 0; background: transparent; box-shadow: none; padding: 5px 0; min-height: 35px; font-size: 14px; text-align: right; color: #9b86aa; border-radius: 0; }
.calculator-expression:focus { box-shadow: none; }
.calculator-display output { display: block; text-align: right; font-size: 29px; color: #684280; overflow-wrap: anywhere; min-height: 45px; line-height: 1.4; }
.calculator-display output.error { font-size: 13px; color: var(--danger); }
.calculator-keys { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.calculator-keys .btn { min-height: 53px; border-radius: 13px; font-size: 18px; }
.calculator-keys .btn:nth-child(4n) { background: #ead7fa; color: var(--purple); }
.calculator > p { margin: 20px 0 0; font-size: 10px; line-height: 1.8; text-align: center; }
.notes-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.notes-grid .note-card { display: flex; flex-direction: column; }
.note-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.note-text { flex: 1; }
.notes-count { font-size: 11px; }
.note-card footer { margin-top: auto; }
.note-card .card-actions { margin-top: 12px; }
.note-card .card-actions .btn { min-height: 31px; padding: 7px 10px; font-size: 10px; }
.note-color-picker { padding: 13px 8px 9px; border: 1px solid var(--stroke); border-radius: 14px; }
.note-color-picker legend { padding: 0 6px; font-size: 11px; color: #675571; }
.note-color-picker label { font-size: 10px; }
.calendar-day.is-outside { color: #c3bec9; }
.calendar-day.is-today { background: var(--soft-purple); border-color: #cca8e2; color: var(--purple); }
.calendar-weekday { padding: 8px 0; text-align: center; color: #8b818f; font-size: 11px; font-weight: 600; }
.calendar-event-count { display: block; width: fit-content; max-width: 100%; margin: 5px auto 0; padding: 2px 5px; border-radius: 5px; background: #f1e4fb; color: #8b4fad; font-size: 9px; white-space: nowrap; }
.calendar-header .card-actions { margin-top: 0; }
.faq-list { border: 0; padding: 0; }
.support-ticket { padding: 18px 0; border-top: 1px solid var(--stroke); }
.support-ticket > p { font-size: 12px; line-height: 1.8; }
.support-ticket .section-header { margin-bottom: 12px; }

@media (min-width: 1740px) {
  .main-content { margin-left: calc(var(--sidebar-width) + (100vw - 1740px) / 2); }
}

@media (max-height: 800px) and (min-width: 801px) {
  .sidebar-note { display: none; }
}

@media (max-width: 1100px) {
  :root { --sidebar-width: 216px; }
  .sidebar { padding-left: 13px; padding-right: 13px; }
  .brand { margin-bottom: 22px; }
  .brand img { width: 155px; }
  .main-content { padding: 27px 26px 40px; }
  .nav-link { padding: 11px 12px; gap: 10px; font-size: 12px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) 265px; gap: 19px; }
  .shortcut-card { flex-direction: column; align-items: flex-start; min-height: 144px; padding: 17px; gap: 10px; }
  .shortcut-card > svg:last-child { display: none; }
  .shortcut-copy h3, .shortcut-copy strong { margin-bottom: 4px; }
  .shortcut-grid { gap: 12px; }
  .panel { padding: 19px; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar-layout { grid-template-columns: minmax(0, 1fr); }
  .calendar-layout > .panel .agenda-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar-layout > .panel .agenda-date { grid-column: 1 / -1; }
  .calendar-day { min-height: 64px; }
  .hero { padding: 28px; gap: 19px; }
  .hero h1, .hero h2 { font-size: 23px; }
  .hero p { font-size: 12px; }
  .hero-icon { width: 60px; height: 60px; flex-basis: 60px; font-size: 27px; }
  .topbar-actions > .muted { display: none; }
  .stat-grid { gap: 10px; }
  .stat-card { padding: 15px; }
  .stat-card > svg, .stat-card .stat-icon { right: 13px; top: 17px; }
  .note-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .notes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tools-grid { gap: 14px; }
  .tool-card, .tutorial-card { padding: 19px; }
  .topbar-date { display: none; }
  .shortcut-arrow { display: none; }
  .auth-screen { padding: 6vh 40px; gap: 6vw; }
  .auth-brand { padding-right: 12px; }
  .auth-brand h1 { font-size: 26px; }
  .auth-logo { width: 245px; }
}

@media (max-width: 800px) {
  .sidebar { display: none; }
  .main-content { width: 100%; max-width: none; margin: 0; padding: 21px 22px 106px; min-height: 100dvh; }
  .mobile-nav { display: flex; position: fixed; inset: auto 0 0; z-index: 50; align-items: stretch; justify-content: space-around; min-height: 70px; padding: 6px 9px max(7px, env(safe-area-inset-bottom)); background: var(--purple-dark); box-shadow: 0 -2px 14px #41234d14; }
  .mobile-nav .nav-link { display: flex; flex: 1; flex-direction: column; justify-content: center; align-items: center; min-width: 0; min-height: 55px; gap: 5px; border-radius: 12px; padding: 5px 3px; color: #e9d7f0; background: transparent; text-align: center; font-size: 10px; font-weight: 400; }
  .mobile-nav .nav-link.active { color: #fff; background: #ffffff13; font-weight: 600; }
  .mobile-nav .nav-link:hover { background: #ffffff13; }
  .mobile-nav .nav-icon, .mobile-nav .nav-icon svg { width: 23px; height: 23px; color: inherit; }
  .topbar { margin-bottom: 20px; gap: 11px; }
  .welcome h1, .welcome h2, .welcome strong { font-size: 17px; }
  .avatar { width: 43px; height: 43px; flex-basis: 43px; font-size: 20px; }
  .topbar .btn { min-height: 37px; border-radius: 12px; padding: 8px 12px; font-size: 11px; }
  .topbar .icon-btn { width: 37px; min-width: 37px; height: 39px; }
  .topbar-actions { gap: 7px; }
  .welcome > span { font-size: 11px; }
  .hero { min-height: 135px; margin-bottom: 22px; padding: 23px; }
  .hero h1, .hero h2 { font-size: 22px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) 260px; gap: 18px; }
  .shortcut-card { min-height: 139px; }
  .shortcut-copy h3, .shortcut-copy strong { font-size: 12px; }
  .dashboard-grid .panel { padding: 17px; }
  .page-heading { margin-bottom: 22px; }
  .page-heading h1 { font-size: 24px; }
  .page-heading p { font-size: 11px; }
  .page-actions { gap: 7px; }
  .calendar { padding: 20px; }
  .calendar-layout { gap: 18px; }
  .modal-backdrop { padding: 20px; }
  .modal { max-height: calc(100dvh - 40px); }
  .toast-container { bottom: 89px; right: 18px; }
  .auth-screen { gap: 0; padding: 35px 25px; grid-template-columns: 1fr; align-content: center; }
  .auth-screen::before { inset: 0; background-size: 100% 100%; }
  .auth-brand { padding: 0; gap: 0; margin-bottom: 23px; }
  .auth-brand > div, .auth-brand h1, .auth-brand p, .auth-brand .eyebrow { display: none; }
  .auth-brand .auth-logo { width: 215px; }
  .auth-card { max-width: 410px; padding: 0; }
  .auth-card h1, .auth-card h2 { color: #fff; font-size: 23px; text-align: center; }
  .auth-card > p { color: #fff; font-size: 12px; text-align: center; margin-bottom: 22px; }
  .auth-card .field > label, .auth-card .field > span:first-child { color: #fff; }
  .auth-card input { border: 0; min-height: 54px; border-radius: 21px; padding: 15px 18px; }
  .auth-card .btn.primary { background: #9b6bff; }
  .auth-card .auth-forgot { color: white; }
  .auth-card .auth-switch { color: #655c74; margin-top: 32px; }
  .auth-card .auth-footer { color: #74697f; margin-top: 22px; }
  .auth-card .auth-switch button { color: #733eb0; }
  .auth-card .field-help { color: #fff; }
  .auth-card .checkbox-row { color: #fff; }
  .auth-card .btn.auth-forgot { color: #fff; }
  .desktop-only { display: none; }
}

@media (max-width: 620px) {
  .dashboard-grid { grid-template-columns: 1fr; gap: 24px; }
  .shortcut-card { flex-direction: row; align-items: center; min-height: 100px; padding: 16px 12px; gap: 11px; }
  .shortcut-copy h3, .shortcut-copy strong { font-size: 13px; }
  .shortcut-icon { width: 38px; height: 38px; flex-basis: 38px; font-size: 20px; border-radius: 14px; }
  .shortcut-copy p, .shortcut-copy small { font-size: 10px; }
  .dashboard-aside { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .stat-card { min-height: 87px; padding: 14px 12px; }
  .stat-card strong { font-size: 24px; }
  .stat-card span, .stat-card p { font-size: 10px; }
  .stat-card > svg, .stat-card .stat-icon { display: none; }
  .page-heading { align-items: flex-start; gap: 12px; }
  .page-heading h1 { font-size: 21px; }
  .page-heading .btn { padding: 10px 12px; font-size: 11px; }
  .page-heading .page-actions { flex-wrap: nowrap; }
  .card-grid { grid-template-columns: 1fr; gap: 14px; }
  .item-card { display: grid; grid-template-columns: 82px minmax(0, 1fr); align-items: start; padding-top: 15px; }
  .item-cover { width: 59px; height: 59px; min-height: 59px; font-size: 27px; margin: 2px 0 0 15px; border-radius: 14px; }
  .item-cover > svg { width: 24px; height: 24px; }
  .item-body { padding: 0 15px 14px 1px; }
  .item-body h3 { font-size: 14px; margin-bottom: 6px; }
  .item-body > p { font-size: 11px; }
  .item-meta { font-size: 10px; gap: 5px 8px; }
  .item-footer { grid-column: 1 / -1; padding: 10px 14px; }
  .calendar-layout > .panel .agenda-list { grid-template-columns: 1fr; }
  .help-grid, .settings-grid { grid-template-columns: 1fr; gap: 16px; }
  .tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-card:last-child { grid-column: auto; }
  .calendar-layout { grid-template-columns: minmax(0, 1fr); }
  .help-card { padding: 20px; }
  .note-grid { gap: 13px; }
  .note-card { padding: 17px; }
  .filters { gap: 10px; margin-bottom: 18px; }
  .filters .search-field { flex-basis: 100%; }
  .filters select { flex: 1; min-width: 130px; }
  .filters > .tabs { flex: 1; min-width: 100%; }
  .filters > .btn { flex: 0; }
  .modal-backdrop { padding: 10px; }
  .modal { border-radius: 18px; max-height: calc(100dvh - 20px); }
  .modal-header { padding: 18px; }
  .modal-header h2 { font-size: 18px; }
  .modal-body { padding: 20px 18px; }
  .modal-footer { padding: 15px 18px; }
  .form-grid { gap: 15px 12px; }
  .slot-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 30px; gap: 10px 8px; }
  .slot-card > .field:first-child { grid-column: 1 / 3; }
  .slot-card .icon-btn { grid-column: 3; grid-row: 1; align-self: center; }
  .question-card { padding: 15px; }
  .slot-item .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .slot-item .form-grid > .field:first-child { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .main-content { padding: 18px 18px 100px; }
  .topbar { gap: 9px; margin-bottom: 16px; }
  .welcome h1, .welcome h2, .welcome strong { font-size: 16px; }
  .welcome p, .welcome small { font-size: 10px; }
  .welcome > span { font-size: 10px; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .btn { font-size: 10px; padding: 9px 10px; }
  .hero { min-height: 124px; padding: 17px; gap: 12px; margin-bottom: 21px; }
  .hero h1, .hero h2 { font-size: 16px; line-height: 1.45; margin-bottom: 6px; }
  .hero p { font-size: 10px; line-height: 1.8; }
  .hero .eyebrow { display: none; }
  .hero-icon { flex-basis: 46px; width: 46px; height: 46px; border-radius: 16px; font-size: 21px; }
  .hero-icon svg { width: 23px; height: 23px; }
  .section-heading { margin-bottom: 13px; }
  .section-heading h2 { font-size: 16px; }
  .section-heading p { font-size: 10px; }
  .shortcut-grid { gap: 11px; }
  .shortcut-card { min-height: 110px; padding: 13px 11px; gap: 8px; }
  .shortcut-icon { width: 34px; height: 36px; flex-basis: 34px; font-size: 18px; border-radius: 12px; }
  .shortcut-copy h3, .shortcut-copy strong { font-size: 11px; line-height: 1.45; margin-bottom: 3px; }
  .shortcut-copy p, .shortcut-copy small { font-size: 9px; line-height: 1.6; }
  .stat-grid { gap: 7px; margin-bottom: 22px; }
  .stat-card { border-radius: 13px; padding: 12px 9px; min-height: 80px; }
  .stat-card strong { font-size: 22px; }
  .stat-card span, .stat-card p { font-size: 9px; }
  .page-heading { flex-wrap: wrap; gap: 14px; margin-bottom: 19px; }
  .page-heading h1 { font-size: 22px; }
  .page-heading > .page-actions { flex: 1 1 100%; justify-content: flex-start; }
  .page-heading > .page-actions > .primary { margin-left: auto; }
  .page-heading p { font-size: 11px; }
  .page-actions .btn { min-height: 37px; }
  .tabs { min-width: 100%; }
  .tab { font-size: 11px; padding: 9px 14px; }
  .filters .field { min-width: 130px; }
  .calendar { padding: 16px 12px; }
  .calendar-header { gap: 7px; padding: 0 3px; margin-bottom: 15px; }
  .calendar-header h2, .calendar-header h3 { font-size: 15px; }
  .calendar-week > * { font-size: 10px; }
  .calendar-grid { gap: 3px; }
  .calendar-day { min-height: 46px; padding: 8px 3px 12px; font-size: 12px; border-radius: 11px; }
  .calendar-day > .day-dot { bottom: 5px; width: 4px; height: 4px; }
  .calendar-day .dots { bottom: 5px; }
  .calendar .legend { font-size: 9px; gap: 7px 11px; }
  .panel { padding: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .modal .field label { font-size: 11px; }
  .modal-footer .btn { font-size: 11px; padding: 11px 13px; }
  .modal-footer .muted { max-width: 115px; }
  .note-grid { grid-template-columns: 1fr; }
  .notes-grid { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: 1fr; gap: 14px; }
  .tool-card, .tutorial-card { padding: 21px; }
  .tool-icon { width: 44px; height: 44px; font-size: 23px; margin-bottom: 13px; }
  .page-header { align-items: flex-start; flex-wrap: wrap; }
  .page-header h1 { font-size: 23px; }
  .page-header p { font-size: 11px; }
  .calendar-event-count { font-size: 8px; padding: 2px 3px; }
  .cover-editor { gap: 12px; padding: 13px; }
  .cover-preview, .cover-placeholder { width: 64px; height: 64px; }
  .cover-editor > div:last-child { min-width: 0; }
  .cover-editor .btn { padding: 7px 9px; }
  .slot-card { padding: 13px; }
  .slot-card > .section-heading { gap: 9px; }
  .slot-card > .section-heading strong { font-size: 10px; }
  .slot-card > .section-heading > .btn { font-size: 10px; padding: 9px 10px; min-height: 34px; }
  .note-card { min-height: 158px; }
  .detail-grid { gap: 10px; }
  .detail-grid > div { padding: 12px; }
  .empty-state { min-height: 230px; padding: 28px 20px; }
  .empty-state h2, .empty-state h3 { font-size: 15px; }
  .empty-state p { font-size: 11px; }
  .auth-screen { padding: 25px 28px 38px; min-height: 100svh; }
  .auth-brand { margin-bottom: 20px; }
  .auth-brand .auth-logo { width: 205px; }
  .auth-card h1, .auth-card h2 { font-size: 21px; }
  .auth-card > p { margin-bottom: 19px; font-size: 11px; }
  .auth-card form { gap: 15px; }
  .auth-card .auth-footer { font-size: 10px; margin-top: 18px; }
  .toast-container { left: 18px; right: 18px; max-width: none; }
  .toast { font-size: 11px; padding: 14px 16px; }
  .table th, .table-wrap th, .table td, .table-wrap td { padding: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  @page { size: A4; margin: 18mm; }
  body.printing { background: #fff; color: #111; }
  body.printing > * { display: none !important; }
  body.printing > .print-sheet, body.printing .print-sheet { display: block !important; position: static; width: auto; max-width: none; margin: 0; padding: 0; border: 0; color: #111; font-family: 'Open Sans', sans-serif; font-size: 11pt; }
  .print-sheet h1 { font-size: 20pt; margin: 0 0 10mm; }
  .print-sheet h2 { font-size: 14pt; margin: 8mm 0 4mm; }
  .print-sheet h3 { font-size: 12pt; }
  .print-sheet p { margin: 0 0 4mm; white-space: pre-wrap; line-height: 1.7; }
  .print-sheet .question { break-inside: avoid; margin-bottom: 8mm; }
  .print-sheet .print-question { break-inside: avoid; margin-bottom: 8mm; }
  .print-sheet .student-line { margin: 6mm 0 10mm; font-size: 10pt; line-height: 2; }
  .print-sheet .question-card { padding: 0; border: 0; border-radius: 0; break-inside: avoid; margin-bottom: 9mm; }
  .print-sheet .answer-lines { min-height: 25mm; background: repeating-linear-gradient(transparent 0, transparent 7mm, #bbb 7.2mm, transparent 7.4mm); }
  .print-sheet .answer-key { break-before: page; }
  .print-sheet img { max-width: 100%; max-height: 70mm; object-fit: contain; }
  .print-sheet table { width: 100%; border-collapse: collapse; }
  .print-sheet td, .print-sheet th { border: 1px solid #aaa; padding: 3mm; text-align: left; }
  .print-sheet .print-meta { border: 1px solid #bbb; padding: 5mm; margin-bottom: 7mm; }
  .print-sheet .muted { color: #555; }
  .print-sheet .badge { border: 1px solid #aaa; background: #fff !important; color: #111 !important; }
  .print-sheet .btn { display: none; }
}
