:root {
    --navy-950:#07172b; --navy-900:#0b1f3a; --navy-800:#123052;
    --turquoise-600:#079696; --turquoise-500:#0eacad; --turquoise-100:#d9f5f3;
    --surface:#fff; --surface-soft:#f6f9fc; --canvas:#eef3f7;
    --text:#17283c; --muted:#66778b; --line:#d9e2eb;
    --danger:#c2362b; --warning:#a66a06; --success:#087a5a; --info:#2365a2;
    --sidebar-width:264px; --topbar-height:70px; --safe-top:env(safe-area-inset-top,0px); --radius:8px;
    --shadow:0 8px 26px rgba(22,48,73,.07);
}
*{box-sizing:border-box} html{min-width:320px;background:var(--canvas);letter-spacing:0}
body{min-height:100vh;margin:0;overflow-x:hidden;color:var(--text);background:var(--canvas);font-family:Inter,"Segoe UI",Arial,sans-serif;font-size:15px}
body.menu-open{overflow:hidden} a{color:var(--turquoise-600);text-decoration:none;font-weight:700}
.sidebar{position:fixed;inset:0 auto 0 0;z-index:1100;width:var(--sidebar-width);display:flex;flex-direction:column;color:#fff;background:var(--navy-900);border-right:1px solid rgba(255,255,255,.06)}
.sidebar-brand{min-height:84px;padding:18px 20px;display:flex;align-items:center;gap:12px;border-bottom:1px solid rgba(255,255,255,.08)}
.sidebar-brand>span:nth-child(2){min-width:0;display:grid;gap:3px}.sidebar-brand strong{color:#fff;font-size:20px}.sidebar-brand small{color:#93a9bc;font-size:11px;font-weight:500}
.brand-logo{width:40px;height:40px;flex:0 0 40px;display:block;object-fit:contain}
.side-nav{min-height:0;flex:1;padding:16px 12px;overflow-y:auto}.nav-section-label{display:block;padding:14px 12px 7px;color:#6f89a0;font-size:10px;font-weight:800}
.side-nav a{position:relative;min-height:44px;margin:2px 0;padding:0 14px 0 30px;display:flex;align-items:center;color:#b8c7d4;border-radius:6px;font-size:14px;font-weight:600}
.side-nav a::before{content:"";position:absolute;left:14px;width:6px;height:6px;border:1px solid #6d879d;border-radius:50%}
.side-nav a:hover,.side-nav a:focus-visible{color:#fff;background:rgba(255,255,255,.07);outline:none}.side-nav a.active{color:#fff;background:rgba(14,172,173,.17)}.side-nav a.active::before{background:var(--turquoise-500);border-color:var(--turquoise-500)}
.sidebar-footer{margin-top:auto;padding:16px;border-top:1px solid rgba(255,255,255,.08)}.user-badge{display:flex;align-items:center;gap:10px}.user-badge>span:last-child{display:grid;gap:2px}.user-badge small{color:#8ea4b6;font-size:11px}
.user-avatar{width:36px;height:36px;display:grid;place-items:center;color:var(--navy-900);background:var(--turquoise-100);border-radius:50%;font-weight:900}.logout-link{width:100%;min-height:36px;padding:0;margin:13px 0 0;justify-content:flex-start;color:#9fb2c2;background:transparent;border:0;font-size:13px}
.topbar{position:fixed;top:0;right:0;left:var(--sidebar-width);z-index:900;height:var(--topbar-height);padding:0 30px;display:flex;align-items:center;justify-content:flex-end;background:rgba(255,255,255,.96);border-bottom:1px solid var(--line)}
.topbar-context{display:grid;text-align:right}.topbar-context span{font-size:13px;font-weight:800}.topbar-context small{margin-top:2px;color:var(--muted);font-size:11px}
.mobile-brand,.menu-toggle,.menu-close,.nav-overlay,.mobile-bottom-nav{display:none}
.public-header{width:min(100% - 32px,1180px);height:68px;margin:0 auto;display:flex;align-items:center;border-bottom:1px solid var(--line)}.public-header a{display:inline-flex;align-items:center;gap:10px;color:var(--navy-900);font-size:19px}.public-header .brand-logo{width:36px;height:36px;flex-basis:36px}
.splash-screen{position:fixed;inset:0;z-index:5000;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#fff;background:var(--navy-900);transition:opacity 240ms ease,visibility 240ms ease}.splash-screen.hide{visibility:hidden;opacity:0}.splash-screen img{width:clamp(150px,24vw,250px);height:auto}.splash-screen strong{margin-top:26px;font-size:clamp(36px,7vw,62px)}.splash-screen span{margin-top:9px;color:#a6cdd6;font-size:clamp(14px,2vw,19px);font-weight:600}
.main-content{width:auto;max-width:1560px;margin:0 0 0 var(--sidebar-width);padding:calc(var(--topbar-height) + 30px) 32px 54px}.auth-layout .main-content{width:min(100% - 32px,1180px);margin:0 auto;padding:30px 0}
h1{margin:0 0 22px;color:var(--navy-900);font-size:28px;line-height:1.2}h2{margin:0 0 15px;color:var(--navy-900);font-size:19px;line-height:1.3}p{color:var(--muted);line-height:1.55}
.page-heading{margin-bottom:22px;display:flex;align-items:flex-start;justify-content:space-between;gap:18px}.page-heading h1{margin-bottom:5px}.page-heading p{margin:0}.quick-actions{display:flex;gap:9px;flex-wrap:wrap}
.panel{min-width:0;padding:22px;margin-bottom:18px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}
.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;align-items:start}.stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.stat{min-height:116px;padding:18px;background:var(--surface);border:1px solid var(--line);border-top:3px solid var(--turquoise-500);border-radius:var(--radius);box-shadow:var(--shadow)}.stat:nth-child(2){border-top-color:var(--info)}.stat:nth-child(3){border-top-color:#e0a120}.stat:nth-child(4){border-top-color:#7656ad}.stat strong{display:block;margin-bottom:7px;color:var(--navy-900);font-size:30px;line-height:1.1}.stat span{color:var(--muted);font-size:13px;font-weight:700}
label{display:block;margin:13px 0 6px;color:var(--navy-900);font-weight:700}input,select,textarea{width:100%;min-height:45px;padding:10px 12px;border:1px solid #cfdbe5;border-radius:6px;color:var(--text);background:#fbfdff;font:inherit}input:focus,select:focus,textarea:focus{border-color:var(--turquoise-500);outline:3px solid rgba(14,172,173,.13)}input[type=checkbox]{min-height:20px}input[readonly],select:disabled{color:var(--muted);background:#edf2f6}textarea{min-height:190px;resize:vertical}
button,.button{min-height:44px;padding:10px 16px;margin-top:14px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:6px;color:#fff;background:var(--turquoise-600);font:inherit;font-weight:800;cursor:pointer}button:hover,.button:hover{color:#fff;background:#077e7e}.button.secondary{color:var(--navy-900);background:#edf3f7;border-color:var(--line)}.button.secondary:hover{background:#e0e9ef}.button.compact{min-height:38px;margin:0 4px 4px 0;padding:7px 10px}.button.danger{background:var(--danger)}.inline-form{display:inline}
.flash{padding:14px 16px;margin-bottom:16px;border:1px solid var(--line);border-left-width:4px;border-radius:6px;background:#fff}.flash.error{color:var(--danger);background:#fff5f4;border-color:#f0c5c1}.flash.success{color:var(--success);background:#effaf6;border-color:#bce2d5}.flash.warning{color:var(--warning);background:#fff9e9;border-color:#ead79e}
.table-scroll{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}table{width:100%;margin-top:12px;border-collapse:collapse;background:var(--surface)}th,td{padding:12px 11px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}th{color:#43566a;background:var(--surface-soft);font-size:12px;text-transform:uppercase}tbody tr:hover{background:#f8fbfd}td input,td select{min-width:110px}td small{min-width:180px;display:block;margin-top:4px;color:var(--muted)}
.ok,.status-ok{color:var(--success);font-weight:800}.bad,.status-error{color:var(--danger);font-weight:800}.blank,.status-warning{color:var(--warning);font-weight:800}.status{display:block;white-space:nowrap}.preview{width:100%;max-width:760px;height:auto;margin-top:16px;border:1px solid var(--line);border-radius:6px}
.key-settings{display:grid;grid-template-columns:2fr 1fr 1fr;gap:14px}.answer-grid{display:grid;grid-template-columns:repeat(5,minmax(110px,1fr));gap:10px}.answer-item{display:grid;grid-template-columns:34px 1fr;align-items:center;gap:6px;margin:0}.answer-item select{min-width:0}.section-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.section-heading p{margin:0}.section-heading .button{margin-top:0;white-space:nowrap}
.login-panel{width:min(430px,100%);margin:clamp(30px,8vh,80px) auto}.error-panel{width:min(620px,100%);margin:clamp(32px,9vh,90px) auto;text-align:center}.empty-state{padding:28px;color:var(--muted);background:var(--surface-soft);border:1px dashed #c9d6df;border-radius:6px;text-align:center}
@media(max-width:1100px){.answer-grid{grid-template-columns:repeat(3,minmax(110px,1fr))}}
@media(max-width:980px){:root{--topbar-height:62px}.sidebar{width:min(310px,88vw);transform:translateX(-105%);transition:transform 180ms ease;box-shadow:16px 0 36px rgba(4,17,32,.22)}.sidebar.open{transform:translateX(0)}.menu-close{width:40px;height:40px;margin:0 0 0 auto;padding:0;display:inline-grid;place-items:center;color:#fff;background:transparent;border-color:rgba(255,255,255,.16);font-size:25px}.nav-overlay{position:fixed;inset:0;z-index:1050;display:block;visibility:hidden;opacity:0;background:rgba(7,23,43,.58);border:0;border-radius:0;transition:opacity 180ms ease,visibility 180ms ease}.nav-overlay.open{visibility:visible;opacity:1}.topbar{left:0;padding:0 18px;justify-content:space-between}.menu-toggle{width:44px;height:44px;margin:0;padding:11px;display:flex;flex-direction:column;gap:5px;background:transparent;border-color:var(--line)}.menu-toggle span{width:20px;height:2px;display:block;background:var(--navy-900)}.mobile-brand{display:inline-flex;align-items:center;gap:9px;color:var(--navy-900)}.mobile-brand .brand-logo{width:34px;height:34px;flex-basis:34px}.topbar-context{display:none}.main-content{margin-left:0;padding:calc(var(--topbar-height) + 24px) 22px 48px}.grid,.key-settings{grid-template-columns:1fr}}
@media(max-width:720px){body.app-layout{padding-bottom:calc(66px + env(safe-area-inset-bottom))}.main-content{padding:calc(var(--topbar-height) + 18px) 12px 26px}h1{margin-bottom:16px;font-size:24px}h2{font-size:18px}.page-heading{align-items:stretch;flex-direction:column}.quick-actions{display:grid;grid-template-columns:1fr 1fr}.quick-actions .button{margin:0}.panel{padding:16px;margin-bottom:13px;box-shadow:0 4px 15px rgba(22,48,73,.05)}.stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.stat{min-height:98px;padding:13px}.stat strong{font-size:25px}.answer-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.section-heading{align-items:stretch;flex-direction:column}.section-heading .button{width:100%}.table-scroll,.panel{overflow-x:auto}table{display:block;overflow-x:auto;white-space:nowrap}th,td{padding:10px 9px}.panel>form>button,.panel>form>.button,main>form>.panel button{width:100%}.mobile-bottom-nav{position:fixed;right:0;bottom:0;left:0;z-index:1000;min-height:calc(62px + env(safe-area-inset-bottom));padding:7px 5px env(safe-area-inset-bottom);display:grid;grid-template-columns:repeat(4,1fr);background:#fff;border-top:1px solid var(--line);box-shadow:0 -8px 22px rgba(22,48,73,.08)}.mobile-bottom-nav a{min-height:48px;padding:5px 3px;display:grid;place-items:center;color:var(--muted);border-radius:6px;font-size:11px;text-align:center}.mobile-bottom-nav a.active{color:var(--turquoise-600);background:var(--turquoise-100)}.login-panel{margin-top:24px}}
@media(max-width:980px){
  .topbar{height:calc(var(--topbar-height) + var(--safe-top));padding-top:var(--safe-top)}
  .main-content{padding-top:calc(var(--topbar-height) + var(--safe-top) + 24px)}
  .sidebar{padding-top:var(--safe-top)}
  .nav-overlay{top:0}
}
@media(max-width:720px){
  .main-content{padding-top:calc(var(--topbar-height) + var(--safe-top) + 18px)}
  .mobile-bottom-nav{padding-bottom:env(safe-area-inset-bottom,0px);min-height:calc(62px + env(safe-area-inset-bottom,0px))}
  .auth-layout .public-header{height:calc(68px + var(--safe-top));padding-top:var(--safe-top)}
}
@media(pointer:coarse){input,select,button,.button,.side-nav a{min-height:48px}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition-duration:.01ms!important}}

/* OptixPro component layer */
.ui-icon{width:19px;height:19px;display:inline-block;flex:0 0 19px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.side-nav a{padding:0 12px;gap:11px}.side-nav a::before{display:none}.side-nav a .ui-icon{width:18px;height:18px;color:#7990a4}.side-nav a.active .ui-icon,.side-nav a:hover .ui-icon{color:var(--turquoise-500)}
.logout-link{display:flex;align-items:center;gap:8px}.logout-link .ui-icon{width:16px;height:16px}
.install-link{width:100%;min-height:38px;margin:12px 0 0;padding:8px 10px;display:flex;align-items:center;justify-content:flex-start;gap:8px;color:#d8f4ef;background:rgba(14,172,173,.14);border:1px solid rgba(14,172,173,.25);font-size:12px}.install-link:hover{background:rgba(14,172,173,.24)}.install-link .ui-icon{width:16px;height:16px}
button,.button{gap:8px}button[hidden],.button[hidden]{display:none}.button .ui-icon,button .ui-icon{width:17px;height:17px}
.eyebrow{display:block;margin-bottom:7px;color:var(--turquoise-600);font-size:11px;font-weight:900}.page-heading .button{margin-top:0}
.panel-title{margin-bottom:18px;display:flex;align-items:center;gap:11px}.panel-title h2,.panel-title p{margin:0}.panel-title p{margin-top:3px;font-size:12px}
.section-icon{width:38px;height:38px;display:grid;place-items:center;flex:0 0 38px;color:var(--turquoise-600);background:var(--turquoise-100);border-radius:7px}.section-icon .ui-icon{width:20px;height:20px}
.section-heading>div{display:flex;align-items:center;gap:11px}.section-heading h2,.section-heading p{margin:0}.section-heading p{margin-top:3px;font-size:12px}.section-heading .text-link{margin-top:10px}
.text-link{display:inline-flex;align-items:center;gap:4px;font-size:13px;white-space:nowrap}.text-link .ui-icon{width:15px;height:15px}
.stats .stat{display:flex;align-items:center;gap:14px;color:var(--text);transition:transform 150ms ease,border-color 150ms ease}.stats a.stat:hover{transform:translateY(-2px);border-color:#b9d8dc}.stat-icon{width:46px;height:46px;display:grid;place-items:center;flex:0 0 46px;color:var(--turquoise-600);background:var(--turquoise-100);border-radius:7px}.stat:nth-child(2) .stat-icon{color:var(--info);background:#e4f0fb}.stat:nth-child(3) .stat-icon{color:#a66a06;background:#fff2cf}.stat-icon .ui-icon{width:23px;height:23px}.stat-copy{min-width:0}.stat-copy strong{margin:0}.stat-copy>span{display:block;margin-top:5px}.stat-arrow{margin-left:auto;width:16px;height:16px;color:#95a4b3}
.dashboard-grid{margin-top:18px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;align-items:start}
.record-list{margin-top:8px}.record-item{min-height:66px;padding:11px 2px;display:flex;align-items:center;gap:11px;color:var(--text);border-bottom:1px solid var(--line)}.record-item:last-child{border-bottom:0}.record-item:hover{color:var(--text);background:var(--surface-soft)}.record-icon{width:38px;height:38px;display:grid;place-items:center;flex:0 0 38px;color:var(--navy-800);background:#edf3f7;border-radius:7px}.record-icon .ui-icon{width:18px;height:18px}.record-main{min-width:0;display:grid;gap:4px;flex:1}.record-main strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.record-main small{overflow:hidden;color:var(--muted);font-size:12px;text-overflow:ellipsis;white-space:nowrap}.score-ring{width:42px;height:42px;display:grid;place-items:center;flex:0 0 42px;color:var(--success);background:#e4f6ef;border:2px solid #a8d9c8;border-radius:50%;font-size:12px;font-weight:900}
.status-pill{min-height:26px;padding:4px 8px;display:inline-flex;align-items:center;border-radius:999px;font-size:11px;font-weight:800;white-space:nowrap}.status-pill.success{color:var(--success);background:#e4f6ef}.status-pill.warning{color:var(--warning);background:#fff3d4}.status-pill.error{color:var(--danger);background:#ffebe9}
.form-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.optional{color:var(--muted);font-size:11px;font-weight:500}.checkbox-row{min-height:44px;padding:10px 0;display:flex;align-items:center;gap:9px}.checkbox-row input{width:20px;min-height:20px;margin:0}.checkbox-row span{font-weight:500}
.layout-form-list{grid-template-columns:minmax(310px,.8fr) minmax(0,1.5fr)}.form-panel form>button{min-width:180px}.upload-zone{padding:15px;margin-top:2px;display:grid;grid-template-columns:28px 1fr;align-items:center;gap:8px;background:var(--surface-soft);border:1px dashed #b9c9d7;border-radius:7px}.upload-zone>.ui-icon{width:23px;height:23px;color:var(--turquoise-600)}.upload-zone input{min-width:0;padding:8px;background:#fff}.file-feedback{display:block;margin-top:6px;color:var(--muted);font-size:12px}
.upload-report{padding-top:18px;margin-top:20px;border-top:1px solid var(--line)}.upload-report h3{margin:0 0 12px}.report-metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:7px}.report-metrics span{padding:8px;display:grid;color:var(--muted);background:var(--surface-soft);border-radius:6px;font-size:11px;text-align:center}.report-metrics strong{color:var(--navy-900);font-size:18px}
.completion-box{padding-top:18px;margin-top:20px;display:grid;grid-template-columns:1fr auto;gap:8px;border-top:1px solid var(--line)}.completion-box span{color:var(--muted)}.completion-box progress{grid-column:1/-1;width:100%;height:9px;accent-color:var(--turquoise-600)}
.result-stats{grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:17px}.result-stats .stat{min-height:90px;display:block;padding:13px}.result-stats .stat strong{font-size:25px}.student-match{padding:13px;margin:14px 0;display:flex;align-items:center;gap:10px;background:var(--surface-soft);border-left:3px solid var(--turquoise-500);border-radius:6px}.student-match>div{display:grid;gap:3px}.student-match small{color:var(--muted)}.answer-details{margin-top:16px;border-top:1px solid var(--line)}.answer-details summary{padding:14px 2px;color:var(--navy-900);font-weight:800;cursor:pointer}
.export-bar{padding:14px 18px;margin-bottom:18px;display:flex;align-items:center;justify-content:space-between;gap:16px;background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}.export-bar>div:first-child{display:flex;align-items:center;gap:10px}.export-bar>div:first-child>div{display:grid;gap:3px}.export-bar small{color:var(--muted)}.export-bar .button{margin:0}.score-badge{min-width:44px;padding:5px 8px;display:inline-flex;justify-content:center;color:#fff;background:var(--navy-800);border-radius:5px;font-weight:800}.icon-link{display:inline-flex;align-items:center;gap:5px}.icon-link .ui-icon{width:16px;height:16px}
.empty-state{min-height:180px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px}.empty-state>.ui-icon{width:34px;height:34px;color:#8ca0b2}.empty-state strong{color:var(--navy-900)}.empty-state span{max-width:420px;font-size:13px}.empty-state .button{margin-top:5px}.result-empty{min-height:360px}
.loading-overlay{position:fixed;inset:0;z-index:4500;display:grid;place-items:center;visibility:hidden;opacity:0;background:rgba(7,23,43,.62);transition:opacity 150ms ease,visibility 150ms ease}.loading-overlay.show{visibility:visible;opacity:1}.loading-dialog{width:min(330px,calc(100% - 32px));padding:28px;display:flex;flex-direction:column;align-items:center;color:var(--text);background:#fff;border-radius:8px;box-shadow:0 18px 50px rgba(7,23,43,.28)}.loading-dialog strong{margin-top:15px;font-size:17px}.loading-dialog small{margin-top:5px;color:var(--muted)}.spinner{width:38px;height:38px;border:4px solid #d7e4e8;border-top-color:var(--turquoise-600);border-radius:50%;animation:spin .75s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}

@media(max-width:1180px){.dashboard-grid{grid-template-columns:1fr}.result-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:980px){.layout-form-list{grid-template-columns:1fr}.topbar{justify-content:flex-start;gap:14px}.mobile-brand{margin-right:auto}}
@media(max-width:720px){.form-row{grid-template-columns:1fr;gap:0}.quick-actions{grid-template-columns:1fr 1fr}.quick-actions .button:last-child:nth-child(odd){grid-column:1/-1}.export-bar{align-items:stretch;flex-direction:column}.export-bar .quick-actions{display:grid;grid-template-columns:repeat(3,1fr)}.export-bar .button{padding:8px}.section-heading>div{align-items:flex-start}.section-heading{gap:10px}.record-main small{white-space:normal}.report-metrics{grid-template-columns:repeat(2,1fr)}.mobile-bottom-nav a{display:flex;flex-direction:column;gap:3px}.mobile-bottom-nav .ui-icon{width:18px;height:18px}.result-empty{min-height:240px}}

.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.capture-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.capture-option{min-height:82px;padding:14px;margin:0;display:flex;align-items:center;gap:11px;color:var(--navy-900);background:var(--surface-soft);border:1px solid #cbd9e4;border-radius:7px;cursor:pointer}.capture-option:hover{border-color:var(--turquoise-500);background:#f1fbfa}.capture-option>.ui-icon{width:25px;height:25px;color:var(--turquoise-600)}.capture-option>span{min-width:0;display:grid;gap:3px}.capture-option small{color:var(--muted);font-size:11px;font-weight:500}.capture-option.camera{color:#fff;background:var(--navy-800);border-color:var(--navy-800)}.capture-option.camera>.ui-icon{color:var(--turquoise-500)}.capture-option.camera small{color:#b8c8d5}
.photo-preview{padding:12px;margin-top:12px;display:flex;align-items:center;gap:12px;background:#fff;border:1px solid var(--line);border-radius:7px}.photo-preview[hidden]{display:none}.photo-preview img{width:86px;height:86px;flex:0 0 86px;object-fit:cover;border-radius:6px}.photo-preview>div{min-width:0;display:grid;gap:3px}.photo-preview strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.photo-preview small{color:var(--muted)}.photo-preview button{width:max-content;margin-top:5px}.field-error{margin:8px 0 0;color:var(--danger);font-size:12px;font-weight:700}.field-error[hidden]{display:none}
.template-preview{padding:12px;margin:12px 0;display:flex;align-items:center;gap:13px;background:var(--surface-soft);border:1px solid var(--line);border-radius:7px}.template-preview img{width:120px;height:90px;display:block;object-fit:cover;border-radius:6px;border:1px solid var(--line)}.template-preview>div{display:grid;gap:4px}.template-preview small{color:var(--muted)}.compact-empty{min-height:120px}
@media(max-width:520px){.capture-options{grid-template-columns:1fr}.capture-option{min-height:68px}.photo-preview{align-items:flex-start}.photo-preview img{width:72px;height:72px;flex-basis:72px}}

.review-layout{display:grid;grid-template-columns:minmax(300px,.72fr) minmax(0,1.5fr);gap:18px;align-items:start}.review-summary{position:sticky;top:calc(var(--topbar-height) + 18px)}.review-summary .result-stats{grid-template-columns:repeat(3,minmax(0,1fr))}.review-summary .stat{min-width:0}.student-read-note{padding:12px;margin-top:13px;display:grid;gap:3px;background:var(--surface-soft);border-left:3px solid var(--turquoise-500);border-radius:6px}.student-read-note small,.student-read-note span,.save-note{color:var(--muted);font-size:12px}.review-legend{margin-top:16px;display:flex;gap:12px;flex-wrap:wrap;color:var(--muted);font-size:12px}.review-legend span{display:flex;align-items:center;gap:5px}.legend-dot{width:9px;height:9px;border-radius:50%}.legend-dot.correct{background:var(--success)}.legend-dot.wrong{background:var(--danger)}.legend-dot.blank{background:#d19a27}.correction-table select{min-width:145px;margin:0}.correction-table td{vertical-align:middle}.review-summary>button{width:100%}
.review-form-preview{margin-top:14px;display:grid;gap:9px}.review-form-preview>div{display:grid;gap:2px}.review-form-preview small{color:var(--muted);font-size:12px}.review-form-preview a{display:block;overflow:hidden;border:1px solid var(--line);border-radius:6px;background:var(--surface-soft)}.review-form-preview img{width:100%;height:240px;display:block;object-fit:contain}.spaced-panel{margin-top:18px}
.review-stat{border-top-color:#d19a27!important}.review-warning{margin:12px 0 0}.needs-review-row{background:#fffaf0!important}.needs-review-row td:first-child{box-shadow:inset 3px 0 0 #d19a27}.review-note{min-width:0!important;margin-top:5px!important;color:var(--warning)!important;font-size:11px!important;font-weight:700;white-space:normal}
@media(max-width:980px){.review-layout{grid-template-columns:1fr}.review-summary{position:static}}

/* Responsive data management */
.wrap-text{display:block;white-space:normal;overflow-wrap:anywhere;word-break:normal;line-height:1.45}.row-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.row-actions form{margin:0}.row-actions .button{margin:0}.management-table td:last-child{min-width:230px}.student-table{table-layout:fixed}.student-table .student-no-col{width:16%}.student-table .student-name-col{width:36%}.student-table .student-grade-col{width:12%}.student-table .student-branch-col{width:12%}.student-table .student-action-col{width:24%}.student-table td{vertical-align:middle}.student-table input,.student-table textarea{min-width:0;width:100%}.student-name-input{min-height:58px;resize:vertical;white-space:normal;overflow-wrap:anywhere;line-height:1.4}.results-table td:nth-child(1),.results-table td:nth-child(2){white-space:normal;min-width:170px}.results-table td{vertical-align:middle}.bulk-results-table th:last-child,.bulk-results-table td:last-child{min-width:190px}.bulk-results-table td:last-child .row-actions{flex-wrap:nowrap}

@media(max-width:720px){
  .table-scroll:has(>table.responsive-cards){overflow:visible}
  table.responsive-cards{width:100%;display:table;overflow:visible;white-space:normal;background:transparent}
  table.responsive-cards thead{display:none}
  table.responsive-cards tbody{display:grid;gap:12px}
  table.responsive-cards tr{display:grid;width:100%;padding:5px 14px;background:#fff;border:1px solid var(--line);border-left:3px solid var(--turquoise-500);border-radius:6px}
  table.responsive-cards td{min-width:0!important;padding:10px 0;display:grid;grid-template-columns:minmax(100px,34%) minmax(0,1fr);align-items:center;gap:12px;border-bottom:1px solid var(--line);white-space:normal;text-align:left}
  table.responsive-cards td:last-child{border-bottom:0}
  table.responsive-cards td::before{content:attr(data-label);color:#53687b;font-size:11px;font-weight:800;text-transform:uppercase}
  table.responsive-cards td>*{min-width:0}
  table.responsive-cards input,table.responsive-cards select,table.responsive-cards textarea{width:100%;min-width:0}
  table.responsive-cards .row-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
  table.responsive-cards .row-actions .button,table.responsive-cards .row-actions form,table.responsive-cards .row-actions form button{width:100%;margin:0}
  .student-name-input{min-height:66px}
}

@media(max-width:430px){table.responsive-cards td{grid-template-columns:1fr;gap:5px}table.responsive-cards td::before{margin-bottom:1px}}

@media(max-width:720px){
  .student-list{overflow:visible!important}
  .student-list colgroup,.student-list thead{display:none!important}
  .student-list .student-table,.student-list .student-table tbody,.student-list .student-table tr,.student-list .student-table td{display:block!important;width:100%!important}
  .student-list .student-table{margin-top:0;background:transparent;white-space:normal!important;overflow:visible!important}
  .student-list .student-table tbody{display:grid!important;gap:12px}
  .student-list .student-table tr{padding:14px;background:#fff;border:1px solid var(--line);border-left:4px solid var(--turquoise-500);border-radius:8px;box-shadow:0 4px 14px rgba(22,48,73,.05)}
  .student-list .student-table td{min-width:0!important;padding:9px 0!important;border-bottom:1px solid var(--line);white-space:normal!important}
  .student-list .student-table td:last-child{border-bottom:0}
  .student-list .student-table td::before{content:attr(data-label);display:block;margin-bottom:5px;color:#53687b;font-size:11px;font-weight:900;text-transform:uppercase}
  .student-list .student-table input,.student-list .student-table textarea{width:100%!important;min-width:0!important;min-height:44px;font-size:16px;line-height:1.35}
  .student-list .student-name-input{min-height:74px}
  .student-list .row-actions{display:grid!important;grid-template-columns:1fr 1fr;gap:8px;width:100%}
  .student-list .row-actions button{width:100%;margin:0}
}

/* Desktop fit polish */
@media(min-width:981px) and (max-width:1450px){
  :root{--sidebar-width:232px;--topbar-height:58px}
  .sidebar-brand{min-height:70px;padding:14px 16px}.brand-logo{width:36px;height:36px;flex-basis:36px}.sidebar-brand strong{font-size:18px}.sidebar-brand small{font-size:10px}
  .side-nav{padding:10px 10px}.nav-section-label{padding:11px 10px 5px}.side-nav a{min-height:38px;padding:0 10px;font-size:13px}
  .sidebar-footer{padding:12px}.user-avatar{width:32px;height:32px}.install-link{min-height:34px;margin-top:9px}.logout-link{min-height:34px;margin-top:9px}
  .topbar{padding:0 24px}.main-content{padding:calc(var(--topbar-height) + 22px) 24px 42px}
  .panel{padding:18px}.grid{gap:16px}.page-heading{margin-bottom:18px}
  h1{font-size:26px}.panel-title{margin-bottom:14px}.section-icon{width:34px;height:34px;flex-basis:34px}
  input,select,textarea{min-height:41px}button,.button{min-height:40px;padding:9px 13px}
  th,td{padding:10px 9px}
}

@media(min-width:981px) and (max-height:820px){
  .main-content{padding-top:calc(var(--topbar-height) + 18px);padding-bottom:30px}
  .panel{padding:16px;margin-bottom:14px}.page-heading{margin-bottom:14px}.page-heading p,.panel-title p{font-size:12px}
  h1{font-size:24px}h2{font-size:18px}
  label{margin:9px 0 5px}input,select,textarea{min-height:38px;padding:8px 10px}
  button,.button{min-height:38px;margin-top:10px;padding:8px 12px}
  .flash{padding:11px 14px;margin-bottom:13px}
}

@media(min-width:721px){
  .management-table{table-layout:auto}
  .management-table th,.management-table td{white-space:normal;overflow-wrap:anywhere}
  .management-table td:last-child{min-width:0;width:1%;white-space:nowrap}
  .management-table .row-actions{flex-wrap:nowrap}
  .settings-admin-table th:nth-child(1),.settings-admin-table td:nth-child(1){width:30%}
  .settings-admin-table th:nth-child(2),.settings-admin-table td:nth-child(2){width:22%}
  .settings-admin-table th:nth-child(3),.settings-admin-table td:nth-child(3){width:28%}
  .settings-admin-table th:nth-child(4),.settings-admin-table td:nth-child(4){width:20%}
}
