/* Light mode integration: one calm palette, loaded after all module styles. */
@media screen {
html[data-theme="light"] .company-shell{
  --light-canvas:#eef3f8;
  --light-surface:#f9fbfd;
  --light-raised:#ffffff;
  --light-soft:#eaf1f8;
  --light-border:#cbd8e7;
  --light-ink:#17324f;
  --light-muted:#536b85;
  --light-link:#215da8;
  color-scheme:light;
}
html[data-theme="light"] .company-shell .admin-main{
  background:var(--light-canvas)!important;
  color:var(--light-ink)!important;
}
html[data-theme="light"] .company-shell .admin-main :is(section,article,fieldset){
  background-color:var(--light-surface)!important;
  color:var(--light-ink)!important;
  border-color:var(--light-border)!important;
}
html[data-theme="light"] .company-shell .admin-main :is(.admin-panel,.module-panel,.settings-card,.form-card,.table-wrap,.table-shell,[role="tabpanel"]){
  background:var(--light-surface)!important;
  color:var(--light-ink)!important;
  border-color:var(--light-border)!important;
}
html[data-theme="light"] .company-shell .admin-main :is(a:not(.primary):not(.btn-primary),.text-link){color:var(--light-link)}
html[data-theme="light"] .company-shell .admin-main :is(input,select,textarea){color-scheme:light}
html[data-theme="light"] .company-shell .admin-main :is(input,select,textarea):disabled{background:#e9eff6!important;color:#60758b!important;opacity:1}
html[data-theme="light"] .company-shell .admin-main :is(button,summary,a[role="button"]):focus-visible{outline:3px solid #8cb7ed!important;outline-offset:2px!important}

/* The previous global rules made every submit button blue, including Delete. */
html[data-theme="light"] .company-shell .admin-main :is(button.danger,button.destructive,button.hr-delete,form[data-confirm] button[type="submit"],.inline-form button.danger){
  background:#fff0f2!important;color:#a9223d!important;border:1px solid #e7a6b5!important;
}
html[data-theme="light"] .company-shell .admin-main :is(button.danger,button.destructive,button.hr-delete,form[data-confirm] button[type="submit"]):hover{background:#ffe3e9!important}
html[data-theme="light"] .company-shell .admin-main :is(button.primary,button.as-primary,a.primary,.btn-primary,button[type="submit"]:not(.danger):not(.destructive):not(.hr-delete)){
  background:#2864bd!important;color:#fff!important;border-color:#2864bd!important;
}
html[data-theme="light"] .company-shell .admin-main :is(button.primary,button.as-primary,a.primary,.btn-primary,button[type="submit"]:not(.danger):not(.destructive):not(.hr-delete)):hover{background:#2057a8!important}
html[data-theme="light"] .company-shell .admin-main :is(button.secondary,a.secondary,.btn-secondary,button[type="button"]:not(.danger):not(.destructive):not(.hr-delete)){
  background:#edf3fa!important;color:#205486!important;border-color:#b9cde2!important;
}
html[data-theme="light"] .company-shell .admin-main :is(button,a,summary) svg{stroke:currentColor}

/* Common tables, actions and tabs must never inherit a dark fill with blue text. */
html[data-theme="light"] .company-shell .admin-main .table-wrap td details>summary,
html[data-theme="light"] .company-shell .admin-main .table-wrap td>details>summary{
  display:inline-flex;align-items:center;justify-content:center;min-height:36px;padding:6px 12px;
  border:1px solid #b9cde2!important;border-radius:9px;background:#edf3fa!important;
  color:#205486!important;cursor:pointer;list-style:none;
}
html[data-theme="light"] .company-shell .admin-main .table-wrap td details>summary::-webkit-details-marker{display:none}
html[data-theme="light"] .company-shell .admin-main .table-wrap td details[open]>summary{background:#dfeeff!important;color:#174b8b!important}
html[data-theme="light"] .company-shell .admin-main :is(.badge,.pill,.status,.as-status){background:#e8f0f7!important;color:#284b70!important;border:1px solid #cad9e7!important}
html[data-theme="light"] .company-shell .admin-main :is(.badge,.pill,.status,.as-status):is(.active,.success,.completed,.approved,.status-active,.status-completed,.status-approved){background:#e4f5ee!important;color:#12654f!important;border-color:#a8d9c4!important}
html[data-theme="light"] .company-shell .admin-main :is(.badge,.pill,.status,.as-status):is(.inactive,.failed,.rejected,.status-inactive,.status-failed){background:#fff0f2!important;color:#a9223d!important;border-color:#e7a6b5!important}
html[data-theme="light"] .company-shell .admin-main :is(.badge,.pill,.status,.as-status):is(.pending,.warning,.status-pending){background:#fff5df!important;color:#78520b!important;border-color:#e5cb89!important}
html[data-theme="light"] .company-shell .admin-main :is(.badge,.pill,.status,.as-status) :is(b,strong,span,small){color:inherit!important}
html[data-theme="light"] .company-shell .admin-main :is(.contract-tabs,.recruitment-tabs,.onboarding-lifecycle-tabs,.perf-local-tabs,.employee-module-tabs,.hr-tabs,.as-settings-tabs) :is(a,button):not(.active):not([aria-selected="true"]):not([aria-pressed="true"]){color:#355573!important}
html[data-theme="light"] .company-shell .admin-main :is(.contract-tabs,.recruitment-tabs,.onboarding-lifecycle-tabs,.perf-local-tabs,.employee-module-tabs,.hr-tabs,.as-settings-tabs) :is(.active,[aria-selected="true"],[aria-pressed="true"]){background:#e0ecfb!important;color:#174f97!important;border-color:#a9c9ee!important}
html[data-theme="light"] .company-shell .admin-main :is(.contract-tabs,.recruitment-tabs,.onboarding-lifecycle-tabs,.perf-local-tabs,.employee-module-tabs,.hr-tabs,.as-settings-tabs) :is(.active,[aria-selected="true"],[aria-pressed="true"]) :is(b,span,svg){color:inherit!important}

/* Shared modal and form layer, including dialogs mounted outside admin-main. */
html[data-theme="light"] .company-shell :is(dialog,.employee-modal,.onboarding-modal,.as-modal,.settings-dialog,.leave-dialog,.learning-dialog,.sm-modal,.perf-modal,.sv-modal,[role="dialog"]){
  background:var(--light-surface)!important;color:var(--light-ink)!important;border-color:var(--light-border)!important;
}
html[data-theme="light"] .company-shell :is(dialog,.employee-modal,.onboarding-modal,.as-modal,.settings-dialog,.leave-dialog,.learning-dialog,.sm-modal,.perf-modal,.sv-modal,[role="dialog"])>header,
html[data-theme="light"] .company-shell dialog .dialog-form>header{
  background:#e8f0f8!important;color:var(--light-ink)!important;border-color:var(--light-border)!important;
}
html[data-theme="light"] .company-shell :is(.employee-modal,.onboarding-modal,.as-modal,.settings-dialog,.leave-dialog,.learning-dialog,.sm-modal,.perf-modal,.sv-modal,[role="dialog"])>header :is(h1,h2,h3,strong,b,p,small){color:var(--light-ink)!important}
html[data-theme="light"] .company-shell :is(.employee-modal,.onboarding-modal,.as-modal,.settings-dialog,.leave-dialog,.learning-dialog,.sm-modal,.perf-modal,.sv-modal,[role="dialog"]) :is(input,select,textarea){background:#fff!important;color:var(--light-ink)!important;border-color:#adbed2!important;color-scheme:light}
html[data-theme="light"] .company-shell :is(.employee-modal,.onboarding-modal,.as-modal,.settings-dialog,.leave-dialog,.learning-dialog,.sm-modal,.perf-modal,.sv-modal,[role="dialog"]) :is(label,legend){color:#36516d!important}
html[data-theme="light"] .company-shell :is(.employee-modal,.onboarding-modal,.as-modal,.settings-dialog,.leave-dialog,.learning-dialog,.sm-modal,.perf-modal,.sv-modal,[role="dialog"]) :is(button[data-details-close],button[aria-label="Close"]){background:#fff!important;color:#284b70!important;border-color:#bdccdc!important}

/* Employee add/edit tabs and the independent resume overlay. */
html[data-theme="light"] .employee-modal>header :is(h1,h2,h3){color:#17324f!important}
html[data-theme="light"] .employee-modal .profile-tabs :is(button,a):not(.active):not([aria-selected="true"]){background:#edf3fa!important;color:#24527e!important;border-color:#c7d6e6!important}
html[data-theme="light"] .employee-modal .profile-tabs :is(.active,[aria-selected="true"]){background:#dceafa!important;color:#174f97!important;border-color:#9abde9!important}
html[data-theme="light"] .employee-profile-sheet.employee-resume{background:#f5f8fc!important;color:#17324f!important;border-color:#c2d1e1!important}
html[data-theme="light"] .employee-resume .employee-profile-sheet-header{background:linear-gradient(120deg,#e4f1f0,#eef0fa)!important;border-color:#bdd4df!important}
html[data-theme="light"] .employee-resume .employee-profile-identity :is(h2,p,small){color:#17324f!important}
html[data-theme="light"] .employee-resume :is(.employee-resume-sidebar,.employee-resume-main){background:#f5f8fc!important;color:#17324f!important;border-color:#d4e0ec!important}
html[data-theme="light"] .employee-resume :is(.employee-resume-side-section,.employee-profile-section,.employee-profile-records article){background:#fbfcfe!important;color:#17324f!important;border-color:#d2dfeb!important}
html[data-theme="light"] .employee-resume :is(.employee-profile-facts>div,.employee-resume-contact>div,.employee-resume-documents>a){background:#fff!important;color:#17324f!important;border:1px solid #d0ddeb!important}
html[data-theme="light"] .employee-resume :is(.employee-profile-facts dt,.employee-profile-records small){color:#5a7189!important}
html[data-theme="light"] .employee-resume :is(.employee-profile-facts dd,.employee-profile-records b,.employee-profile-records strong){color:#17324f!important}
html[data-theme="light"] .employee-resume :is(.employee-resume-side-section>h3,.employee-resume-main .employee-profile-section>h3){background:#dceafa!important;color:#173f70!important;border-color:#b7cfe8!important}
html[data-theme="light"] .employee-resume .employee-profile-toolbar>button{background:#edf3fa!important;color:#214f7c!important;border-color:#b7cce0!important}
html[data-theme="light"] .employee-resume .employee-profile-toolbar>button :is(svg,span){color:inherit!important}

/* Recruitment: statuses and selected cards must retain readable text. */
html[data-theme="light"] .module-recruitment :is(.ats-card.status-shortlisted,.resume-intake-card.status-shortlisted){background:#eaf7f1!important;border-color:#79c3a2!important;color:#174b3c!important}
html[data-theme="light"] .module-recruitment :is(.ats-card-status,.status-shortlisted .shortlist,.status-shortlisted>span){background:#dcf3e7!important;color:#12654f!important;border:1px solid #9dd4ba!important}
html[data-theme="light"] .module-recruitment .ats-card.status-shortlisted :is(b,strong,span,small){color:#174b3c!important}
html[data-theme="light"] .module-recruitment .ats-column :is(.ats-card,.ats-card-status){min-width:0;overflow-wrap:anywhere}

/* Onboarding and organization retain semantic step colors without dark islands. */
html[data-theme="light"] .module-onboarding :is(.journey-card,.day-one-strip,.onboarding-panel,.onboarding-inbox article){background:#f9fbfd!important;color:#17324f!important;border-color:#cbd8e7!important}
html[data-theme="light"] .module-onboarding .journey-card-actions :is(button,form button){background:#edf3fa!important;color:#225583!important;border-color:#b9cde2!important}
html[data-theme="light"] .module-onboarding .journey-card-actions :is(button.danger,form button.danger){background:#fff0f2!important;color:#a9223d!important;border-color:#e7a6b5!important}
html[data-theme="light"] .module-onboarding .onboarding-status{background:#fff5df!important;color:#78520b!important;border:1px solid #e5cb89!important}
html[data-theme="light"] .module-onboarding .onboarding-status.completed{background:#e4f5ee!important;color:#12654f!important;border-color:#a8d9c4!important}
html[data-theme="light"] .module-onboarding .journey-line :is(.done,.active) :is(b,small){color:#17324f!important}
html[data-theme="light"] .module-organization :is(.organization-next-step,.manager-reporting-line,.organization-stage-complete){background:#e7f3f1!important;color:#21564d!important;border-color:#afcfca!important}
html[data-theme="light"] .module-organization :is(.organization-next-step,.manager-reporting-line,.organization-stage-complete) :is(b,small){color:#21564d!important}
html[data-theme="light"] .module-organization :is(.org-model-tabs,.ot-panel,.holo-map,.holo-layout){background:#f9fbfd!important;color:#17324f!important;border-color:#cbd8e7!important}
html[data-theme="light"] .module-organization :is(.org-model-tabs,.ot-panel,.holo-map) :is(a,button){color:#225583!important}

/* Settings email diagnostics: long IDs and errors wrap inside equal cards. */
html[data-theme="light"] .module-settings .as-mail-settings{background:#f9fbfd!important;color:#17324f!important;border-color:#cbd8e7!important}
html[data-theme="light"] .module-settings :is(.as-mail-smtp,.as-mail-test,.as-mail-queues){background:#edf3f9!important;color:#17324f!important;border-color:#c4d5e5!important}
html[data-theme="light"] .module-settings .as-mail-queues article{background:#fff!important;color:#17324f!important;border-color:#c8d9e8!important}
html[data-theme="light"] .module-settings .as-mail-queues article :is(span,small){color:#4f6882!important;overflow-wrap:anywhere}
html[data-theme="light"] .module-settings .as-mail-queues article.has-error{border-color:#e7a6b5!important;background:#fff8f9!important}
html[data-theme="light"] .module-settings .as-mail-queues article.has-error small{color:#a9223d!important}

@media(max-width:850px){
  html[data-theme="light"] .employee-resume .employee-profile-sheet-body{grid-template-columns:1fr}
  html[data-theme="light"] .company-shell .admin-main :is(.as-mail-queues,.as-mail-settings){min-width:0;max-width:100%}
}
}
