/* Shared visual language. This file changes presentation, not teacher data. */
:root{--ui-bg:#f5f8fc;--ui-surface:#fff;--ui-text:#18354d;--ui-muted:#647e91;--ui-line:#dce6ed;--ui-radius:18px;--ui-shadow:0 10px 30px #173e5910;--ui-focus:#078d9c;--ui-success:#178461;--ui-danger:#bd4353;--ui-warning:#a87922}
.app{--feature:#376f93;--feature-soft:#e9f3f8;--feature-line:#cbdfea;background:var(--ui-bg);color:var(--ui-text)}
.app[data-feature=classes]{--feature:#7956b1;--feature-soft:#f1ebfb;--feature-line:#dfd2f3}
.app[data-feature=students]{--feature:#2884b2;--feature-soft:#e9f5fb;--feature-line:#c9e7f4}
.app[data-feature=attendance]{--feature:#20845d;--feature-soft:#e8f7ef;--feature-line:#c5e7d5}
.app[data-feature=participation]{--feature:#bb7440;--feature-soft:#fff1e6;--feature-line:#f1d8c2}
.app[data-feature=homework]{--feature:#b95375;--feature-soft:#fff0f4;--feature-line:#efd2dc}
.app[data-feature=fluency]{--feature:#168c95;--feature-soft:#e8f8f8;--feature-line:#bee9e9}
.app[data-feature=notes]{--feature:#a77a24;--feature-soft:#fff8e7;--feature-line:#efddae}
.app[data-feature=reports]{--feature:#6654ad;--feature-soft:#efecfa;--feature-line:#d8d0f1}
.app[data-feature=settings]{--feature:#5a7389;--feature-soft:#eef3f7;--feature-line:#d6e2ea}
.app[data-feature=custom]{--feature:#387fa1;--feature-soft:#eaf5fa;--feature-line:#d0e6ee}
.app .main{max-width:1440px}
.app .top{background:transparent}
.app .page-heading{gap:12px}
.app .page-heading-text{display:flex;flex-direction:column;gap:2px;min-width:0}
.app .page-heading h1{display:flex;align-items:center;gap:8px;max-width:100%;overflow-wrap:anywhere;color:var(--feature);font-size:clamp(18px,2vw,25px);line-height:1.2}
.app .page-heading h1[data-icon]:not([data-icon=""])::before{content:attr(data-icon);display:inline-grid;place-items:center;flex:none;width:34px;height:34px;border-radius:10px;background:var(--feature-soft);color:var(--feature);font-size:19px}
.app .page-subtitle{color:var(--ui-muted);font-size:12px;line-height:1.35}
.app .header-home-button{color:var(--feature);border-color:var(--feature-line);background:var(--feature-soft);flex:none}
.app .header-home-button:hover{background:#fff;box-shadow:var(--ui-shadow)}
.app .panel,.app .workspace-toolbar,.app .class-card,.app .manual-save-bar{background:var(--ui-surface);border:1px solid var(--ui-line);border-radius:var(--ui-radius);box-shadow:var(--ui-shadow)}
.app .panel-title,.app .section-head{border-color:var(--ui-line)}
.app .panel-title h2,.app .section-head h2,.app .ws-report-heading h2{color:var(--ui-text)}
.app .btn{min-height:44px;border-radius:11px;padding:9px 15px;background:var(--feature);color:#fff;font-weight:700;box-shadow:0 5px 12px color-mix(in srgb,var(--feature) 15%,transparent)}
.app .btn:hover{background:color-mix(in srgb,var(--feature) 86%,#122b43)}
.app .btn.secondary{background:#fff;border:1px solid var(--ui-line);color:var(--feature);box-shadow:none;font-weight:700}
.app .btn.secondary:hover{background:var(--feature-soft);border-color:var(--feature-line)}
.app .btn.danger,.app button.danger:not(.icon-button){background:var(--ui-danger);color:#fff}
.app .icon-button{border-radius:10px;min-width:42px;min-height:42px;color:var(--feature)}
.app .icon-button:hover{background:var(--feature-soft)}
.app .icon-button.danger{color:var(--ui-danger)}
.app .search,.app .filter-select,.app input:not([type=radio]):not([type=checkbox]):not([type=hidden]),.app textarea,.app select{border:1px solid #cfdae3;border-radius:11px;background:#fff;min-height:44px;color:var(--ui-text)}
.app textarea{padding:11px 13px;line-height:1.65}
.app input:focus-visible,.app textarea:focus-visible,.app select:focus-visible,.app button:focus-visible,.app summary:focus-visible{outline:3px solid var(--ui-focus);outline-offset:2px;box-shadow:0 0 0 5px #078d9c1b}
.app input[type=radio],.app input[type=checkbox]{accent-color:var(--feature)}
.app .class-selection,.app .ws-filter{color:var(--ui-muted)}
.app .class-selection .filter-select{min-width:min(290px,100%);border-color:var(--feature-line);background:var(--feature-soft);font-weight:700}
.app .empty{color:var(--ui-muted);border-radius:16px;background:linear-gradient(145deg,#fff,var(--feature-soft));padding:35px 20px}
.app .empty b{color:var(--ui-text)}
.app .empty-symbol,.app .class-icon{background:var(--feature-soft);color:var(--feature)}
.app .class-card:hover{border-color:var(--feature-line);box-shadow:0 14px 30px #1e4b6818}
.app .class-open small{color:var(--ui-muted)}
.app .manual-save-bar{border-color:var(--feature-line);background:#fff}
.app #manualSaveState[data-state=dirty]{color:var(--ui-warning)}
.app #manualSaveState[data-state=saved]{color:var(--ui-success)}
.app #manualSaveState[data-state=failed],.app #manualSaveState[data-state=conflict]{color:var(--ui-danger)}
.app #saveStatus[data-state=failed],.app #saveStatus[data-state=conflict]{color:var(--ui-danger);background:#fff0f1;border-radius:8px}
.app #studentList .roster-heading{align-items:center;gap:12px}
.app #studentList .roster-heading h2{color:var(--feature)}
.app #studentList #rosterCount{color:var(--ui-muted);font-weight:700}
.app .roster-search{display:flex;align-items:center;gap:8px;width:min(390px,100%);padding:0 13px;background:#fff;border:1px solid var(--ui-line);border-radius:12px;margin:13px 0 17px;color:var(--feature)}
.app .roster-search input{border:0!important;box-shadow:none!important;outline:none!important;width:100%;min-width:0}
.app #studentList .roster-table{width:100%;min-width:0}
.app #studentList .roster-table th{background:var(--feature-soft);color:var(--feature);font-weight:700}
.app #studentList .roster-table td{border-color:#e9eff3}
.app #studentList .roster-table tbody tr:hover td{background:#f8fcff}
.app #students .tracking-panel{overflow:hidden}
.app #students .tracking-table th{background:var(--feature-soft);color:var(--feature);font-weight:700}
.app #students .tracking-table td{border-color:#e7eff3}
.app #students .tracking-table tbody tr:hover td{background:color-mix(in srgb,var(--feature-soft) 45%,#fff)}
.app #students .student-identity{color:var(--ui-text)}
.app #students .score-input,.app #students .notes-input{border-color:#d5e0e7;background:#fff}
.app #students .notes-input{min-width:160px;min-height:50px}
.app .quick-choice{border-color:var(--ui-line);border-radius:10px;min-height:44px}
.app .quick-choice.selected{border-color:var(--feature);background:var(--feature-soft);color:var(--feature)}
.app #reports .ws-filters,.app #reports .ws-report-preview,.app #settings .ws-settings{box-shadow:var(--ui-shadow)}
.app .report-preset-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0 0 22px}
.app .report-preset-card{display:flex;flex-direction:column;align-items:flex-start;gap:5px;min-height:145px;padding:17px;border:1px solid var(--feature-line);border-radius:16px;background:linear-gradient(145deg,#fff,var(--feature-soft));text-align:right;color:var(--ui-text);box-shadow:var(--ui-shadow)}
.app .report-preset-card:hover,.app .report-preset-card[aria-pressed=true]{border-color:var(--feature);transform:translateY(-2px)}
.app .report-preset-icon{display:grid;place-items:center;width:35px;height:35px;border-radius:10px;background:#fff;color:var(--feature);font-size:19px;font-weight:700}
.app .report-preset-card strong{font-size:16px}
.app .report-preset-card small{font-size:12px;color:var(--ui-muted)}
.app .report-preset-action{margin-top:auto;color:var(--feature);font-weight:700;font-size:12px}
.app #reports .ws-checks label{background:var(--feature-soft);border-radius:9px}
.app #reports .ws-checks label:has(input:checked){color:var(--feature);font-weight:700}
.app #reports .ws-report-preview th,.app .ws-history-table th{background:var(--feature-soft);color:var(--feature);border-color:var(--ui-line)}
.app #reports .ws-report-preview td,.app .ws-history-table td{border-color:var(--ui-line)}
.app .student-profile{display:flex;align-items:center;gap:14px;padding:16px;margin-bottom:18px;border-radius:15px;background:var(--feature-soft)}
.app .student-profile-avatar{display:grid;place-items:center;width:50px;height:50px;flex:none;border-radius:15px;background:#fff;color:var(--feature);font-size:24px}
.app .student-profile h3{margin:0;color:var(--ui-text);font-size:19px}
.app .student-profile p{margin:3px 0 0;color:var(--ui-muted)}
.app #workspaceHistoryResult h4{color:var(--ui-text);font-size:16px;margin:17px 0 12px}
.app .student-profile-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.app .student-profile-stat{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px;border-radius:12px;background:#f5f8fb;border-inline-start:4px solid var(--feature);font-size:12px}
.app .student-profile-stat strong{font-size:21px;color:var(--ui-text)}
.app .student-profile-stat.present{border-color:#259b69;background:#edf9f3}
.app .student-profile-stat.absent{border-color:#ce5764;background:#fff1f2}
.app .student-profile-stat.late{border-color:#c3822b;background:#fff6e9}
.app .student-profile-stat.participation{border-color:#d48249;background:#fff4ea}
.app .student-profile-stat.homework{border-color:#bf6480;background:#fff1f5}
.app .student-profile-stat.fluency{border-color:#26a4ab;background:#eafafa}
.app #settings .settings-panel,.app #settings .ws-settings{max-width:850px;padding:25px}
.app #settings .security-heading{color:var(--feature)}
.app .category-type-card,.app .shape-card{border-radius:12px;border-color:var(--ui-line)}
.app .category-type-card:has(input:checked),.app .shape-card:has(input:checked){background:var(--feature-soft);border-color:var(--feature)}
.app .category-preview,.app .ws-report-preview{border-radius:var(--ui-radius)}
.app .modal-box,.app .student-record-box,.app dialog{border:1px solid var(--ui-line);border-radius:20px;box-shadow:0 24px 70px #16385138;background:#fff;color:var(--ui-text)}
.app dialog::backdrop{background:#18334f80}
.app .modal-box h2,.app .student-record-box h2,.app dialog h2{color:var(--ui-text)}
dialog{border:1px solid var(--ui-line);border-radius:20px;box-shadow:0 24px 70px #16385138;background:#fff;color:var(--ui-text)}
dialog::backdrop{background:#18334f80}
dialog input,dialog textarea,dialog select{border:1px solid #d1dee7;border-radius:11px;min-height:44px}
dialog .btn{border-radius:11px}
.app .toast,.app .manual-save-toast{border-radius:12px;box-shadow:0 10px 26px #173e5933}
.app .date-context,.app .count-badge{background:var(--feature-soft);color:var(--feature)}
.app .premium-footer{color:var(--ui-muted)}
#authGate{background:linear-gradient(135deg,#eff8fb,#f5f1fa)}
#authGate .auth-box{border:1px solid #d9e7ed;border-radius:24px;box-shadow:0 26px 80px #163c5b22}
#authGate .auth-brand-panel{background:linear-gradient(270deg,#173850d9,#173850b0),url('kuwait-mobile-panorama.webp') center/cover no-repeat}
#authGate .auth-brand-panel .kuwait-scene{display:none}
#authGate .auth-brand-panel h2 em{color:#b3ece7}
#authGate .auth-form-heading h2{color:var(--ui-text)}
#authGate .auth-box input{border-radius:11px;border-color:#d4e0e7;background:#fff}
#authGate .auth-box input:focus-visible{outline:3px solid var(--ui-focus);outline-offset:2px}
#authGate .auth-box .btn{border-radius:11px}
#authGate #authStatus{background:#eaf5fa;color:#315a72;border-radius:11px}
#authGate #authStatus[data-tone=error]{background:#fff0f2;color:var(--ui-danger)!important}
@media(max-width:750px){
  .app .page-heading{max-width:100%}
  .app #studentList .roster-table thead{display:none}
  .app #studentList .roster-table,.app #studentList .roster-table tbody{display:block;width:100%}
  .app #studentList .roster-table tr:not(:has(td[colspan])){display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:5px 8px;padding:12px 14px;border-bottom:1px solid var(--ui-line)}
  .app #studentList .roster-table tr:not(:has(td[colspan])) td{display:block;width:auto;height:auto;padding:0;border:0}
  .app #studentList .roster-table tr:not(:has(td[colspan])) td:first-child{display:none}
  .app #studentList .roster-table tr:not(:has(td[colspan])) td:nth-child(2){font-size:16px;font-weight:700;overflow-wrap:anywhere}
  .app #studentList .roster-table tr:has(td[colspan]) td{display:block}
  .app #studentList .roster-actions{display:flex;flex-wrap:wrap}
  .app #studentList .roster-actions .btn{flex:1}
  .app .ws-grid{grid-template-columns:1fr}
  .app #reports .ws-report-preview .table-wrap{overflow:auto}
  .app .report-preset-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .app #students .notes-input{width:100%;max-width:100%}
  .app .student-profile-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:650px){
  .app .page-heading h1{font-size:17px}
  .app .page-heading h1[data-icon]:not([data-icon=""])::before{width:30px;height:30px;font-size:17px}
  .app .page-subtitle{font-size:11px}
  .app #studentList .roster-heading{align-items:flex-start;flex-direction:column}
  .app .panel,.app .workspace-toolbar{border-radius:15px}
  .app .report-preset-card{min-height:135px;padding:13px}
  .app .modal-box,.app .student-record-box,.app dialog{border-radius:19px}
  #authGate .auth-brand-panel{background-position:40% center}
}
@media print{
  .app{background:#fff;color:#111}
  .app .panel,.app .workspace-toolbar,.app .class-card,.app .ws-report-preview{box-shadow:none;border-color:#d4d4d4;background:#fff}
  .app .page-heading,.app .header-national,.app .roster-search,.app .report-preset-grid,.app .btn{display:none!important}
  .app #reports .ws-report-preview th,.app .ws-history-table th{background:#f2f2f2;color:#111}
}
