:root {
  --portal-sidebar-width: 240px;
  --portal-sidebar-collapsed: 74px;
}

body {
  background: #f5f8fb;
  color: #2d3440;
  overflow-x: hidden;
}

.portal-sidebar {
  width: var(--portal-sidebar-width);
  padding: 28px 18px 24px;
  gap: 28px;
  background: #29384a;
  color: #d7e1eb;
}

body:not(.portal-menu-expanded) { --portal-sidebar-width: var(--portal-sidebar-collapsed); }
.portal-brand { min-height: 40px; justify-content: flex-start; padding: 0 12px; }
.portal-brand strong { color: #fff; font-size: 19px; letter-spacing: .03em; }
.portal-menu-expanded .portal-brand strong { width: auto; opacity: 1; overflow: visible; }
.portal-sidebar nav { gap: 8px; overflow: visible; }
.portal-nav-item {
  min-height: 54px;
  height: 54px;
  flex: 0 0 54px;
  padding: 0 14px;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #d7e1eb;
  font-size: 14px;
  font-weight: 700;
}
.portal-nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.portal-nav-item.is-active { background: #3a4c5f; border-color: #61768b; color: #fff; }
.portal-nav-icon { width: 20px; height: 20px; flex-basis: 20px; }
.portal-nav-icon .ceo-icon { width: 20px; height: 20px; }
.portal-menu-expanded .portal-nav-item { justify-content: flex-start; }
.portal-menu-toggle {
  top: 28px;
  right: -20px;
  width: 40px;
  height: 40px;
  border: 1px solid #d5dee7;
  border-radius: 50%;
  background: #fff;
  color: #29384a;
  box-shadow: 0 2px 0 #becbd7, 0 8px 20px rgba(41,56,74,.10);
}
.portal-menu-toggle .ceo-icon { width: 18px; height: 18px; }
.portal-sidebar > small {
  width: auto;
  margin-top: auto;
  padding: 18px 12px 0;
  border-top: 1px solid rgba(255,255,255,.18);
  color: #aebecb;
  opacity: 1;
}

.portal-header {
  min-height: 84px;
  height: 84px;
  box-sizing: border-box;
  padding: 16px 32px;
  background: #f5f8fb;
  color: #2d3440;
  border-bottom: 1px solid #d5dee7;
}
.login-header-copy, .login-header-title { display: none; }
.portal-session-heading { display: block; }
.portal-header p { margin: 0 0 2px; color: #718497; font-size: 11px; letter-spacing: .15em; }
.portal-header h1 { margin: 0; font-size: 27px; line-height: 1.4; }
.portal-header nav button { min-height: 36px; padding: 0 14px; border: 1px solid #d5dee7; border-radius: 8px; background: #fff; color: #496682; box-shadow: 0 2px 0 #becbd7; }
.portal-header nav span { color: #2d3440; font-size: 14px; }
body.portal-active .portal-header { margin-left: var(--portal-sidebar-width); }

main { width: min(1180px, calc(100% - 32px)); margin: 20px auto 32px; }
body.portal-active main { width: auto; max-width: 1180px; margin: 20px 16px 32px calc(var(--portal-sidebar-width) + 32px); }

.login-card, .salary-console, .workspace-console {
  border: 1px solid #d5dee7;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 3px 0 #dbe3ea, 0 10px 28px rgba(41,56,74,.08);
}
.login-card { width: min(804px, 100%); max-width: 804px; min-height: 496px; margin: 105px auto 0; padding: 0; display: grid; grid-template-columns: 287px minmax(0, 1fr); overflow: hidden; }
.login-intro { display: flex; flex-direction: column; min-width: 0; padding: 38px 35px 26px; background: #29384a; color: #fff; }
.login-brand { color: #fff; font-size: 19px; letter-spacing: .03em; }
.login-intro-copy { margin-top: 126px; }
.login-intro .eyebrow { color: #aebecb; }
.login-intro h2 { margin: 7px 0 14px; color: #fff; font-size: 27px; line-height: 1.35; }
.login-intro-copy > p:last-child { margin: 0; color: #d7e1eb; font-size: 12px; line-height: 1.75; }
.login-security { display: flex; align-items: center; gap: 8px; margin: auto 0 0; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.18); color: #d7e1eb; font-size: 10px; }
.login-security .ceo-icon { width: 13px; height: 13px; }
.login-form-panel { min-width: 0; padding: 42px 88px 25px; background: #fff; }
.login-form-heading .eyebrow { margin-bottom: 5px; color: #29384a; }
.login-form-heading h2 { margin: 0 0 7px; color: #2d3440; font-size: 25px; line-height: 1.4; }
.login-form-heading > p:last-child { margin: 0; color: #718497; font-size: 10px; line-height: 1.55; white-space: nowrap; }
.login-card form { gap: 12px; margin-top: 22px; }
.login-card form label { gap: 5px; color: #2d3440; font-size: 11px; }
.login-input-wrap { position: relative; display: block; }
.login-input-wrap > span { position: absolute; top: 50%; left: 12px; z-index: 1; width: 16px; height: 16px; color: #496682; transform: translateY(-50%); }
.login-input-wrap .ceo-icon { width: 16px; height: 16px; }
.login-card input { min-height: 40px; height: 40px; padding: 8px 12px 8px 38px; font-size: 11px; }
.login-card form .primary { width: 100%; min-height: 40px; height: 40px; margin-top: 4px; padding: 0 18px; border-radius: 8px; background: #29384a; box-shadow: 0 2px 0 #152231; font-size: 12px; }
.login-help { display: flex; align-items: flex-start; gap: 10px; margin: 16px 0 0; padding: 11px 12px; border: 1px solid #d5dee7; border-radius: 8px; background: #f8fafc; color: #2d3440; font-size: 10px; line-height: 1.5; }
.login-help > span { flex: 0 0 15px; width: 15px; height: 15px; color: #496682; }
.login-help .ceo-icon { width: 15px; height: 15px; }
.login-help strong { display: block; margin-bottom: 2px; }
.login-help p { margin: 0; color: #718497; }
.login-card .message { min-height: 16px; margin: 4px 0 0; font-size: 10px; }
.login-disclaimer { margin: 0; color: #8a99a8; font-size: 8px; text-align: center; }
body:not(.portal-active) .portal-header { display: none; }
body:not(.portal-active) .portal-session-heading { display: none; }
body:not(.portal-active) .login-header-copy, body:not(.portal-active) .login-header-title { display: block; color: #fff; font-size: 16px; font-weight: 500; }
body:not(.portal-active) .login-header-title { position: absolute; left: 50%; transform: translateX(-50%); }
body:not(.portal-active) main { width: min(1052px, calc(100% - 32px)); min-height: 700px; margin: 4px auto 32px; border: 0; border-radius: 0; background: transparent; }
.eyebrow { color: #718497; font-size: 11px; letter-spacing: .15em; }
label { color: #2d3440; }
input, select, textarea { border-color: #d5dee7; border-radius: 8px; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(73,102,130,.2); border-color: #496682; }

.salary-console { overflow: hidden; }
.salary-console > header { min-height: 108px; padding: 18px 22px; background: #fff; border-bottom-color: #d5dee7; }
.salary-console > header p { color: #718497; }
.salary-header-actions { align-items: flex-end; }
.salary-header-actions .primary { min-height: 40px; height: 40px; }
#saveSalaryButton {
  width: 142px;
  min-width: 142px;
  height: 40px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #29384a;
  border-radius: 8px;
  background: #29384a;
  color: #fff;
  box-shadow: 0 2px 0 #172330;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}
#saveSalaryButton .ceo-icon { width: 18px; height: 18px; }
#saveSalaryButton:not(:disabled):hover { background: #34475b; border-color: #34475b; }
#saveSalaryButton:not(:disabled):active { transform: translateY(2px); box-shadow: none; }
#saveSalaryButton:disabled { cursor: wait; opacity: .55; transform: none; box-shadow: none; }
.salary-console > header label { width: 180px; color: #2d3440; font-size: 13px; }
.salary-console > header input { min-height: 40px; height: 40px; }
body.portal-active #workerTypeTabs {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center !important;
  gap: 8px !important;
  width: auto !important;
  margin: 12px 16px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
body.portal-active #workerTypeTabs button {
  box-sizing: border-box !important;
  flex: 0 0 60px !important;
  width: 60px !important;
  min-width: 60px !important;
  max-width: 60px !important;
  height: 29px !important;
  min-height: 29px !important;
  max-height: 29px !important;
  margin: 0 !important;
  padding: 0 6px !important;
  border: 1px solid #d5dee7 !important;
  border-radius: 8px !important;
  background: linear-gradient(#fff, #f6f9fc) !important;
  color: #496682 !important;
  box-shadow: 0 2px 0 #becbd7 !important;
  font-size: 12px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}
body.portal-active #workerTypeTabs button:hover {
  border-color: #9fb0c0 !important;
  background: #edf2f7 !important;
  color: #29384a !important;
}
body.portal-active #workerTypeTabs button.is-active {
  border-color: #61768b !important;
  background: #edf2f7 !important;
  color: #29384a !important;
}
body.portal-active #workerTypeTabs button:active {
  transform: translateY(2px) !important;
  box-shadow: none !important;
}
.salary-console th { background: #edf2f7; color: #496682; }
.salary-console th:first-child { background: #edf2f7; }
.salary-console td:first-child { background: #fff; }
.salary-console footer { min-height: 48px; padding: 10px 22px; }

.workspace-console { padding: 20px 22px 26px; }
.section-copy { color: #718497; font-size: 13px; }
.event-filter-head { padding-bottom: 16px; border-bottom: 1px solid #d5dee7; }
.event-filter-head > div:first-child { flex: 1 1 auto; min-width: 0; }
.event-status-tabs, .event-type-stats, .category-tabs { gap: 8px; }
.event-status-tabs { margin-bottom: 10px; }
.event-type-stats { margin-bottom: 0; padding-top: 10px; border-top: 1px solid #d5dee7; }
.page-message:empty { display: none; }
.event-status-tab, .event-type-stat, .category-tab, .event-preview-button {
  min-height: 36px !important;
  height: 36px;
  padding: 0 14px !important;
  border: 1px solid #d5dee7 !important;
  border-radius: 8px !important;
  background: #fff !important;
  color: #496682 !important;
  box-shadow: 0 2px 0 #becbd7;
}
.event-status-tab.active, .event-type-stat.active, .category-tab.active, .event-preview-button.active { background: #29384a !important; color: #fff !important; border-color: #29384a !important; }
.event-header-actions { flex: 0 0 auto; align-items: center; }
.event-header-actions > button { min-height: 36px !important; height: 36px; padding: 0 14px; }
#openDeletedEvents {
  width: auto;
  min-width: 142px;
  min-height: 40px !important;
  height: 40px !important;
  padding: 0 14px !important;
  gap: 7px;
  overflow: visible;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}
#openDeletedEvents .ceo-icon { width: 18px; height: 18px; }
.event-preview-nav { margin-top: 0; }
.event-list { grid-auto-columns: calc((100% - 18px) / 2); gap: 18px; }
.event-card { min-height: 520px; padding: 18px; border-top: 3px solid #496682; border-radius: 12px; color: #2d3440; }
.event-card h3 { color: #2d3440; font-size: 20px; }
.event-description { color: #718497; }
.event-card-tools { top: 14px; right: 14px; gap: 8px; }
.icon-button, .event-card-tools .icon-button, .milestone-card-tools .icon-button { width: 38px !important; min-width: 38px; height: 38px !important; min-height: 38px !important; padding: 0 !important; }
.icon-button .ceo-icon { width: 18px; height: 18px; }
.event-type-pill, .todo-work-type, .readonly-badge, .milestone-completed-date { border-radius: 8px; }
.event-progress { height: 12px !important; margin: 8px 0 12px; }
.event-subtasks { padding: 0; gap: 0; border: 1px solid #d5dee7; border-radius: 8px; background: #fff; overflow: auto; }
.event-subtask-row { min-height: 48px; padding: 8px 10px; border: 0; border-bottom: 1px solid #d5dee7; border-radius: 0; background: #fff; }
.event-subtask-row:last-child { border-bottom: 0; }
.event-subtask-row input[type="checkbox"] { appearance: none; display: grid; place-content: center; width: 20px; height: 20px; border: 1px solid #9fb2c5; border-radius: 5px; background: #fff; }
.event-subtask-row input[type="checkbox"]:checked { border-color: #29384a; background: #29384a; }
.event-subtask-row input[type="checkbox"]:checked::after { content: ""; width: 9px; height: 5px; border: solid #fff; border-width: 0 0 2px 2px; transform: rotate(-45deg) translate(1px,-1px); }
.add-event-todo { grid-template-columns: minmax(180px,1fr) 40px; gap: 8px; padding: 0; margin-top: 10px; border: 0; background: transparent; }
.add-event-todo input, .add-event-todo button { height: 40px !important; min-height: 40px !important; }
.event-actions { justify-content: flex-end; padding-top: 12px; margin-top: 0; border-top: 0; }
.event-actions button { min-height: 44px; height: 44px; }
.event-rail-next { right: -1px; width: 42px; height: 52px; border: 1px solid #d5dee7; border-radius: 8px; background: #fff; color: #29384a; box-shadow: 0 2px 0 #becbd7; }

.milestone-summary { border-color: #d5dee7; border-radius: 8px; background: #fff; }
.milestone-road { border-left-color: #d5dee7; }
.milestone-card { border-top-color: #496682; border-radius: 12px; background: #fff; }
.milestone-card:before { background: #496682; box-shadow: 0 0 0 6px #f5f8fb; }
.milestone-card .pill { background: #edf2f7 !important; color: #496682 !important; }
.milestone-actions .primary, .milestone-actions .secondary, .milestone-actions .danger { min-height: 40px; height: 40px; }

.primary, .secondary, .danger { border-radius: 8px; }
.danger { min-height: 40px; border: 1px solid #e8c9c6; background: #f6e2df; color: #a9473f; box-shadow: 0 2px 0 #dfbbb7; }
dialog { width: min(720px, calc(100% - 32px)); max-height: calc(100vh - 48px); border-radius: 12px; overflow: auto; }
dialog::backdrop { background: rgba(24,35,48,.66); backdrop-filter: blur(3px); }
dialog form, .dialog-card { padding: 26px; gap: 16px; }
dialog header { padding-bottom: 14px; border-bottom: 1px solid #d5dee7; }
dialog header [data-close-dialog] { width: 40px; min-width: 40px; height: 40px; min-height: 40px; padding: 0; }
.dialog-actions { align-items: center; gap: 10px; padding-top: 16px; border-top: 1px solid #d5dee7; }
.dialog-actions-end { justify-content: flex-end; }
.dialog-spacer { flex: 1; }
.dialog-actions button { min-height: 40px; height: 40px; padding: 0 18px; }
.deleted-event-item { border-color: #d5dee7; border-radius: 8px; }

@media (max-width: 900px) {
  :root { --portal-sidebar-width: 240px; }
  body:not(.portal-menu-expanded) { --portal-sidebar-width: 74px; }
}

/* Chapter 08 — the authenticated supervisor workspace uses the exact same
   desktop frame as the primary CEO-OS application. */
body.portal-active.portal-menu-expanded { --portal-sidebar-width: 240px; }
body.portal-active:not(.portal-menu-expanded) { --portal-sidebar-width: 74px; }

body.portal-active .login-header-copy,
body.portal-active .login-header-title { display: none !important; }

body.portal-active .portal-header {
  position: relative;
  z-index: 20;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between;
  width: auto;
  min-height: 84px !important;
  height: 84px !important;
  margin: 50px 34px 0 calc(var(--portal-sidebar-width) + 34px) !important;
  padding: 0 !important;
  overflow: visible;
  border: 0;
  background: transparent !important;
  color: #2d3440 !important;
  transition: margin-left .2s ease;
}
body.portal-active .portal-session-heading {
  position: static;
  z-index: auto;
  display: block;
  min-width: 0;
  max-width: calc(100% - 350px);
  transform: none;
}
body.portal-active .portal-session-heading .portal-eyebrow {
  margin: 0 0 7px;
  color: #718497;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: .15em;
}
body.portal-active .portal-session-heading h1 {
  margin: 0;
  color: #2d3440;
  font-size: 27px;
  line-height: 1.4;
}
body.portal-active .portal-session-heading .portal-page-subtitle {
  margin: 6px 0 0;
  overflow: hidden;
  color: #718497;
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.portal-active #sessionActions {
  position: static;
  z-index: auto;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 10px;
  transform: none;
}
body.portal-active #sessionActions[hidden] { display: none; }
body.portal-active #sessionActions button { min-height: 40px; height: 40px; }
body.portal-active .portal-month-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #718497;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
body.portal-active .portal-month-control[hidden] { display: none; }
body.portal-active .portal-month-control input {
  width: 180px;
  height: 40px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #d5dee7;
  border-radius: 8px;
  background: #fff;
  color: #2d3440;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
}
body.portal-active .portal-page-actions { display: flex; align-items: center; }
body.portal-active .portal-page-actions[hidden] { display: none; }
body.portal-active .portal-page-primary {
  width: 142px;
  min-width: 142px;
  max-width: 142px;
  padding: 0 12px !important;
  overflow: hidden;
  border: 1px solid #d5dee7;
  border-radius: 8px;
  background: #fff;
  color: #496682;
  box-shadow: 0 2px 0 #becbd7;
  font-size: 14px;
  line-height: 1;
  text-overflow: clip;
  white-space: nowrap;
}
body.portal-active .portal-sidebar {
  inset: 0 auto 0 0;
  z-index: 25;
  width: var(--portal-sidebar-width) !important;
  height: 100vh;
  padding: 44px 22px 36px !important;
  gap: 0;
}
body.portal-active .portal-brand {
  min-height: auto;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 10px 42px;
}
body.portal-active .portal-brand strong {
  color: #fff;
  font-family: var(--ceo-font-family, system-ui, sans-serif);
  font-size: 20px;
  font-style: normal;
  font-weight: 700;
  line-height: normal;
  letter-spacing: .03em;
}
body.portal-active .portal-sidebar nav {
  display: grid;
  gap: 13px;
  overflow: visible auto;
}
body.portal-active .portal-nav-item {
  min-height: 58px !important;
  height: 58px !important;
  flex-basis: 58px !important;
  padding: 14px 16px !important;
  gap: 12px;
  border-radius: 8px !important;
  font-size: 17px;
}
body.portal-active:not(.portal-menu-expanded) .portal-sidebar { padding-inline: 10px !important; }
body.portal-active:not(.portal-menu-expanded) .portal-brand { justify-content: center; padding-inline: 0; }
body.portal-active:not(.portal-menu-expanded) .portal-sidebar nav { justify-items: stretch; }
body.portal-active:not(.portal-menu-expanded) .portal-nav-item {
  justify-content: center;
  width: 100%;
  padding-inline: 0 !important;
  gap: 0;
}
body.portal-active .portal-menu-toggle {
  top: 22px;
  right: -15px;
  width: 30px !important;
  min-width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  border: 2px solid #f5f8fb;
  background: #fff;
  box-shadow: 0 2px 0 #becbd7, 0 8px 20px rgba(41,56,74,.10);
}
body.portal-active .portal-menu-toggle .ceo-icon { width: 18px; height: 18px; }
body.portal-active .portal-menu-toggle span { transform: none !important; }
body.portal-active .portal-sidebar > small { padding: 18px 10px 0; }
body.portal-active main {
  width: auto !important;
  max-width: none !important;
  margin: 20px 34px 40px calc(var(--portal-sidebar-width) + 34px) !important;
  transition: margin-left .2s ease, width .2s ease;
}

body.portal-active .salary-console > header {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between;
  min-height: 84px !important;
  height: 84px;
  padding: 16px 22px !important;
  gap: 24px;
}
body.portal-active .salary-console > header > div:first-child { max-width: 470px; }
body.portal-active .salary-console > header h2 { margin: 2px 0 5px; }
body.portal-active .salary-console > header p { margin: 0; line-height: 1.5; }
body.portal-active .salary-header-actions { flex: 0 0 auto; align-items: flex-end; }

body.portal-active .workspace-console { padding: 20px 22px 26px !important; }
body.portal-active .event-card { border-top: 3px solid #496682 !important; }

/* Chapter 08 supervisor controls: keep the approved input-adjacent and rail sizes
   even after the shared icon-system selectors are applied. */
body.portal-active #supervisorEventList button.ceo-icon-only.add-event-todo-button {
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
}
body.portal-active #eventRailNext.ceo-icon-only {
  width: 42px !important;
  min-width: 42px !important;
  height: 52px !important;
  min-height: 52px !important;
}

/* Chapter 08 dialogs use the approved compact desktop canvas. */
body.portal-active dialog { width: min(444px, calc(100vw - 48px)); }
body.portal-active dialog form,
body.portal-active dialog .dialog-card { padding: 18px 22px; gap: 8px; }
body.portal-active dialog h2 { margin: 2px 0 0; font-size: 18px; line-height: 1.35; }
body.portal-active dialog header { padding-bottom: 9px; }
body.portal-active dialog header [data-close-dialog] { width: 40px; min-width: 40px; height: 40px; min-height: 40px; }
body.portal-active dialog label { gap: 4px; margin: 0; font-size: 12px; }
body.portal-active dialog input,
body.portal-active dialog select { height: 40px; min-height: 40px; padding: 7px 10px; font-size: 12px; }
body.portal-active dialog textarea { min-height: 72px; padding: 8px 10px; font-size: 12px; }
body.portal-active dialog .dialog-actions { gap: 8px; padding-top: 8px; }
body.portal-active dialog .dialog-actions button {
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 16px;
  font-size: 12px;
}
body.portal-active #eventDialog,
body.portal-active #subtaskDialog,
body.portal-active #milestoneDialog,
body.portal-active #deletedEventsDialog { width: min(444px, calc(100vw - 48px)); }
body.portal-active #deleteEventDialog,
body.portal-active #deleteSubtaskDialog,
body.portal-active #purgeEventDialog,
body.portal-active #deleteMilestoneDialog { width: min(368px, calc(100vw - 48px)); }
body.portal-active #deletedEventsDialog { width: min(520px, calc(100vw - 48px)); }
body.portal-active #milestoneDialog > form { padding: 18px 22px !important; gap: 8px; }
body.portal-active #milestoneDialog h2 { margin: 2px 0 0 !important; font-size: 18px; }
body.portal-active #milestoneDialog label { gap: 4px; margin: 0 !important; font-size: 12px; }
body.portal-active #milestoneDialog input,
body.portal-active #milestoneDialog select { min-height: 40px; height: 40px; padding: 7px 10px; }
body.portal-active #milestoneDialog textarea { min-height: 72px; padding: 8px 10px; }
body.portal-active #deleteEventDialog .dialog-card > p,
body.portal-active #deleteSubtaskDialog .dialog-card > p,
body.portal-active #purgeEventDialog .dialog-card > p,
body.portal-active #deleteMilestoneDialog .dialog-card > p {
  margin: 0;
  padding: 12px;
  border-left: 2px solid #b85c55;
  background: #fbf1f0;
  color: #2d3440;
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 900px) {
  body.portal-active.portal-menu-expanded { --portal-sidebar-width: 240px; }
  body.portal-active:not(.portal-menu-expanded) { --portal-sidebar-width: 74px; }
}

@media (min-width: 1181px) {
  body.portal-active .portal-header {
    margin-right: clamp(36px, 4.2vw, 54px) !important;
    margin-left: calc(var(--portal-sidebar-width) + clamp(36px, 4.2vw, 54px)) !important;
  }
  body.portal-active main {
    margin-right: clamp(36px, 4.2vw, 54px) !important;
    margin-left: calc(var(--portal-sidebar-width) + clamp(36px, 4.2vw, 54px)) !important;
  }
}

@media (min-width: 761px) and (max-height: 800px) {
  body.portal-active .portal-sidebar { padding: 24px 22px 18px !important; }
  body.portal-active:not(.portal-menu-expanded) .portal-sidebar { padding-inline: 10px !important; }
  body.portal-active .portal-brand { padding-bottom: 20px; }
  body.portal-active .portal-sidebar nav { gap: 4px; }
  body.portal-active .portal-nav-item {
    min-height: 44px !important;
    height: 44px !important;
    flex-basis: 44px !important;
    padding-block: 9px !important;
    font-size: 15px;
  }
}

@media (min-width: 761px) and (max-width: 1180px) {
  body.portal-active .portal-session-heading { max-width: calc(100% - 330px); }
}

/* Supervisor salary workspace — approved parity with the main WLG monthly-version UI. */
body.portal-active .salary-console {
  overflow: hidden;
  border: 1px solid #d5dee7;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 0 #d5dee7, 0 16px 38px rgba(41, 56, 74, .06);
}
body.portal-active .salary-console > .salary-module-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between;
  min-height: 156px !important;
  height: auto;
  padding: 26px 28px !important;
  gap: 32px;
  border-bottom: 1px solid #d5dee7;
  background: #f8fafc;
}
body.portal-active .salary-module-header > div:first-child { max-width: 560px; }
body.portal-active .salary-module-header .eyebrow,
body.portal-active .salary-input-heading .eyebrow,
body.portal-active .supervisor-payout-heading .eyebrow {
  margin: 0 0 8px;
  color: #718497;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: .15em;
}
body.portal-active .salary-module-header h2 {
  margin: 0 0 7px;
  color: #2d3440;
  font-size: 27px;
  line-height: 1.4;
}
body.portal-active .salary-module-header p:last-child {
  margin: 0;
  color: #718497;
  font-size: 14px;
  line-height: 1.45;
}
body.portal-active .salary-operation-tabs {
  display: inline-flex;
  flex: 0 0 auto;
  align-self: center;
  gap: 5px;
  width: auto;
  margin: 0;
  padding: 5px;
  border: 1px solid #d5dee7;
  border-radius: 8px;
  background: #e7edf3;
}
body.portal-active .salary-operation-tabs button {
  min-width: 132px;
  height: 44px;
  padding: 0 20px;
  border: 1px solid #d5dee7;
  border-radius: 8px;
  background: #fff;
  color: #496682;
  box-shadow: 0 2px 0 #becbd7;
  font-size: 14px;
  font-weight: 800;
}
body.portal-active .salary-operation-tabs button.is-active {
  border-color: #29384a !important;
  background: #29384a !important;
  color: #fff !important;
  box-shadow: 0 2px 0 #172434 !important;
}
body.portal-active .salary-operation-tabs button:active {
  transform: translateY(2px);
  box-shadow: none;
}
body.portal-active #salaryForm {
  margin: 0;
  background: #fff;
}
body.portal-active .salary-input-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 112px;
  padding: 22px 28px;
  gap: 24px;
  border-bottom: 1px solid #d5dee7;
}
body.portal-active .salary-input-heading h3,
body.portal-active .supervisor-payout-heading h3 {
  margin: 0;
  color: #2d3440;
  font-size: 23px;
  line-height: 1.4;
}
body.portal-active .supervisor-payout-heading h3 {
  font-size: 20px;
  white-space: nowrap;
}
body.portal-active .salary-input-heading p:last-child {
  margin: 5px 0 0;
  color: #718497;
  font-size: 14px;
}
body.portal-active .salary-input-heading #saveSalaryButton {
  flex: 0 0 auto;
  min-width: 142px;
  height: 40px;
  min-height: 40px;
}
body.portal-active .worker-type-tabs {
  gap: 5px;
  padding: 16px 28px;
  border-bottom: 1px solid #d5dee7;
  background: #f5f8fb;
}
body.portal-active .worker-type-tabs button {
  min-width: 100px;
  height: 36px;
  margin: 0;
  padding: 0 16px;
  border: 1px solid #d5dee7;
  border-radius: 8px;
  background: #fff;
  color: #496682;
  box-shadow: 0 2px 0 #becbd7;
}
body.portal-active .worker-type-tabs button:hover,
body.portal-active .worker-type-tabs button.is-active {
  border-color: #29384a;
  background: #29384a;
  color: #fff;
}
body.portal-active .worker-type-tabs button:active {
  transform: translateY(2px);
  box-shadow: none;
}
body.portal-active .supervisor-payout {
  display: grid;
  gap: 18px;
  padding: 22px 28px 28px;
  background: #fff;
}
body.portal-active .supervisor-payout[hidden] { display: none; }
body.portal-active .supervisor-payout > .supervisor-payout-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 96px;
  padding: 18px 20px;
  gap: 28px;
  border: 1px solid #d5dee7;
  border-radius: 8px;
  background: #fff;
}
body.portal-active .supervisor-payout-heading small {
  display: block;
  margin-top: 5px;
  color: #718497;
  font-size: 13px;
  line-height: 1.5;
}
body.portal-active .supervisor-payout-steps {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
body.portal-active .supervisor-payout-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #718497;
  font-size: 13px;
  white-space: nowrap;
}
body.portal-active .supervisor-payout-steps b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #d5dee7;
  border-radius: 8px;
  background: #fff;
  color: #718497;
}
body.portal-active .supervisor-payout-steps .is-active {
  color: #29384a;
  font-weight: 800;
}
body.portal-active .supervisor-payout-steps .is-active b {
  border-color: #29384a;
  background: #29384a;
  color: #fff;
}
body.portal-active .supervisor-payout-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #d5dee7;
  border-radius: 8px;
  background: #f5f8fb;
}
body.portal-active .supervisor-payout-summary > div {
  min-width: 0;
  padding: 15px 18px;
  border-right: 1px solid #d5dee7;
}
body.portal-active .supervisor-payout-summary > div:last-child { border-right: 0; }
body.portal-active .supervisor-payout-summary span,
body.portal-active .supervisor-payout-summary strong { display: block; }
body.portal-active .supervisor-payout-summary span {
  color: #718497;
  font-size: 12px;
}
body.portal-active .supervisor-payout-summary strong {
  margin-top: 6px;
  overflow: hidden;
  color: #29384a;
  font-size: 19px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.portal-active .supervisor-payout-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}
body.portal-active .supervisor-payout-toolbar label {
  display: grid;
  gap: 5px;
  color: #718497;
  font-size: 12px;
  font-weight: 700;
}
body.portal-active .supervisor-payout-toolbar > nav {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
body.portal-active .supervisor-payout-toolbar #saveSalaryPayoutAccounts,
body.portal-active .supervisor-payout-toolbar #submitSalaryPayout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 142px;
  height: 40px;
  min-height: 40px;
  text-align: center;
}
body.portal-active .supervisor-payout .table-wrap {
  border: 1px solid #d5dee7;
  border-radius: 8px;
}
body.portal-active .supervisor-payout table {
  min-width: 1040px;
  table-layout: auto;
}
body.portal-active .supervisor-payout th,
body.portal-active .supervisor-payout td {
  height: 54px;
  padding: 8px 12px;
  border-color: #d5dee7;
  text-align: center;
  white-space: nowrap;
}
body.portal-active .supervisor-payout th {
  height: 42px;
  background: #e9eff5;
  color: #496682;
  font-size: 12px;
}
body.portal-active .supervisor-payout td:first-child { text-align: left; }
body.portal-active .supervisor-payout .payout-person-row > td { border-top: 2px solid #becbd7; }
body.portal-active .supervisor-payout .payout-person-row:first-child > td { border-top: 0; }
body.portal-active .supervisor-payout .payout-downline-row td { background: #f5f8fb; }
body.portal-active .supervisor-payout .payout-downline-row .person { padding-left: 30px; }
body.portal-active .supervisor-payout .payout-downline-row .person strong { color: #496682; }
body.portal-active .supervisor-payout .payout-account-fields {
  width: 100%;
  justify-content: center;
}
body.portal-active .supervisor-payout .payout-account-fields input[data-member-account] {
  box-sizing: border-box;
  flex: 1 1 0;
  width: 100%;
  max-width: 100%;
  text-align: center;
}
body.portal-active .supervisor-payout .payout-account-fields input,
body.portal-active .supervisor-payout td input[data-submit-amount] {
  height: 38px;
  min-height: 38px;
  border-color: #d5dee7;
  border-radius: 8px;
}
body.portal-active .supervisor-payout-copy {
  padding: 18px 20px;
  border: 1px solid #d5dee7;
  border-radius: 8px;
  background: #fff;
}
body.portal-active .supervisor-payout-copy nav {
  align-self: start;
  align-items: flex-start;
  justify-content: flex-end;
}

body.portal-active .salary-statements-panel {
  display: grid;
  gap: 18px;
  padding: 22px 28px 28px;
  background: #fff;
}
body.portal-active .salary-statements-panel[hidden] { display: none; }
body.portal-active .salary-statements-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 96px;
  padding: 18px 20px;
  gap: 24px;
  border: 1px solid #d5dee7;
  border-radius: 8px;
  background: #f5f8fb;
}
body.portal-active .salary-statements-panel > header h3 {
  margin: 0;
  color: #2d3440;
  font-size: 23px;
  line-height: 1.4;
}
body.portal-active .salary-statements-panel > header p:last-child {
  margin: 5px 0 0;
  color: #718497;
  font-size: 14px;
}
body.portal-active .salary-statements-panel .readonly-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #d5dee7;
  border-radius: 8px;
  background: #e7edf3;
  color: #496682;
  font-size: 12px;
  font-weight: 800;
}
body.portal-active .salary-statements-panel .salary-statement-preview-list {
  margin: 0;
  border: 1px solid #d5dee7;
  border-radius: 8px;
}
body.portal-active .salary-statements-panel .salary-statement-preview-list > article {
  min-height: 116px;
  padding: 18px 20px;
  border-bottom: 1px solid #d5dee7;
}
body.portal-active .salary-statements-panel .statement-preview-button {
  min-width: 82px;
  height: 38px;
  min-height: 38px;
  border-radius: 8px;
}
body.portal-active #salaryStatementPreviewDialog {
  width: min(1180px, calc(100vw - 30px)) !important;
  height: min(820px, calc(100vh - 30px));
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d5dee7;
  border-radius: 12px;
  background: #fff;
}
body.portal-active #salaryStatementPreviewDialog::backdrop {
  background: rgba(24, 35, 48, .66) !important;
  backdrop-filter: blur(3px);
}
body.portal-active .salary-statement-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 86px;
  padding: 16px 20px !important;
  gap: 20px;
  border: 0;
  background: #29384a;
  color: #fff;
}
body.portal-active .salary-statement-preview-head strong,
body.portal-active .salary-statement-preview-head small { display: block; }
body.portal-active .salary-statement-preview-head strong {
  font-size: 18px;
  line-height: 1.4;
}
body.portal-active .salary-statement-preview-head small {
  margin-top: 4px;
  color: #aebecb;
  font-size: 13px;
}
body.portal-active .salary-statement-preview-head #closeSalaryStatementPreview {
  flex: 0 0 40px;
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  border: 1px solid #d5dee7;
  border-radius: 8px;
  background: #fff;
  color: #29384a;
  box-shadow: 0 2px 0 #becbd7;
}
body.portal-active .salary-statement-preview-frame {
  display: block;
  width: 100%;
  height: calc(100% - 86px);
  border: 0;
  background: #f5f8fb;
}

@media (max-width: 1180px) {
  body.portal-active .salary-console > .salary-module-header,
  body.portal-active .supervisor-payout > .supervisor-payout-heading {
    align-items: flex-start !important;
    flex-direction: column !important;
  }
  body.portal-active .salary-module-header .salary-operation-tabs {
    align-self: stretch;
    width: 100%;
  }
  body.portal-active .salary-operation-tabs button {
    flex: 1 1 0;
    min-width: 0;
  }
  body.portal-active .supervisor-payout-summary {
    min-width: 760px;
  }
  body.portal-active .supervisor-payout { overflow-x: auto; }
}

/* Approved supervisor payout parity; values remain canonical and read-only. */
body.portal-active .supervisor-payout table { min-width: 860px; }
body.portal-active .supervisor-payout .payout-account-fields input[data-member-account] { text-align: center; }
body.portal-active .supervisor-payout .payout-account-fields input[readonly] { background: #E7EDF3; color: #718497; }
body.portal-active .supervisor-payout .payout-account-fields button { flex: none; width: 38px; height: 38px; padding: 0; white-space: nowrap; }
body.portal-active .supervisor-payout .payout-account-fields input.is-missing-account { border-color: #b95c55; background: #fbefee; color: #8f3732; }
body.portal-active .supervisor-payout .status.is-missing-account { background: #fbefee; color: #8f3732; }
#salaryPayoutMissing { color: #8f3732; margin: 0; }
#portalConfirmDialog.is-payout-preview { width: min(760px, calc(100vw - 48px)); max-height: 90vh; }
#portalConfirmDialog.is-payout-preview .dialog-card { display: flex; flex-direction: column; max-height: 85vh; }
#portalConfirmDialog.is-payout-preview #portalConfirmMessage { white-space: pre-wrap; overflow: auto; min-height: 0; overflow-wrap: anywhere; }
#portalConfirmDialog.is-payout-preview header, #portalConfirmDialog.is-payout-preview .dialog-actions { flex: none; }

/* Approved payout table alignment, shared with the main system. */
body.portal-active .supervisor-payout table{width:100%;border-collapse:collapse}
body.portal-active .supervisor-payout table th,body.portal-active .supervisor-payout table td,body.portal-active .supervisor-payout table td:first-child{ text-align:center;border-color:#D5DEE7 }
