/* PESO feedback review — targeted cross-role readability and responsive fixes. */
/* Logout remains distinct and legible instead of white text on a pale tint. */
html body[data-peso-page] #dashboardSidebar .dashboard-sidebar-logout {
  background: #fff0f0 !important;
  border: 1px solid #e9b5b5 !important;
  color: #9b1c1c !important;
  -webkit-text-fill-color: #9b1c1c !important;
  opacity: 1 !important;
}
html body[data-peso-page] #dashboardSidebar .dashboard-sidebar-logout :is(span,i) { color: inherit !important; -webkit-text-fill-color: inherit !important; opacity: 1 !important; }
html body[data-peso-page] #dashboardSidebar .dashboard-sidebar-logout:hover { background: #ffe0e0 !important; }
html[data-theme='dark'] body[data-peso-page] #dashboardSidebar .dashboard-sidebar-logout,
html body.dark-mode[data-peso-page] #dashboardSidebar .dashboard-sidebar-logout {
  background: #391b20 !important;
  border-color: #84434b !important;
  color: #ffd5d9 !important;
  -webkit-text-fill-color: #ffd5d9 !important;
}
html[data-theme='dark'] body[data-peso-page] #dashboardSidebar .dashboard-sidebar-logout:hover,
html body.dark-mode[data-peso-page] #dashboardSidebar .dashboard-sidebar-logout:hover { background: #52262e !important; }
html body[data-peso-page] #dashboardSidebar .dashboard-sidebar-logout:focus-visible { outline: 3px solid #ba6a21 !important; outline-offset: 3px; }
html body[data-peso-page='jobseeker-announcements'] #cardsGrid > .card[hidden] { display: none !important; }

/* Reschedule actions retain contrast across theme and request states. */
html body #rescheduleModal #submitReschedule,
html body #rescheduleModal #submitReschedule :is(span,i) {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  opacity: 1 !important;
  text-shadow: none !important;
}
html body #rescheduleModal #submitReschedule {
  background: #087443 !important;
  border: 1px solid #087443 !important;
  font-size: .875rem !important;
  font-weight: 700 !important;
  min-height: 46px !important;
}
html body #rescheduleModal #submitReschedule:hover:not(:disabled) { background: #065a34 !important; }
html body #rescheduleModal #submitReschedule:disabled { background: #455c51 !important; border-color: #455c51 !important; opacity: 1 !important; cursor: wait; }
html body #rescheduleModal #cancelReschedule {
  background: #f0f6f3 !important;
  border: 1px solid #b3cabe !important;
  color: #173c2c !important;
  -webkit-text-fill-color: #173c2c !important;
  opacity: 1 !important;
  font-size: .875rem !important;
  font-weight: 600 !important;
  min-height: 46px !important;
}
html body #rescheduleModal #cancelReschedule:hover { background: #dfece5 !important; }
html body #rescheduleModal .reschedule-actions button:focus-visible { outline: 3px solid #c69a16 !important; outline-offset: 3px; }

