:root {
  --ink: #1d2b27;
  --muted: #71807a;
  --paper: #f5f2ea;
  --card: #fffdf9;
  --line: #dedfd7;
  --green: #2d604f;
  --green-dark: #173f34;
  --mint: #dbe9df;
  --orange: #df7850;
  --yellow: #f3d995;
  --shadow: 0 18px 50px rgba(35, 54, 46, .08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled, select:disabled { cursor: not-allowed; opacity: .45; }
.app-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 230px; padding: 32px 22px 24px; background: var(--green-dark); color: #f9f5e9; z-index: 20; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; margin: 0 8px 48px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.5); border-radius: 13px; font: 700 16px Georgia, serif; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 18px; letter-spacing: .05em; }
.brand small { opacity: .55; font: 10px Georgia, serif; letter-spacing: .12em; margin-top: 3px; }
.nav-label { margin: 0 13px 12px; opacity: .45; font-size: 11px; letter-spacing: .2em; }
.nav-list { display: grid; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 13px; width: 100%; padding: 13px 14px; border: 0; border-radius: 11px; color: rgba(255,255,255,.67); background: transparent; text-align: left; transition: .2s; }
.nav-item span { width: 20px; font-size: 18px; text-align: center; }
.nav-item:hover, .nav-item.active { color: white; background: rgba(255,255,255,.11); }
.sidebar-note { margin-top: auto; padding: 15px; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; color: rgba(255,255,255,.55); display: flex; gap: 10px; font-size: 11px; line-height: 1.7; }
.sidebar-note p { margin: 0; }
.pulse { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: #9ed29b; box-shadow: 0 0 0 5px rgba(158,210,155,.1); }
main { grid-column: 2; min-width: 0; }
.topbar { height: 78px; padding: 0 4vw; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(245,242,234,.9); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 10; }
.student-switcher { display: flex; align-items: center; gap: 12px; }
.student-switcher label { color: var(--muted); font-size: 12px; }
.student-switcher select { min-width: 158px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink); padding: 9px 32px 9px 11px; font-weight: 700; }
.top-actions { display: flex; gap: 10px; }
.primary-button, .secondary-button, .icon-button { border-radius: 9px; padding: 10px 16px; border: 1px solid transparent; transition: .2s; }
.primary-button { color: white; background: var(--green); box-shadow: 0 8px 20px rgba(45,96,79,.16); }
.primary-button:hover { background: var(--green-dark); transform: translateY(-1px); }
.secondary-button { border-color: var(--line); background: var(--card); color: var(--ink); }
.secondary-button:hover { border-color: var(--green); color: var(--green); }
.icon-button { border-color: var(--line); color: var(--green); background: transparent; font-size: 20px; padding: 7px 13px; }
.menu-button { display: none; border: 0; background: transparent; font-size: 22px; }
.content { max-width: 1280px; margin: 0 auto; padding: 48px 4vw 70px; }
.view { display: none; animation: enter .35s ease; }
.view.active { display: block; }
.empty-students-page { display: none; max-width: 570px; margin: 9vh auto; padding: 55px 35px; border: 1px dashed #cfd4ca; border-radius: 18px; background: rgba(255,253,249,.65); text-align: center; }
.empty-students-page h2 { margin: 9px 0; font: 700 30px Georgia, "Songti SC", serif; }
.empty-students-page > p:not(.eyebrow) { max-width: 390px; margin: 0 auto 24px; color: var(--muted); line-height: 1.8; font-size: 12px; }
.empty-students-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 20px; border-radius: 18px; color: var(--green); background: var(--mint); font-size: 25px; }
#overviewView.no-students > :not(#noStudentsState) { display: none; }
#overviewView.no-students #noStudentsState { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(7px); } }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-heading h1 { font: 700 clamp(30px, 4vw, 44px)/1.15 Georgia, "Songti SC", serif; margin: 5px 0 7px; }
.subtle { color: var(--muted); margin: 0; font-size: 14px; }
.eyebrow { margin: 0; color: var(--orange); letter-spacing: .18em; font-size: 10px; font-weight: 800; }
.status-pill { padding: 8px 12px; border: 1px solid #cbd9cd; border-radius: 20px; color: var(--green); background: #edf4eb; font-size: 11px; }
.status-pill i { display: inline-block; width: 6px; height: 6px; background: #5b9b66; border-radius: 50%; margin-right: 5px; }
.hero-card { min-height: 285px; padding: 42px 52px; border-radius: 18px; color: white; background: radial-gradient(circle at 80% 10%, rgba(243,217,149,.15), transparent 35%), linear-gradient(135deg, #214c3f, #173a31); display: flex; justify-content: space-between; gap: 30px; box-shadow: var(--shadow); overflow: hidden; position: relative; }
.hero-card:after { content: "✦"; position: absolute; right: 30%; bottom: -62px; color: rgba(255,255,255,.03); font-size: 210px; }
.hero-copy { max-width: 680px; z-index: 1; }
.hero-kicker { color: #d5bf85; font-size: 12px; letter-spacing: .12em; }
.hero-copy h2 { margin: 13px 0; font: 700 clamp(27px, 4vw, 42px)/1.25 Georgia, "Songti SC", serif; }
.hero-copy > p:not(.hero-kicker) { color: rgba(255,255,255,.63); line-height: 1.8; font-size: 13px; }
.teacher-line { display: flex; align-items: center; gap: 10px; margin-top: 26px; }
.avatar { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 50%; color: var(--green-dark); background: var(--yellow); font-weight: 700; }
.teacher-line small, .teacher-line strong { display: block; }
.teacher-line small { color: rgba(255,255,255,.45); font-size: 9px; margin-bottom: 3px; }
.teacher-line strong { font-size: 11px; }
.hero-progress { min-width: 185px; display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 1; }
.progress-ring { --progress: 0deg; width: 148px; height: 148px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: radial-gradient(circle, var(--green-dark) 62%, transparent 64%), conic-gradient(var(--yellow) var(--progress), rgba(255,255,255,.12) 0); }
.progress-ring strong { font: 700 32px Georgia, serif; }
.progress-ring span { display: block; margin-top: 4px; color: rgba(255,255,255,.5); font-size: 9px; }
.progress-meta { margin-top: 18px; color: rgba(255,255,255,.55); font-size: 10px; display: flex; gap: 18px; }
.overview-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; margin-top: 20px; }
.panel { padding: 27px 29px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: 0 7px 26px rgba(37,54,47,.025); }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 24px; }
.panel-title h3 { margin: 4px 0 0; font: 700 20px Georgia, "Songti SC", serif; }
.text-button { padding: 5px; border: 0; background: transparent; color: var(--green); font-size: 11px; }
.muted-badge { color: var(--muted); background: var(--paper); border-radius: 15px; padding: 5px 9px; font-size: 10px; }
.next-lesson-card { display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: 20px; }
.date-block { padding: 14px 8px; text-align: center; background: #edf2e9; border-radius: 11px; color: var(--green); }
.date-block strong { display: block; font: 700 28px Georgia, serif; }
.date-block span { font-size: 10px; }
.lesson-info h4 { margin: 0 0 7px; font-size: 15px; }
.lesson-info p { margin: 0 0 9px; color: var(--muted); line-height: 1.6; font-size: 11px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--green); font-size: 10px; }
.join-button { padding: 9px 13px; border: 1px solid var(--green); border-radius: 8px; background: transparent; color: var(--green); font-size: 11px; }
.empty-state { padding: 24px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.stats-grid div { min-width: 0; }
.stats-grid span { display: block; color: var(--muted); font-size: 10px; margin-bottom: 7px; }
.stats-grid strong { font: 700 28px Georgia, serif; color: var(--green); }
.stats-grid small { color: var(--muted); margin-left: 4px; }
.recent-panel { margin-top: 20px; }
.lesson-list { display: grid; }
.lesson-row { display: grid; grid-template-columns: 105px minmax(0,1fr) auto; gap: 22px; align-items: center; padding: 17px 2px; border-top: 1px solid #ecebe5; }
.lesson-row:first-child { border-top: 0; padding-top: 0; }
.lesson-date { color: var(--muted); font-size: 11px; }
.lesson-row h4 { margin: 0 0 6px; font-size: 13px; }
.lesson-row p { margin: 0; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag, .status-mark { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 5px 9px; border: 1px solid transparent; border-radius: 15px; font-size: 9px; font-style: normal; font-weight: 700; white-space: nowrap; }
.tag.complete, .status-mark.complete, .tag.signed, .status-mark.signed { color: #23613f; border-color: #bdd9c7; background: #e4f3e8; }
.tag.pending, .status-mark.upcoming, .status-mark.incomplete { color: #925d0e; border-color: #ead19a; background: #fff0c9; }
.tag.unsigned, .status-mark.unsigned { color: #a13f35; border-color: #ebbbb4; background: #fde8e4; }
.tag.neutral, .status-mark.neutral { color: #66726d; border-color: #d7dbd6; background: #eff1ee; }
.filter-row { display: flex; gap: 8px; margin-bottom: 20px; }
.calendar-heading { align-items: flex-end; }
.calendar-controls { display: flex; align-items: center; gap: 10px; }
.month-switch { display: flex; align-items: center; min-width: 235px; height: 40px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); }
.month-switch button { width: 42px; height: 100%; border: 0; background: transparent; color: var(--green); font-size: 16px; }
.month-switch strong { flex: 1; text-align: center; font: 700 16px Georgia, "Songti SC", serif; }
.calendar-summary { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 16px; }
.summary-chip { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: rgba(255,253,249,.55); font-size: 10px; }
.summary-chip strong { color: var(--ink); font-size: 13px; }
.summary-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
.summary-dot.done { background: var(--green); }
.student-legend-chip { border-color: var(--student-color); color: var(--ink); background: var(--student-soft); }
.student-legend-chip .summary-dot { background: var(--student-color); }
.calendar-card { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: 0 8px 30px rgba(37,54,47,.035); }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { border-bottom: 1px solid var(--line); background: #f8f6f0; }
.calendar-weekdays span { padding: 13px 8px; color: var(--muted); text-align: center; font-size: 10px; }
.calendar-day { position: relative; min-height: 132px; padding: 10px 8px; border-right: 1px solid #e8e7e0; border-bottom: 1px solid #e8e7e0; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.other-month { background: #faf9f5; }
.calendar-day.other-month .day-number { opacity: .32; }
.day-number { display: grid; place-items: center; width: 25px; height: 25px; margin: 0 0 5px auto; color: var(--muted); border-radius: 50%; font: 700 11px Georgia, serif; }
.calendar-day.today .day-number { color: white; background: var(--orange); }
.calendar-event { position: relative; width: 100%; margin-top: 5px; padding: 7px 18px 7px 8px; border: 0; border-left: 4px solid var(--student-color, var(--orange)); border-radius: 6px; color: var(--ink); background: var(--student-soft, #fbede6); text-align: left; transition: .18s; }
.calendar-event:after { content: ""; position: absolute; top: 8px; right: 7px; width: 7px; height: 7px; border: 2px solid white; border-radius: 50%; background: #d78a25; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.calendar-event.done:after { background: #31945b; }
.calendar-event:hover { transform: translateY(-1px); filter: brightness(.98); }
.calendar-event strong, .calendar-event span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event strong { font-size: 10px; }
.calendar-event span { margin-top: 3px; color: var(--muted); font-size: 8px; }
.more-events { display: block; margin: 6px 3px 0; color: var(--green); font-size: 9px; }
.mobile-agenda { display: none; }
.filter-chip { border: 1px solid var(--line); border-radius: 20px; padding: 7px 14px; background: transparent; color: var(--muted); font-size: 11px; }
.filter-chip.active { background: var(--green); color: white; border-color: var(--green); }
.timeline { position: relative; padding-left: 22px; }
.timeline:before { content: ""; position: absolute; left: 5px; top: 15px; bottom: 15px; width: 1px; background: var(--line); }
.timeline-card { position: relative; margin-bottom: 14px; padding: 24px 26px; border: 1px solid var(--line); border-radius: 13px; background: var(--card); display: grid; grid-template-columns: 140px minmax(0,1fr) auto; gap: 25px; }
.timeline-card:before { content: ""; position: absolute; left: -21px; top: 30px; width: 9px; height: 9px; border: 3px solid var(--paper); border-radius: 50%; background: var(--green); }
.timeline-date strong, .timeline-date span { display: block; }
.timeline-date strong { font: 700 17px Georgia, serif; margin-bottom: 5px; }
.timeline-date span { color: var(--muted); font-size: 10px; }
.timeline-copy h3 { margin: 0 0 8px; font-size: 14px; }
.timeline-copy p { margin: 0 0 11px; color: var(--muted); line-height: 1.7; font-size: 11px; }
.timeline-actions { align-self: center; display: flex; flex-direction: column; align-items: stretch; gap: 7px; min-width: 82px; }
.timeline-actions .outline-button { align-self: stretch; }
.signature-button { border: 1px solid var(--green); border-radius: 8px; padding: 8px 10px; color: white; background: var(--green); font-size: 10px; }
.signature-button:hover { background: var(--green-dark); }
.outline-button { align-self: center; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: transparent; color: var(--green); font-size: 10px; }
.resource-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.student-overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.student-stat { padding: 19px 21px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,253,249,.65); }
.student-stat span { display: block; color: var(--muted); font-size: 10px; }
.student-stat strong { display: block; margin-top: 7px; color: var(--green); font: 700 25px Georgia, serif; }
.student-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.student-card { padding: 25px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); transition: .2s; }
.student-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.student-card-head { display: flex; align-items: center; gap: 13px; margin-bottom: 20px; }
.student-avatar { display: grid; place-items: center; flex: 0 0 47px; width: 47px; height: 47px; border-radius: 14px; color: var(--green-dark); background: var(--mint); font: 700 18px Georgia, "Songti SC", serif; }
.student-card-head h3 { margin: 0 0 5px; font-size: 16px; }
.student-card-head p { margin: 0; color: var(--muted); font-size: 10px; }
.student-card-head .tag { margin-left: auto; }
.student-course { min-height: 44px; margin: 0 0 18px; line-height: 1.6; font: 700 14px Georgia, "Songti SC", serif; }
.student-progress-line { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }
.student-progress-bar { height: 6px; margin: 8px 0 17px; overflow: hidden; border-radius: 5px; background: #e8e8e0; }
.student-progress-bar i { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.student-next { min-height: 32px; padding: 10px 11px; border-radius: 8px; color: var(--muted); background: var(--paper); font-size: 9px; }
.student-next strong { color: var(--ink); }
.student-card-actions { display: flex; gap: 8px; margin-top: 17px; }
.student-card-actions button { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--green); background: transparent; font-size: 10px; }
.student-card-actions button:first-child { color: white; border-color: var(--green); background: var(--green); }
.student-card-actions .danger-button { flex: 0 0 auto; color: #a94736; border-color: #e6c6be; background: #fff8f5; }
.student-card-actions .danger-button:hover { color: white; border-color: #a94736; background: #a94736; }
.resource-card { min-height: 200px; padding: 25px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); display: flex; flex-direction: column; transition: .2s; }
.resource-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.resource-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 22px; border-radius: 11px; color: var(--green); background: var(--mint); font-size: 20px; }
.resource-card h3 { margin: 0 0 9px; font-size: 14px; }
.resource-card p { margin: 0; color: var(--muted); line-height: 1.65; font-size: 11px; }
.resource-card a { margin-top: auto; padding-top: 18px; color: var(--green); text-decoration: none; font-size: 11px; font-weight: 700; }
.homework-list { display: grid; gap: 13px; }
.homework-card { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 18px; padding: 23px 25px; border: 1px solid var(--line); border-radius: 13px; background: var(--card); }
.homework-check { width: 24px; height: 24px; accent-color: var(--green); }
.homework-copy h3 { margin: 0 0 7px; font-size: 14px; }
.homework-copy p { margin: 0; color: var(--muted); line-height: 1.6; font-size: 11px; }
.homework-due { display: grid; justify-items: end; gap: 6px; text-align: right; color: var(--muted); font-size: 9px; }
.homework-card.done { opacity: .6; }
.homework-card.done h3 { text-decoration: line-through; }
.modal-backdrop { position: fixed; inset: 0; padding: 20px; display: none; place-items: center; background: rgba(15,35,29,.48); backdrop-filter: blur(4px); z-index: 50; }
.modal-backdrop.open { display: grid; }
.modal { width: min(560px, 100%); max-height: 90vh; overflow: auto; padding: 29px; border-radius: 16px; background: var(--card); box-shadow: 0 30px 80px rgba(12,31,25,.25); }
.modal-head { display: flex; justify-content: space-between; margin-bottom: 24px; }
.modal-head h2 { margin: 5px 0 0; font: 700 27px Georgia, "Songti SC", serif; }
.close-button { border: 0; background: transparent; color: var(--muted); font-size: 27px; }
.modal label { display: grid; gap: 7px; margin: 14px 0; color: var(--muted); font-size: 11px; }
.modal input, .modal select, .modal textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 11px; color: var(--ink); background: white; outline: none; }
.modal input:focus, .modal textarea:focus, .modal select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(45,96,79,.08); }
.modal textarea { min-height: 88px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 23px; }
.toast { position: fixed; right: 28px; bottom: 28px; padding: 12px 18px; border-radius: 9px; color: white; background: var(--green-dark); box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .25s; z-index: 100; font-size: 12px; }
.toast.show { opacity: 1; transform: translateY(0); }

.login-screen { min-height: 100vh; padding: 32px 18px; display: grid; place-items: center; background: radial-gradient(circle at 15% 15%, rgba(243,217,149,.22), transparent 28%), linear-gradient(135deg, #173f34, #214c3f); }
.login-card { width: min(430px, 100%); padding: 42px; border-radius: 20px; background: var(--card); box-shadow: 0 30px 90px rgba(7,26,20,.35); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 42px; color: var(--green-dark); }
.login-brand .brand-mark { color: white; background: var(--green); }
.login-brand strong, .login-brand small { display: block; }
.login-brand small { margin-top: 3px; color: var(--muted); font: 10px Georgia, serif; letter-spacing: .12em; }
.login-card h1 { margin: 7px 0 10px; font: 700 30px Georgia, "Songti SC", serif; }
.login-intro { margin: 0 0 28px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.login-card form label { display: grid; gap: 8px; margin: 15px 0; color: var(--muted); font-size: 11px; }
.login-card input { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: white; outline: none; }
.login-card input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(45,96,79,.08); }
.login-submit { width: 100%; margin-top: 8px; padding: 12px; }
.form-error { min-height: 18px; margin: 0; color: #ae4938; font-size: 11px; }
.user-menu { display: flex; align-items: center; gap: 11px; padding-left: 11px; border-left: 1px solid var(--line); }
.user-menu span { text-align: right; }
.user-menu strong, .user-menu small { display: block; }
.user-menu strong { font-size: 11px; }
.user-menu small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.user-menu .text-button { padding: 5px; color: var(--muted); }
.account-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.account-panel { padding: 0; overflow: hidden; }
.account-table-wrap { overflow-x: auto; }
.account-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.account-table th, .account-table td { padding: 15px 18px; border-bottom: 1px solid var(--line); text-align: left; font-size: 11px; }
.account-table th { color: var(--muted); background: #faf8f2; font-size: 9px; letter-spacing: .08em; }
.account-table tr:last-child td { border-bottom: 0; }
.account-disabled { opacity: .55; }
.role-badge, .account-status { display: inline-block; padding: 5px 9px; border-radius: 12px; color: var(--green); background: var(--mint); font-size: 9px; }
.role-badge.admin { color: #8d4c31; background: #faeadf; }
.role-badge.student { color: #35628e; background: #e7f0fc; }
.account-status { color: var(--muted); background: #ecece7; }
.account-status.active { color: #2f7254; background: #e1f1e7; }
.table-actions { display: flex; gap: 6px; }
.table-actions button { padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--green); background: transparent; font-size: 9px; }
.table-actions .danger-button { color: #a94736; border-color: #e6c6be; }
.role-student .nav-item[data-view="calendar"], .role-student .nav-item[data-view="students"], .role-student #addLessonButton, .role-student #addResourceButton, .role-student #addHomeworkButton, .role-student #emptyAddStudentButton, .role-student .timeline-actions, .role-student .join-button { display: none !important; }
.role-student .homework-check { pointer-events: none; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  main { grid-column: 1; }
  .sidebar { transform: translateX(-100%); transition: .25s; box-shadow: 20px 0 50px rgba(0,0,0,.18); }
  .sidebar.open { transform: translateX(0); }
  .menu-button { display: block; }
  .overview-grid { grid-template-columns: 1fr; }
  .resource-grid { grid-template-columns: 1fr 1fr; }
  .student-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .topbar { height: auto; min-height: 70px; padding: 12px 18px; gap: 10px; }
  .user-menu span { display: none; }
  .login-card { padding: 32px 24px; }
  .account-summary { grid-template-columns: 1fr; }
  .student-switcher label, .icon-button { display: none; }
  .student-switcher select { min-width: 120px; max-width: 140px; }
  .primary-button { padding: 10px; font-size: 11px; }
  .content { padding: 30px 18px 50px; }
  .page-heading { align-items: flex-start; }
  .status-pill { display: none; }
  .hero-card { padding: 30px 25px; display: block; }
  .hero-progress { margin-top: 30px; }
  .next-lesson-card { grid-template-columns: 60px 1fr; }
  .join-button { grid-column: 1 / -1; }
  .panel { padding: 23px 20px; }
  .lesson-row { grid-template-columns: 75px 1fr; }
  .lesson-row .tag { display: none; }
  .timeline-card { grid-template-columns: 1fr; gap: 13px; }
  .outline-button { justify-self: start; }
  .resource-grid { grid-template-columns: 1fr; }
  .student-overview { grid-template-columns: 1fr; gap: 8px; }
  .homework-card { align-items: start; }
  .homework-due { grid-column: 2 / -1; justify-items: start; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .calendar-heading { display: block; }
  .calendar-controls { margin-top: 20px; }
  .month-switch { flex: 1; min-width: 0; }
  .calendar-summary { overflow-x: auto; padding-bottom: 3px; }
  .summary-chip { flex: 0 0 auto; }
  .calendar-card { display: none; }
  .mobile-agenda { display: grid; gap: 11px; }
  .agenda-day { display: grid; grid-template-columns: 60px minmax(0,1fr); gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
  .agenda-date strong, .agenda-date span { display: block; }
  .agenda-date strong { color: var(--green); font: 700 22px Georgia, serif; }
  .agenda-date span { color: var(--muted); font-size: 9px; margin-top: 4px; }
  .agenda-events { display: grid; gap: 8px; }
  .agenda-event { position: relative; padding: 9px 24px 9px 11px; border: 0; border-left: 4px solid var(--student-color, var(--orange)); border-radius: 6px; background: var(--student-soft, transparent); text-align: left; }
  .agenda-event:after { content: ""; position: absolute; top: 10px; right: 9px; width: 8px; height: 8px; border: 2px solid white; border-radius: 50%; background: #d78a25; }
  .agenda-event.done:after { background: #31945b; }
  .agenda-event strong, .agenda-event span { display: block; }
  .agenda-event strong { font-size: 12px; }
  .agenda-event span { margin-top: 5px; color: var(--muted); font-size: 9px; }
}
