/* Staging experiment: portal-style navigation. No effect until the environment gate succeeds. */
.staging-sidebar-enabled {
  --staging-sidebar-width: 225px;
  --staging-header-height: 75px;
  --staging-sidebar-occupied-width: calc(var(--staging-sidebar-width) * 2);
  --layout-left-padding: calc(var(--staging-sidebar-occupied-width) + 75px);
  --employee-rail-menu-left: 250px;
  --employee-rail-secondary-left: 275px;
  --sidebar-icon-size: 15px;
  --sidebar-icon-gap: 10px;
  --sidebar-row-height: 40px;
  --sidebar-row-gap: 10px;
  --sidebar-secondary-font-size: 11px;
  --sidebar-row-pitch: calc(var(--sidebar-row-height) + var(--sidebar-row-gap));
  --sidebar-divider-color: #d9d9d9;
  --layout-col-3-content-left: calc(var(--layout-left-padding) + var(--layout-col-2) + var(--layout-gap) + var(--column-card-inset));
}
.staging-sidebar-enabled:has(.task-rail-overview) {
  --staging-sidebar-occupied-width: var(--staging-sidebar-width);
  --layout-col-3-content-left: calc(var(--layout-left-padding) + var(--layout-col-1) + var(--layout-col-2) + var(--layout-gap) * 2 + var(--column-card-inset));
}
.staging-sidebar-enabled.staging-menu-open {
  --staging-sidebar-occupied-width: calc(var(--staging-sidebar-width) * 2);
  --employee-rail-menu-left: calc(var(--staging-sidebar-occupied-width) + 25px);
  --employee-rail-secondary-left: calc(var(--staging-sidebar-occupied-width) + 50px);
}
#stagingSidebar {
  position: absolute;
  top: var(--staging-header-height);
  bottom: 0;
  left: 0;
  width: var(--staging-sidebar-occupied-width);
  display: flex;
  z-index: auto;
}
#stagingSidebar .sidebar-column {
  flex: 0 0 var(--staging-sidebar-width);
  width: var(--staging-sidebar-width);
  min-width: 0;
  padding: 50px 25px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  border-right: 1px solid var(--sidebar-divider-color);
  background: #f8f8f8;
}
#stagingSidebar :is(#stagingNavigationColumn, #stagingClientColumn) { border-right-color: #e1c16e; }
#stagingSidebar #stagingClientColumn { display: flex; flex-direction: column; overflow: hidden; }
#stagingSidebar #stagingClientColumn > .sidebar-heading { flex: 0 0 auto; }
#stagingSidebar #stagingClientActions {
  flex: 0 0 auto; display: grid; gap: var(--sidebar-row-gap);
  margin: 0; padding: 0;
  max-height: calc(100% - 55px); overflow-y: auto; overflow-x: hidden;
}
#stagingSidebar #stagingClientActions::before {
  content: ""; display: block; height: var(--sidebar-row-pitch);
  background: linear-gradient(to bottom, transparent calc(50% - .5px), var(--sidebar-divider-color) calc(50% - .5px), var(--sidebar-divider-color) calc(50% + .5px), transparent calc(50% + .5px));
}
#stagingSidebar[hidden], #stagingSidebar .sidebar-column[hidden], #stagingSidebar #stagingClientColumn[hidden] { display: none; }
.staging-sidebar-enabled .topbar { height: var(--staging-header-height); padding: 0 50px; justify-content: flex-start; }
.staging-sidebar-enabled .top-employee,
.staging-sidebar-enabled #topLogoImg { display: none; }
.staging-sidebar-enabled #topStatus { position: static; width: auto; justify-content: flex-start; }
.staging-brand { display: flex; align-items: center; gap: 25px; color: #fff; }
.staging-wordmark { font-size: 32px; font-weight: 600; letter-spacing: .05em; color: #e1c16e; }
.staging-brand-name { font-size: 10px; letter-spacing: .15em; }
.staging-brand-name small { display: block; margin-top: 5px; font-size: 9px; color: #e1c16e; }
.staging-sidebar-enabled #mainLayout { height: calc(100% - var(--staging-header-height)); }
#stagingSidebar #employeeRailSupportBtn { display: none; }
#stagingSidebar #clientList .sidebar-client-status { flex: 0 0 var(--sidebar-icon-size); width: var(--sidebar-icon-size); height: var(--sidebar-icon-size); background: none; border: 0; fill: none; }
#stagingSidebar .sidebar-client-status.status-green { color: var(--task-status-success); }
#stagingSidebar .sidebar-client-status.status-orange { color: #ffb400; }
#stagingSidebar .sidebar-client-status.status-red { color: #ff2000; }
#stagingSidebar .sidebar-client-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#stagingSidebar .sidebar-heading {
  color: #636963; font-size: 10px; font-weight: 600; letter-spacing: .12em;
  margin: 0 0 15px; line-height: 1.5;
}
#stagingSidebar #clientList { display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: max-content; gap: var(--sidebar-row-gap); padding: 0; flex: 0 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; }
#stagingSidebar .client-list-entry { margin: 0; padding: 0; width: 100%; min-width: 0; }
#stagingSidebar .sidebar-link,
#stagingSidebar .left-action-rail-glyph,
#stagingSidebar .employee-rail-menu-action {
  display: flex; align-items: center; gap: var(--sidebar-icon-gap); text-align: left;
  position: relative; inset: auto; justify-content: flex-start; width: 100%; min-width: 0; min-height: var(--sidebar-row-height); height: auto;
  margin: 0; padding: 10px 15px; border: 0; border-radius: 3px; text-indent: 0;
  background: transparent; color: #000; font: 400 12px/20px Raleway, sans-serif;
  box-shadow: none; transform: none; animation: none; white-space: normal;
  overflow-wrap: anywhere; transition: color 180ms, background-color 180ms;
}
#stagingSidebar .sidebar-link:hover,
#stagingSidebar .left-action-rail-glyph:hover,
#stagingSidebar .employee-rail-menu-action:hover { background: #e1c16e25; }
#stagingSidebar .sidebar-link.active,
#stagingSidebar .sidebar-link.is-selected,
#stagingSidebar .left-action-rail-glyph.toggle-active,
#stagingSidebar .employee-rail-menu-action.toggle-active { background: #203220; color: #e1c16e; }
#stagingSidebar :is(#employeeRailClientsViewBtn, #employeeRailTasksViewBtn, #employeeRailReportingViewBtn).toggle-active {
  background: #fff; color: #000;
}
#stagingSidebar #clientList .client-list-item { box-shadow: none; transform: none; animation: none; }
#stagingSidebar button:focus-visible { outline: 2px solid #e1c16e; outline-offset: -2px; }
#stagingSidebar #leftActionRail { position: relative; inset: auto; z-index: 1100; display: grid; gap: 0; padding: 0; width: 100%; height: auto; background: none; border: 0; box-shadow: none; pointer-events: auto; }
#stagingSidebar #leftActionRail > .left-action-rail-glyph:not(:first-child) { margin-top: var(--sidebar-row-gap); }
#stagingSidebar .left-action-rail-icon,
#stagingSidebar .sidebar-action-icon { flex: 0 0 var(--sidebar-icon-size); width: var(--sidebar-icon-size); height: var(--sidebar-icon-size); }
#stagingSidebar .sidebar-action-icon { overflow: hidden; }
#stagingSidebar #stagingClientActions button:disabled { opacity: .45; cursor: default; background: transparent; }
#stagingSidebar .left-action-rail-glyph::before,
#stagingSidebar #employeeRailMenu .employee-rail-menu-action::before { content: none; }
/* The existing menu is the second column's content, not a floating surface. */
#stagingSidebar #employeeRailMenu {
  display: grid !important; position: static !important; width: 100% !important;
  height: auto !important; min-height: 0; max-height: none !important;
  margin: 0; padding: 0; border: 0; box-shadow: none;
  background: transparent; color: #000; transform: none; overflow: visible; gap: var(--sidebar-row-gap);
}
#stagingSidebar .employee-rail-menu-divider { height: var(--sidebar-row-pitch); }
#stagingSidebar .employee-rail-menu-divider::before { background: var(--sidebar-divider-color); }
#stagingSidebar .employee-rail-menu-action.hidden { display: none; }
.staging-sidebar-enabled #mainLayout:not(.task-rail-overview) { grid-template-columns: var(--layout-col-2) var(--layout-col-3); }
.staging-sidebar-enabled #mainLayout:not(.task-rail-overview):not(.reporting-rail-overview) {
  grid-template-columns: var(--layout-col-2) var(--layout-col-2) var(--layout-col-3);
  overflow-x: auto; overflow-y: hidden;
}
.staging-sidebar-enabled:has(#mainLayout:not(.task-rail-overview):not(.reporting-rail-overview)) {
  --layout-col-3-content-left: calc(var(--layout-left-padding) + var(--layout-col-2) * 2 + var(--layout-gap) * 2 + var(--column-card-inset));
}
.staging-sidebar-enabled #stagingTodoColumn {
  display: flex; flex-direction: column; min-height: 0; padding-top: 25px;
}
.staging-sidebar-enabled #mainLayout:is(.task-rail-overview, .reporting-rail-overview) #stagingTodoColumn { display: none; }
.staging-sidebar-enabled #stagingTodoList {
  flex: 1 1 auto; min-height: 0; overflow: auto; padding: 0 25px 25px;
}
.staging-sidebar-enabled #mainLayout:not(.task-rail-overview) #clientColumn { display: none; }
.staging-sidebar-enabled #mainLayout:not(.task-rail-overview) #taskColumn::before { content: none; }
.staging-sidebar-enabled #stagingTaskWeekList { overflow: auto; min-height: 0; padding: 50px 50px 16px 0; }
.staging-sidebar-enabled #employeeMenuBackdrop { left: var(--staging-sidebar-width); }
.staging-sidebar-enabled.staging-menu-open #employeeMenuBackdrop { left: var(--staging-sidebar-occupied-width); }
.staging-sidebar-enabled #employeeRailSystemPanel,
.staging-sidebar-enabled #employeeRailPasswordPanel,
.staging-sidebar-enabled #employeeRailAddClientPanel {
  left: var(--employee-rail-menu-left); top: 81px; bottom: auto;
  max-height: calc(100dvh - 106px);
}
.staging-sidebar-enabled #clientInfoPanel { max-width: calc(100vw - var(--staging-sidebar-occupied-width) - 50px); }
/* Task rows share the client-row geometry; the original completion input and
   editor bindings remain in place. Production keeps its original card layout. */