/* Calendar details: constrain the shell, scroll only the schedule body. */
html body[data-peso-page='jobseeker-calendar'] #interviewModal > .modal-content {
  display: flex !important;
  flex-direction: column !important;
  width: min(840px, calc(100vw - 24px)) !important;
  max-width: 840px !important;
  max-height: calc(100dvh - 32px) !important;
  overflow: hidden !important;
  padding: 0 !important;
  border-radius: 18px !important;
}
html body[data-peso-page='jobseeker-calendar'] #interviewModal .modal-header {
  flex: 0 0 auto;
  padding: 18px 22px !important;
  gap: 14px;
  background: #075338 !important;
}
html body #interviewModal .modal-header :is(h3,.calendar-detail-eyebrow) { color: #fff !important; -webkit-text-fill-color: #fff !important; }
html body #interviewModal .calendar-detail-eyebrow { display: block; font-size: .65rem; letter-spacing: .09em; text-transform: uppercase; margin-bottom: 5px; }
html body #interviewModal .calendar-detail-layout { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(0,1fr); gap: 24px; }
html body #interviewModal .interview-details { min-width: 0; gap: 0 !important; }
html body #interviewModal .calendar-detail-guidance { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 14px; padding: 18px; min-width: 0; }
html body #interviewModal .calendar-detail-office { display: grid; justify-items: center; text-align: center; gap: 7px; padding-bottom: 18px; border-bottom: 1px solid var(--card-border); }
html body #interviewModal .calendar-detail-office > i { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; background: #e1f1e9; color: #075338; -webkit-text-fill-color: #075338; font-size: 1.2rem; }
html body #interviewModal .calendar-detail-office span { font-size: .75rem; color: var(--text-secondary); }
html body #interviewModal .calendar-detail-tip { display: flex; gap: 10px; margin-top: 18px; }
html body #interviewModal .calendar-detail-tip > i { flex: 0 0 18px; margin-top: 4px; color: var(--accent); }
html body #interviewModal .calendar-detail-tip strong { font-size: .8rem; }
html body #interviewModal .calendar-detail-tip p { font-size: .78rem; line-height: 1.65; margin: 5px 0 0; }
html body #interviewModal .calendar-detail-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--card-border); margin-top: 22px; padding-top: 16px; }
html body #interviewModal .calendar-detail-dismiss { border: 1px solid var(--card-border); background: var(--card-bg); color: var(--text-primary); border-radius: 10px; padding: 10px 20px; min-height: 44px; cursor: pointer; }
html body #interviewModal .calendar-detail-footer #modalViewApplicationBtn { margin: 0 !important; width: auto !important; }
html body #interviewModal .calendar-detail-footer #jobFairActions { margin-top: 0 !important; }
@media (max-width: 640px) {
  html body #interviewModal .calendar-detail-layout { grid-template-columns: minmax(0,1fr); gap: 18px; }
  html body #interviewModal .calendar-detail-footer > :is(a,button) { width: 100% !important; text-align: center; }
}
html body[data-peso-page='jobseeker-calendar'] #interviewModal .modal-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 20px 22px !important;
}
html body[data-peso-page='jobseeker-calendar'] #interviewModal .detail-row {
  display: grid !important;
  grid-template-columns: minmax(120px, .7fr) minmax(0, 1fr) !important;
  gap: 10px 16px !important;
  padding: 12px 0 !important;
  border-bottom: 1px solid var(--card-border);
}
html body[data-peso-page='jobseeker-calendar'] #interviewModal :is(.detail-value,.detail-label) {
  min-width: 0 !important;
  width: auto !important;
  overflow-wrap: anywhere;
  font-family: 'Plus Jakarta Sans', Arial, sans-serif !important;
  font-size: .875rem !important;
  line-height: 1.6 !important;
}
html body[data-peso-page='jobseeker-calendar'] #interviewModal .modal-close-btn { flex: 0 0 40px; width: 40px !important; height: 40px !important; }
html body[data-peso-page='employer-calendar'] #dateModal > .modal-content {
  max-height: calc(100dvh - 32px) !important;
  overflow-y: auto !important;
  width: min(640px, calc(100vw - 24px)) !important;
  box-sizing: border-box;
}
@media (max-width: 480px) {
  html body[data-peso-page='jobseeker-calendar'] #interviewModal .detail-row { grid-template-columns: minmax(0, 1fr) !important; gap: 4px !important; }
  html body[data-peso-page='jobseeker-calendar'] #interviewModal :is(.modal-body,.modal-header) { padding: 16px !important; }
}

/* Application form: explicit warning contrast and restrained portal typography. */
html body #applyModal .modal-content {
  font-family: 'Plus Jakarta Sans', Arial, sans-serif !important;
  width: min(560px, calc(100vw - 24px)) !important;
  max-height: calc(100dvh - 32px) !important;
  overflow-y: auto !important;
  padding: 24px !important;
  box-sizing: border-box;
}
html body #applyModal :is(h3,label,input,textarea,button,small,p,strong,em,a) {
  font-family: 'Plus Jakarta Sans', Arial, sans-serif !important;
  letter-spacing: normal !important;
}
html body #applyModal .modal-header {
  background: transparent !important;
  padding: 0 0 16px !important;
  border-bottom: 1px solid var(--card-border) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between;
  gap: 16px;
}
html body #applyModal .modal-header h3 { font-size: 1.15rem !important; font-weight: 700 !important; line-height: 1.45 !important; margin: 0 !important; }
html body #applyModal .modal-close { position: static !important; flex: 0 0 40px; width: 40px !important; height: 40px !important; padding: 0 !important; }
html body #applyModal #lowMatchWarning {
  background: #fff3cd !important;
  color: #624400 !important;
  border: 1px solid #e5c56d !important;
  border-left: 4px solid #b78103 !important;
  padding: 16px !important;
  border-radius: 12px !important;
  margin: 18px 0 !important;
}
html body #applyModal #lowMatchWarning,
html body #applyModal #lowMatchWarning :is(strong,p,i) {
  color: #624400 !important;
  -webkit-text-fill-color: #624400 !important;
  opacity: 1 !important;
  text-shadow: none !important;
  font-size: .875rem !important;
  line-height: 1.65 !important;
}
html body #applyModal #lowMatchWarning strong { font-weight: 700 !important; }
html body #applyModal .form-group > label { font-size: .875rem !important; font-weight: 600 !important; line-height: 1.5 !important; }
html body #applyModal .apply-resume-opt {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  padding: 13px 14px !important;
  font-size: .875rem !important;
  font-weight: 600 !important;
}
html body #applyModal .apply-resume-opt::before { display: none !important; content: none !important; }
html body #applyModal .apply-resume-opt input { position: static !important; opacity: 1 !important; pointer-events: auto !important; appearance: auto !important; flex: 0 0 18px; width: 18px !important; height: 18px !important; min-height: 18px !important; padding: 0 !important; margin: 3px 0 0 !important; accent-color: #0b9560; }
html body #applyModal .apply-resume-opt span { min-width: 0; line-height: 1.55; }
html body #applyModal .apply-resume-opt em { display: block; margin-top: 3px; font-style: normal !important; font-size: .8rem !important; font-weight: 400 !important; color: var(--text-secondary) !important; }
html body #applyModal :is(textarea,input[type='number']) { font-size: .9375rem !important; line-height: 1.6 !important; font-weight: 400 !important; width: 100%; box-sizing: border-box; }
html body #applyModal small { font-size: .8rem !important; line-height: 1.6 !important; }
html body #applyModal .modal-actions { background: transparent !important; gap: 12px !important; }
html body #applyModal .modal-actions button { min-height: 46px; font-size: .875rem !important; font-weight: 600 !important; }
html body #applyModal #submitApply { background: #087443 !important; color: #fff !important; opacity: 1 !important; }
@media (max-width: 480px) {
  html body #applyModal .modal-content { padding: 18px !important; }
  html body #applyModal .modal-actions { display: grid !important; grid-template-columns: 1fr !important; }
  html body #applyModal .modal-actions button { width: 100% !important; }
}

