:root{
  --bg:#f3f6fb;--surface:#fff;--surface-2:#f8fafc;--text:#162033;--muted:#6b7280;
  --brand:#1f4aa8;--brand-2:#2e6adf;--brand-soft:#eaf1ff;--line:#e4e9f2;
  --ok:#0f8a63;--warn:#b7791f;--danger:#c0392b;--shadow:0 12px 34px rgba(29,46,84,.08);
  --radius:20px;--radius-sm:12px;
}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;font-family:Tajawal,"Segoe UI",Tahoma,Arial,sans-serif;background:linear-gradient(180deg,#eef3fb 0,#f8fafc 280px,#f3f6fb 100%);color:var(--text);direction:rtl;min-height:100vh}
a{color:inherit}.shell{min-height:100vh}.wrap{max-width:1240px;margin:auto;padding:24px}.topbar{position:sticky;top:0;z-index:40;background:rgba(255,255,255,.94);backdrop-filter:blur(14px);border-bottom:1px solid var(--line)}.topbar .wrap{padding-top:13px;padding-bottom:13px;display:flex;justify-content:space-between;align-items:center;gap:16px}.brand{display:flex;align-items:center;gap:12px;font-weight:900;font-size:20px}.brand-mark{width:42px;height:42px;border-radius:14px;background:linear-gradient(135deg,var(--brand),#5d87e8);display:grid;place-items:center;color:#fff;font-weight:900;box-shadow:0 8px 18px rgba(31,74,168,.22)}.nav-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.hero{background:linear-gradient(135deg,#173d8d 0,#2558bd 55%,#4f78d7 100%);color:#fff;border-radius:28px;padding:28px;box-shadow:0 22px 55px rgba(27,66,151,.22);position:relative;overflow:hidden}.hero:after{content:"";position:absolute;width:280px;height:280px;border-radius:50%;background:rgba(255,255,255,.09);left:-70px;top:-110px}.hero h1{font-size:32px;margin:0 0 8px}.hero p{margin:0;opacity:.9}.hero .meta{margin-top:20px;display:flex;gap:8px;flex-wrap:wrap}.pill{display:inline-flex;align-items:center;gap:7px;border-radius:999px;padding:7px 12px;background:rgba(255,255,255,.14);font-size:13px}.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:20px}.section{margin-top:24px}.section-title{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:14px}.section-title h2{margin:0;font-size:22px}.muted{color:var(--muted)}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:16px}.course-card,.resource-card{background:#fff;border:1px solid var(--line);border-radius:20px;padding:18px;box-shadow:0 8px 24px rgba(30,48,84,.06);transition:.2s ease}.course-card:hover,.resource-card:hover{transform:translateY(-2px);box-shadow:0 14px 32px rgba(30,48,84,.1)}.course-icon,.file-icon{width:52px;height:52px;border-radius:16px;display:grid;place-items:center;background:var(--brand-soft);color:var(--brand);font-size:24px;font-weight:900}.course-card h3,.resource-card h3{margin:14px 0 8px;font-size:18px}.stat-row{display:flex;gap:12px;flex-wrap:wrap;margin-top:12px}.stat{background:var(--surface-2);border:1px solid var(--line);border-radius:14px;padding:10px 12px;min-width:110px}.stat b{display:block;font-size:19px}.btn{appearance:none;border:0;border-radius:12px;padding:10px 15px;font:inherit;font-weight:800;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:8px;background:var(--brand);color:#fff;transition:.18s}.btn:hover{filter:brightness(.98);transform:translateY(-1px)}.btn.alt{background:var(--brand-soft);color:var(--brand)}.btn.ghost{background:#fff;color:var(--text);border:1px solid var(--line)}.btn.danger{background:var(--danger)}.btn.sm{padding:8px 11px;font-size:13px}.badge{display:inline-flex;align-items:center;gap:5px;padding:5px 9px;border-radius:999px;background:#eef3fb;color:#31558a;font-size:12px;font-weight:700}.badge.ok{background:#e8f7f1;color:#087456}.badge.warn{background:#fff7e5;color:#96621a}.badge.gray{background:#f2f4f7;color:#5f6875}.row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.resource-head{display:flex;gap:14px;align-items:flex-start}.resource-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}.file-meta{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}.preview-box{border:1px solid var(--line);border-radius:18px;overflow:hidden;background:#0d1320;min-height:320px}.preview-box iframe{width:100%;height:72vh;border:0;background:#fff}.preview-box img{display:block;max-width:100%;max-height:76vh;margin:auto;background:#fff}.preview-box video,.preview-box audio{width:100%;background:#111}.empty{padding:34px;text-align:center;color:var(--muted);background:#fff;border:1px dashed #cfd8e7;border-radius:18px}.login-shell{min-height:100vh;display:grid;place-items:center;padding:24px}.login-card{width:min(520px,100%);background:rgba(255,255,255,.96);border:1px solid rgba(255,255,255,.8);box-shadow:0 24px 70px rgba(20,42,91,.14);border-radius:28px;padding:30px}.login-card .brand-mark{width:64px;height:64px;border-radius:20px;font-size:28px;margin-bottom:18px}.login-card h1{margin:0 0 6px;font-size:30px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}label{display:block;font-weight:800;margin:8px 0 6px}input,select,textarea{width:100%;padding:12px 13px;border:1px solid #cad4e3;border-radius:12px;background:#fff;font:inherit;color:var(--text);outline:none}input:focus,select:focus,textarea:focus{border-color:#6d91df;box-shadow:0 0 0 3px rgba(70,110,205,.12)}input[type=file]{padding:10px;background:#f8fafc}.alert{padding:12px 14px;border-radius:12px;background:#fff1f0;color:#8e2a20;border:1px solid #ffd2cc;margin-bottom:14px}.alert.ok{background:#eaf8f2;color:#087456;border-color:#c7eedf}.toolbar{display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap}.filters{display:grid;grid-template-columns:2fr 1fr 1fr auto;gap:10px;align-items:end}.table-wrap{overflow:auto}.table{width:100%;border-collapse:separate;border-spacing:0}.table th,.table td{padding:12px;border-bottom:1px solid var(--line);text-align:right;vertical-align:middle}.table th{font-size:13px;color:#657084;background:#f8fafc;position:sticky;top:0}.mini-preview{width:46px;height:46px;border-radius:12px;background:var(--brand-soft);display:grid;place-items:center;font-weight:900;color:var(--brand)}.kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.kpi{background:#fff;border:1px solid var(--line);border-radius:18px;padding:18px}.kpi b{font-size:26px;display:block;margin-top:5px}.crumbs{display:flex;gap:8px;align-items:center;flex-wrap:wrap;color:var(--muted);font-size:14px;margin-bottom:14px}.soft{background:#f8fafc;border:1px solid var(--line);border-radius:16px;padding:14px}.version-list{display:grid;gap:10px}.version-item{display:flex;justify-content:space-between;align-items:center;gap:12px;background:#fff;border:1px solid var(--line);border-radius:14px;padding:12px}.notice{font-size:13px;color:var(--muted);margin-top:8px}.footer{text-align:center;color:var(--muted);padding:28px 16px 40px;font-size:13px}
@media(max-width:900px){.kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.filters{grid-template-columns:1fr 1fr}.filters .wide{grid-column:1/-1}.form-grid{grid-template-columns:1fr}.hero h1{font-size:26px}}
@media(max-width:620px){.wrap{padding:16px}.topbar .wrap{align-items:flex-start}.hero{padding:22px;border-radius:22px}.grid{grid-template-columns:1fr}.kpi-grid{grid-template-columns:1fr 1fr}.filters{grid-template-columns:1fr}.btn{width:auto}.login-card{padding:22px}.resource-head{flex-direction:column}.preview-box iframe{height:64vh}}


/* V5 — subject identity, completion state and explicit logout */
.course-card,.subject-mini{position:relative;overflow:hidden;--subject:#2e6adf;--subject-soft:#eaf1ff}
.course-card:before,.subject-mini:before{content:"";position:absolute;inset:0 auto 0 0;width:6px;background:var(--subject)}
.course-card .course-icon{background:var(--subject-soft);color:var(--subject)}
.course-card h3,.subject-mini h3{color:#17233a}
.subject-tone-1{--subject:#2463d4;--subject-soft:#eaf1ff}.subject-tone-2{--subject:#7c3aed;--subject-soft:#f1eafe}.subject-tone-3{--subject:#0f8a63;--subject-soft:#e7f7f1}.subject-tone-4{--subject:#d97706;--subject-soft:#fff3df}.subject-tone-5{--subject:#c2416c;--subject-soft:#fdebf1}.subject-tone-6{--subject:#0891b2;--subject-soft:#e3f7fb}.subject-tone-7{--subject:#4f46e5;--subject-soft:#ececff}.subject-tone-8{--subject:#64748b;--subject-soft:#edf1f5}
.course-card.no-files,.subject-mini.no-files{border-style:dashed;border-color:#e6b968;background:linear-gradient(180deg,#fffdf8,#fff)}
.course-card.no-files:after{content:"";position:absolute;inset:0;pointer-events:none;background:repeating-linear-gradient(-45deg,transparent,transparent 10px,rgba(217,119,6,.025) 10px,rgba(217,119,6,.025) 20px)}
.subject-status{position:absolute;top:14px;left:14px;font-size:11px;font-weight:900;padding:5px 9px;border-radius:999px;z-index:2}.subject-status.missing{background:#fff3dc;color:#9a5c09;border:1px solid #f3d096}.subject-status.ready{background:#e8f7f1;color:#087456;border:1px solid #c3e9dc}
.subject-overview{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px}.subject-mini{background:#fff;border:1px solid var(--line);border-radius:18px;padding:16px 18px;box-shadow:0 7px 20px rgba(30,48,84,.05)}.subject-mini-top{display:flex;align-items:center;justify-content:space-between;gap:8px}.subject-dot{width:13px;height:13px;border-radius:50%;background:var(--subject);box-shadow:0 0 0 5px var(--subject-soft)}.subject-mini h3{font-size:16px;margin:15px 0 6px}.subject-mini p{font-size:12px;color:var(--muted);margin:0 0 10px}.mini-link{font-size:12px;font-weight:900;color:var(--subject);text-decoration:none}.kpi-grid{grid-template-columns:repeat(auto-fit,minmax(170px,1fr))}.kpi.attention{border-color:#f1d59f;background:#fffbf3}.kpi.attention b{color:#a9650a}
@media(max-width:620px){.subject-status{position:static;display:inline-flex;margin:0 0 8px}.subject-overview{grid-template-columns:1fr}}


/* V7 — isolated employee authentication inside /files */
.employee-login-card{border-top:5px solid var(--brand);position:relative}
.login-kicker{display:inline-flex;margin-bottom:8px;padding:5px 10px;border-radius:999px;background:var(--brand-soft);color:var(--brand);font-size:12px;font-weight:900}
.login-separator{display:flex;align-items:center;gap:12px;color:var(--muted);font-size:12px;margin:18px 0}.login-separator:before,.login-separator:after{content:"";height:1px;background:var(--line);flex:1}

/* V8 — system users and upload scopes by department/stage */
.user-hero{background:linear-gradient(135deg,#123b78 0,#1d5aa8 55%,#3778c9 100%)}
.admin-user-layout{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(340px,.65fr);gap:18px;align-items:start}.user-editor,.users-panel{min-width:0}.scope-head{margin:24px 0 12px;padding-top:18px;border-top:1px solid var(--line)}.scope-head h3{margin:0 0 5px}.scope-head p{margin:0}.scope-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;max-height:580px;overflow:auto;padding:2px}.scope-card{border:1px solid var(--line);border-radius:16px;background:#fff;padding:14px;transition:.18s}.scope-card:hover{border-color:#b9c9e7;box-shadow:0 8px 20px rgba(30,48,84,.06)}.scope-card.scope-all{border-color:#8fb0e8;background:#f5f8ff}.scope-card-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.scope-card-head b{display:block;font-size:14px}.scope-card-head small{display:block;color:var(--muted);margin-top:3px;font-size:11px}.full-scope,.switch-line{display:flex;align-items:center;gap:7px;font-size:12px;font-weight:800;margin:0}.full-scope input,.switch-line input,.stage-check input{width:auto}.stage-pills{display:flex;gap:7px;flex-wrap:wrap;margin-top:12px}.stage-check{margin:0;cursor:pointer}.stage-check span{display:inline-flex;padding:6px 10px;border-radius:999px;border:1px solid #d7e0ed;background:#f8fafc;font-size:11px}.stage-check input{display:none}.stage-check input:checked+span{background:var(--brand);border-color:var(--brand);color:#fff}.stage-check input:disabled+span{opacity:.4;cursor:not-allowed}.scope-disabled{opacity:.42;pointer-events:none}.teacher-link{margin-top:18px}.teacher-link select[multiple]{min-height:210px}.toggle-field{display:flex;flex-direction:column;justify-content:flex-end}.user-list{display:grid;gap:10px}.user-row{display:flex;align-items:flex-start;gap:11px;border:1px solid var(--line);border-radius:15px;padding:12px;background:#fff}.user-avatar{width:42px;height:42px;flex:0 0 42px;border-radius:13px;background:var(--brand-soft);color:var(--brand);display:grid;place-items:center;font-weight:900}.user-main{flex:1;min-width:0}.user-meta{font-size:12px;margin-top:3px}.scope-summary{font-size:11px;color:#586579;margin-top:7px;line-height:1.7}.users-panel{position:sticky;top:92px;max-height:calc(100vh - 118px);overflow:auto}
@media(max-width:980px){.admin-user-layout{grid-template-columns:1fr}.users-panel{position:static;max-height:none}.scope-grid{grid-template-columns:1fr}}

/* V10 — academic year switcher and archive/read-only mode */
.year-switcher{display:flex;align-items:center;gap:8px;padding:5px 7px 5px 10px;border:1px solid var(--line);border-radius:13px;background:#fff;box-shadow:0 4px 14px rgba(30,48,84,.04)}
.year-switcher span{font-size:11px;font-weight:900;color:#68758a;white-space:nowrap}.year-switcher select{width:auto;min-width:150px;padding:7px 30px 7px 9px;border:0;background-color:#f7f9fc;font-size:12px;font-weight:900;color:#223556;box-shadow:none}
.archive-banner{margin:0 0 18px;padding:12px 16px;border:1px solid #e7c77f;border-radius:15px;background:linear-gradient(135deg,#fff9e9,#fffdf7);color:#805414;font-size:13px;box-shadow:0 6px 18px rgba(145,96,21,.06)}
.archive-banner b{color:#68420e}
@media(max-width:760px){.year-switcher{width:100%;justify-content:space-between}.year-switcher select{min-width:0;flex:1}.topbar .nav-actions{width:100%}}


/* V11 — professional redesign */
:root{
  --bg:#f4f7ff;--surface:#ffffff;--surface-2:#f6f9ff;--text:#132238;--muted:#66768f;
  --brand:#315efb;--brand-2:#7f56d9;--brand-3:#00b8d9;--brand-soft:#edf2ff;--line:#dfe7f5;
  --shadow:0 18px 50px rgba(40,72,138,.10);--shadow-lg:0 26px 70px rgba(33,66,145,.16);
}
body{background:
 radial-gradient(circle at top right, rgba(127,86,217,.11), transparent 24%),
 radial-gradient(circle at top left, rgba(49,94,251,.12), transparent 28%),
 linear-gradient(180deg,#f6f9ff 0,#f3f7ff 230px,#eef4ff 100%);color:var(--text)}
.student-app,.student-auth{background:
 radial-gradient(circle at top right, rgba(0,184,217,.12), transparent 24%),
 radial-gradient(circle at top left, rgba(49,94,251,.12), transparent 30%),
 linear-gradient(180deg,#eef6ff 0,#f7faff 250px,#eef5ff 100%)}
.admin-app,.employee-auth{background:
 radial-gradient(circle at top right, rgba(127,86,217,.12), transparent 24%),
 radial-gradient(circle at top left, rgba(49,94,251,.10), transparent 28%),
 linear-gradient(180deg,#f8f8ff 0,#f7fbff 250px,#f2f6ff 100%)}
.topbar{background:rgba(255,255,255,.78);border-bottom:1px solid rgba(224,233,247,.9);backdrop-filter:blur(18px);box-shadow:0 8px 30px rgba(20,44,92,.06)}
.topbar:before{content:"";position:absolute;inset:0 auto auto 0;height:3px;width:100%;background:linear-gradient(90deg,var(--brand),var(--brand-2),var(--brand-3))}
.topbar .wrap{padding-top:14px;padding-bottom:14px}
.brand{gap:14px}.brand>div:last-child{display:flex;flex-direction:column;gap:3px}.brand-sub{font-size:12px;color:var(--muted);font-weight:800}.brand-mark{width:48px;height:48px;border-radius:16px;background:linear-gradient(135deg,var(--brand),var(--brand-2));box-shadow:0 12px 24px rgba(61,95,252,.24)}
.nav-actions{gap:10px}
.user-chip{display:inline-flex;align-items:flex-start;gap:9px;padding:9px 12px;border-radius:16px;border:1px solid var(--line);background:rgba(255,255,255,.82);box-shadow:0 6px 18px rgba(16,37,84,.06);min-width:0}.user-chip b,.user-chip span{display:block;line-height:1.2}.user-chip b{font-size:12px;color:#1d3358}.user-chip span:last-child{font-size:11px;color:var(--muted);max-width:180px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-chip.student{background:linear-gradient(135deg,#eef8ff,#ffffff)}.user-chip.admin{background:linear-gradient(135deg,#f4efff,#ffffff)}
.hero{border-radius:30px;padding:30px 32px;background:
 linear-gradient(135deg,rgba(16,51,125,.96) 0,rgba(49,94,251,.94) 47%,rgba(0,184,217,.86) 100%);box-shadow:var(--shadow-lg)}
.admin-app .hero,.employee-auth .hero,.user-hero{background:linear-gradient(135deg,#1e2b7d 0,#315efb 45%,#7f56d9 100%)}
.hero:before{content:"";position:absolute;inset:auto -65px -75px auto;width:240px;height:240px;border-radius:50%;background:rgba(255,255,255,.08)}
.hero:after{width:340px;height:340px;background:rgba(255,255,255,.11);left:-100px;top:-130px}
.hero h1{font-size:34px;letter-spacing:-.2px}.hero p{max-width:780px;font-size:15px}.pill{background:rgba(255,255,255,.15);border:1px solid rgba(255,255,255,.18)}.soft-pill{background:#fff;border:1px solid rgba(255,255,255,.78);color:#21428a}
.card,.kpi,.course-card,.resource-card,.subject-mini,.login-card,.soft,.empty{box-shadow:var(--shadow)}
.card,.kpi,.resource-card,.course-card,.subject-mini{border-color:#e3eaf7}
.section-title h2{font-size:24px}
.btn{border-radius:14px;background:linear-gradient(135deg,var(--brand),var(--brand-2));box-shadow:0 10px 22px rgba(65,97,246,.18)}
.btn.alt{background:linear-gradient(135deg,#eaf1ff,#f6f2ff);color:#23439b}.btn.ghost{background:rgba(255,255,255,.9);border:1px solid #dbe4f2}.btn.danger{background:linear-gradient(135deg,#d64545,#e26a5b)}
.kpi{position:relative;overflow:hidden;background:linear-gradient(180deg,#fff,#fbfcff)}.kpi:before{content:"";position:absolute;inset:0 auto auto 0;width:100%;height:5px;background:linear-gradient(90deg,var(--brand),var(--brand-3))}.kpi b{color:#16336a}
.resource-card,.course-card,.subject-mini{transition:transform .24s ease, box-shadow .24s ease, border-color .24s ease}.resource-card:hover,.course-card:hover,.subject-mini:hover{transform:translateY(-4px);box-shadow:0 22px 40px rgba(27,52,111,.12);border-color:#c6d5ef}
.file-icon,.course-icon{box-shadow:inset 0 0 0 1px rgba(255,255,255,.5),0 10px 24px rgba(49,94,251,.12)}
.badge{font-weight:800}.badge.ok{background:linear-gradient(135deg,#e6faf0,#eefcf5);border:1px solid #c5eedd}.badge.warn{background:linear-gradient(135deg,#fff7df,#fffdf1);border:1px solid #f3d89a}.badge.gray{background:linear-gradient(135deg,#f2f5fb,#fafcff);border:1px solid #dfe6f2}
.year-switcher{background:rgba(255,255,255,.92);border:1px solid #dfe7f5;box-shadow:0 8px 18px rgba(26,50,104,.05)}
.login-shell{background:
 radial-gradient(circle at top right, rgba(127,86,217,.18), transparent 28%),
 radial-gradient(circle at top left, rgba(49,94,251,.16), transparent 28%),
 linear-gradient(180deg,#eef6ff 0,#f9fbff 100%)}
.student-landing-card,.employee-login-card{position:relative;overflow:hidden}.student-landing-card:before,.employee-login-card:before{content:"";position:absolute;inset:-60px auto auto -40px;width:170px;height:170px;border-radius:50%;background:rgba(49,94,251,.07)}
.student-landing-card{width:min(620px,100%)}.landing-features{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0 6px}.landing-note{background:linear-gradient(180deg,#fbfdff,#ffffff)}
.preview-box{border:1px solid #dce5f4;background:linear-gradient(180deg,#0a1020,#111b30)}
.archive-banner{border-radius:16px;padding:13px 16px;background:linear-gradient(135deg,#fff7df,#fffdf4);box-shadow:0 8px 22px rgba(145,96,21,.08)}
.admin-user-layout{gap:20px}.users-panel{background:linear-gradient(180deg,#fff,#fbfcff)}.user-row{border-radius:18px;transition:.2s ease}.user-row:hover{transform:translateY(-2px);box-shadow:0 12px 26px rgba(22,46,94,.08)}
.table th{background:linear-gradient(180deg,#f7faff,#eef4ff)}
.footer{color:#66768f}
@keyframes floatIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
.hero,.card,.kpi,.course-card,.resource-card,.subject-mini,.login-card{animation:floatIn .45s ease both}
@media(max-width:760px){.user-chip{display:none}.hero{padding:24px}.hero h1{font-size:28px}.brand-sub{display:none}}


/* V12 — flexible subject search table */
.subject-directory{padding:22px}.subject-search-grid{display:grid;grid-template-columns:minmax(250px,2fr) repeat(4,minmax(130px,1fr)) auto;gap:11px;align-items:end;margin-top:18px;padding:16px;border:1px solid #e4ebf7;border-radius:18px;background:linear-gradient(135deg,#f8fbff,#fff)}.subject-search-grid label{font-size:12px;color:#5f6f88}.subject-search-actions{display:flex;gap:8px;align-items:center}.table-summary{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:17px 2px 10px;font-size:13px;font-weight:800;color:#50627d}.subject-table-wrap{border:1px solid #e0e8f4;border-radius:18px;background:#fff;max-height:640px}.subject-table{min-width:1120px}.subject-table th{top:0;z-index:3;background:linear-gradient(180deg,#f7faff,#eef4ff);color:#4f607b;white-space:nowrap}.subject-table td{font-size:13px}.subject-table tbody tr{transition:.16s}.subject-table tbody tr:hover{background:#f7faff}.subject-table tbody tr.row-missing{background:linear-gradient(90deg,#fffaf0,#fff)}.subject-table tbody tr.row-missing:hover{background:#fff7e7}.row-index{color:#8896aa;font-weight:800;width:52px}.subject-name-cell{display:flex;align-items:center;gap:11px;min-width:220px}.subject-name-cell b{display:block;font-size:14px;color:#1b2f50}.subject-name-cell small{display:block;margin-top:3px;color:#8290a5;font-size:11px}.subject-color-dot{display:inline-block;flex:0 0 12px;width:12px;height:38px;border-radius:999px;background:var(--subject,#315efb);box-shadow:0 0 0 4px var(--subject-soft,#edf2ff)}.subject-color-dot.subject-tone-1{--subject:#2463d4;--subject-soft:#eaf1ff}.subject-color-dot.subject-tone-2{--subject:#7c3aed;--subject-soft:#f1eafe}.subject-color-dot.subject-tone-3{--subject:#0f8a63;--subject-soft:#e7f7f1}.subject-color-dot.subject-tone-4{--subject:#d97706;--subject-soft:#fff3df}.subject-color-dot.subject-tone-5{--subject:#c2416c;--subject-soft:#fdebf1}.subject-color-dot.subject-tone-6{--subject:#0891b2;--subject-soft:#e3f7fb}.subject-color-dot.subject-tone-7{--subject:#4f46e5;--subject-soft:#ececff}.subject-color-dot.subject-tone-8{--subject:#64748b;--subject-soft:#edf1f5}.pagination{display:flex;justify-content:center;align-items:center;gap:7px;flex-wrap:wrap;margin-top:16px}.page-btn{min-width:38px;height:38px;padding:0 11px;border-radius:11px;border:1px solid #dbe4f1;background:#fff;color:#334964;display:inline-flex;align-items:center;justify-content:center;text-decoration:none;font-size:12px;font-weight:900;transition:.16s}.page-btn:hover{transform:translateY(-1px);border-color:#9cb6e6;background:#f5f8ff}.page-btn.active{background:linear-gradient(135deg,var(--brand),var(--brand-2));color:#fff;border-color:transparent;box-shadow:0 8px 18px rgba(49,94,251,.18)}
@media(max-width:1180px){.subject-search-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.subject-search-grid .search-wide{grid-column:1/-1}.subject-search-actions{grid-column:auto}}
@media(max-width:720px){.subject-directory{padding:15px}.subject-search-grid{grid-template-columns:1fr}.subject-search-grid .search-wide,.subject-search-actions{grid-column:auto}.subject-search-actions .btn{flex:1}.table-summary{align-items:flex-start;flex-direction:column}.subject-table-wrap{max-height:none}.subject-table{min-width:920px}.subject-table th:nth-child(6),.subject-table td:nth-child(6){display:none}}

/* V13 — compact one-line subject filters on desktop */
@media (min-width: 901px){
  .subject-search-grid{
    display:flex;
    flex-wrap:nowrap;
    align-items:flex-end;
    gap:8px;
    padding:10px 12px;
    margin-top:12px;
    overflow:visible;
  }
  .subject-search-grid>div{min-width:0;flex:1 1 0}
  .subject-search-grid>.search-wide{flex:2.35 1 300px;min-width:230px}
  .subject-search-grid>div:nth-of-type(2){flex:1.05 1 150px}
  .subject-search-grid>div:nth-of-type(3){flex:1.05 1 150px}
  .subject-search-grid>div:nth-of-type(4){flex:.78 1 115px}
  .subject-search-grid>div:nth-of-type(5){flex:.58 1 92px;max-width:105px}
  .subject-search-grid>.subject-search-actions{flex:0 0 auto;display:flex;gap:6px;white-space:nowrap}
  .subject-search-grid label{font-size:11px;margin:0 0 4px;white-space:nowrap}
  .subject-search-grid input,.subject-search-grid select{height:40px;padding-top:7px;padding-bottom:7px;font-size:12px;border-radius:11px}
  .subject-search-grid .btn{height:40px;padding:8px 13px;font-size:12px;border-radius:11px}
}
@media (max-width: 900px){
  .subject-search-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
  .subject-search-grid .search-wide{grid-column:1/-1}
  .subject-search-actions{grid-column:1/-1;display:flex}
  .subject-search-actions .btn{flex:1}
}
@media (max-width: 620px){
  .subject-search-grid{grid-template-columns:1fr}
  .subject-search-grid .search-wide,.subject-search-actions{grid-column:auto}
}


/* V14 — user management table + cascading scope selector */
.users-table small{display:block;color:var(--muted);font-size:11px;margin-top:4px}.users-table td{vertical-align:middle}.users-table .scope-cell{display:block;max-width:460px;line-height:1.7;font-size:12px;color:#52627a}.code-chip{display:inline-flex;padding:6px 9px;border-radius:10px;background:#f3f6fb;border:1px solid var(--line);font-size:12px;direction:ltr}.user-editor.standalone{max-width:1180px;margin:auto}.password-field{position:relative}.password-field input{padding-left:52px}.password-eye{position:absolute;left:6px;top:50%;transform:translateY(-50%);width:40px;height:36px;border:0;border-radius:10px;background:#eef3ff;cursor:pointer;font-size:18px;display:grid;place-items:center}.password-eye:hover{background:#e3ebff}.cascade-scope{display:grid;gap:12px}.scope-step{display:grid;grid-template-columns:44px minmax(0,1fr);gap:12px;border:1px solid var(--line);border-radius:18px;padding:14px;background:linear-gradient(180deg,#fff,#fbfcff);transition:.2s}.scope-step:hover{border-color:#bdcdea;box-shadow:0 9px 24px rgba(31,59,117,.06)}.scope-step-no{width:38px;height:38px;border-radius:13px;background:linear-gradient(135deg,var(--brand),var(--brand-2));color:#fff;display:grid;place-items:center;font-weight:900;box-shadow:0 8px 18px rgba(49,94,251,.18)}.scope-step-body{min-width:0}.scope-step-body>b{font-size:16px}.scope-step-body>small{display:block;color:var(--muted);margin:3px 0 10px}.scope-title{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}.switch-line.compact{font-size:11px}.scope-master{margin-top:10px}.choice-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:8px}.choice-chip{margin:0;cursor:pointer}.choice-chip input{display:none}.choice-chip span{display:flex;flex-direction:column;justify-content:center;min-height:42px;padding:8px 11px;border-radius:12px;border:1px solid #d9e3f1;background:#f9fbff;font-size:12px;font-weight:800;transition:.15s}.choice-chip span small{font-size:10px;color:var(--muted);font-weight:600;margin-top:2px}.choice-chip input:checked+span{border-color:#7898f5;background:linear-gradient(135deg,#eaf1ff,#f4efff);color:#173f9f;box-shadow:0 5px 14px rgba(49,94,251,.10)}.scope-disabled{opacity:.42;pointer-events:none}.form-footer-actions{justify-content:flex-start;padding-top:18px;border-top:1px solid var(--line);margin-top:22px}
@media(max-width:760px){.scope-step{grid-template-columns:1fr}.scope-step-no{width:34px;height:34px}.scope-title{align-items:flex-start;flex-direction:column}.choice-grid{grid-template-columns:1fr}.users-table{min-width:900px}}

/* V15 users page verification */
.version-tag{display:inline-flex;margin-inline-start:6px;padding:2px 7px;border-radius:999px;background:#eef2ff;color:#4f46e5;font-size:10px;font-weight:900;border:1px solid #d9ddff}
.users-table td small{display:block;color:var(--muted);font-size:11px;margin-top:4px}
.users-table .scope-cell{display:block;max-width:420px;line-height:1.7}
.password-field{position:relative}.password-field input{padding-left:48px}.password-eye{position:absolute;left:7px;top:50%;transform:translateY(-50%);width:38px;height:38px;border:0;border-radius:11px;background:#eef3ff;cursor:pointer;font-size:18px;display:grid;place-items:center}
.cascade-scope{display:grid;gap:14px}.scope-step{display:grid;grid-template-columns:42px 1fr;gap:12px;align-items:start;padding:16px;border:1px solid var(--line);border-radius:18px;background:#fff}.scope-step-no{width:34px;height:34px;border-radius:11px;background:linear-gradient(135deg,var(--brand),var(--brand-2));color:#fff;display:grid;place-items:center;font-weight:900}.scope-step-body{min-width:0}.scope-step-body small{display:block;color:var(--muted);margin-top:3px}.scope-title{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.choice-grid{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.choice-chip{margin:0;cursor:pointer}.choice-chip input{display:none}.choice-chip span{display:inline-flex;align-items:center;gap:6px;padding:8px 12px;border-radius:999px;border:1px solid #dce4f2;background:#f9fbff;font-size:12px}.choice-chip input:checked+span{background:linear-gradient(135deg,var(--brand),var(--brand-2));border-color:transparent;color:#fff}.choice-chip span small{font-size:10px;opacity:.8;margin:0}.scope-step.scope-disabled{opacity:.45;pointer-events:none}.scope-master{margin-top:10px}.compact{font-size:12px}.standalone{max-width:1100px;margin-inline:auto}.form-footer-actions{justify-content:flex-start}.users-table .btn{white-space:nowrap}@media(max-width:760px){.scope-step{grid-template-columns:1fr}.scope-step-no{margin-bottom:4px}.choice-grid{gap:6px}}


/* V17 — auto-filled academic context in resource editor */
.resource-editor-card{padding:22px}.subject-context{margin:-4px 0 22px;padding:18px;border:1px solid #d9e5f7;border-radius:20px;background:linear-gradient(135deg,#f8fbff 0,#f4f1ff 100%);box-shadow:0 12px 30px rgba(44,75,145,.07)}
.subject-context-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:14px}.subject-context-head h2{margin:4px 0 0;font-size:21px}.context-kicker{font-size:11px;font-weight:900;color:#55709f}.context-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.context-item{padding:11px 12px;border-radius:14px;background:rgba(255,255,255,.88);border:1px solid #e1e9f6;min-width:0}.context-item span{display:block;font-size:11px;color:var(--muted);font-weight:800;margin-bottom:5px}.context-item b{display:block;font-size:13px;line-height:1.6;overflow-wrap:anywhere}.context-teacher{grid-column:span 2}.context-teacher small{display:block;color:var(--muted);font-size:10px;margin-top:4px}.context-empty{border-style:dashed}.resource-primary-fields{padding-top:4px}
@media(max-width:850px){.context-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.context-teacher{grid-column:1/-1}}
@media(max-width:520px){.context-grid{grid-template-columns:1fr}.context-teacher{grid-column:auto}.subject-context-head{flex-direction:column}}

/* V18 — locked academic context when opened from subject directory */
.locked-field{min-height:48px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 14px;border:1px solid #d6e1f2;border-radius:13px;background:linear-gradient(135deg,#f7faff,#eef4ff);color:#233958;font-weight:800}.locked-field b{font-size:14px;color:#6d7f9c}.resource-primary-fields>.notice{margin-top:4px}
