/* Secondary staff workspace surfaces: detail, schedule, payroll, profile, tasks. */
#shell {
  --staff-canvas: #131715;
  --staff-panel: #1b211d;
  --staff-raised: #232b25;
  --staff-line: #343e36;
  --staff-text: #f1f4ed;
  --staff-muted: #aeb9af;
  --staff-accent: #f5cf48;
  --staff-danger: #ef8d86;
  --staff-success: #87d3ad;
}

#shell .detail-overlay {
  background: var(--staff-canvas);
  color: var(--staff-text);
}

#shell .detail-topbar {
  min-height: 64px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--staff-line);
  background: var(--staff-panel);
}

#shell .detail-back,
#shell .detail-delete-icon {
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  color: var(--staff-muted);
  background-color: transparent;
}

#shell .detail-back:hover,
#shell .detail-delete-icon:hover { color: var(--staff-text); background-color: var(--staff-raised); }
#shell .detail-back:focus-visible,
#shell .detail-delete-icon:focus-visible { outline: 2px solid var(--staff-accent); outline-offset: 2px; }

#shell .detail-title {
  color: var(--staff-text);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
}

#shell .detail-scroll {
  min-height: 0;
  padding: 24px;
  background: var(--staff-canvas);
}

#shell .detail-scroll > * + * { margin-top: 16px; }
#shell .detail-field-label,
#shell .profile-block > label,
#shell .task-employee-list + .detail-field-label {
  color: var(--staff-muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

#shell .detail-scroll input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
#shell .detail-scroll textarea,
#shell .detail-scroll select,
#shell .pin-form input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
  min-height: 44px;
  border: 1px solid var(--staff-line);
  border-radius: 12px;
  color: var(--staff-text);
  background: var(--staff-panel);
}

#shell .detail-scroll input:focus,
#shell .detail-scroll textarea:focus,
#shell .detail-scroll select:focus,
#shell .pin-form input:focus { border-color: var(--staff-accent); outline: 2px solid rgba(245, 207, 72, .2); outline-offset: 1px; }

#shell .profile-card,
#shell .profile-block,
#shell .efficiency-report,
#shell .cash-outflow-details {
  border: 1px solid var(--staff-line);
  border-radius: 14px;
  color: var(--staff-text);
  background: var(--staff-panel);
}

#shell .detail-overlay .desc-box,
#shell .detail-overlay .task-desc,
#shell .detail-overlay .task-blocked-comment { padding: 16px; line-height: 1.55; }
#shell .detail-item-title { color: var(--staff-text); font-family: inherit; font-size: 20px; font-weight: 700; line-height: 1.4; text-transform: none; letter-spacing: -.01em; }
#shell .detail-price { color: var(--staff-accent); font-size: 22px; font-weight: 800; }

#shell .detail-footer-row {
  display: flex;
  gap: 12px;
  padding: 16px 24px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--staff-line);
  background: var(--staff-panel);
}

#shell .detail-footer-row > button { min-height: 44px; flex: 1 1 0; }

#shell .schedule-emp-tabs {
  display: flex;
  gap: 8px;
  padding-bottom: 16px;
  overflow-x: auto;
}
#shell .schedule-emp-tab,
#shell .schedule-choice-btn,
#shell .schedule-choice-cancel {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--staff-line);
  border-radius: 12px;
  color: var(--staff-muted);
  background: var(--staff-panel);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
}
#shell .schedule-emp-tab.active { border-color: var(--staff-accent); color: var(--staff-accent); background: var(--staff-raised); }
#shell .schedule-choice-btn.selected { box-shadow: 0 0 0 2px currentColor inset; }
#shell .schedule-grid { gap: 8px; }
#shell .schedule-grid .schedule-day { border-radius: 12px; }
#shell .schedule-grid .schedule-day.working { background: #21372b; }
#shell .schedule-grid .schedule-day.off { background: var(--staff-panel); border-color: var(--staff-line); }
#shell .schedule-grid.readonly .schedule-day { cursor: default; }
#shell .schedule-choice-btn.schedule-choice-l1 { border-color: #33b4e0; color: #33b4e0; background: var(--staff-panel); }
#shell .schedule-choice-btn.schedule-choice-l2 { border-color: #f5c400; color: #f5c400; background: var(--staff-panel); }
#shell .schedule-choice-btn.schedule-choice-l3 { border-color: #ff7a1e; color: #ff9a55; background: var(--staff-panel); }
#shell .schedule-choice-btn.schedule-choice-off { border-color: var(--staff-muted); color: var(--staff-muted); background: var(--staff-panel); }
#shell .schedule-hint,
#shell .schedule-choice-empty { color: var(--staff-muted); line-height: 1.5; }

#shell .dash-month-nav {
  border: 1px solid var(--staff-line);
  border-radius: 14px;
  background: var(--staff-panel);
}
#shell .dash-month-nav button { min-width: 44px; min-height: 44px; color: var(--staff-accent); }
#shell .dash-month-label { color: var(--staff-text); font-size: 16px; font-weight: 800; }