/* Never let action labels or compact KPI values inherit a low-contrast tone. */
html[data-theme='dark'] body :is(.apply-btn, .btn-primary, .primary-btn, .submit-btn),
body.dark-mode :is(.apply-btn, .btn-primary, .primary-btn, .submit-btn),
body.jsa-dark :is(.apply-btn, .btn-primary, .primary-btn, .submit-btn) {
  color: #fff !important;
}

html[data-theme='dark'] body :is(.stat-number, .metric-value, .summary-value, .count-number),
body.dark-mode :is(.stat-number, .metric-value, .summary-value, .count-number),
body.jsa-dark :is(.stat-number, .metric-value, .summary-value, .count-number) {
  color: #f7fff9 !important;
}

/* Dialogs keep one readable surface in both themes; the header does not use
   selection-like highlighting and secondary actions remain clearly neutral. */
html[data-theme='dark'] body .modal-content,
body.dark-mode .modal-content,
body.jsa-dark .modal-content {
  color: #eaf7ef;
}
html[data-theme='dark'] body .modal-content :is(h1,h2,h3,h4,label,strong,.modal-title),
body.dark-mode .modal-content :is(h1,h2,h3,h4,label,strong,.modal-title),
body.jsa-dark .modal-content :is(h1,h2,h3,h4,label,strong,.modal-title) {
  color: #f7fff9 !important;
  background: transparent !important;
}
html[data-theme='dark'] body .modal-content :is(p,small,.help-text,.form-text),
body.dark-mode .modal-content :is(p,small,.help-text,.form-text),
body.jsa-dark .modal-content :is(p,small,.help-text,.form-text) {
  color: #bed3c6 !important;
}
html[data-theme='dark'] body .modal-content :is(.btn-secondary,.cancel-btn),
body.dark-mode .modal-content :is(.btn-secondary,.cancel-btn),
body.jsa-dark .modal-content :is(.btn-secondary,.cancel-btn) {
  color: #eaf7ef !important;
  background: #173c2e !important;
  border-color: #47725f !important;
}

/* Employer controls and navigation must shrink/wrap without disappearing. */
@media (max-width: 900px) {
  body[data-peso-page^='employer-'] :is(.navbar,.navbar-container,.nav-container,.header-container) {
    min-width: 0 !important;
    max-width: 100% !important;
  }
  body[data-peso-page^='employer-'] :is(.navbar-menu,.nav-links,.header-actions,.navbar-actions) {
    flex-wrap: wrap !important;
    min-width: 0 !important;
  }
  body[data-peso-page^='employer-'] :is(.nav-link,.header-action,.icon-btn) {
    flex: 0 0 auto;
  }
}

