:root {
    --bg: #f1f3f7;
    --surface: #fff;
    --ink: #222d40;
    --muted: #727e91;
    --line: #e6eaf1;
    --accent: #d87459;
    --accent-soft: #fcf0eb;
    --rail: #182230;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button, a, select, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .4; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #c7735a; outline-offset: 3px; }
[hidden] { display: none !important; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 104px; background: var(--rail); color: #a7b3c4; display: flex; flex-direction: column; align-items: center; padding: 22px 10px 12px; z-index: 30; overflow-y: auto; }
.brand { padding-bottom: 35px; }
.brand > span:last-child, .nav-label, .sidebar-note, .sidebar-footer > div, .sidebar-footer > .online-dot { display: none; }
.brand-mark { display: block; width: 64px; height: 64px; border-radius: 18px; background: #000; object-fit: cover; box-shadow: 0 0 0 1px #d4a35a55; }
.brand { display: block; }
.sidebar nav { width: 100%; display: grid; gap: 9px; }
.nav-item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 12px 2px; border-radius: 12px; font-size: 10px; min-height: 66px; }
.nav-item .icon { width: 22px; height: 22px; }
.nav-item.selected { background: #344151; color: #ffc3af; }
.nav-item small { font-size: 7px; color: #8c9aaf; }
#nav-count { position: absolute; right: 10px; top: 7px; border-radius: 5px; background: var(--accent); color: #fff; font-size: 8px; padding: 2px 4px; }
.sidebar-footer { margin-top: auto; padding-top: 28px; }
.school-avatar { width: 37px; height: 37px; display: inline-grid; place-items: center; border-radius: 12px; background: #efe5de; color: #937864; font-size: 13px; font-weight: 650; flex-shrink: 0; }
.sidebar-footer .school-avatar { background: #2c3849; color: #c5d0df; border: 1px solid #405067; }
.workspace { margin-left: 104px; }
.topbar { position: sticky; top: 0; z-index: 20; height: 72px; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: #ffffffed; backdrop-filter: blur(16px); }
.app-identity { display: flex; align-items: center; gap: 10px; }
.app-identity strong { display: block; font-size: 13px; font-weight: 650; }
.workspace-label { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }
.mobile-mark { display: none; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.mode-label { font-size: 10px; color: #8b7457; background: #fbf4e8; border: 1px solid #f0e4cf; padding: 6px 10px; border-radius: 20px; }
main { max-width: 1510px; margin: 0 auto; padding: 28px 32px 32px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.eyebrow { font-size: 9px; letter-spacing: 1.8px; color: var(--muted); font-weight: 650; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -1px; margin: 5px 0 6px; line-height: 1.2; }
h1 span { color: var(--accent); }
.page-heading p { font-size: 12px; color: var(--muted); margin: 0; }
.directory-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.online-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #56a58a; flex-shrink: 0; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 17px 20px; }
.stat-icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px; }
.coral { color: #d48168; background: #fcf0e9; }
.green { color: #5b9a86; background: #eaf5ef; }
.purple { color: #9880bd; background: #f1edf8; }
.amber { color: #c39b5e; background: #fcf5e9; }
.stat > div > span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.stat strong { display: block; font-size: 25px; line-height: 1; font-weight: 650; }
.stat-note { display: none; }
.directory { background: #f8f9fc; border: 1px solid #e3e7ee; border-radius: 20px; padding: 22px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.billing-rate-actions { display: flex; gap: 8px; }
.billing-bulk-rate { display: flex; align-items: end; justify-content: flex-end; gap: 10px; margin: 0 0 16px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.billing-bulk-rate .select-field { width: min(100%, 360px); }
.billing-bulk-rate select { height: 44px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font-size: 12px; }
.billing-dialog-price-lists { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #f8f9fc; }
.billing-dialog-price-lists h3 { margin: 0 0 5px; font-size: 13px; }
.billing-dialog-price-lists .billing-help { margin: 8px 0 0; }
.billing-price-list-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 12px; }
.billing-price-list-row span { color: var(--muted); }
h2 { font-size: 16px; margin: 0; letter-spacing: -.3px; font-weight: 650; }
h2 > span { display: inline-flex; align-items: center; justify-content: center; height: 22px; min-width: 26px; border-radius: 7px; background: #e8ecf3; color: #67768d; font-size: 11px; margin-left: 7px; padding: 0 5px; }
.view-switch { display: flex; padding: 3px; border: 1px solid var(--line); background: #fff; border-radius: 10px; gap: 3px; }
.view-switch button { display: grid; place-items: center; height: 34px; width: 36px; border: 0; background: transparent; border-radius: 7px; color: #8895a6; }
.view-switch .icon { width: 17px; height: 17px; }
.view-switch button.active { color: #fff; background: var(--ink); }
.status-tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.status-tabs button { display: flex; align-items: center; gap: 6px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; padding: 11px 16px; font-size: 12px; font-weight: 600; }
.status-tabs button.active { border-bottom-color: var(--accent); color: #bb6049; }
.filters { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
.search-field { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 11px; background: #fff; padding: 0 14px; min-width: 0; }
.search-field .icon { color: #98a3b3; width: 18px; height: 18px; }
.search-field input { height: 44px; width: 100%; min-width: 0; border: 0; background: transparent; color: var(--ink); font-size: 12px; }
input::placeholder { color: #8d99ab; }
.filter-toggle { display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: #fff; color: #65748b; border-radius: 11px; padding: 0 16px; min-height: 44px; font-size: 12px; }
.filter-toggle .icon { height: 17px; width: 17px; }
.filter-toggle[aria-expanded="true"] { border-color: #e5b7a7; background: var(--accent-soft); color: #b7654d; }
#filter-count { display: grid; place-items: center; min-width: 18px; height: 18px; border-radius: 5px; background: var(--accent); color: white; font-size: 10px; }
.advanced-filters { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.select-field { display: grid; gap: 5px; min-width: 0; }
.select-field > span { color: var(--muted); font-size: 10px; }
.select-field select { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 9px; padding: 10px; height: 42px; color: #596980; background: #fff; font-size: 12px; }
.results-toolbar { display: flex; justify-content: space-between; align-items: center; min-height: 47px; gap: 10px; color: var(--muted); font-size: 11px; }
.results-toolbar p { margin: 0; }
.text-button { border: 0; background: transparent; color: #ba654d; padding: 10px 0; font-size: 11px; }
.text-button span { font-size: 16px; margin-left: 3px; }
.student-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.student-card { min-width: 0; border: 1px solid var(--line); border-radius: 15px; background: #fff; overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.student-card:hover { border-color: #d9b4a8; box-shadow: 0 4px 18px #26364b09; }
.card-body { padding: 11px 12px 0; }
.card-heading { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 8px; align-items: center; margin-bottom: 9px; }
.portrait-wrap { width: 42px; height: 42px; border-radius: 12px; overflow: hidden; background: #eee6e1; }
.portrait { width: 100%; height: 100%; object-fit: cover; display: block; }
.portrait-wrap .portrait { transform: scale(1.3); transform-origin: center 40%; }
.avatar-fallback { height: 100%; display: grid; place-items: center; font-size: 23px; background: #efe4de; color: #8e7c74; }
.card-identity { min-width: 0; }
.student-name { font-size: 13px; line-height: 1.35; font-weight: 650; margin: 0 0 4px; overflow-wrap: anywhere; }
.student-id { font-size: 9px; color: #8e99aa; margin: 0; letter-spacing: .5px; }
.status-pill { display: inline-flex; align-items: center; justify-self: start; gap: 5px; border-radius: 5px; padding: 4px 7px; font-size: 9px; white-space: nowrap; background: #edf7f1; color: #51876c; }
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #61a17f; }
.status-pill.inactive { color: #8c8e97; background: #f0f1f4; }
.status-pill.inactive::before { background: #a3a6b1; }
.card-heading > .status-pill { grid-column: 2; margin-top: -11px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 7px; min-height: 20px; }
.tag { display: inline-flex; align-items: center; color: #a47558; background: #f8eee5; font-size: 9px; padding: 3px 6px; border-radius: 6px; }
.tag[data-discipline="2"] { background: #f2edf7; color: #8e74ac; }
.tag[data-discipline="3"] { background: #eaf0f6; color: #6584a3; }
.tag[data-discipline="4"] { background: #f8edf1; color: #b0778e; }
.teacher-line { display: flex; align-items: flex-start; gap: 6px; margin: 0 0 7px; color: #7a8799; font-size: 10px; line-height: 1.4; }
.teacher-line .icon { width: 14px; height: 14px; margin-top: 1px; }
.teacher-line span { min-width: 0; overflow-wrap: anywhere; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid #eef1f5; padding: 4px 11px; background: #fdfdfe; }
.joined { display: inline-flex; align-items: center; gap: 5px; font-size: 9px; color: #8a96a8; }
.joined .icon { height: 12px; width: 12px; }
.profile-button { display: inline-flex; align-items: center; gap: 5px; padding: 8px 0; min-height: 32px; border: 0; background: transparent; color: #b8654e; font-size: 11px; font-weight: 600; white-space: nowrap; }
.profile-button .icon { height: 13px; width: 13px; }
.pagination { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--muted); margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.pagination > div { display: flex; align-items: center; gap: 8px; }
.pagination button { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: #fff; border: 1px solid var(--line); color: #6d7c92; }
.pagination .icon { width: 15px; height: 15px; }
.reverse { transform: rotate(180deg); }
#page-number { display: grid; place-items: center; min-width: 34px; height: 34px; background: var(--ink); color: #fff; border-radius: 9px; }
.error-state, .empty-state { padding: 35px 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; text-align: center; font-size: 13px; }
.error-state { color: #a85640; border-color: #e8b7a8; }
.empty-state h3 { font-size: 17px; font-weight: 600; margin: 16px 0 8px; }
.empty-state p { font-size: 12px; color: var(--muted); }
.primary-button { background: var(--accent); color: #fff; padding: 12px 17px; border: 0; border-radius: 9px; font-size: 12px; }
.loading-card { height: 205px; background: linear-gradient(110deg, #e9edf3 8%, #f5f6f8 18%, #e9edf3 33%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border: 1px solid var(--line); border-radius: 15px; }
@keyframes shimmer { to { background-position-x: -200%; } }
.student-grid.list-view { grid-template-columns: 1fr; gap: 8px; }
.list-view .student-card { display: flex; align-items: center; }
.list-view .card-body { display: grid; grid-template-columns: minmax(230px, 1.2fr) minmax(0, .8fr) minmax(0, 1fr); align-items: center; gap: 16px; flex: 1; padding: 13px 16px; min-width: 0; }
.list-view .card-heading { margin: 0; grid-template-columns: 44px minmax(0, 1fr); gap: 2px 10px; }
.list-view .portrait-wrap { width: 44px; height: 44px; border-radius: 12px; grid-row: 1 / 3; }
.list-view .card-heading > .status-pill { margin-top: 0; }
.list-view .tags, .list-view .teacher-line { margin: 0; }
.list-view .card-footer { border: 0; background: transparent; padding: 10px 16px 10px 0; }
.list-view .joined { display: none; }
.list-view .loading-card { height: 84px; }
dialog { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(460px, 100%); max-width: 100%; height: 100%; max-height: 100%; border: 0; border-left: 1px solid var(--line); padding: 0; overflow-y: auto; color: var(--ink); background: #fff; box-shadow: -20px 0 70px #15212e20; }
dialog::backdrop { background: #18223060; backdrop-filter: blur(3px); }
.dialog-close { position: absolute; top: 16px; right: 16px; z-index: 1; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid #fff; background: #fffffff0; color: #65748a; border-radius: 12px; }
.dialog-close .icon { width: 18px; height: 18px; }
.dialog-portrait { height: 240px; overflow: hidden; }
.dialog-body { padding: 26px; }
.dialog-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dialog-title-row h2 { font-size: 23px; overflow-wrap: anywhere; }
.dialog-body .student-id { margin-top: 8px; }
.contact-block { display: grid; gap: 12px; margin: 24px 0; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.contact-block p { margin: 0; overflow-wrap: anywhere; }
.contact-block a { color: #ba654e; }
.dialog-body h3 { font-size: 13px; margin: 20px 0 12px; }
.course-item { margin: 10px 0; padding: 16px; border: 1px solid var(--line); background: #f7f9fc; border-radius: 12px; }
.course-item strong { display: block; font-size: 12px; }
.course-item p { font-size: 11px; color: var(--muted); margin: 8px 0 0; }
.school-lesson-plans { margin: 24px 0; }
.school-attendance { margin: 24px 0; padding: clamp(16px, 3vw, 28px); border: 1px solid var(--line); border-radius: 18px; background: #fbfafc; min-width: 0; }
.school-attendance .section-heading { margin: 0 0 12px; }
.school-attendance .section-heading h3 { margin: 0 0 4px; }
.school-attendance-form { display: grid; grid-template-columns: minmax(160px, 220px) minmax(0, 1fr); align-items: end; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.school-attendance-form .select-field { min-width: 0; }
.school-attendance-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.school-attendance-actions button { min-height: 44px; white-space: normal; }
.school-attendance-form input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font: inherit; }
.school-attendance-rows { display: grid; gap: 8px; margin-top: 12px; }
.school-attendance-role-counts { margin: 0; padding: 10px 12px; border-radius: 9px; background: #f2f5f8; color: var(--ink); font-size: 12px; font-weight: 650; }
.school-attendance-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; min-width: 0; }
.school-attendance-identity { min-width: 0; display: grid; justify-items: start; gap: 8px; flex: 1; }
.school-attendance-student-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 14px; max-width: 55%; min-width: 0; }
.school-attendance-student-actions:has(> [hidden]:only-child) { display: none; }
.school-attendance-row strong { overflow-wrap: anywhere; }
.school-attendance-row .secondary-button, .school-attendance-row .text-button { min-height: 44px; white-space: normal; overflow-wrap: anywhere; text-decoration: none; text-align: center; }
.school-attendance-badge { border-radius: 30px; padding: 5px 10px; font-size: 11px; font-weight: 650; }
.school-attendance-badge.yes, .school-attendance-metric.yes { color: #226447; background: #eaf5ee; }
.school-attendance-badge.no, .school-attendance-metric.no { color: #963b3b; background: #fff0ef; }
.school-attendance-badge.pending, .school-attendance-metric.pending { color: #77551c; background: #fff6e3; }
#school-attendance-summary:not(:empty) { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 20px 0 12px; }
.school-attendance-metric { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 12px; min-width: 0; overflow-wrap: anywhere; background: #eef1f6; color: var(--ink); }
.school-attendance-metric strong { font-size: 26px; line-height: 1; }
.school-attendance-metric > span { font-size: 12px; }
.school-attendance-list-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 12px; margin: 26px 0 8px; }
.school-attendance-list-heading h4 { margin: 0; font-size: 15px; }
#school-push-status { overflow-wrap: anywhere; }
@media (max-width: 700px) {
    .school-attendance-form { grid-template-columns: minmax(0, 1fr); }
    .school-attendance-form input { min-width: 0; max-width: 100%; font-size: 16px; }
    .school-attendance-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
    .school-attendance-actions button { width: 100%; }
    #school-attendance-summary:not(:empty) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .school-attendance-metric { padding: 14px 12px; }
    .school-attendance-row { flex-direction: column; align-items: stretch; gap: 12px; padding: 16px; }
    .school-attendance-student-actions { max-width: none; justify-content: flex-start; border-top: 1px solid var(--line); padding-top: 10px; }
    .school-attendance-student-actions > a, .school-attendance-student-actions > button { flex: 1 1 110px; }
}
.school-lesson-plans .section-heading { margin-bottom: 10px; }
.school-lesson-plans .section-heading h3 { margin: 0; }
.school-lesson-plan-selector { margin: 12px 0; }
.school-lesson-plan-selector select { height: 46px; font-size: 13px; }
.school-lesson-plan { display: grid; gap: 6px; margin: 8px 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #f8f9fc; }
.school-lesson-plan strong { font-size: 13px; }
.school-lesson-plan-steps { display: grid; gap: 8px; margin: 4px 0 0; padding-left: 24px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.school-lesson-plan-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.school-lesson-plan-editor-heading strong { font-size: 13px; }
.school-lesson-plan-step-fields { display: grid; gap: 10px; }
.school-lesson-plan-step-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; }
.school-lesson-plan-step-input textarea { width: 100%; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); font: inherit; font-size: 13px; resize: vertical; }
.demo-note { color: #9c876f; font-size: 10px; line-height: 1.7; margin-top: 22px; }
.profile-billing { width: 100%; margin-top: 20px; }
.billing-notice { background: #fbf4e8; border: 1px solid #f0e4cf; color: #866f52; padding: 12px 15px; border-radius: 12px; font-size: 12px; line-height: 1.6; margin: 0 0 20px; }
.billing-stats .stat > div { min-width: 0; }
.billing-stats strong { font-size: clamp(16px, 1.8vw, 24px); overflow-wrap: anywhere; }
.billing-filters { display: grid; grid-template-columns: 170px minmax(0, 1fr) 160px; gap: 12px; align-items: end; }
.billing-filters input[type="month"], .billing-dialog input { border: 1px solid var(--line); border-radius: 9px; padding: 10px; height: 44px; width: 100%; min-width: 0; background: #fff; color: var(--ink); font-size: 13px; }
.billing-help { color: var(--muted); font-size: 11px; line-height: 1.7; }
.settlement-stats { color: var(--ink, inherit); font-size: 12px; font-weight: 600; line-height: 1.6; }
.settlement-warning { margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: #fff4dc; color: #8a5a00; font-size: 12px; line-height: 1.5; }
.billing-scope { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; margin-top: 14px; background: var(--accent-soft); border-radius: 9px; font-size: 12px; }
.billing-feedback { color: #43836d; background: #edf7f1; padding: 12px 15px; border-radius: 10px; font-size: 12px; line-height: 1.6; }
.billing-rows { display: grid; gap: 9px; }
.billing-rows .loading-card { height: 98px; }
.billing-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto; align-items: center; gap: 15px; background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 16px; }
.settlement-course { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.settlement-course .billing-row-identity { grid-column: 1 / -1; }
.settlement-course-fields { display: grid; gap: 10px; }
.settlement-course-fields .select-field { min-width: 0; }
.settlement-rule-row { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(135px, 1fr) minmax(90px, 120px); gap: 8px; align-items: center; }
.settlement-rule-row strong { font-size: 12px; }
.settlement-rule-row select, .settlement-rule-row input, .settlement-course-fields input { border: 1px solid var(--line); border-radius: 9px; padding: 10px; height: 42px; width: 100%; min-width: 0; background: #fff; color: var(--ink); font-size: 12px; }
.billing-row-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.billing-row-identity > div { min-width: 0; }
.billing-row-identity h3 { font-size: 13px; margin: 0 0 5px; overflow-wrap: anywhere; }
.billing-row-identity .status-pill { margin-top: 7px; }
.billing-initials { display: grid; place-items: center; flex-shrink: 0; width: 43px; height: 43px; background: #f2ebe6; color: #ad7d63; border-radius: 13px; font-size: 13px; font-weight: 650; }
.billing-row-info { display: grid; gap: 3px; min-width: 0; }
.billing-amount { font-size: 18px; white-space: nowrap; }
.billing-payment-note { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; margin: 3px 0 0; }
.billing-row-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.billing-history { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 10px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.billing-history summary { cursor: pointer; padding: 6px 0; }
.billing-history p { line-height: 1.7; margin: 9px 0; }
.status-pill.pending { background: #fff4df; color: #b08635; }
.status-pill.pending::before { background: #d0a455; }
.secondary-button { background: #fff; color: #65748b; padding: 11px 14px; border: 1px solid var(--line); border-radius: 9px; font-size: 12px; }
dialog.billing-dialog { inset: 0; margin: auto; width: min(480px, calc(100% - 32px)); height: fit-content; max-height: calc(100dvh - 32px); border-radius: 18px; border: 1px solid var(--line); box-shadow: 0 20px 70px #15212e20; }
.billing-dialog h2 { font-size: 20px; }
#billing-dialog-fields { display: grid; gap: 15px; margin: 22px 0; }
#billing-dialog-description { font-size: 12px; }
.billing-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
#billing-dialog-error { padding: 12px; font-size: 12px; text-align: left; }
.finance-period { display: flex; align-items: center; gap: 24px; margin: 0 0 22px; }
.finance-period .select-field { width: 230px; flex-shrink: 0; }
.finance-period input { min-width: 0; width: 100%; padding: 10px; height: 44px; background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 9px; font-size: 14px; }
.finance-period p { color: var(--muted); font-size: 12px; line-height: 1.7; }
.result-positive { color: #43836d; }
.result-negative { color: #b65449; }
.finance-context { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 18px; border: 1px solid var(--line); background: #fff; border-radius: 12px; }
.finance-context p { font-size: 12px; line-height: 1.7; margin: 0; color: var(--muted); }
.finance-panels { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: 18px; margin: 20px 0; }
.finance-panels > .directory { min-width: 0; }
.finance-panels .section-heading { gap: 10px; flex-wrap: wrap; }
.chart-legend { display: flex; gap: 18px; color: var(--muted); font-size: 11px; margin: 20px 0; }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.chart-legend i { width: 9px; height: 9px; display: inline-block; border-radius: 3px; }
.income-key, .income-bar { background: #73a992; }
.expense-key, .expense-bar { background: #de957f; }
.finance-chart { display: flex; justify-content: space-around; gap: 10px; }
.chart-column { display: grid; grid-template-rows: 150px auto; flex: 1; min-width: 0; gap: 10px; text-align: center; }
.chart-bars { display: flex; gap: 4px; justify-content: center; align-items: end; border-bottom: 1px solid #dfe5ec; }
.chart-bars > div { width: 22px; max-width: 35%; border-radius: 5px 5px 0 0; }
.chart-month { color: var(--muted); font-size: 10px; line-height: 1.5; }
.finance-table-details { margin-top: 22px; color: var(--muted); font-size: 11px; }
.finance-table-details summary { cursor: pointer; padding: 10px 0; }
.finance-table-wrap { overflow-x: auto; }
.finance-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.finance-table caption { text-align: left; padding: 10px 0; }
.finance-table th, .finance-table td { border-bottom: 1px solid var(--line); padding: 10px 5px; text-align: right; white-space: nowrap; }
.finance-table th:first-child { text-align: left; }
.category-item { margin: 20px 0; }
.category-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.category-line strong { color: var(--ink); font-size: 12px; }
.category-track { height: 6px; border-radius: 6px; overflow: hidden; background: #e9edf3; }
.category-bar { height: 100%; background: #de957f; border-radius: 6px; }
.expense-filters { display: flex; align-items: end; gap: 20px; }
.expense-filters > .select-field { width: 230px; }
.expense-cancelled-toggle { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; min-height: 42px; }
.expense-row .billing-row-actions { gap: 12px; }
.expense-is-cancelled { background: #f4f5f7; }
.expense-is-cancelled > .billing-amount { text-decoration: line-through; color: var(--muted); }
#expense-dialog-fields { display: grid; gap: 14px; margin: 20px 0; }
#expense-dialog-error { text-align: left; font-size: 12px; padding: 12px; }
.school-filters { display: grid; gap: 12px; }
.school-course-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.school-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.school-card { min-width: 0; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 15px; display: flex; flex-direction: column; }
.school-card-heading { display: flex; align-items: center; gap: 12px; }
.school-card-heading > div { min-width: 0; }
.school-card-heading h3 { font-size: 14px; margin: 0 0 6px; overflow-wrap: anywhere; }
.school-card-mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; font-size: 16px; font-weight: 650; flex-shrink: 0; }
.school-card-content { padding: 15px 0; flex: 1; overflow-wrap: anywhere; }
.school-contact { display: flex; align-items: flex-start; gap: 7px; font-size: 11px; color: var(--muted); line-height: 1.7; margin: 7px 0; overflow-wrap: anywhere; }
.school-contact a { color: var(--accent); min-width: 0; }
.school-contact .icon { height: 15px; width: 15px; margin-top: 2px; }
.school-card-counts { display: flex; gap: 9px; margin-bottom: 14px; }
.school-card-counts span { color: #6b7c90; background: #f2f5f8; font-size: 10px; border-radius: 6px; padding: 6px 9px; }
.school-card-actions { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 12px; }
.school-detail-body { padding-top: 28px; }
#school-course-screen .school-detail-body { padding: 24px 0; }
#school-course-screen #school-detail-title { font-size: clamp(26px, 4vw, 36px); }
.school-detail-mark { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 19px; background: #f1edf8; color: #9880bd; margin-bottom: 16px; font-weight: 650; font-size: 22px; }
#school-detail-title { font-size: 23px; padding-right: 16px; }
.school-detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.school-danger-button { color: #a62d25; border-color: #efc5c0; }
.school-course-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin: 22px 0 18px; padding: 5px; border: 1px solid var(--line); border-radius: 13px; background: #f7f7fa; }
.school-course-tab { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px 5px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 650; line-height: 1.25; text-align: center; white-space: normal; overflow-wrap: anywhere; cursor: pointer; }
.school-course-tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 5px #18223014; }
.school-course-tab:focus-visible { outline: 2px solid #9880bd; outline-offset: 2px; }
.school-course-tab-summary { max-width: 100%; color: #27754d; font-size: 9px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.school-course-panel { min-width: 0; }
.school-course-panel[hidden], .school-course-tabs[hidden] { display: none; }
.school-course-panel > h3 { margin: 0 0 14px; }
.school-roster-filters { display: grid; gap: 12px; }
.school-roster-filters .search-field input { font-size: 16px; }
.school-roster { display: grid; gap: 8px; }
.school-roster-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 12px; }
.school-roster-row > div { min-width: 0; display: grid; gap: 6px; flex: 1 1 160px; }
.school-roster-row strong { font-size: 12px; overflow-wrap: anywhere; }
.school-roster-row button { font-size: 11px; }
.school-editor-fields { display: grid; gap: 14px; margin: 20px 0; }
.school-editor-fields textarea { width: 100%; resize: vertical; min-height: 90px; padding: 10px; border: 1px solid var(--line); background: #fff; border-radius: 9px; font: inherit; font-size: 14px; color: var(--ink); }
#school-editor-error { padding: 12px; text-align: left; font-size: 12px; }
@media (max-width: 1200px) {
    .school-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    main { padding: 24px; }
    .topbar { padding: 0 24px; }
    .student-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .stats { gap: 10px; }
    .stat { padding: 14px 12px; gap: 10px; }
    .stat > div > span { font-size: 10px; }
    .list-view .card-body { grid-template-columns: minmax(200px, 1fr) minmax(0, 1fr); }
    .list-view .teacher-line { grid-column: 2; }
    .list-view .card-heading { grid-row: 1 / 3; }
}
@media (max-width: 900px) {
    .student-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .sidebar { inset: auto 0 0; width: 100%; overflow: visible; padding: 7px 8px max(7px, env(safe-area-inset-bottom)); border-top: 1px solid #344050; }
    .brand, .sidebar-footer { display: none; }
    .sidebar nav { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
    .nav-item { min-width: 0; min-height: 51px; padding: 6px 0; gap: 4px; border-radius: 10px; font-size: clamp(6px, 2vw, 9px); white-space: nowrap; }
    .nav-item .icon { width: 20px; height: 20px; }
    .nav-item small { font-size: 6px; }
    #nav-count { right: 10%; top: 2px; font-size: 7px; }
    .workspace { margin: 0; }
    .topbar { height: 66px; padding: 0 18px; }
    .mobile-mark { display: block; width: 38px; height: 38px; border-radius: 11px; background: #000; object-fit: cover; }
    .app-identity strong { font-size: 12px; }
    .workspace-label { font-size: 9px; }
    .topbar-right { gap: 9px; }
    .school-avatar.small { width: 30px; height: 30px; border-radius: 10px; font-size: 11px; }
    .mode-label { font-size: 8px; padding: 5px 7px; }
    main { padding: 22px 16px calc(96px + env(safe-area-inset-bottom)); }
    .page-heading { margin-bottom: 18px; }
    h1 { font-size: 28px; }
    .directory-label { display: none; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 20px; }
    .stat { border-radius: 12px; padding: 13px; gap: 10px; }
    .stat-icon { width: 34px; height: 34px; border-radius: 10px; }
    .stat-icon .icon { width: 19px; height: 19px; }
    .stat strong { font-size: 22px; }
    .stat > div > span { font-size: 10px; }
    .directory { padding: 16px 12px; border-radius: 16px; }
    .status-tabs { gap: 0; margin-bottom: 12px; }
    .status-tabs button { padding: 12px 14px; }
    .filters { gap: 8px; }
    .search-field { padding: 0 10px; }
    .search-field input { font-size: 16px; }
    .search-field input::placeholder { font-size: 11px; }
    .filter-toggle { padding: 0 10px; gap: 5px; font-size: 11px; }
    .advanced-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .status-field { grid-column: 1 / -1; }
    .select-field select { font-size: 16px; }
    .results-toolbar { font-size: 10px; }
    .text-button { font-size: 10px; }
    .student-grid { grid-template-columns: 1fr; gap: 10px; }
    .card-body { padding: 11px 12px 0; }
    .card-heading { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 8px; margin-bottom: 8px; }
    .portrait-wrap { width: 42px; height: 42px; border-radius: 12px; }
    .card-heading > .status-pill { grid-column: auto; margin: 0; }
    .student-name { font-size: 13px; }
    .student-id { font-size: 8px; }
    .teacher-line { font-size: 10px; }
    .profile-button { min-height: 40px; }
    .card-footer { padding-top: 2px; padding-bottom: 2px; }
    .pagination button { width: 44px; height: 44px; }
    .view-switch button { width: 40px; height: 38px; }
    .list-view .student-card { align-items: flex-start; }
    .list-view .card-body { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 13px; }
    .list-view .card-heading { grid-template-columns: 38px minmax(0, 1fr); gap: 2px 8px; }
    .list-view .portrait-wrap { width: 38px; height: 38px; }
    .list-view .card-heading > .status-pill { grid-column: 2; }
    .list-view .student-name { font-size: 13px; }
    .list-view .teacher-line { font-size: 10px; }
    .list-view .card-footer { align-self: center; padding: 8px 12px 8px 0; }
    .list-view .profile-button { font-size: 10px; }
    dialog { inset: auto 0 0; width: 100%; height: auto; max-height: 92dvh; border-radius: 24px 24px 0 0; border: 0; padding-bottom: env(safe-area-inset-bottom); }
    .dialog-portrait { height: 180px; }
    .dialog-body { padding: 22px; }
    .dialog-title-row h2 { font-size: 21px; }
    .billing-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .billing-filters .search-field { grid-column: 1 / -1; grid-row: 1; }
    .billing-filters > .select-field { grid-column: 1 / -1; }
    #settlement-mode-form .primary-button { width: 100%; }
    .settlement-rule-row { grid-template-columns: minmax(75px, 1fr) minmax(120px, 1.2fr) minmax(75px, .8fr); }
    .billing-row { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 14px; }
    .billing-row-identity { grid-column: 1 / -1; }
    .billing-amount { font-size: 17px; }
    .billing-stats strong { font-size: 18px; }
    .billing-row .primary-button, .billing-row .secondary-button { font-size: 11px; padding: 12px; }
    .billing-filters input[type="month"], .billing-dialog input, .billing-dialog select { font-size: 16px; }
    .billing-bulk-rate { align-items: stretch; flex-direction: column; }
    .billing-bulk-rate .select-field { width: 100%; }
    #billing-view .section-heading { flex-wrap: wrap; gap: 10px; }
    .billing-rate-actions { width: 100%; justify-content: flex-end; }
    .billing-scope { flex-wrap: wrap; }
    dialog.billing-dialog { padding-bottom: 0; }
    #finance-view > .page-heading { align-items: flex-start; gap: 12px; }
    #finance-view > .page-heading .primary-button { font-size: 11px; padding: 12px; margin-top: 9px; flex-shrink: 0; }
    .finance-period { flex-direction: column; align-items: stretch; gap: 2px; }
    .finance-period .select-field { width: 100%; }
    .finance-period input { font-size: 16px; }
    .finance-panels { grid-template-columns: minmax(0, 1fr); }
    .finance-context { gap: 10px; }
    .expense-filters { flex-direction: column; align-items: stretch; gap: 4px; }
    .expense-filters > .select-field { width: 100%; }
    .chart-column { grid-template-rows: 120px auto; }
    .chart-month { font-size: 9px; }
    .finance-chart { gap: 6px; }
    .expense-row .billing-row-actions { gap: 8px; }
    .school-grid { grid-template-columns: minmax(0, 1fr); }
    #school-list-screen > .page-heading { align-items: flex-start; gap: 12px; }
    #school-list-screen > .page-heading .primary-button { flex-shrink: 0; font-size: 11px; padding: 12px; margin-top: 9px; }
    .school-course-filters { grid-template-columns: minmax(0, 1fr); }
    .school-course-tabs { gap: 3px; padding: 4px; }
    .school-course-tab { gap: 3px; padding: 9px 3px; font-size: 10px; }
    .school-editor-fields textarea { font-size: 16px; }
}
@media (max-width: 360px) {
    .topbar { padding: 0 12px; }
    .topbar-right .school-avatar { display: none; }
    main { padding-left: 10px; padding-right: 10px; }
    .card-heading { grid-template-columns: 44px minmax(0, 1fr); }
    .portrait-wrap { width: 44px; height: 44px; }
    .card-heading > .status-pill { grid-column: 2; margin-top: -7px; }
    .filter-toggle { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
.platform-body { display: block; min-height: 100vh; background: #f5f6fa; color: #182230; }
.platform-layout { width: min(1100px, 100%); margin: 0 auto; padding: 32px 24px; min-width: 0; }
.auth-panel { width: min(480px, calc(100% - 32px)); margin: 7vh auto; padding: 32px; background: white; border: 1px solid #e8ebf0; border-radius: 24px; box-shadow: 0 16px 60px #1822300a; }
.auth-panel h1 { font-size: 28px; margin: 28px 0 12px; }
.platform-brand { color: #182230; font-size: 28px; font-weight: 800; text-decoration: none; }
.platform-brand span { display: block; font-size: 12px; font-weight: 500; color: #677184; }
.platform-brand { display: flow-root; }
.platform-logo { float: left; width: 44px; height: 44px; margin-right: 12px; border-radius: 12px; background: #000; }
.auth-brand { text-align: center; margin-bottom: 8px; }
.auth-brand span { margin-top: 8px; }
.auth-logo { display: block; width: 180px; height: 180px; margin: 0 auto; border-radius: 28px; background: #000; box-shadow: 0 12px 34px #00000026; }
.platform-header { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 32px; }
.platform-header .platform-brand { margin-right: auto; }
.platform-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 24px; }
.subscription-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.subscription-stats strong { font-size: clamp(22px, 4vw, 32px); overflow-wrap: anywhere; }
.subscription-month { max-width: 320px; }
.school-teacher-choices { margin: 0; padding: 14px; border: 1px solid #d9dee7; border-radius: 10px; min-width: 0; }
.school-teacher-choices legend { font-size: 13px; font-weight: 600; }
.school-teacher-choices label { display: flex; align-items: center; gap: 10px; padding: 8px 0; overflow-wrap: anywhere; }
.school-teacher-choices input[type="checkbox"] { width: 18px; height: 18px; flex-shrink: 0; }
.subscription-sections { align-items: start; }
.subscription-history-heading { margin-top: 28px !important; }
.subscription-history { display: grid; gap: 12px; }
.subscription-history > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 12px; background: #f5f6fa; border-radius: 10px; }
.platform-panel { min-width: 0; background: white; border: 1px solid #e8ebf0; border-radius: 20px; padding: 24px; }
.platform-panel h2 { margin: 0 0 12px; font-size: 20px; }
.platform-form { display: grid; gap: 16px; margin: 20px 0; }
.platform-form fieldset { min-width: 0; margin: 0; padding: 16px; border: 1px solid #d9dee7; border-radius: 10px; }
.platform-form legend { padding: 0 6px; font-size: 14px; font-weight: 600; }
.platform-form label { display: grid; gap: 8px; font-size: 13px; font-weight: 600; }
.platform-form input, .platform-form select, .platform-form textarea { width: 100%; min-width: 0; padding: 12px; border: 1px solid #d9dee7; border-radius: 10px; background: white; color: #182230; font: inherit; }
.platform-form label:has(input[type="checkbox"]) { display: flex; align-items: flex-start; }
.platform-form input[type="checkbox"] { width: auto; margin-top: 3px; flex-shrink: 0; }
.platform-error, .platform-success { padding: 14px; border-radius: 12px; overflow-wrap: anywhere; }
.platform-error { background: #fff0ee; color: #a62d25; }
.platform-success { background: #edf9f2; color: #206d43; }
.platform-business, .platform-space { padding: 18px 0; border-bottom: 1px solid #e8ebf0; overflow-wrap: anywhere; }
.platform-business h3 { margin: 0 0 6px; }
.platform-business p { color: #677184; font-size: 13px; }
.platform-business details { margin-top: 12px; font-size: 13px; }
.platform-inline { display: inline-block; margin: 12px 8px 0 0; }
.platform-space { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin-bottom: 16px; }
.identity-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.delete-confirm { display: grid; gap: 10px; margin-top: 14px; padding: 14px; border: 1px solid #efc5c0; border-radius: 12px; background: #fff7f6; }
.delete-confirm input { width: 100%; min-width: 0; padding: 12px; border: 1px solid #d9dee7; border-radius: 10px; background: white; color: #182230; font: inherit; }
.delete-confirm .school-danger-button { justify-self: start; }
.delete-confirm .school-danger-button:disabled { opacity: .5; }
.invitation-code { width: 100%; font-family: monospace; overflow-wrap: anywhere; padding: 12px; border-radius: 10px; background: #f4f5f9; }
@media (max-width: 760px) {
    .platform-grid { grid-template-columns: minmax(0, 1fr); }
    .subscription-stats { grid-template-columns: minmax(0, 1fr); }
    .platform-layout { padding: 20px 16px; }
    .platform-panel, .auth-panel { padding: 20px; }
    .platform-space { align-items: flex-start; flex-direction: column; }
    .topbar-right .mode-label { display: none; }
    .app-identity strong { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