#shell .detail-overlay .task-stats-row {
  border: 1px solid var(--staff-line);
  border-radius: 14px;
  background: var(--staff-panel);
}
#shell .detail-overlay .task-stats-row:hover { border-color: #4b5b4e; background: var(--staff-raised); }
#shell .detail-overlay .task-stats-name-plaque { color: var(--staff-text); font-size: 16px; font-weight: 750; }
#shell .detail-overlay .task-stats-row.leader .task-stats-name-plaque { color: #3f300b; text-shadow: none; }
#shell .detail-overlay .task-stats-row.silver .task-stats-name-plaque { color: #25333f; text-shadow: none; }
#shell .detail-overlay .task-stats-row.bronze .task-stats-name-plaque { color: #2d1b10; text-shadow: none; }
#shell .detail-overlay .task-stats-role,
#shell .detail-overlay .task-stats-num-label,
#shell .detail-overlay .efficiency-report-stat span { color: var(--staff-muted); }
#shell .detail-overlay .task-action-btn,
#shell .profile-row-btn,
#shell .task-emp-row { min-height: 44px; border-radius: 12px; }
#shell .detail-overlay .task-action-btn:focus-visible,
#shell .profile-row-btn:focus-visible,
#shell .task-emp-row:focus-visible { outline: 2px solid var(--staff-accent); outline-offset: 2px; }

#shell .profile-card { padding: 24px; }
#shell .profile-name { color: var(--staff-text); font-size: 22px; font-weight: 800; }
#shell .profile-block { padding: 16px; }
#shell .profile-row-btn { color: var(--staff-text); background: transparent; }
#shell .profile-row-btn:hover { background: var(--staff-raised); }
#shell .profile-footer { color: var(--staff-muted); }
#shell .pin-form { padding: 16px; border: 1px solid var(--staff-line); border-radius: 14px; background: var(--staff-panel); }
#shell .pin-ok-note { color: var(--staff-success); }

#shell .app-modal-backdrop { background: rgba(5, 7, 5, .72); }
#shell .app-modal { border: 1px solid var(--staff-line); border-radius: 16px; color: var(--staff-text); background: var(--staff-panel); }

/* Payroll uses its own structure, independent of the seller ranking cards. */
#shell #reportOverlay .detail-scroll { width: 100%; max-width: 1120px; }
#shell #reportOverlay .dash-month-nav { width: max-content; max-width: 100%; gap: 12px; margin: 0 0 24px auto; padding: 4px; }
#shell #payrollContent { margin-top: 0; }
#shell .payroll-summary { padding: 0 0 28px; }
#shell .payroll-summary h2 { margin: 0 0 20px; color: var(--staff-text); font-size: 18px; font-weight: 700; }
#shell .payroll-summary-values { display: flex; flex-wrap: wrap; gap: 20px 64px; }
#shell .payroll-list { border: 1px solid var(--staff-line); border-radius: 14px; background: var(--staff-panel); }
#shell .payroll-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1.15fr); align-items: center; gap: 24px; padding: 24px; }
#shell .payroll-row + .payroll-row { border-top: 1px solid var(--staff-line); }
#shell .payroll-identity { min-width: 0; }
#shell .payroll-identity h3 { margin: 0; color: var(--staff-text); font-size: 16px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
#shell .payroll-identity p { margin: 4px 0 0; color: var(--staff-muted); font-size: 12px; line-height: 1.5; }
#shell .payroll-metric { min-width: 0; margin: 0; }
#shell .payroll-metric dt { color: var(--staff-muted); font-size: 12px; line-height: 1.5; }
#shell .payroll-metric dd { margin: 8px 0 0; color: var(--staff-text); font-size: 22px; font-weight: 650; line-height: 1.4; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#shell .payroll-metric--forecast dd { color: var(--staff-muted); font-size: 20px; font-weight: 500; }
#shell .payroll-pending { display: block; margin-top: 6px; color: var(--staff-accent); font-size: 12px; font-weight: 500; }
#shell .payroll-list--personal { max-width: 720px; margin: 0 auto; }
#shell .payroll-list--personal .payroll-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; padding: 28px; }
#shell .payroll-list--personal .payroll-identity { grid-column: 1 / -1; }

@media (max-width: 699px) {
  #shell #reportOverlay .dash-month-nav { margin: 0 auto 20px; }
  #shell .payroll-summary { padding: 8px 0 24px; }
  #shell .payroll-summary-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  #shell .payroll-summary h2 { margin-bottom: 16px; font-size: 16px; }
  #shell .payroll-row, #shell .payroll-list--personal .payroll-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; padding: 20px 16px; }
  #shell .payroll-identity { grid-column: 1 / -1; }
  #shell .payroll-metric dt { min-height: 36px; font-size: 12px; }
  #shell .payroll-metric dd, #shell .payroll-metric--forecast dd { font-size: clamp(16px, 5vw, 20px); }
}

@media (min-width: 900px) {
  #shell .detail-scroll { max-width: 1120px; margin: 0 auto; }
  #shell .detail-footer-row { padding-right: 24px; padding-left: 24px; }
}

