:root {
  --ink: #16201f;
  --muted: #6f7b78;
  --line: #dde6e2;
  --paper: #fbfaf6;
  --panel: #ffffff;
  --green: #326b52;
  --blue: #426d9b;
  --gold: #d8a63c;
  --rose: #b45d5d;
  --shadow: 0 18px 48px rgba(23, 37, 33, 0.12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(180deg, #f7faf7 0%, #eef4f1 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 26px 20px; background: rgba(255,255,255,.82); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 22px; font-weight: 800; }
.brand-mark { width: 31px; height: 31px; border-radius: 8px; display: grid; place-items: center; color: #fff; background: var(--green); font-size: 16px; }
.side-nav { display: grid; gap: 6px; }
.nav-item, .mobile-item, .text-button, .ghost { border: 0; background: transparent; color: var(--muted); }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 13px 14px; border-radius: 8px; text-align: left; font-weight: 800; }
.nav-item.active { color: var(--green); background: #edf6ef; }
.tab-icon { width: 18px; height: 18px; display: inline-block; flex: 0 0 auto; background: currentColor; mask-repeat: no-repeat; mask-position: center; mask-size: contain; }
.icon-today { mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 2h2v3H7V2Zm8 0h2v3h-2V2ZM4 5h16a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2Zm0 6v9h16v-9H4Z'/%3E%3C/svg%3E"); }
.icon-courses { mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 4h7v7H4V4Zm9 0h7v7h-7V4ZM4 13h7v7H4v-7Zm9 0h7v7h-7v-7Z'/%3E%3C/svg%3E"); }
.icon-tasks { mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 3h6l1 2h4v16H4V5h4l1-2Zm1 7 2 2 4-5 2 1.6-5.8 7.2L8 11.6 10 10Z'/%3E%3C/svg%3E"); }
.icon-readings { mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 4.5A2.5 2.5 0 0 1 5.5 2H21v18H6a1 1 0 1 0 0 2h15v-2H6a3 3 0 0 1-3-3V4.5ZM7 6h9v2H7V6Zm0 4h8v2H7v-2Z'/%3E%3C/svg%3E"); }
.icon-planner { mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm1 5h-2v6l5 3 1-1.7-4-2.3V7Z'/%3E%3C/svg%3E"); }
.icon-grades { mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12 2 3 6 7 .9-5 4.8 1.2 6.8L12 17.2l-6.2 3.3L7 13.7 2 8.9 9 8l3-6Z'/%3E%3C/svg%3E"); }
.icon-more { mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 10a2 2 0 1 1 0 4 2 2 0 0 1 0-4Zm7 0a2 2 0 1 1 0 4 2 2 0 0 1 0-4Zm7 0a2 2 0 1 1 0 4 2 2 0 0 1 0-4Z'/%3E%3C/svg%3E"); }
.ghost { margin-top: auto; border: 1px solid var(--line); border-radius: 8px; padding: 12px; color: var(--ink); background: #fff; font-weight: 800; }
.main { min-width: 0; }
.auth-view { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, .95fr) minmax(360px, 1fr); }
.auth-art { padding: 18px; }
.auth-art img { width: 100%; height: 100%; min-height: 540px; object-fit: cover; border-radius: 8px; box-shadow: var(--shadow); }
.auth-card { align-self: center; width: min(520px, calc(100% - 40px)); margin: 0 auto; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 12px; font-weight: 800; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 22px; font-size: clamp(35px, 5vw, 58px); line-height: .96; }
h2 { margin-bottom: 0; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin-bottom: 16px; }
.auth-tab { border: 0; border-radius: 6px; padding: 12px; background: transparent; color: var(--muted); font-weight: 800; }
.auth-tab.active { color: #fff; background: var(--green); }
.form { display: grid; gap: 13px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 800; }
input, select, textarea { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 8px; padding: 0 13px; color: var(--ink); background: #fff; outline: none; }
textarea { padding: 12px 13px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(50, 107, 82, .12); }
.primary, .secondary, .small-button { border: 0; border-radius: 8px; color: #fff; background: var(--green); font-weight: 800; }
.primary { min-height: 50px; padding: 0 18px; }
.secondary { min-height: 50px; padding: 0 18px; color: var(--green); background: #edf6ef; }
.compact { min-height: 42px; }
.small-button { min-height: 36px; padding: 0 12px; }
.form-note { min-height: 20px; color: var(--rose); font-size: 13px; font-weight: 800; }
.demo-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.demo-user { border: 1px solid var(--line); border-radius: 8px; padding: 12px; text-align: left; color: var(--ink); background: rgba(255,255,255,.8); }
.demo-user span, .demo-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-user span { font-weight: 800; }
.demo-user small { margin-top: 4px; color: var(--muted); font-size: 12px; }
.workspace { width: min(1220px, 100%); margin: 0 auto; padding: 30px 30px 95px; }
.topbar, .section-head, .card-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.topbar { margin-bottom: 24px; }
.topbar h1 { margin: 0; font-size: clamp(34px, 5vw, 52px); }
.top-actions { display: flex; gap: 10px; }
.view { display: none; }
.view.active { display: block; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.stat-card, .course-card, .task-card, .reading-card, .session-card, .note-card, .grade-card, .guide-card, .guide-intro { border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.88); box-shadow: 0 10px 28px rgba(23,37,33,.08); }
.stat-card { padding: 18px; }
.stat-card span { display: block; font-size: 34px; font-weight: 800; }
.stat-card p, .muted, .course-card p, .task-card p, .reading-card p, .session-card p, .note-card p, .grade-card p, .guide-card p, .guide-intro p { margin: 0; color: var(--muted); line-height: 1.45; }
.split-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; }
.task-list, .session-list, .notes-list { display: grid; gap: 12px; margin-top: 12px; }
.task-card { display: grid; grid-template-columns: 9px 1fr auto; gap: 14px; align-items: center; padding: 14px; overflow: hidden; }
.task-color { width: 9px; height: 100%; min-height: 64px; border-radius: 8px; background: var(--green); }
.task-card h3, .course-card h3, .reading-card h3, .session-card h3, .grade-card h3 { margin-bottom: 5px; font-size: 18px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.pill { padding: 6px 9px; border-radius: 999px; color: var(--green); background: #edf6ef; font-size: 12px; font-weight: 800; }
.course-grid, .reading-grid, .grade-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.course-card, .reading-card, .session-card, .note-card, .grade-card, .guide-card, .guide-intro { padding: 16px; }
.course-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.course-dot { width: 38px; height: 38px; border-radius: 8px; flex: 0 0 auto; }
.weight-list { display: grid; gap: 8px; margin-top: 14px; }
.weight-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; color: var(--muted); font-size: 13px; }
.progress-track { height: 9px; border-radius: 999px; background: #e8eeeb; overflow: hidden; margin-top: 12px; }
.progress-bar { height: 100%; border-radius: inherit; background: var(--green); }
.inline-form { display: grid; grid-template-columns: 1fr 1.2fr .8fr .8fr auto; gap: 10px; margin-bottom: 16px; }
.note-form { grid-template-columns: 1fr 2fr auto; margin-top: 20px; }
.grade-score { font-size: 42px; font-weight: 800; margin: 8px 0; }
.more-grid { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.guide-intro { position: sticky; top: 30px; }
.guide-intro h2 { margin-bottom: 10px; font-size: 28px; line-height: 1.05; }
.guide-list { display: grid; gap: 14px; }
.guide-card h3 { margin-bottom: 8px; font-size: 20px; }
.guide-steps { display: grid; gap: 10px; margin-top: 14px; }
.guide-step { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; }
.guide-step span { width: 9px; height: 9px; margin-top: 7px; border-radius: 999px; background: var(--green); }
.text-button { color: var(--green); font-weight: 800; }
dialog { width: min(500px, calc(100% - 28px)); border: 0; border-radius: 8px; padding: 0; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(20, 32, 29, .36); }
.modal { padding: 20px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h2 { margin: 0; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; font-size: 20px; }
.mobile-nav { display: none; }
.hidden { display: none !important; }
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .auth-view { grid-template-columns: 1fr; padding: 16px; }
  .auth-art { height: 205px; padding: 0; }
  .auth-art img { min-height: 0; height: 205px; }
  .auth-card { width: 100%; padding: 22px 4px 84px; }
  .workspace { padding: 22px 14px 96px; }
  .topbar { align-items: flex-start; }
  .split-grid, .course-grid, .reading-grid, .grade-grid, .more-grid { grid-template-columns: 1fr; }
  .guide-intro { position: static; }
  .stats-grid { gap: 8px; }
  .stat-card { padding: 13px 10px; }
  .stat-card span { font-size: 27px; }
  .task-card { grid-template-columns: 7px 1fr; }
  .task-card .small-button { grid-column: 2; }
  .inline-form, .note-form { grid-template-columns: 1fr; }
  .mobile-nav { position: fixed; z-index: 5; right: 12px; bottom: 12px; left: 12px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.96); box-shadow: var(--shadow); }
  .mobile-item { min-height: 46px; display: grid; place-items: center; gap: 2px; padding: 5px 2px; border-radius: 6px; font-size: 11px; font-weight: 800; }
  .mobile-item .tab-icon { width: 17px; height: 17px; }
  .mobile-item.active { color: #fff; background: var(--green); }
}
@media (max-width: 520px) {
  h1 { font-size: 38px; }
  .topbar { flex-direction: column; }
  .top-actions, .top-actions button { width: 100%; }
  .demo-list { grid-template-columns: 1fr; }
  .card-actions { align-items: stretch; flex-direction: column; }
}