.staging-sidebar-enabled:has(#mainLayout:not(.reporting-rail-overview)) {
  --layout-left-padding: var(--staging-sidebar-occupied-width);
}
.staging-sidebar-enabled #mainLayout:not(.reporting-rail-overview) :is(#taskColumn, #processColumn),
.staging-sidebar-enabled #mainLayout.task-rail-overview :is(#clientColumn, #processColumn) { padding-top: 25px; }
.staging-sidebar-enabled #mainLayout:not(.reporting-rail-overview) :is(#taskColumn, #processColumn) .column-title,
.staging-sidebar-enabled #mainLayout.task-rail-overview :is(#clientColumn, #processColumn) .column-title,
.staging-sidebar-enabled #stagingTodoColumn .column-title,
.staging-sidebar-enabled #taskList .client-section-label {
  color: #636963; font-size: 10px; font-weight: 600; letter-spacing: .12em;
  line-height: 15px; text-transform: uppercase; margin: 0 0 15px; padding: 0 25px;
}
.staging-sidebar-enabled #mainLayout:not(.reporting-rail-overview) #taskColumn #taskList,
.staging-sidebar-enabled #stagingTaskWeekList,
.staging-sidebar-enabled #mainLayout:not(.reporting-rail-overview) #processColumn .content { padding: 0 25px 25px; }
.staging-sidebar-enabled #mainLayout:not(.reporting-rail-overview) #processColumn::before { top: 55px; }
.staging-sidebar-enabled #mainLayout:not(.reporting-rail-overview) #processColumn .column-title-row { min-height: 0; }
.staging-sidebar-enabled #taskList .client-section-divider { height: 15px; margin: 25px 0 15px; padding: 0; }
.staging-sidebar-enabled #taskList .client-section-divider::before { content: none; }
.staging-sidebar-enabled #taskList .client-section-label { margin: 0; padding: 0; }
.staging-sidebar-enabled .task-card:is(.task, .todo) {
  --staging-task-surface: #f8f8f8;
  --task-card-height: var(--sidebar-row-height);
  display: grid; grid-template-columns: var(--sidebar-icon-size) minmax(0, 1fr);
  grid-template-rows: 20px; grid-auto-rows: auto; gap: 0 var(--sidebar-icon-gap);
  align-items: center; width: 370px; min-height: var(--sidebar-row-height); height: auto;
  padding: 10px 15px; margin-bottom: var(--sidebar-row-gap);
  background: transparent; color: #000; border: 0; border-radius: 3px;
  box-shadow: none; transform: none;
  transition: background-color 180ms, color 180ms, margin-bottom 900ms cubic-bezier(0.2, .85, .22, 1);
}
.staging-sidebar-enabled .task-card:is(.task, .todo):hover {
  --staging-task-surface: linear-gradient(#e1c16e25, #e1c16e25), #f8f8f8;
  background: #e1c16e25;
}
.staging-sidebar-enabled .task-card:is(.task, .todo).active {
  --staging-task-surface: #203220;
  background: #203220; color: #e1c16e;
}
.staging-sidebar-enabled .task-card:is(.task, .todo) :is(.task-stack, .task-top) { display: contents; }
.staging-sidebar-enabled .task-card:is(.task, .todo) :is(.task-status-marker, .task-column-gap, .task-toggle-gap, .task-client-row, .task-completion-date) { display: none; }
.staging-sidebar-enabled .task-card:is(.task, .todo) .task-main {
  display: block; grid-column: 2; grid-row: 1; width: auto; max-width: none; min-width: 0; height: 20px;
}
.staging-sidebar-enabled .task-card:is(.task, .todo) .task-title-row { height: 20px; }
.staging-sidebar-enabled .task-card:is(.task, .todo) .task-title {
  display: block; width: auto; max-width: none; height: 20px;
  font: 400 12px/20px Raleway, sans-serif; color: inherit;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.staging-sidebar-enabled .task-title[data-staging-date]::after { content: attr(data-staging-date); }
.staging-sidebar-enabled .task-card:is(.task, .todo) .task-toggle-slot { grid-column: 1; grid-row: 1; }
.staging-sidebar-enabled .task-card:is(.task, .todo) { --staging-task-tone: var(--task-status-success); }
.staging-sidebar-enabled .task-card:has(.task-status-marker.status-orange) { --staging-task-tone: #ffb400; }
.staging-sidebar-enabled .task-card:has(.task-status-marker.status-red) { --staging-task-tone: #ff2000; }
.staging-sidebar-enabled .task-card .task-complete-toggle > svg { display: none; }
.staging-sidebar-enabled .task-card .task-complete-toggle::after {
  content: ""; display: block; width: var(--sidebar-icon-size); height: var(--sidebar-icon-size);
  box-sizing: border-box; border: 1px solid var(--staging-task-tone); border-radius: 50%;
  background: transparent; transition: background-color 180ms, border-color 180ms;
}
.staging-sidebar-enabled .task-card .task-complete-toggle:has(input:checked)::after {
  border-color: var(--task-status-success); background: var(--task-status-success);
}
.staging-sidebar-enabled .task-card .task-complete-toggle:has(input:focus-visible)::after { outline: 2px solid #e1c16e; outline-offset: 3px; }
.staging-sidebar-enabled .task-card.support .task-toggle-slot::after {
  content: ""; width: 15px; height: 15px; border-radius: 50%; background: var(--task-status-success);
}
.staging-sidebar-enabled .task-card:is(.task, .todo) :is(.task-desc, .subtasks-inline) {
  grid-column: 2; margin: 10px 0 0; min-width: 0; width: auto; color: inherit;
}
.staging-sidebar-enabled .task-card:is(.task, .todo) .task-desc {
  margin: 0; padding: 0; border: 0;
  font: 400 var(--sidebar-secondary-font-size)/20px Raleway, sans-serif; overflow-wrap: anywhere;
}
/* Client context is required across clients in the task overview, not in the
   selected-client view. Reuse its existing row and the description line rhythm. */
.staging-sidebar-enabled #mainLayout.task-rail-overview :is(#stagingTaskWeekList, #taskList, #processList) {
  /* Overflow must scroll, not compress the cards' intrinsic text rows. */
  grid-auto-rows: min-content;
}
.staging-sidebar-enabled #mainLayout.task-rail-overview .task-card .task-main {
  grid-row: 1 / 3; height: auto;
}
.staging-sidebar-enabled #mainLayout.task-rail-overview .task-card .task-client-row {
  display: block; height: auto;
}
.staging-sidebar-enabled #mainLayout.task-rail-overview .task-card .task-client-name {
  display: block; width: auto; max-width: none; height: auto; margin: 0;
  font: 400 var(--sidebar-secondary-font-size)/20px Raleway, sans-serif; color: inherit;
  white-space: normal; overflow-wrap: anywhere;
}
.staging-sidebar-enabled .task-card:is(.task, .todo):is(.has-duration-input, .is-duration-closing) {
  animation: none; transform: none; background: transparent;
}
/* Keep the drawer's overlap behind an opaque row face. display:contents on the
   old stack cannot establish a stacking context, so layer the visible grid items. */
.staging-sidebar-enabled .task-card:is(.task, .todo):is(.has-duration-input, .is-duration-closing)::before {
  background: var(--staging-task-surface); box-shadow: none; animation: none;
}
.staging-sidebar-enabled .task-card:is(.task, .todo):is(.has-duration-input, .is-duration-closing) :is(.task-main, .task-toggle-slot, .task-desc, .subtasks-inline) {
  position: relative; z-index: 3;
}
.staging-sidebar-enabled .task-card:is(.task, .todo).has-duration-input { margin-bottom: calc(var(--sidebar-row-gap) + var(--task-duration-visible-height)); }
.staging-sidebar-enabled .task-card:is(.task, .todo).is-duration-closing { margin-bottom: var(--sidebar-row-gap); }
.staging-sidebar-enabled .task-card:is(.task, .todo) .task-duration-inline { grid-column: 1 / -1; left: 25px; right: 25px; }
/* Process headers use the same row grid while their existing body accordion and
   separate edit action retain their behavior. Body padding belongs to the body. */
.staging-sidebar-enabled .process-card {
  grid-template-columns: var(--sidebar-icon-size) minmax(0, 1fr);
  column-gap: var(--sidebar-icon-gap); width: 370px; min-height: var(--sidebar-row-height);
  padding: 0 15px; margin-bottom: var(--sidebar-row-gap);
  background: transparent; color: #000; box-shadow: none;
  transition: background-color 180ms, color 180ms;
}
.staging-sidebar-enabled .process-card:hover { background: #e1c16e25; }
.staging-sidebar-enabled .process-card:is(.active, .is-closing) { background: #fff; color: #000; }
.staging-sidebar-enabled .process-card .process-column-gap,
.staging-sidebar-enabled .process-card .process-edit-gap { display: none; }
.staging-sidebar-enabled .process-card .process-status-marker {
  grid-column: 1; grid-row: 1; width: var(--sidebar-icon-size); height: var(--sidebar-icon-size);
  min-height: 0; margin-top: calc((var(--sidebar-row-height) - var(--sidebar-icon-size)) / 2);
  border: 0; border-radius: 0; background: transparent; color: #203220;
}
.staging-sidebar-enabled .process-status-marker .staging-process-icon,
.staging-sidebar-enabled .staging-process-icon svg { display: block; width: var(--sidebar-icon-size); height: var(--sidebar-icon-size); }
.staging-sidebar-enabled .process-card .process-stack { grid-column: 2; min-width: 0; width: auto; min-height: var(--sidebar-row-height); }
.staging-sidebar-enabled .process-card .process-head {
  grid-template-columns: minmax(0, 1fr);
  height: var(--sidebar-row-height); padding: 10px 0;
}
.staging-sidebar-enabled .process-card .process-head-copy { height: 20px; }
.staging-sidebar-enabled .process-card .process-name {
  height: 20px; font: 400 12px/20px Raleway, sans-serif; color: inherit;
}
.staging-sidebar-enabled .process-card .process-card-edit-link { color: inherit; }
.staging-sidebar-enabled .process-card .process-desc { font-size: 12px; }
.staging-sidebar-enabled .process-card:is(.active, .is-closing) :is(.process-desc, .process-stamp) { color: #000; }
.staging-sidebar-enabled .process-card .process-body > .process-edit-slot {
  width: 100%; height: 25px; margin-top: 25px; justify-content: flex-end;
}
@media (max-width: 650px) {
  .staging-sidebar-enabled { --staging-sidebar-width: 175px; }
  #stagingSidebar .sidebar-column { padding: 25px 15px; }
  .staging-sidebar-enabled .topbar { padding: 0 25px; }
  .staging-sidebar-enabled #employeeRailSystemPanel,
  .staging-sidebar-enabled #employeeRailPasswordPanel,
  .staging-sidebar-enabled #employeeRailAddClientPanel,
  .staging-sidebar-enabled #clientInfoPanel { left: 25px; max-width: calc(100vw - 50px); z-index: 1300; }
}