@media (max-width: 899px) {
  #shell .detail-topbar { min-height: 56px; padding: 8px 16px; }
  #shell .detail-title { font-size: 22px; }
  #shell .detail-scroll { padding: 16px; padding-bottom: 24px; }
  #shell .detail-footer-row { position: sticky; bottom: 0; z-index: 3; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  #shell .schedule-emp-tabs { margin-right: -16px; padding-right: 16px; }
}

/* Rank layouts follow the available content width, including a narrowed rail window. */
#shell #dashboardOverlay .detail-scroll { container: ranking / inline-size; width: 100%; box-sizing: border-box; }
#shell .rating-method { margin: 0 0 24px; border-bottom: 1px solid var(--staff-line); }
#shell .rating-method summary { min-height: 44px; box-sizing: border-box; padding: 12px 0; color: var(--staff-muted); font-size: 14px; font-weight: 600; cursor: pointer; }
#shell .rating-method summary:hover { color: var(--staff-text); }
#shell .rating-method summary:focus-visible { outline: 2px solid var(--staff-accent); outline-offset: 3px; border-radius: 4px; }
#shell .rating-method .efficiency-intro { display: block; margin: 0; padding: 8px 0 20px; border: 0; background: transparent; box-shadow: none; }
#shell .rating-method .efficiency-intro-copy { padding: 0; border: 0; }
#shell .rating-method .efficiency-intro p, #shell .rating-method .efficiency-method { max-width: 72ch; color: var(--staff-muted); font-size: 13px; line-height: 1.6; }
#shell .rating-method .efficiency-title { color: var(--staff-text); font-size: 16px; }
#shell .rating-method .efficiency-weights { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
#shell .rating-method .efficiency-weight { min-width: 0; padding: 10px 0; border: 0; border-top: 1px solid var(--staff-line); border-radius: 0; color: var(--staff-muted); background: transparent; }
#shell .rating-method .efficiency-weight span { white-space: normal; font-size: 12px; line-height: 1.5; overflow: visible; }
#shell .rating-method .efficiency-weight strong { flex-shrink: 0; color: var(--staff-text); font-size: 13px; }
#shell .detail-overlay .task-stats-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1.2fr) 80px; gap: 16px; align-items: center; padding: 24px 20px 16px; }
#shell .task-stats-row .efficiency-rank { grid-column: 1; grid-row: 1; justify-self: center; }
#shell .task-stats-row .task-stats-identity { grid-column: 2; grid-row: 1; }
#shell .detail-overlay .task-stats-name-plaque { box-sizing: border-box; white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
#shell .task-stats-row .efficiency-score { grid-column: 4; grid-row: 1; min-width: 0; text-align: center; }
#shell .task-stats-row .efficiency-score strong { line-height: 1.2; overflow-wrap: anywhere; }
#shell .task-stats-row .task-stats-nums { grid-column: 3; grid-row: 1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
#shell .detail-overlay .task-stats-num-label { font-size: 11px; text-transform: none; letter-spacing: 0; overflow-wrap: anywhere; }
#shell .task-stats-row .efficiency-report { grid-column: 2 / -1; grid-row: 2; padding: 12px 0 0; border: 0; border-top: 1px solid var(--staff-line); border-radius: 0; background: transparent; }
#shell .efficiency-report-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#shell .efficiency-report-stat { display: block; padding: 8px 0; border: 0; border-radius: 0; background: transparent; overflow: visible; }
#shell .detail-overlay .efficiency-report-stat span { font-size: 11px; font-weight: 500; text-transform: none; letter-spacing: 0; }
#shell .efficiency-report-stat .efficiency-report-value { margin-top: 6px; text-align: left; }
#shell .efficiency-report-stat strong { font-size: 13px; text-align: left; white-space: normal; overflow-wrap: anywhere; }
#shell .efficiency-report-stat small { font-size: 10px; text-align: left; }

@container ranking (max-width: 850px) {
  #shell .detail-overlay .task-stats-row { grid-template-columns: 48px minmax(0, 1fr) 80px; gap: 16px; }
  #shell .task-stats-row .efficiency-score { grid-column: 3; }
  #shell .task-stats-row .task-stats-nums { grid-column: 1 / -1; grid-row: 2; }
  #shell .task-stats-row .efficiency-report { grid-column: 1 / -1; grid-row: 3; }
  #shell .rating-method .efficiency-weights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container ranking (max-width: 500px) {
  #shell .detail-overlay .task-stats-row { grid-template-columns: 38px minmax(0, 1fr) 60px; gap: 12px; padding: 24px 12px 12px; }
  #shell .detail-overlay .task-stats-name-plaque { font-size: 14px; }
  #shell .efficiency-report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  #shell .task-stats-row .efficiency-score strong { font-size: 22px; }
  #shell .rating-method .efficiency-weights { grid-template-columns: 1fr; gap: 0; }
}

@media (min-width: 900px) and (max-width: 1180px) {
  #shell .payroll-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  #shell .payroll-identity { grid-column: 1 / -1; }
  #shell .detail-title { font-size: 24px; }
}