/* Related vacancies follow employer preferences on desktop, main content on mobile. */
body[data-peso-page='job-details'] .js-related-jobs-card .related-jobs-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
html body[data-peso-page='job-details'] .js-job-details-sidebar .js-company-overview-card { order: 1 !important; }
html body[data-peso-page='job-details'] .js-job-details-sidebar .js-candidate-preferences { order: 2 !important; }
html body[data-peso-page='job-details'] .js-job-details-sidebar .js-related-jobs-card { order: 3 !important; min-width: 0; }
body[data-peso-page='job-details'] .js-job-details-sidebar .related-job-title-sm { white-space: normal; overflow-wrap: anywhere; }
body[data-peso-page='job-details'] .js-job-details-sidebar .related-job-meta-sm { flex-wrap: wrap; gap: 4px 10px; }
body[data-peso-page='job-details'] .js-job-details-sidebar .related-job-item { min-width: 0; gap: 10px; }
body[data-peso-page='job-details'] .js-job-details-sidebar .js-related-jobs-card .section-title { font-size: 1.15rem; }
@media (max-width: 680px) {
  body[data-peso-page='job-details'] .js-related-jobs-card .related-jobs-list { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  html body[data-peso-page='job-details'] .js-job-details-grid > .js-related-jobs-card {
    grid-column: 1 / -1 !important;
    order: 99 !important;
    width: 100%;
    min-width: 0;
    margin: 0 !important;
  }
  body[data-peso-page='job-details'] .js-related-jobs-card .related-job-title-sm { white-space: normal; overflow-wrap: anywhere; }
  body[data-peso-page='job-details'] .js-related-jobs-card .related-job-meta-sm { flex-wrap: wrap; }
}

/* Password reveal buttons and compact icon-only actions stay optically centered. */
:is([data-pw-toggle],.password-toggle,.toggle-password) {
  display: inline-grid !important;
  place-items: center !important;
  line-height: 1 !important;
}
:is([data-pw-toggle],.password-toggle,.toggle-password) > i { margin: 0 !important; }

/* Helpdesk text on the green treatment must remain readable. */
body[data-peso-page='admin-helpdesk'] :is(.helpdesk-hero,.helpdesk-summary,.support-hero,.support-summary) :is(h1,h2,h3,p,span,small,a) {
  color: #fff !important;
}

body[data-peso-page='admin-walkins'] .walkin-required-badge {
  background: #087443 !important;
  color: #fff !important;
  font-size: 10.5px !important;
}

body[data-peso-page^='admin-'] :is(.admin-sidebar small, .sidebar small, .sidebar-section-label, .admin-kicker) {
  font-size: max(10.5px, .68rem) !important;
}

body[data-peso-page^='admin-'] .admin-topbar-heading > span {
  font-size: max(10.5px, .68rem) !important;
}

body[data-peso-page^='admin-'] .notif-badge {
  min-width: 20px;
  font-size: 10.5px !important;
}

body.light[data-peso-page='admin-support'] .sup-badge--open {
  color: #704900 !important;
  background: #fff3cf !important;
  border-color: #d6a321 !important;
}

html[data-theme='dark'] body.auth-page .auth-label-row a,
body.auth-page.dark-mode .auth-label-row a,
html[data-theme='dark'] body[data-peso-page='jobseeker-register'] :is(.registration-back, .login-link a),
body[data-peso-page='jobseeker-register'].dark-mode :is(.registration-back, .login-link a) {
  color: #8ce6b8 !important;
  text-decoration-color: currentColor !important;
}

html[data-theme='dark'] body[data-peso-page='jobseeker-register'] .registration-brand strong,
body[data-peso-page='jobseeker-register'].dark-mode .registration-brand strong {
  color: #f4fff8 !important;
}
html[data-theme='dark'] body[data-peso-page='jobseeker-register'] :is(.registration-brand small, .registration-theme-toggle),
body[data-peso-page='jobseeker-register'].dark-mode :is(.registration-brand small, .registration-theme-toggle) {
  color: #c3ddcf !important;
}

body[data-peso-page='index'] :is(.alive-job-category, .alive-update-badge, .alive-tool__idx, .alive-float-job__type),
body[data-peso-page='employer-index'] :is(.alive-update-badge, .alive-employer-card small),
body[data-peso-page='admin-login'] .auth-login-identity small {
  font-size: max(10.5px, .68rem) !important;
}

html[data-theme='dark'] body .pagination-btn.disabled,
body.dark-mode .pagination-btn.disabled,
body:not(.light)[data-peso-page^='admin-'] .pagination-btn.disabled {
  color: #b9d4c4 !important;
  opacity: .78 !important;
}

@media (max-width: 560px) {
  .registration-step-actions--final { grid-template-columns: 1fr !important; }
  .registration-step-actions--final > :is(.registration-step-button,.btn-submit) { width: 100% !important; }
}
