/* Administrative surfaces own a light palette, including portalled dialogs.
   Public appearance tokens must never determine administrative control contrast. */
body[data-role="staff"] {
  color-scheme:var(--a2-legacy-color-scheme,light);
  --bg:#f0f7fa;--panel:#fff;--panel-2:#f3f7fa;
  --text:#19354d;--muted:#587185;--faint:#617b8c;
  --border:#c4d6df;--border-soft:#dbe6ec;--accent:#008c96;
  --accent-strong:#007681;--accent-soft:#e5f4f3;
  background:var(--a2-legacy-surface,#f0f7fa)!important;color:var(--a2-legacy-text,#19354d)!important;
}
body[data-role="staff"] .topbar {
  background:var(--a2-legacy-surface,#fff)!important;color:var(--a2-legacy-text,#19354d)!important;
  border-bottom:1px solid var(--av-divider)!important;box-shadow:none!important;
  backdrop-filter:none!important;
}
body[data-role="staff"] .topbar h1 {color:var(--a2-legacy-text,#19354d)!important;text-shadow:none!important;}
body[data-role="staff"] .topbar p {color:var(--a2-legacy-text-secondary,#587185)!important;}
body[data-role="staff"] :is(input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea) {
  color-scheme:var(--a2-legacy-color-scheme,light)!important;background:var(--a2-legacy-field,#f3f7fa)!important;color:var(--a2-legacy-text,#19354d)!important;
  border:1px solid transparent!important;border-radius:10px!important;
  box-shadow:var(--a2-legacy-autofill-shadow,none)!important;font:400 14px/1.45 var(--av-font-sans)!important;
  padding:10px 12px!important;min-height:42px;opacity:1;
  -webkit-text-fill-color:var(--a2-legacy-text,#19354d)!important;
}
body[data-role="staff"] :is(input,textarea)::placeholder {color:var(--a2-legacy-text-secondary,#647d8e)!important;-webkit-text-fill-color:var(--a2-legacy-text-secondary,#647d8e)!important;opacity:1;}
body[data-role="staff"] select option {color:var(--a2-legacy-text,#19354d)!important;background:var(--a2-legacy-field,#fff)!important;}
body[data-role="staff"] :is(input,select,textarea):focus-visible {
  outline:none!important;outline-offset:2px!important;background:var(--av-focus-well)!important;
}
body[data-role="staff"] :is(input,select,textarea):disabled {opacity:.65;cursor:not-allowed;}
body[data-role="staff"] :is(input[type=checkbox],input[type=radio]) {accent-color:var(--a2-legacy-accent,#008c96);color-scheme:var(--a2-legacy-color-scheme,light);}
body[data-role="staff"] #uploadPanel {
  background:var(--a2-legacy-surface,#fff)!important;color:var(--a2-legacy-text,#19354d)!important;border:1px solid transparent!important;
  border-radius:18px!important;padding:24px!important;box-shadow:none!important;
}
body[data-role="staff"] #uploadPanel::before,
body[data-role="staff"] #uploadPanel::after,
body[data-role="staff"] #dropzone::before,
body[data-role="staff"] #dropzone::after,
body[data-role="staff"] #dropzone strong::after {display:none!important;}
body[data-role="staff"] #dropzone {
  min-height:180px!important;padding:24px!important;background:var(--a2-legacy-surface-well,#f3f8fa)!important;
  border:1px dashed var(--a2-legacy-border,#88afb9)!important;border-radius:14px!important;color:var(--a2-legacy-text,#19354d)!important;
  box-shadow:none!important;transform:none!important;
}
body[data-role="staff"] #dropzone strong {color:var(--a2-legacy-text,#19354d)!important;font-size:19px!important;}
body[data-role="staff"] #dropzone p {color:var(--a2-legacy-text-secondary,#587185)!important;margin:10px auto 0!important;max-width:620px;}
body[data-role="staff"] #dropzone .dz-icon {width:44px!important;height:44px!important;margin:0 auto 12px!important;border-radius:12px!important;background:var(--a2-legacy-surface-well,#e0f3f1)!important;color:var(--a2-legacy-accent,#007681)!important;box-shadow:none!important;}
body[data-role="staff"] #uploadPanel .uploadbar {margin-top:18px!important;padding:14px!important;background:var(--a2-legacy-surface-well,#f3f8fa)!important;border:1px solid transparent!important;border-radius:12px!important;box-shadow:none!important;}
body[data-role="staff"] #uploadPanel :is(.ub-t,.ub-s,.status,.publishBar span) {color:var(--a2-legacy-text,#19354d)!important;}
body[data-role="staff"] #uploadPanel .statusline {margin-top:14px!important;border:0!important;}
body[data-role="staff"] #uploadPanel .status {background:transparent!important;border:0!important;padding:0!important;}
body[data-role="staff"] #publishBar {background:transparent!important;border:0!important;border-top:1px solid var(--av-divider)!important;margin-top:16px!important;padding:16px 0 0!important;box-shadow:none!important;}
body[data-role="staff"] #logoutBtn {display:none!important;}
body[data-role="staff"] #averaAccounts .sa-danger {color:var(--a2-legacy-danger,#a63043);border-color:var(--a2-legacy-border,#dcbac1);background:var(--a2-legacy-danger-soft,#fff);}

/* A single import preparation action, separate from publication. */
body[data-role="staff"] #publishBar,body[data-role="staff"] #publishWeekRange,body[data-role="staff"] #staffTabPublish .staff-box:nth-child(2){display:none!important;}
body[data-role="staff"] #staffTabPublish .staff-grid{grid-template-columns:1fr!important;}
body[data-role="staff"] #staffTabPublish .staff-box{background:var(--a2-legacy-surface,#fff)!important;color:var(--a2-legacy-text,#19354d)!important;box-shadow:none!important;border:0!important;}
body[data-role="staff"] #staffTabPublish :is(h3,p,label){color:var(--a2-legacy-text-secondary,#19354d)!important;}
/* Administrator workspace autofill stays readable.
   The access dialog owns an independent palette and must not inherit these light-only controls. */
body[data-role="staff"] input:-webkit-autofill,
body[data-role="staff"] input:-webkit-autofill:hover,
body[data-role="staff"] input:-webkit-autofill:focus {
  -webkit-text-fill-color:var(--a2-legacy-text,#19354d)!important;
  -webkit-box-shadow:0 0 0 1000px var(--a2-legacy-field,#f3f7fa) inset!important;
  box-shadow:var(--av-shadow-well)!important;
  caret-color:var(--a2-legacy-text,#19354d)!important;
  transition:background-color 9999s ease-out 0s!important;
background:var(--av-focus-well);}
/* Login/access overlays are theme-isolated from the light administrative workspace. */
body[data-role="staff"] #loginOverlay .admin-login-input input {
  background:transparent!important;
  color:var(--av-text-primary)!important;
  -webkit-text-fill-color:var(--al-text)!important;
  border:0!important;
  box-shadow:none!important;
  caret-color:var(--al-text)!important;
}
body[data-role="staff"] #loginOverlay[data-admin-theme="light"] .admin-login-input input { color-scheme:var(--a2-legacy-color-scheme,light)!important; }
body[data-role="staff"] #loginOverlay[data-admin-theme="dark"] .admin-login-input input { color-scheme:dark!important; }
body[data-role="staff"] #loginOverlay[data-admin-theme="light"] input:-webkit-autofill,
body[data-role="staff"] #loginOverlay[data-admin-theme="light"] input:-webkit-autofill:hover,
body[data-role="staff"] #loginOverlay[data-admin-theme="light"] input:-webkit-autofill:focus {
  -webkit-text-fill-color:var(--al-text)!important;
  -webkit-box-shadow:0 0 0 1000px var(--al-surface) inset!important;
  box-shadow:var(--av-shadow-well)!important;
  caret-color:var(--al-text)!important;
background:var(--av-focus-well);}
body[data-role="staff"] #loginOverlay[data-admin-theme="dark"] input:-webkit-autofill,
body[data-role="staff"] #loginOverlay[data-admin-theme="dark"] input:-webkit-autofill:hover,
body[data-role="staff"] #loginOverlay[data-admin-theme="dark"] input:-webkit-autofill:focus {
  -webkit-text-fill-color:var(--al-text)!important;
  -webkit-box-shadow:0 0 0 1000px var(--al-surface) inset!important;
  box-shadow:var(--av-shadow-well)!important;
  caret-color:var(--al-text)!important;
background:var(--av-focus-well);}
/* REV2 · compact, guided Excel upload */
body[data-role="staff"] #dropzone{min-height:140px!important;padding:18px!important;}body[data-role="staff"] #uploadPanel.loaded #dropzone{min-height:76px!important;padding:12px 18px!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:12px!important;}body[data-role="staff"] #uploadPanel.loaded #dropzone .dz-icon{width:34px!important;height:34px!important;margin:0!important;}body[data-role="staff"] #uploadPanel.loaded #dropzone strong{font-size:15px!important;}body[data-role="staff"] #uploadPanel.loaded #dropzone p{display:none!important;}body[data-role="staff"] #publishWeekBtn{background:var(--av-primary-gradient)!important;color:var(--av-primary-ink)!important;border-color:transparent!important;font-weight:750!important;box-shadow:var(--av-shadow-primary)!important;}


/* RC22: explicit solid borders remove the native outset bevel from legacy actions. */
:where(html body[data-role="staff"] :is(.au-admin button,.au-dialog button,#averaAccounts button,#averaEditor button,.staff-box .btn,#uploadPanel .btn,#checkPanel .btn,.av-shell-actions button):where(:not(.au-group-open):not(.ae-lesson):not(.ae-empty):not(.avera-dropdown-trigger):not(.avera-dropdown-option):not(.avera-modal-close):not([data-close]):not([data-sa="close"]):not([data-ae="close"]):not([data-update-dismiss]))){
 box-sizing:border-box;min-height:44px;padding:10px 14px;border:1px solid var(--av-border-subtle);border-radius:12px;background:var(--av-secondary-bg);color:var(--a2-text,var(--av-text-primary));box-shadow:var(--av-shadow-control);font-weight:650;line-height:1.3;touch-action:manipulation;transition:background var(--av-motion-ui) var(--av-ease-standard),box-shadow var(--av-motion-interaction) var(--av-ease-standard),transform var(--av-motion-interaction) var(--av-ease-standard);
}
html body[data-role="staff"] :is(.au-admin,.au-dialog,#averaAccounts,#averaEditor,.staff-box,#uploadPanel,#checkPanel,.av-shell-actions) :is(.au-primary,.ae-primary,.sa-primary,.btn.primary,.av-primary,[data-update-now]){background:var(--av-primary-gradient)!important;color:var(--av-primary-ink)!important;border-color:transparent!important;background-image:var(--av-primary-gradient)!important;box-shadow:var(--av-shadow-primary);}
html body[data-role="staff"] :is(.au-admin,.au-dialog,#averaAccounts,#averaEditor,.staff-box,#uploadPanel,#checkPanel,.av-shell-actions) :is(.au-danger,.ae-danger,.sa-danger,.btn.danger){background:var(--a2-danger-soft,var(--av-danger-soft))!important;color:var(--a2-danger,var(--av-danger))!important;border-color:color-mix(in srgb,var(--a2-danger,var(--av-danger)) 22%,transparent)!important;box-shadow:none!important}
html body[data-role="staff"] :is(.au-primary,.au-danger,.ae-primary,.ae-danger,.sa-danger,.btn)::before,html body[data-role="staff"] :is(.au-primary,.au-danger,.ae-primary,.ae-danger,.sa-danger,.btn)::after{content:none!important}
html body[data-role="staff"] :is(.au-admin button,.au-dialog button,#averaAccounts button,#averaEditor button,.staff-box .btn,.av-shell-actions button):not(:disabled):active{transform:translateY(1px);box-shadow:var(--a2-inset,var(--av-shadow-pressed))!important}
html body[data-role="staff"] :is(.au-admin button,.au-dialog button,#averaAccounts button,#averaEditor button,.av-shell-actions button):focus-visible{outline:none!important;outline-offset:2px;background:var(--av-focus-action);}
html body[data-role="staff"] :is(.au-admin button,.au-dialog button,#averaAccounts button,#averaEditor button,.av-shell-actions button):disabled{opacity:.5;cursor:default;transform:none;box-shadow:none!important}
@media(prefers-reduced-motion:reduce){html body[data-role="staff"] :is(.au-admin button,.au-dialog button,#averaAccounts button,#averaEditor button,.av-shell-actions button){transition:none!important;transform:none!important}}
