/* Shared ERP design tokens and components. Business state is assigned by server markup. */
:root{--navy:#17364d;--teal:#107b7a;--teal-dark:#0c6262;--ink:#20394c;--muted:#536879;--line:#d6e1e8;--bg:#f3f6f8;--radius:12px;--space:16px;font-size:15px;line-height:1.6}
body{font-family:-apple-system,BlinkMacSystemFont,'PingFang HK','Noto Sans TC','Microsoft JhengHei',sans-serif}h1{font-size:clamp(23px,2.4vw,30px);line-height:1.3}h2{font-size:20px}h3{font-size:17px}main{padding:28px;max-width:1550px;min-width:0}.panel{padding:24px;margin-bottom:20px;box-shadow:0 2px 10px #17364d06}.layout{grid-template-columns:244px minmax(0,1fr)}aside{padding:24px 14px}.menu a,.menu summary{font-size:14px;line-height:1.5;min-height:44px}.menu a{display:flex;gap:10px;align-items:center}.menu .icon{width:18px;height:18px;flex:0 0 18px}.menu details a{font-size:13px}.menu summary{cursor:pointer;border-radius:8px}.menu summary:hover{background:#ffffff12}
button,.btn{min-height:42px;max-width:100%;border-radius:7px;padding:10px 16px;font-size:14px;gap:8px;line-height:1.4;white-space:normal;flex-shrink:0}.danger{background:#a82b35;border-color:#a82b35}.toolbar,.action-group,.management-actions,.form-footer,.modal-footer{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.toolbar{justify-content:space-between;margin-bottom:18px}.toolbar h2{margin:0;flex:1;min-width:140px}.action-group form,.management-actions form,.modal-footer form{margin:0;display:inline-flex}.form-footer,.modal-footer{justify-content:flex-end;padding-top:18px;margin-top:20px;border-top:1px solid var(--line)}.fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:18px}.field{display:flex;flex-direction:column;gap:7px;font-size:14px;min-width:0;margin:0 0 16px}.field input,.field select,.field textarea,input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea{min-width:0;max-width:100%;border:1px solid #bacbd6;border-radius:7px;padding:10px 12px;min-height:44px;color:var(--ink);background:#fff}.field textarea{resize:vertical;line-height:1.65;min-height:112px}input[type=checkbox],input[type=radio]{width:18px;height:18px;min-height:18px;flex:0 0 18px;accent-color:var(--teal);vertical-align:middle;margin-right:8px}fieldset{min-width:0;border:1px solid var(--line);border-radius:8px;padding:16px}fieldset label{display:flex;align-items:center;margin:8px 0}.note,.success,.errors{padding:14px 16px;line-height:1.65;border-radius:8px;overflow-wrap:anywhere}.success{background:#e8f5ec;color:#245b39;border:1px solid #a9d0b5}.errors,.field-error{color:#8d2530;background:#fff0f1;border-color:#e7b1b7}.muted,small{color:var(--muted)}
.cards,.task-categories{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr));gap:16px;margin-bottom:22px}.card{padding:20px;border-radius:10px;margin:0;min-height:124px;display:flex;flex-direction:column;gap:8px;justify-content:space-between;color:var(--navy);font-size:14px}.card .num{font-size:clamp(24px,3cqi,34px);line-height:1.3;font-weight:750;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}.tone-neutral{background:#fff!important;color:#17364d!important;border-color:#bccdd8!important}.tone-yellow{background:#fff5d5!important;color:#765300!important;border-color:#dfc67f!important}.tone-green{background:#e8f5ec!important;color:#245b39!important;border-color:#abd0b6!important}.tone-red{background:#fff0f1!important;color:#8d2530!important;border-color:#e6afb5!important}.tone-grey{background:#eef1f4!important;color:#526574!important;border-color:#cad4dc!important}.card small{color:inherit}.table-wrap{width:100%;min-width:0;max-width:100%;overflow:auto;border-radius:8px}table{min-width:600px;font-size:14px}th,td{padding:14px 12px;vertical-align:middle}th{background:#f0f5f8;color:#425e72;font-size:13px;font-weight:700}td .field{margin:0;min-width:145px}td form{display:flex;align-items:center;flex-wrap:wrap;gap:10px}td button{min-height:38px}.tabs{gap:9px;display:flex;flex-wrap:wrap;margin-bottom:18px}.tabs .btn{min-height:38px;font-size:13px;padding:8px 13px}
.erp-modal{width:min(760px,calc(100vw - 32px));max-width:none;max-height:calc(100dvh - 32px);padding:24px;border:1px solid var(--line);border-radius:14px;overflow:auto;margin:auto;box-shadow:0 20px 70px #102b4d55}.erp-modal::backdrop{background:#142c45a8}.erp-modal>.panel{padding:0;box-shadow:none;border:0}.modal-close{display:flex;margin-left:auto;margin-bottom:20px}.lesson-drawer,.finance-drawer{width:min(1080px,calc(100vw - 40px));max-width:1080px;max-height:calc(100dvh - 40px);border-radius:14px;padding:26px;overflow:auto}.drawer-overlay{padding:20px;align-items:center;justify-content:center}.calendar-navigation{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;gap:12px}.calendar-period{text-align:center;overflow-wrap:anywhere}.calendar-views{justify-content:flex-start}.calendar-legend{display:flex;flex-wrap:wrap;gap:14px}.enrolment-card>summary{display:flex;justify-content:space-between;align-items:center;gap:16px;cursor:pointer;list-style:none}.credit-balance{font-size:30px;white-space:nowrap;font-weight:750;color:var(--navy)}.credit-balance small{font-size:14px}.enrolment-body{padding-top:20px}.enrolment-body>.panel{padding:16px;box-shadow:none}.account-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.account-grid .panel{margin:0}.account-security p:has(#profile-login){display:flex;align-items:center;gap:12px;flex-wrap:wrap}.lifecycle-zone{padding:24px;background:white;border:1px solid var(--line)}.lifecycle-zone form{margin-bottom:12px}.hours-filters{justify-content:flex-start;align-items:center}.hours-filters>label{display:flex;align-items:center;gap:12px;margin:0}.hours-filters>label input,.hours-filters>label select{width:auto;min-width:170px}.content-row{padding:18px 0;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;gap:18px;flex-wrap:wrap}.content-row p{margin:6px 0 0}.content-preview{border:1px solid var(--line);border-radius:9px;padding:18px;margin-top:20px}.info-box{border:1px solid var(--line);border-radius:9px;margin-top:14px}.info-box summary{padding:16px;cursor:pointer;font-weight:700}.info-box .policy-text{padding:16px;border-top:1px solid var(--line)}.chart-scroll{overflow:auto;max-width:100%}.tuition-chart{display:flex;gap:24px;min-width:max-content;padding:12px}.chart-month{display:flex;flex-direction:column;align-items:center;font-size:12px;gap:8px}.chart-bars{height:190px;display:flex;gap:5px;align-items:flex-end;border-bottom:1px solid #9bafbd}.chart-bar{width:18px}.chart-bar.due{background:#fff;border:2px solid #17364d}.chart-bar.paid{background:#38834f}.chart-bar.outstanding{background:#b4424a}.chart-legend{display:flex;gap:20px;flex-wrap:wrap}.account-actions span{overflow-wrap:anywhere;white-space:normal}.top{padding:16px 24px}.header-search label{min-width:0}.header-search input{min-height:40px}.policy-text,pre{overflow-wrap:anywhere;max-width:100%}pre{overflow:auto;white-space:pre-wrap}
@media(max-width:1000px){main{padding:20px}.layout{grid-template-columns:218px minmax(0,1fr)}.account-grid{grid-template-columns:1fr}.top strong{font-size:16px}.erp-modal{width:min(700px,calc(100vw - 24px))}}
@media(max-width:760px){.layout{display:block}main{padding:16px}.panel{padding:18px}.top{padding:12px 16px}.toolbar{gap:10px}.calendar-navigation{grid-template-columns:auto minmax(0,1fr) auto}.calendar-navigation>a:last-child{grid-column:1/-1}.drawer-overlay{padding:8px}.lesson-drawer,.finance-drawer{width:calc(100vw - 16px);max-height:calc(100dvh - 16px);padding:18px}.erp-modal{padding:18px;max-height:calc(100dvh - 24px)}.hours-filters>label{flex:1 1 100%;justify-content:space-between}.hours-filters>label select,.hours-filters>label input{min-width:0;width:70%}.account-grid{gap:16px}.content-row{align-items:flex-start}.action-group{width:100%}.form-footer>*{flex:1 1 auto}.menu a,.menu summary{min-height:44px}}
@container(max-width:550px){.cards,.task-categories{grid-template-columns:1fr}.fields{grid-template-columns:1fr}}@container(min-width:551px) and (max-width:850px){.cards,.task-categories{grid-template-columns:repeat(2,minmax(0,1fr))}}

@media(max-width:760px){.top .header-search{grid-column:1/-1;display:flex;width:100%}.top .header-search label{flex:1;min-width:0}.top .header-search input{width:100%}.top .header-search button{flex-shrink:0}}
/* FIX-01..19 shared controls and responsive layout. */
.menu>a,.menu>details>summary{font-size:15px;font-weight:700;min-height:46px;padding:12px 14px;line-height:1.45;box-sizing:border-box}.menu>details>a{font-size:14px;font-weight:500}.menu>a::after{content:none}.menu a[aria-current=page]{background:#d9f3ee;color:#075c50}.menu .icon{width:20px;height:20px;min-width:20px;flex-shrink:0;vertical-align:middle}.calendar-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:12px;margin-bottom:18px}.calendar-navigation,.calendar-views{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.calendar-navigation{justify-content:center}.calendar-views{justify-content:flex-end}.calendar-period{white-space:nowrap;text-align:center}.row-actions,.management-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap}.row-actions form,.management-actions form{margin:0;display:inline-flex}.row-actions .btn,.row-actions button,.management-actions .btn,.management-actions button{min-height:40px;margin:0;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box}.course-flat{border-bottom:1px solid #dbe1ea;padding:16px 0}.course-line{display:grid;grid-template-columns:minmax(180px,1fr) auto auto;align-items:center;gap:16px;padding:10px 0}.course-line small{display:block;color:#526174;margin-top:4px}.group-line{padding-left:28px;border-left:3px solid #dbe1ea;margin-left:8px}.enrolment-card header h3{margin:0}.enrolment-card fieldset{border:0;margin:0;padding:0}.enrolment-card fieldset:disabled{opacity:1}.enrolment-card fieldset:disabled input,.enrolment-card fieldset:disabled select{background:#f4f6f9;color:#48586b}.enrolment-card .credit-balance{font-size:26px;color:#183c66}.account-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch;gap:20px}.account-grid>.panel{min-width:0;margin:0}.login-copy{display:flex;gap:12px;align-items:center}.login-copy input{flex:1;min-width:0;width:100%}.login-copy button{flex-shrink:0;white-space:nowrap}.hours-filters{display:flex;align-items:flex-end;gap:16px;flex-wrap:wrap}.hours-filters label{display:flex;flex-direction:row;align-items:center;gap:10px;flex:0 1 auto}.hours-filters input,.hours-filters select{width:auto;min-width:170px;min-height:42px;margin:0}.hours-filters button{min-height:42px}.finance-chart-frame{position:relative;height:340px;min-width:0;width:100%}.finance-chart-frame canvas{max-width:100%}.whatsapp-confirm{background:#167342;border-color:#167342;color:white}.copy-preview{display:block;margin:16px 0}.file-list{list-style:none;padding:0}.file-list li{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:10px 0;border-bottom:1px solid #dbe1ea}.file-list .field{margin:0;min-width:160px}.visibility-options{display:flex;gap:18px;flex-wrap:wrap;border:0;padding:8px 0;margin:8px 0 16px}.visibility-options legend{font-weight:600}.visibility-options label{display:flex;gap:8px;align-items:center}.visibility-options input{width:auto}.content-row{padding:12px 0}.content-actions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap}.form-footer{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap;margin-top:18px}.form-footer form{margin:0}.content-preview{border:1px solid #dbe1ea;border-radius:10px;padding:14px;margin-top:16px}.renewal-card{padding:16px}.pricing-table td:last-child{text-align:right}
@media(max-width:1250px){.calendar-toolbar{grid-template-columns:minmax(60px,1fr) minmax(0,3fr)}.calendar-navigation{grid-column:1/-1;grid-row:1}.calendar-today{grid-column:1;grid-row:2}.calendar-views{grid-column:2;grid-row:2}}@media(max-width:760px){.account-grid{grid-template-columns:1fr}.course-line{grid-template-columns:minmax(0,1fr) auto;gap:10px}.course-line .row-actions{grid-column:1/-1}.calendar-toolbar{display:flex;flex-wrap:wrap}.calendar-navigation{width:100%;order:-1;gap:6px}.calendar-period{white-space:normal;flex:1}.calendar-views{flex:1;min-width:200px}.hours-filters label{flex:1 1 100%;justify-content:space-between}.hours-filters input,.hours-filters select{width:calc(100% - 55px);min-width:0}.login-copy{flex-wrap:wrap}.login-copy input{flex-basis:100%}.finance-chart-frame{height:300px}.row-actions,.management-actions{gap:8px}.group-line{padding-left:14px}}

@media(min-width:761px) and (max-width:1100px){.account-grid{grid-template-columns:1fr}.course-line{grid-template-columns:minmax(0,1fr) auto}.course-line .row-actions{grid-column:1/-1}.hours-filters label{max-width:100%}}

/* ISSUES-01–17: refine the established navy/teal identity, without changing business state. */
.calendar-toolbar .calendar-views{border-top:0;padding-top:0}.calendar-period{border:0;text-decoration:none;min-width:0}
form.toolbar,.filter-toolbar{justify-content:flex-start;align-items:flex-end;gap:10px}.filter-toolbar .field,form.toolbar>label{margin:0;display:flex;flex-direction:column;gap:6px;min-width:0;flex:0 1 auto}.filter-toolbar input,.filter-toolbar select,form.toolbar input,form.toolbar select{min-height:44px;width:auto;max-width:100%;margin:0}.filter-toolbar>input[type=search]{flex:0 1 240px}.filter-toolbar button,form.toolbar>button{min-height:44px;align-self:flex-end}.history-filters{gap:10px}.history-filters .field{flex:1 1 135px;max-width:210px}.history-filters input,.history-filters select{width:100%}
.fields{row-gap:16px;column-gap:20px}.fields>.field{margin-bottom:0}fieldset .field{display:flex;flex-direction:column;align-items:stretch;gap:6px}.fields .field input,.fields .field select,.fields .field textarea{margin-top:0}.profile-basic>.fields,.profile-basic .guardian-contact>.fields{grid-template-columns:repeat(2,minmax(0,1fr))}.profile-basic .primary-guardian{justify-content:flex-start}.profile-basic .radio-control{display:flex;align-items:center;min-height:44px}.guardian-contact{background:#fff}.erp-modal,.erp-modal>.panel,.lesson-drawer{background:#fff}.erp-modal>.modal-close,.erp-modal>[data-close-modal],.lesson-drawer>.drawer-close{display:inline-flex;width:auto;max-width:100%;margin:0 auto 18px 0;float:none}.erp-modal>.panel{margin:0}.erp-modal .form-footer,.lesson-drawer .form-footer{padding-top:18px;margin-top:20px;justify-content:flex-end}.erp-modal .form-footer>*{flex:0 1 auto}.erp-modal .panel .panel{box-shadow:none}.erp-modal .fields{margin-top:12px}.erp-modal>h2{margin-top:0}
.cards.statistics-kpis{grid-template-columns:repeat(auto-fit,minmax(min(100%,245px),1fr))}.statistics-kpis .card{container-type:inline-size;padding:20px}.statistics-kpis .num{white-space:nowrap;overflow-wrap:normal;word-break:normal;font-size:clamp(17px,10cqi,30px);max-width:100%;font-variant-numeric:tabular-nums}
.enrolment-card.panel{padding:16px 18px;margin-bottom:14px}.enrolment-card .toolbar{margin-bottom:4px}.enrolment-card>p{margin:4px 0 12px}.enrolment-card .fields{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.enrolment-card .field{margin:0}.enrolment-card .row-actions{padding-top:12px;gap:8px}.enrolment-card fieldset{margin:0}.enrolment-card .credit-balance{line-height:1.2}
.finance-primary{border-bottom:2px solid var(--line);padding-bottom:12px;margin-bottom:20px}.finance-primary .btn{font-size:16px;font-weight:700;padding:10px 24px;min-height:46px}.finance-secondary{gap:8px;margin:0 0 12px}.finance-secondary .btn{font-size:13px;min-height:38px}.finance-secondary .btn.outline{border-color:transparent;background:#f3f6f8}.finance-secondary+form{margin-bottom:20px}
.course-flat{border:1px solid var(--line);border-radius:10px;margin-bottom:14px;padding:12px 16px;background:white}.course-line:first-child{font-weight:650}.course-line .row-actions{font-weight:400}.group-line{background:#f8fafb;border-left:3px solid #c6dcd9;margin-top:10px;padding:12px 10px 12px 24px}.course-no-groups{margin:10px 0 0 12px;padding:8px 12px;border-left:3px solid var(--line);color:var(--muted)}.lifecycle-actions{justify-content:flex-start;flex-wrap:wrap;min-width:340px}.lifecycle-actions form{margin:0;flex:0 0 auto}.credential-page{max-width:850px}.credential-page form{display:flex;flex-direction:column;align-items:flex-start;gap:12px}.credential-page dd{margin:6px 0 12px}
@media(max-width:760px){.profile-basic>.fields,.profile-basic .guardian-contact>.fields{grid-template-columns:1fr}.enrolment-card .fields{grid-template-columns:1fr}.filter-toolbar .field,form.toolbar>label{flex:1 1 145px;max-width:100%}.filter-toolbar .field input,.filter-toolbar .field select,form.toolbar>label input,form.toolbar>label select{width:100%;min-width:0}.filter-toolbar>input{flex:1 1 160px;min-width:0}.filter-toolbar>button{flex:0 0 auto}.lifecycle-actions{min-width:230px}.erp-modal .form-footer{justify-content:flex-end}.cards.statistics-kpis{grid-template-columns:repeat(auto-fit,minmax(min(100%,235px),1fr))}}
/* Post17 shared status and password controls reuse established semantic tones. */
.pill,[data-status-badge]{border-radius:6px;padding:3px 9px;display:inline-flex;align-items:center;gap:4px;font-size:12px;line-height:1.5;max-width:100%;white-space:normal}.password-control{position:relative;display:block;width:100%}.password-control input{padding-right:50px!important;width:100%}.password-eye{position:absolute;right:1px;top:1px;bottom:1px;width:44px;min-height:42px;padding:10px;border:0;background:transparent;color:var(--ink)}.password-eye svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8}.password-eye .eye-slash{display:none}.password-eye[aria-pressed=true] .eye-slash{display:block}.password-eye:focus-visible{outline:2px solid var(--teal);outline-offset:-3px}.feedback-version-management{border-top:1px solid var(--line);margin-top:20px;padding-top:14px}.feedback-version-management .row-actions{justify-content:flex-end}.information-section>.row{padding:10px 0}.backup-secret{font-family:monospace;overflow-wrap:anywhere;padding:12px;background:var(--soft)}

.section-order-list{padding:0;list-style:none}.section-order-list li{display:flex;align-items:center;gap:.65rem;flex-wrap:wrap;padding:.75rem;border-bottom:1px solid #d9dfe5}.section-order-list li>span:nth-of-type(2){flex:1;min-width:8rem}.order-handle{cursor:grab;font-size:1.5rem}.information-section h2{overflow-wrap:anywhere}
/* Only the two account lifecycle badges change; no other status tokens are overridden. */
.account-active{color:#146c43;background:#e7f4ec}.account-inactive{color:#9a2020;background:#fde8e8}
@media(max-width:640px){
 body.parent .toolbar,body.teacher .toolbar,body.admin .toolbar{flex-wrap:wrap;align-items:end;gap:.65rem}
 body.parent .field,body.teacher .field,body.admin .field{min-width:0;max-width:100%}
 .filter-toolbar>.field,.filter-toolbar>label,.filter-toolbar>select,.filter-toolbar>input,.toolbar>label{flex:1 1 9rem;min-width:0}
 .fields{grid-template-columns:repeat(auto-fit,minmax(min(100%,10rem),1fr))}
 input,select,textarea{max-width:100%;min-width:0;font-size:16px;box-sizing:border-box}
 input[type=date],input[type=datetime-local],input[type=time]{width:100%;min-inline-size:0}
 .erp-modal,.lesson-drawer,.finance-drawer{max-width:calc(100vw - 1rem);max-height:calc(100dvh - 1rem);overflow:auto;box-sizing:border-box}
 .row-actions,.form-footer{flex-wrap:wrap;gap:.5rem}.table-wrap{max-width:100%;overflow-x:auto}.policy-text{white-space:pre-wrap;overflow-wrap:anywhere}
 body.teacher .mobile-three-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.4rem}
 body.teacher .mobile-four-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.5rem}
 body.teacher .mobile-three-cards .card,body.teacher .mobile-four-cards .card{padding:.6rem;min-width:0;font-size:.8rem;overflow-wrap:anywhere}
 body.teacher .mobile-three-cards .num,body.teacher .mobile-four-cards .num{font-size:1.5rem}
 .bottomnav a{display:flex;flex-direction:column;align-items:center;gap:.2rem}.bottomnav .icon{width:20px;height:20px}
 .legacy-mobile-cancel{display:none!important}
}

/* Post-update: shared identity, management view-first; mobile rules do not alter desktop forms. */
.portal-brand{display:flex;align-items:center;gap:.6rem;text-decoration:none;color:inherit;min-width:0}.portal-brand img{object-fit:contain;background:white;border-radius:5px}.portal-brand small{display:block}.login-page{min-height:100dvh;display:grid;place-items:center;background:#f1f6f8;padding:20px}.login-page .login{margin:0;width:min(100%,480px)}.login-identity{text-align:center}.login-identity img{max-width:100%;object-fit:contain}.login-page .login-brand{font-size:1.35rem}.slogan-zh{font-size:1.05rem;color:#153d50;margin:.5rem 0}.slogan-en{font-size:.88rem;line-height:1.6;color:#536474;overflow-wrap:anywhere}.login-page h2,.login-page .subtitle{text-align:center}.login-page hr{border:0;border-top:1px solid #dce4e8;margin:1.2rem 0}[hidden]{display:none!important}.health-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.consistent-admin-table table{border-collapse:collapse;width:100%}.consistent-admin-table th,.consistent-admin-table td{padding:12px 14px;vertical-align:middle;border-bottom:1px solid #dce4e8}.consistent-admin-table .row-actions{display:flex;gap:8px;flex-wrap:wrap}.menu a[aria-current="page"]{background:#e0f0ef;color:#106f75;font-weight:700}.management-readonly .toolbar{justify-content:space-between}.management-readonly pre,.policy-text{white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:640px){
main,.layout,section,.panel,.field,.fields>*{min-width:0;max-width:100%;box-sizing:border-box}.fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 12px}.fields input,.fields select,.fields textarea,.toolbar input,.toolbar select,input[type=date],input[type=time],input[type=datetime-local]{box-sizing:border-box;min-width:0;max-width:100%;width:100%;min-height:44px;font-size:16px}.field{display:flex;flex-direction:column;gap:6px}.toolbar,.filter-toolbar{flex-wrap:wrap;gap:12px}.toolbar>*{min-width:0;max-width:100%}.toolbar>.field,.toolbar>input,.toolbar>select{flex:1 1 140px}.erp-modal,.lesson-drawer{box-sizing:border-box;max-width:calc(100vw - 20px);max-height:calc(100dvh - 24px);overflow-y:auto;overflow-x:hidden}.erp-modal .panel{padding:14px}.table-wrap{width:100%;max-width:100%;overflow-x:auto}.summary-grid:has(> :nth-child(3):last-child),.stat-grid:has(> :nth-child(3):last-child),.health-cards{grid-template-columns:repeat(3,minmax(0,1fr))}.summary-grid:has(> :nth-child(4):last-child),.stat-grid:has(> :nth-child(4):last-child){grid-template-columns:repeat(2,minmax(0,1fr))}.summary-card,.stat-card{min-width:0;overflow-wrap:anywhere}.summary-card strong,.stat-card strong{font-size:clamp(1rem,5vw,1.6rem)}.portal-brand img{width:70px;height:28px}.portal-brand strong{font-size:.85rem}.portal-brand small{font-size:.7rem}.login-page{padding:12px}.login-page .login{padding:22px}.health-cards .summary-card{padding:8px;font-size:.8rem}
}@media(max-width:430px){.fields{grid-template-columns:minmax(0,1fr)}.fields>.span-2{grid-column:auto}.top{gap:8px}.health-cards{gap:6px}}

@media(max-width:640px){body.admin .cards:has(> :nth-child(3):last-child){display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.4rem}body.admin .cards:has(> :nth-child(4):last-child),body.admin .task-categories:has(> :nth-child(4):last-child){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.5rem}body.admin .cards .card{min-width:0;padding:.6rem;font-size:.8rem;overflow-wrap:anywhere}body.admin .cards .num{font-size:clamp(1.1rem,5vw,1.5rem)}}

/* Latest corrections: scoped table cells and square authentic emblem. */
.portal-brand img{width:64px;height:64px;flex:0 0 64px;object-fit:contain;background:transparent}.portal-brand .brand-slogan{max-width:320px;font-size:.65rem;white-space:normal}.login-identity img{width:160px;height:160px;object-fit:contain}.account-status{display:inline-block;padding:4px 10px;border-radius:999px;font-weight:700;line-height:1.5}.account-active{background:#e5f4e9;color:#205c35;border:1px solid #a6d0b2}.account-inactive{background:#edf0f3;color:#485563;border:1px solid #ccd3dc}#account-table td{display:table-cell}#account-table .management-actions{justify-content:flex-start}#account-table th,#account-table td{border-bottom:1px solid #dce4e8;padding:14px;vertical-align:middle}#account-table .management-actions form{flex:none}
@media(max-width:640px){.fields,.history-range-fields{grid-template-columns:minmax(0,1fr)!important}.fields>.span-2{grid-column:auto}.toolbar.filter-toolbar,.hours-filters,form.toolbar{display:flex;flex-direction:column;align-items:stretch}.filter-toolbar>input,.filter-toolbar>select,.filter-toolbar>.field,form.toolbar>label,.hours-filters>label{flex:0 0 auto;width:100%;max-width:100%;margin:0}.hours-filters>label{display:flex;flex-direction:column;align-items:stretch;gap:6px}.hours-filters>label input,.hours-filters>label select,form.toolbar>label input,form.toolbar>label select{width:100%;min-width:0;box-sizing:border-box}.filter-toolbar>button,form.toolbar>button,.hours-filters>button{width:100%;min-height:44px;margin-top:4px}.fields input[type=date],.fields input[type=time]{display:block;appearance:none;-webkit-appearance:none;width:100%;min-width:0;min-height:44px}.portal-brand img{width:48px;height:48px;flex-basis:48px}.portal-brand .brand-slogan{max-width:185px;font-size:.58rem}.erp-modal form,.lesson-drawer form{min-width:0}.erp-modal .fields{grid-template-columns:1fr!important}}

/* UI & Operations: scoped grouping; mobile flex basis must not become field height. */
.export-form{max-width:960px}.export-section{margin:0 0 18px;padding:18px;border:1px solid var(--line)}.export-section legend{font-weight:700;padding:0 8px}.export-section .field{margin-bottom:0}.export-entities{display:grid;gap:16px;margin-bottom:16px}.entity-selector{position:relative;min-width:0}.combobox-trigger{width:100%;justify-content:space-between;min-height:44px;color:var(--ink);font-weight:400;text-align:left}.combobox-trigger [data-combobox-value]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.combobox-popup{position:absolute;top:100%;left:0;right:0;z-index:20;background:white;border:1px solid #bacbd6;border-radius:8px;padding:12px;box-shadow:0 8px 24px #10253d20}.combobox-popup .field{margin-bottom:10px}.combobox-popup [role=listbox]{max-height:220px;overflow:auto}.combobox-popup [role=option]{display:block;width:100%;text-align:left;justify-content:flex-start;white-space:normal;border:0;border-radius:4px;background:white;color:var(--ink);font-weight:400;min-height:44px}.combobox-popup [role=option]:hover,.combobox-popup [role=option][aria-selected=true]{background:var(--soft);color:var(--teal-dark)}.operations-kpis{grid-template-columns:repeat(4,minmax(0,1fr));margin:18px 0}.operations-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:20px 0}.operations-tabs a{border-radius:6px}.operations-chart{height:320px;position:relative;min-width:0;max-width:100%}.stats-global-filters{justify-content:flex-start;gap:20px}.stats-global-filters .field{min-width:200px;margin:0}.stats-global-filters button{flex:none}.operations-kpis .card{min-width:0}.operations-kpis .num{font-size:clamp(1.2rem,2cqi,1.8rem)}
@media(max-width:1100px){.operations-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){form.toolbar,form.filter-toolbar,.hours-filters,.history-range,.history-filters{gap:14px;align-items:stretch}form.toolbar>.field,form.filter-toolbar>.field,.toolbar>.field,.filter-toolbar>.field,form.toolbar>input,form.toolbar>select,.filter-toolbar>input,.filter-toolbar>select,.history-range>.field,.history-filters>.field,.hours-filters>label{flex:0 0 auto!important;min-height:0;width:100%;max-width:100%;margin:0;gap:7px}.toolbar .field,.history-range .field,.history-filters .field{display:flex;flex-direction:column;align-items:stretch}.toolbar input:not([type=checkbox]):not([type=radio]):not([type=hidden]),.toolbar select,.filter-toolbar input,.filter-toolbar select,.history-range input,.history-range select,.history-filters input,.history-filters select,.export-form input,.export-form select,.combobox-trigger{height:44px;min-height:44px;max-height:48px;padding:8px 12px;line-height:1.35;box-sizing:border-box;font-size:16px;width:100%;min-width:0;max-width:100%}form.toolbar>button,.filter-toolbar>button,.hours-filters>button{flex:0 0 auto;min-height:44px;padding:8px 12px}.toolbar input[type=date],.history-range input[type=date],.export-form input[type=date]{appearance:auto;-webkit-appearance:auto;min-width:0}.export-section{padding:14px;margin-bottom:14px}.export-section .fields{gap:14px}.export-form .form-footer{display:flex;gap:12px;flex-wrap:wrap}.export-form .form-footer button{flex:1 1 110px;min-height:44px}.combobox-popup{max-width:100%;box-sizing:border-box}.combobox-popup [role=listbox]{max-height:180px}.operations-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px}.operations-tabs{gap:6px}.operations-tabs a{flex:1 1 85px;padding:9px 8px;font-size:14px}.operations-chart{height:260px}.stats-global-filters .field{min-width:0}}
.mobile-filter-label{display:none}@media(max-width:640px){form.toolbar>.mobile-filter-label{display:block;flex:0 0 auto;font-size:14px;line-height:1.5;margin:0 0 -7px;width:100%}}

.export-form .export-section:first-of-type .fields{grid-template-columns:repeat(2,minmax(0,1fr))}.export-form .export-section:first-of-type .fields>.field:first-child{grid-column:1/-1}

.special-event-label{border-left:3px solid #aa4545;padding:8px 12px;color:#8d2530;background:#fff0f1;border-radius:4px}.special-event-label a{color:inherit}.calendar-special-events{margin-bottom:16px}[data-student-audience-options]{max-height:240px;overflow:auto}[data-student-audience-selected]{display:flex;flex-wrap:wrap;gap:8px}
/* Short notice dialogs must not inherit the mobile ERP form's full viewport height.
   Scoped sizing also neutralizes descendant stretch/min-height; complex lesson dialogs retain their sizing. */
.erp-modal.compact-notice-modal{width:min(560px,calc(100vw - 32px));height:fit-content;min-height:0;max-height:calc(100dvh - 32px);margin:auto;inset:0;padding:22px;overflow:auto;border-radius:14px}
.erp-modal.compact-notice-modal[open]{display:flex;flex-direction:column;align-items:stretch;gap:0}
.erp-modal.compact-notice-modal>.panel{padding:0;margin:0;height:auto;min-height:0;flex:0 1 auto}
.compact-notice-modal .compact-modal-body{min-height:0;overflow-y:auto;overflow-wrap:anywhere}
.compact-notice-modal .compact-modal-footer{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding-top:16px;margin:0;flex:0 0 auto;flex-wrap:wrap}
.compact-notice-modal .compact-modal-footer>*{flex:0 1 auto;width:auto;min-height:38px;margin:0}
.compact-notice-modal .compact-modal-close{align-self:flex-end;min-width:32px;min-height:32px;padding:4px 8px;margin:0 0 8px auto}
.notice-management-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.notice-management-actions .btn,.notice-management-actions button{min-height:36px;padding:7px 10px;white-space:nowrap}.notice-management-actions form{margin:0}
@media(max-width:390px){.erp-modal.compact-notice-modal{width:calc(100vw - 24px);max-height:calc(100dvh - 24px);padding:16px}.compact-notice-modal .compact-modal-footer{gap:8px}}
