:root {
  --ink: #17211b;
  --muted: #738078;
  --line: #e5e9e5;
  --paper: #f4f6f2;
  --white: #fff;
  --green: #DF983A;
  --green-2: #C77C1D;
  --mint: #F8E7CE;
  --sage: #D9B37C;
  --gold: #DF983A;
  --danger: #b64d49;
  --shadow: 0 20px 50px rgba(28, 50, 37, .09);
}

* { box-sizing: border-box; }
html { height: 100%; }
body { margin: 0; min-height: 100%; font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--ink); background: radial-gradient(circle at 88% 8%, rgba(223,152,58,.08), transparent 27%), var(--paper); }
body.nav-open, body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 8px; color: var(--green-2); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.08fr) minmax(440px, .92fr); background: #f7f8f5; }
.login-brand { position: relative; overflow: hidden; padding: 9vh 8vw; color: #fffaf2; background: radial-gradient(circle at 20% 0%, rgba(255,255,255,.12), transparent 32%), linear-gradient(145deg, #9A5B0A 0%, #C87A16 58%, #DF983A 100%); }
.login-brand::before { content: ""; position: absolute; width: 540px; height: 540px; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; left: -220px; bottom: -260px; box-shadow: 0 0 0 70px rgba(255,255,255,.02), 0 0 0 140px rgba(255,255,255,.02); }
.brand-logo { width: 104px; height: auto; display: block; flex: 0 0 auto; border-radius: 9px; object-fit: contain; object-position: center; background: white; }
.login-logo { width: 190px; height: auto; margin-bottom: 8vh; border-radius: 18px; }
.venue-name { margin: -6vh 0 6vh; color: #fff2df; font-family: Georgia, "Songti SC", serif; font-size: 17px; letter-spacing: .08em; }
.login-brand .eyebrow { color: #ffe7c4; }
.login-brand h1 { position: relative; z-index: 1; margin: 0; max-width: 650px; font-family: Georgia, "Songti SC", serif; font-size: clamp(42px, 5vw, 72px); font-weight: 500; line-height: 1.18; letter-spacing: -.035em; }
.login-intro { max-width: 520px; margin: 26px 0 32px; color: #ffead0; font-size: 16px; line-height: 1.8; }
.feature-pills { display: flex; gap: 10px; }
.feature-pills span { padding: 8px 14px; border: 1px solid rgba(255,255,255,.22); border-radius: 20px; color: #fff7ed; font-size: 12px; }
.decor-card { position: absolute; min-width: 150px; padding: 17px 20px; border: 1px solid rgba(255,255,255,.12); border-radius: 16px; background: rgba(255,255,255,.08); backdrop-filter: blur(10px); }
.decor-card span { display: block; margin-bottom: 7px; color: #ffe7c4; font-size: 11px; }
.decor-card strong { font-family: Georgia, "Songti SC", serif; font-size: 20px; font-weight: 500; }
.card-a { right: 7%; top: 18%; transform: rotate(3deg); }
.card-b { right: 13%; bottom: 10%; transform: rotate(-3deg); }
.login-panel { display: grid; place-items: center; padding: 48px; background: radial-gradient(circle at 82% 18%, rgba(223,152,58,.12), transparent 28%); }
.login-card { width: min(430px, 100%); padding: 38px; border: 1px solid rgba(223,152,58,.16); border-radius: 22px; background: rgba(255,255,255,.78); box-shadow: 0 24px 70px rgba(123,75,16,.1); backdrop-filter: blur(12px); }
.login-card h2 { margin: 0 0 8px; font-family: Georgia, "Songti SC", serif; font-size: 36px; font-weight: 600; }
.login-card > .muted { margin: 0 0 38px; }
.login-card label { display: block; margin: 0 0 20px; color: #435047; font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; margin-top: 8px; padding: 12px 14px; border: 1px solid #dce2dd; border-radius: 10px; outline: none; color: var(--ink); background: white; transition: border-color .2s, box-shadow .2s; }
input:focus, select:focus, textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(53, 105, 78, .1); }
textarea { min-height: 92px; resize: vertical; }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 60px; }
.text-button { position: absolute; right: 12px; top: 50%; transform: translateY(-40%); border: 0; color: var(--green); background: transparent; font-size: 12px; font-weight: 700; }
.primary-button, .secondary-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border-radius: 10px; font-size: 13px; font-weight: 750; transition: .2s ease; }
.primary-button { border: 1px solid var(--green); color: white; background: var(--green); box-shadow: 0 7px 16px rgba(36,81,59,.15); }
.primary-button:hover { background: var(--green-2); transform: translateY(-1px); }
.secondary-button { border: 1px solid var(--line); color: #475249; background: white; }
.secondary-button:hover { border-color: #bec9c0; background: #fafbf9; }
.login-button { width: 100%; min-height: 50px; justify-content: space-between; margin-top: 8px; padding: 0 18px; }
.login-copyright { margin: 28px 0 0; color: #9a8570; font-size: 9px; line-height: 1.6; text-align: center; }
.login-copyright a, .site-footer a { color: #9A5B0A; text-decoration: none; }
.login-copyright a:hover, .site-footer a:hover { text-decoration: underline; }
.demo-accounts { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.demo-accounts p { margin: 0 0 10px; color: var(--muted); font-size: 11px; font-weight: 700; }
.demo-accounts button { width: 100%; display: flex; justify-content: space-between; margin: 6px 0; padding: 8px 0; border: 0; color: var(--green); background: transparent; font-size: 12px; }
.demo-accounts code { color: #89948d; font-family: inherit; }
.mobile-logo { display: none; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; width: 240px; display: flex; flex-direction: column; padding: 24px 16px; color: #fff4e5; background: #7B4B10; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 32px; }
.sidebar-brand .brand-logo { width: 58px; height: 58px; padding: 0; }
.sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand strong { color: white; font-family: Georgia, "Songti SC", serif; font-size: 15px; line-height: 1.45; }
.sidebar-brand small { margin-top: 3px; color: #e4ba80; font-size: 8px; letter-spacing: .16em; }
.sidebar nav { display: grid; gap: 6px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 13px; padding: 12px 14px; border: 0; border-radius: 9px; color: #ead0ad; background: transparent; text-align: left; font-size: 13px; font-weight: 650; }
.nav-item:hover { color: white; background: rgba(255,255,255,.06); }
.nav-item.active { color: white; background: rgba(255,255,255,.11); box-shadow: inset 3px 0 #b7cbbd; }
.nav-icon { width: 18px; text-align: center; font-size: 17px; }
.sidebar-bottom { margin-top: auto; }
.logout-button { width: 100%; display: flex; justify-content: space-between; padding: 11px 14px; border: 0; color: #93aa9b; background: transparent; font-size: 12px; }
.logout-button:hover { color: white; }
.main-area { width: 100%; min-width: 0; min-height: 100vh; display: flex; flex-direction: column; margin-left: 240px; }
.topbar { height: 84px; display: flex; align-items: center; padding: 0 34px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.9); box-shadow: 0 6px 24px rgba(123,75,16,.035); backdrop-filter: blur(14px); }
.topbar h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 22px; font-weight: 600; }
.topbar .eyebrow { margin-bottom: 2px; font-size: 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--green); font-size: 13px; }
.user-chip strong, .user-chip small { display: block; }
.user-chip strong { font-size: 12px; }
.user-chip small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.menu-button { display: none; }
.nav-backdrop { position: fixed; z-index: 19; inset: 0; display: block; border: 0; background: rgba(23, 33, 27, .48); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
main { flex: 1; padding: 34px; }
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 34px; padding: 20px 2px 26px; border-top: 1px solid var(--line); color: #929a94; font-size: 9px; }
.site-footer strong { color: #765630; font-family: Georgia, "Songti SC", serif; font-size: 10px; font-weight: 600; }
.page { display: none; animation: fadeIn .25s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: .3; transform: translateY(5px); } }
.welcome-row, .section-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
#dashboardPage .welcome-row { position: relative; overflow: hidden; padding: 24px 26px; border: 1px solid rgba(223,152,58,.16); border-radius: 18px; background: linear-gradient(120deg, rgba(255,255,255,.96), rgba(255,244,226,.9)); box-shadow: 0 16px 40px rgba(123,75,16,.055); }
#dashboardPage .welcome-row::after { content: ""; position: absolute; z-index: 0; width: 180px; height: 180px; right: -58px; top: -92px; border-radius: 50%; background: rgba(223,152,58,.1); }
#dashboardPage .welcome-row > * { position: relative; z-index: 1; }
.toolbar-actions { display: flex; align-items: center; gap: 9px; }
.inline-month { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; font-weight: 700; }
.inline-month input { width: 160px; height: 42px; margin: 0; }
.welcome-row h1 { margin: 0 0 8px; font-family: Georgia, "Songti SC", serif; font-size: 30px; font-weight: 600; }
.welcome-row p, .section-toolbar p { margin: 0; font-size: 13px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat-card { position: relative; overflow: hidden; min-height: 132px; padding: 21px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.94); box-shadow: 0 12px 30px rgba(123,75,16,.055); transition: transform .2s ease, box-shadow .2s ease; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 18px 36px rgba(123,75,16,.09); }
.stat-card::after { content: ""; position: absolute; width: 80px; height: 80px; right: -26px; bottom: -34px; border-radius: 50%; background: var(--mint); opacity: .55; }
.stat-card .stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 700; }
.stat-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; color: var(--green); background: #edf3ee; font-size: 14px; }
.stat-card strong { display: block; margin-top: 17px; font-family: Georgia, serif; font-size: 28px; font-weight: 600; }
.stat-card small { color: #98a099; font-size: 9px; }
.leave-notification-card { width: 100%; color: inherit; text-align: left; cursor: pointer; }
.leave-notification-card strong { color: #b46035; }
.leave-notification-card .stat-icon { color: #b46035; background: #fff0e8; }
.dashboard-grid { display: grid; grid-template-columns: minmax(220px, .62fr) minmax(360px, 1.15fr) minmax(340px, 1fr); gap: 18px; }
.teacher-dashboard .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
.panel { border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.95); box-shadow: 0 14px 34px rgba(123,75,16,.05); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 21px 22px 12px; }
.panel-heading h3 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 17px; font-weight: 600; }
.panel-heading .eyebrow { margin-bottom: 4px; font-size: 8px; }
.soft-badge { padding: 5px 9px; border-radius: 12px; color: var(--green); background: #edf3ee; font-size: 9px; }
.bar-chart { height: 190px; display: flex; align-items: flex-end; gap: 12px; padding: 24px 18px 20px; border-top: 1px solid #f1f3f0; background: repeating-linear-gradient(to top, transparent 0, transparent 39px, #f0f3f0 40px); }
.bar-item { min-width: 34px; flex: 1; display: flex; height: 100%; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; }
.bar { width: min(38px, 65%); min-height: 4px; border-radius: 7px 7px 2px 2px; background: linear-gradient(#F2C17D, #DF983A); transition: height .5s ease; }
.bar-item strong { font-size: 9px; }
.bar-item span { color: var(--muted); font-size: 9px; }
.link-button { border: 0; color: var(--green); background: transparent; font-size: 10px; font-weight: 700; }
.recent-list { padding: 4px 20px 16px; }
.recent-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #edf0ed; }
.recent-item:last-child { border: 0; }
.date-box { padding: 5px 2px; border-radius: 8px; color: var(--green); background: #edf3ee; text-align: center; }
.date-box strong, .date-box small { display: block; }
.date-box strong { font-family: Georgia, serif; font-size: 16px; }
.date-box small { font-size: 8px; }
.recent-item h4 { overflow: hidden; margin: 0 0 4px; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.recent-item p { overflow: hidden; margin: 0; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.hour-chip { color: var(--green); font-family: Georgia, serif; font-size: 13px; }
.completion-chip { min-width: 42px; padding: 6px 8px; border-radius: 12px; color: #A96514; background: #FFF1DC; font-size: 10px; font-weight: 800; text-align: center; }
.table-panel { overflow: hidden; }
.filters { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.filters input, .filters select { width: auto; min-width: 150px; height: 38px; margin: 0; padding: 8px 12px; font-size: 12px; }
.search-box { position: relative; min-width: 260px; }
.search-box input { width: 100%; padding-left: 34px; }
.search-box span { position: absolute; z-index: 2; left: 12px; top: 10px; color: #829088; }
.filters .secondary-button { min-height: 38px; }
.filter-total { margin-left: auto; color: var(--green); font-size: 12px; font-weight: 700; }
.compact-stats { margin-bottom: 14px; }
.compact-stats .stat-card { min-height: 112px; padding: 18px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 58px; padding: 10px 16px; border-top: 1px solid var(--line); }
.pagination button { min-width: 36px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; color: #59655d; background: white; }
.pagination button.active { border-color: #DF983A; color: white; background: #DF983A; }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }
.pagination span { color: var(--muted); font-size: 10px; }
.member-list { display: flex; flex-wrap: wrap; gap: 5px; max-width: 420px; white-space: normal; }
.member-chip { padding: 4px 7px; border-radius: 10px; color: #A96514; background: #FFF1DC; font-size: 9px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { padding: 12px 16px; color: #849087; background: #fafbf9; text-align: left; font-size: 10px; letter-spacing: .04em; }
td { padding: 14px 16px; border-top: 1px solid #edf0ed; color: #4c5750; font-size: 11px; }
.low-balance td { background: #fff8f6; }
.low-balance td:first-child { box-shadow: inset 3px 0 #b64d49; }
td strong { display: block; color: var(--ink); font-size: 12px; }
td small { display: block; margin-top: 4px; color: #8b958e; font-size: 9px; }
.student-cell { display: flex; align-items: center; gap: 10px; }
.student-export-link { width: 100%; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; }
.student-export-link:hover strong { color: var(--green-2); }
.mobile-student-toggle { display: none; }
.export-hint { margin-left: auto; padding: 5px 8px; border-radius: 12px; color: var(--green-2); background: #FFF1DC; font-size: 8px; font-weight: 700; opacity: 0; transition: opacity .2s; }
.student-export-link:hover .export-hint, .student-export-link:focus .export-hint { opacity: 1; }
.mini-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: var(--green); background: #e8f0e9; font-family: Georgia, serif; font-size: 13px; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 14px; font-size: 9px; font-weight: 700; }
.status-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-在读, .status-出勤 { color: #A96514; background: #FFF1DC; }
.status-暂停, .status-停课, .status-迟到, .status-请假 { color: #9a702d; background: #f8f0df; }
.status-退费 { color: #7b6664; background: #eee9e8; }
.status-新增 { color: #387052; background: #e8f4ec; }
.status-结课, .status-退课, .status-缺勤 { color: #8c5b59; background: #f7eae9; }
.leave-待审核 { color: #9a702d; background: #fff2d8; }
.leave-同意 { color: #48765a; background: #e9f4ec; }
.leave-驳回, .leave-拒绝 { color: #a54845; background: #fbeceb; }
.wrap-cell { max-width: 280px; white-space: normal; line-height: 1.65; }
.row-actions { display: flex; justify-content: flex-end; gap: 4px; }
.row-actions button, .icon-button { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 8px; color: #6d7870; background: transparent; }
.row-actions .text-action { width: auto; padding: 0 8px; font-size: 9px; }
.row-actions button:hover, .icon-button:hover { border-color: var(--line); background: #f7f9f6; }
.row-actions .danger:hover { color: var(--danger); background: #fff3f2; }
.row-actions .approve { color: #48765a; background: #edf6ef; }
.empty-state { padding: 70px 20px; text-align: center; }
.empty-state > div { width: 48px; height: 48px; display: grid; place-items: center; margin: auto; border-radius: 15px; color: var(--green); background: #edf3ee; font-size: 20px; }
.empty-state h3 { margin: 14px 0 6px; font-family: Georgia, "Songti SC", serif; }
.empty-state p { margin: 0; color: var(--muted); font-size: 11px; }
.payment-summary { position: relative; overflow: hidden; margin-bottom: 18px; padding: 22px 24px; border-radius: 14px; color: white; background: linear-gradient(120deg, #B86C10, #DF983A); }
.payment-summary span, .payment-summary strong { display: block; }
.payment-summary span { color: #bdd0c3; font-size: 11px; }
.payment-summary strong { margin-top: 7px; font-family: Georgia, serif; font-size: 27px; }
.summary-decoration { position: absolute; right: 28px; top: -20px; color: rgba(255,255,255,.08); font-family: Georgia, serif; font-size: 110px; }

.modal-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(17, 31, 23, .55); backdrop-filter: blur(4px); }
.modal-card { width: min(680px, 100%); max-height: calc(100vh - 40px); overflow: auto; border-radius: 17px; background: white; box-shadow: var(--shadow); animation: modalIn .2s ease; }
@keyframes modalIn { from { opacity: 0; transform: scale(.98) translateY(8px); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 23px 25px 17px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 21px; }
.modal-header .eyebrow { margin-bottom: 3px; font-size: 8px; }
.modal-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; padding: 23px 25px; }
.modal-body label { color: #4e5952; font-size: 11px; font-weight: 700; }
.modal-body input, .modal-body select, .modal-body textarea { margin-top: 7px; font-size: 12px; }
.modal-body .full { grid-column: 1 / -1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 16px 25px 22px; border-top: 1px solid var(--line); }
.toast { position: fixed; z-index: 100; top: 20px; left: 50%; transform: translate(-50%, -20px); padding: 11px 17px; border-radius: 9px; color: white; background: #A96514; box-shadow: var(--shadow); opacity: 0; pointer-events: none; font-size: 12px; transition: .25s; }

.checkbox-field { grid-column: 1 / -1; }
.field-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field-heading .text-button { padding: 5px 8px; border-radius: 8px; color: #A96514; background: #fff4e2; font-size: 10px; }
.checkbox-group { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.check-card { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; color: #4e5952; background: #fff; font-size: 11px; font-weight: 500; cursor: pointer; }
.check-card:has(input:checked) { border-color: var(--green); color: #9A5B0A; background: #FFF6E9; }
.check-card input { width: 15px; height: 15px; margin: 0; accent-color: var(--green); box-shadow: none; }
.check-card em { margin-left: auto; color: #9aa29d; font-style: normal; font-size: 9px; }
.lesson-student-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.lesson-student-card { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: white; transition: border-color .2s, background .2s; }
.lesson-student-card.student-selected { border-color: #DF983A; background: #fffaf2; }
.lesson-student-main { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 9px 11px; cursor: pointer; }
.lesson-student-main input, .makeup-toggle input, .student-leave-toggle input { width: 15px; height: 15px; margin: 0; accent-color: #DF983A; box-shadow: none; }
.lesson-student-main span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson-student-main em { margin-left: auto; color: #9aa29d; font-style: normal; font-size: 8px; }
.makeup-toggle { display: flex; align-items: center; gap: 6px; min-height: 30px; padding: 6px 11px; border-top: 1px dashed #ead8be; color: #9a702d !important; background: #fff7ea; cursor: pointer; font-size: 9px !important; }
.makeup-toggle small { margin-left: auto; color: #9a8060; font-size: 8px; }
.makeup-toggle:has(input:checked) { color: #9A5B0A !important; background: #ffe8c2; }
.makeup-toggle:has(input:disabled) { opacity: .48; cursor: not-allowed; }
.makeup-deduction { display: flex; align-items: center; justify-content: space-between; gap: 7px; min-height: 35px; padding: 5px 11px; border-top: 1px dashed #ead8be; color: #8a5a1c !important; background: #fffaf1; font-size: 9px !important; }
.makeup-deduction input { width: 76px; min-height: 29px; padding: 4px 7px; border: 1px solid #dfbd86; border-radius: 8px; background: #fff; color: #714713; font-weight: 700; }
.student-leave-toggle { display: flex; align-items: center; gap: 6px; min-height: 30px; padding: 6px 11px; border-top: 1px dashed #ead8be; color: #8b6030 !important; background: #fffdf8; cursor: pointer; font-size: 9px !important; }
.student-leave-toggle small { margin-left: auto; color: #9a8060; font-size: 8px; }
.student-leave-toggle:has(input:checked) { color: #8b5715 !important; background: #f8f0df; }
.student-leave-toggle:has(input:disabled) { opacity: .48; cursor: not-allowed; }
.lesson-student-card.leave-selected { border-color: #c89a55; background: #fff9ef; }
.lesson-makeup-help { margin: 8px 2px 0; color: #8f7657; font-size: 9px; line-height: 1.55; }
.makeup-hours { color: #9A5B0A; }
.class-breakdown { display: grid; min-width: 230px; gap: 7px; }
.class-breakdown > div { padding: 7px 9px; border: 1px solid #eee3d2; border-radius: 8px; background: #fffcf7; }
.class-breakdown strong, .class-breakdown small { display: block; }
.class-breakdown small { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 5px; color: #7c837f; white-space: normal; }
.class-breakdown small span:last-child { color: #9A5B0A; font-weight: 700; }
.class-record-link { display: grid; gap: 3px; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; }
.class-record-link strong { color: #2f4437; font-size: 12px; }
.class-record-link small { color: #A96514; font-size: 9px; }
.class-record-link:hover strong { color: #A96514; }
.lesson-content-cell { min-width: 180px; white-space: normal; line-height: 1.6; }
.teacher-revenue { color: #2f6b4f; }
.unit-price-preview { display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 10px 12px; border: 1px solid #ead8be; border-radius: 10px; background: linear-gradient(135deg, #fffaf1, #fff); }
.unit-price-preview span { color: #7c837f; font-size: 9px; }
.unit-price-preview strong { color: #A96514; font-size: 13px; }
.payment-tier-card, .payment-student-guide { padding: 13px; border: 1px solid #ead8be; border-radius: 11px; background: linear-gradient(135deg, #fffaf1, #fff); }
.payment-tier-card > small { display: block; margin-top: 8px; color: #7c837f; line-height: 1.5; }
.payment-tier-card .field-heading strong { color: #A96514; }
.student-profile-payment-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 11px; padding-top: 10px; border-top: 1px dashed #e4cda9; }
.payment-student-guide { display: grid; gap: 7px; }
.payment-student-guide > div { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.payment-student-guide strong { color: #805016; }
.payment-student-guide small { color: #7c837f; }
.compact-link { padding: 2px 5px; font-size: 10px; }
.bulk-check-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.quota-reset-button { margin-top: 6px; padding: 5px 8px; border: 1px solid #e5c89c; border-radius: 8px; color: #A96514; background: #fff8ed; font-size: 9px; }
.conditional-fields { padding: 15px; border: 1px solid #ecd5b3; border-radius: 12px; background: #fffaf2; }
.nested-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 13px; }
.inline-create { display: flex; align-items: flex-end; gap: 9px; }
.inline-create input { flex: 1; }
.inline-create button { flex: 0 0 auto; min-height: 39px; }
.homework-status-field { padding-top: 3px; }
.homework-check-list { display: grid; gap: 8px; margin-top: 9px; }
.homework-check-row { display: grid; grid-template-columns: minmax(150px, 1fr) auto auto; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.homework-check-row label { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.homework-check-row input { width: 16px; height: 16px; margin: 0; accent-color: #DF983A; box-shadow: none; }
.homework-student-list { display: flex; flex-wrap: wrap; gap: 5px; max-width: 420px; white-space: normal; }
.homework-student-chip { padding: 5px 7px; border-radius: 9px; color: #7a6561; background: #f7eeec; font-size: 9px; }
.homework-student-chip.is-complete { color: #48765a; background: #e9f4ec; }
.student-change-panel { margin-top: 18px; }
.student-change-panel .stat-grid { padding: 0 22px; }
.student-inactive { filter: grayscale(.7); opacity: .68; }
.student-inactive td { background: #f3f3f1; }
.inactive-member { filter: grayscale(1); opacity: .55; text-decoration: line-through; }
.lifecycle-history { display: grid; gap: 8px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #fafaf8; }
.lifecycle-history > div:not(.field-heading) { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 8px; border-top: 1px dashed var(--line); }
.lifecycle-history span, .lifecycle-history strong, .lifecycle-history small { display: block; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.error { background: #a54845; }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .login-shell { display: block; min-height: 100dvh; padding: 24px 20px; }
  .login-brand { display: none; }
  .login-panel { min-height: calc(100dvh - 48px); padding: 0; background: transparent; }
  .login-card { padding: 28px 22px; border-radius: 18px; }
  .mobile-logo .brand-logo { width: 132px; }
  .mobile-logo { display: flex; align-items: center; gap: 10px; margin-bottom: clamp(34px, 10vh, 60px); }
  .sidebar { z-index: 40; width: min(84vw, 300px); padding-top: max(24px, env(safe-area-inset-top)); padding-bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-100%); box-shadow: var(--shadow); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  body.nav-open .nav-backdrop { opacity: 1; visibility: visible; }
  .main-area { margin-left: 0; }
  .menu-button { width: 42px; height: 42px; display: grid; flex: 0 0 auto; place-items: center; margin-right: 12px; border: 1px solid var(--line); border-radius: 10px; background: white; }
  .topbar { position: sticky; z-index: 15; top: 0; height: 74px; padding: 0 16px; padding-top: env(safe-area-inset-top); }
  main { padding: 22px 16px; }
}
@media (max-width: 680px) {
  .topbar h2 { font-size: 19px; }
  .topbar .eyebrow { display: none; }
  main { padding: 18px 12px calc(24px + env(safe-area-inset-bottom)); }
  .site-footer { align-items: flex-start; flex-direction: column; gap: 6px; margin: 0 12px; padding: 18px 2px max(22px, env(safe-area-inset-bottom)); }
  .welcome-row, .section-toolbar { gap: 14px; margin-bottom: 18px; }
  #dashboardPage .welcome-row { padding: 20px 18px; }
  .welcome-row, .section-toolbar { align-items: flex-start; flex-direction: column; }
  .welcome-row h1 { font-size: 25px; }
  .welcome-row > .primary-button, .section-toolbar > .primary-button { width: 100%; min-height: 46px; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions button { min-width: 0; flex: 1; min-height: 46px; padding-inline: 10px; }
  .inline-month { width: 100%; justify-content: space-between; }
  .inline-month input { width: min(190px, 62%); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
  .stat-card { min-height: 116px; padding: 16px; }
  .stat-card strong { margin-top: 13px; font-size: 23px; overflow-wrap: anywhere; }
  .dashboard-grid { gap: 12px; }
  .panel { border-radius: 12px; }
  .panel-heading { padding: 17px 16px 11px; }
  .bar-chart { height: 210px; gap: 7px; padding: 24px 12px 18px; }
  .bar-item strong { max-width: 50px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .recent-list { padding-inline: 14px; }
  .recent-item { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 9px; }
  .payment-summary { margin-bottom: 12px; padding: 18px; }
  .table-panel { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .filters { align-items: stretch; flex-direction: column; margin-bottom: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 8px 24px rgba(38,55,44,.035); }
  .filters input, .filters select, .search-box { width: 100%; min-width: 0; }
  .filters input, .filters select, .filters .secondary-button { min-height: 44px; }
  .filter-total { margin-left: 0; }
  .table-scroll { overflow: visible; }
  table { white-space: normal; }
  thead { display: none; }
  tbody { display: grid; gap: 12px; }
  tbody tr { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 8px 24px rgba(38,55,44,.035); }
  tbody td { display: grid; grid-template-columns: minmax(86px, 34%) minmax(0, 1fr); align-items: start; gap: 12px; padding: 11px 14px; border-top: 1px solid #edf0ed; text-align: right; overflow-wrap: anywhere; }
  tbody td:first-child { border-top: 0; }
  tbody td::before { content: attr(data-label); color: #849087; text-align: left; font-size: 10px; font-weight: 700; letter-spacing: .03em; }
  tbody td > * { min-width: 0; }
  tbody .student-cell { width: 100%; justify-self: stretch; text-align: left; }
  tbody .student-export-link { align-items: center; }
  .student-mobile-card td:first-child { display: block; text-align: left; }
  .student-mobile-card td:first-child::before { display: none; }
  .student-mobile-card .mobile-student-toggle { display: block; width: 100%; margin-top: 10px; padding: 9px 10px 4px; border: 0; border-top: 1px dashed var(--line); color: #A96514; background: transparent; text-align: center; font-size: 10px; font-weight: 700; }
  .student-mobile-card .student-extra { display: none; }
  .student-mobile-card.mobile-expanded .student-extra { display: grid; }
  .export-hint { display: none; }
  .row-actions { justify-content: flex-end; }
  .row-actions button, .icon-button { min-width: 42px; min-height: 42px; }
  .row-actions .text-action { min-width: 58px; padding-inline: 10px; }
  .low-balance { border-color: #e8b7b4; }
  .low-balance td { background: #fff8f6; }
  .low-balance td:first-child { box-shadow: inset 3px 0 var(--danger); }
  .modal-backdrop { place-items: end center; padding: 0; }
  .modal-card { width: 100%; max-height: 94dvh; border-radius: 18px 18px 0 0; }
  .modal-header { position: sticky; z-index: 2; top: 0; padding: 18px 18px 14px; background: white; }
  .modal-body { grid-template-columns: 1fr; gap: 14px; padding: 18px; }
  .modal-body .full { grid-column: auto; }
  .checkbox-field { grid-column: auto; }
  .checkbox-group { grid-template-columns: 1fr 1fr; }
  .lesson-student-grid { grid-template-columns: 1fr 1fr; }
  .check-card { min-height: 46px; }
  .nested-fields { grid-template-columns: 1fr; }
  .inline-create { align-items: stretch; flex-direction: column; }
  .inline-create button { min-height: 46px; }
  .homework-check-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .homework-check-row strong { grid-column: 1 / -1; }
  .homework-check-row label { min-height: 40px; padding: 7px; border-radius: 8px; background: #f8faf8; }
  .modal-actions { position: sticky; z-index: 2; bottom: 0; padding: 12px 18px max(14px, env(safe-area-inset-bottom)); background: white; }
  .modal-actions button { min-height: 48px; flex: 1; }
  .toast { top: max(12px, env(safe-area-inset-top)); width: calc(100% - 24px); text-align: center; }
  .user-chip > div:last-child { display: none; }
}
@media (max-width: 420px) {
  .login-shell { padding-inline: 16px; }
  .login-card h2 { font-size: 31px; }
  .stat-grid { grid-template-columns: 1fr; }
  .checkbox-group { grid-template-columns: 1fr; }
  .lesson-student-grid { grid-template-columns: 1fr; }
  tbody td { grid-template-columns: 82px minmax(0, 1fr); }
}
