/* =========================================================================
   MM Recruitment - LOS Recruitment 2.0 workforce screens
   Worker Workspace (candidate portal), employer Workforce tab, staff
   Workforce / Timesheets / Finance / Management tabs. Layered on
   tokens.css, portal.css and los-recruitment.css: same ivory/gold
   surface, same cards, badges, tables and buttons. Only what these
   screens add lives here.
   ========================================================================= */

/* -------------------------------------------------------------------
   Shared
   ------------------------------------------------------------------- */
.los-stage-rejected { background: rgba(163, 49, 44, 0.12); color: #a3312c; }
.wf-muted { color: var(--text-muted); }
.wf-money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.wf-right { text-align: right; }
.wf-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wf-actions .button { margin: 0; }
.wf-inline-note { font-size: 0.86rem; color: var(--text-muted); margin: 6px 0 0; }
.wf-warning {
  background: rgba(177, 138, 67, 0.12);
  border: 1px solid rgba(177, 138, 67, 0.4);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.9rem;
  margin: 0 0 14px;
}
.wf-danger {
  background: rgba(163, 49, 44, 0.08);
  border: 1px solid rgba(163, 49, 44, 0.35);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.9rem;
  margin: 0 0 14px;
}
.wf-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 20px; margin: 12px 0 18px; }
.wf-kv > div { min-width: 0; font-size: 0.92rem; }
.wf-kv-label { display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-dark); margin-bottom: 2px; }
.wf-subhead { font-size: 1rem; margin: 18px 0 8px; color: var(--charcoal); }
.wf-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; }
.wf-list li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--hairline); }
.wf-list li:first-child { border-top: 0; }
.wf-fieldset { border: 1px solid var(--hairline); border-radius: var(--radius-sm); padding: 12px 14px 4px; margin: 0 0 12px; }
.wf-fieldset legend { font-weight: 700; font-size: 0.9rem; color: var(--charcoal); padding: 0 6px; }
.wf-check { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; }
.wf-check input { width: auto; }
.wf-tab-hidden { display: none !important; }

/* -------------------------------------------------------------------
   Worker Workspace (candidate portal)
   ------------------------------------------------------------------- */
.worker-intro { border-left: 4px solid var(--gold); }
.worker-intro .eyebrow { margin: 0 0 4px; }
.worker-assignment-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.worker-assignment { border: 1px solid var(--hairline); border-radius: var(--radius-sm); background: var(--white); overflow: hidden; }
.worker-assignment.is-open { border-color: rgba(177, 138, 67, 0.55); }
.worker-assignment-head {
  appearance: none;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: none;
  border: 0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.worker-assignment-head:hover { background: rgba(233, 215, 180, 0.22); }
.worker-assignment-head:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.worker-assignment-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.worker-assignment-title strong { color: var(--charcoal); font-size: 1rem; }
.worker-assignment-title span { color: var(--text-muted); font-size: 0.88rem; }
.worker-assignment-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.worker-assignment-meta small { color: var(--text-muted); font-size: 0.78rem; white-space: nowrap; }
.worker-assignment-detail { padding: 4px 16px 16px; border-top: 1px solid var(--hairline); }
.worker-assignment-detail h4 { font-size: 0.92rem; margin: 16px 0 6px; color: var(--charcoal); }
.worker-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 18px; margin-top: 12px; font-size: 0.92rem; }
.worker-detail-grid small { color: var(--text-muted); }
.worker-detail-label { display: block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-dark); }
.worker-rate-list, .worker-doc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; }
.worker-rate-list small, .worker-doc-list small { color: var(--text-muted); margin-left: 6px; }

.worker-period-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.worker-period-row label { font-weight: 700; font-size: 0.9rem; }
.worker-period-row select { flex: 1 1 240px; font: inherit; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--white); }
.worker-period-row .button { margin: 0; }

.worker-timesheet { margin-top: 18px; border-top: 1px solid var(--hairline); padding-top: 16px; }
.worker-timesheet-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.worker-timesheet-head h3 { margin: 0; font-size: 1.1rem; color: var(--charcoal); }
.worker-timesheet-head small { color: var(--text-muted); }
.worker-returned-note { background: rgba(163, 49, 44, 0.08); border: 1px solid rgba(163, 49, 44, 0.35); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 0.9rem; margin: 0 0 12px; }

.worker-week { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.worker-week th { text-align: left; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-dark); padding: 6px 8px; border-bottom: 1px solid var(--hairline); }
.worker-week td { padding: 10px 8px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.worker-week td:first-child { white-space: nowrap; width: 84px; }
.worker-week tfoot td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--hairline); }
.worker-day.is-outside td { color: var(--text-muted); background: rgba(38, 35, 31, 0.03); }
.worker-no-hours { color: var(--text-muted); }
.worker-day-total { white-space: nowrap; font-variant-numeric: tabular-nums; }
.worker-day-add { white-space: nowrap; text-align: right; }
.worker-entry-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.worker-entry-list li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.worker-entry-list em { font-style: normal; color: var(--gold-dark); font-size: 0.82rem; }
.worker-entry-list small { display: block; color: var(--text-muted); }
.worker-entry-actions { display: flex; gap: 10px; white-space: nowrap; }
.worker-entry-form-row td { background: rgba(233, 215, 180, 0.16); padding: 14px 12px; }
.worker-entry-form { margin: 0; }
.worker-entry-form-title { margin: 0 0 8px; font-weight: 700; }
.worker-entry-form .button-row { margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; }
.worker-entry-form .button { margin: 0; }
.worker-note-row { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.worker-note-row label { font-weight: 700; font-size: 0.9rem; }
.worker-note-row textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 8px; resize: vertical; }
.worker-submit-row { align-items: center; gap: 14px; margin-top: 14px; display: flex; flex-wrap: wrap; }
.worker-submit-row .button { margin: 0; }
.worker-submit-row small { color: var(--text-muted); max-width: 44ch; }
.worker-history { margin-top: 16px; }
.worker-history summary { cursor: pointer; font-weight: 700; color: var(--gold-dark); }
.worker-history .portal-timeline { margin-top: 10px; }
.worker-history-table tbody tr { cursor: pointer; }

@media (max-width: 640px) {
  .worker-assignment-head { flex-direction: column; align-items: flex-start; }
  .worker-assignment-meta { align-items: flex-start; }
  .worker-week th:nth-child(3), .worker-week td:nth-child(3) { display: none; }
  .worker-week td:first-child { width: auto; }
}

/* -------------------------------------------------------------------
   Staff and employer screens
   ------------------------------------------------------------------- */
.wf-split { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 16px; }
@media (min-width: 960px) { .wf-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.wf-panel-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 0 0 12px; }
.wf-panel-actions .button { margin: 0; }
.wf-entry-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin: 8px 0 14px; }
.wf-entry-table th, .wf-entry-table td { padding: 6px 8px; border-bottom: 1px solid var(--hairline); text-align: left; vertical-align: top; }
.wf-entry-table th { font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-dark); }
.wf-entry-table tfoot td { font-weight: 700; border-bottom: 0; }
.wf-reason { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.wf-reason label { font-weight: 700; font-size: 0.88rem; }
.wf-reason textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 8px; resize: vertical; }
.wf-invoice-lines td.wf-money, .wf-invoice-lines th.wf-money { text-align: right; }
.wf-totals { margin: 8px 0 0 auto; width: min(320px, 100%); font-size: 0.92rem; }
.wf-totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.wf-totals div.is-grand { border-top: 2px solid var(--hairline); font-weight: 700; margin-top: 4px; padding-top: 8px; }
.wf-checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.wf-checklist li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--hairline); border-radius: var(--radius-sm); font-size: 0.9rem; }
.wf-checklist li input { width: auto; }
.wf-checklist li span.wf-fill { flex: 1; }
.wf-group { margin-top: 16px; }
.wf-group h4 { margin: 0 0 8px; font-size: 0.98rem; color: var(--charcoal); }
.wf-flag-note { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(44, 95, 147, 0.1); color: #2c5f93; font-size: 0.8rem; font-weight: 600; }
.wf-filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 12px; }
.wf-filter-row input[type="date"], .wf-filter-row select { font: inherit; padding: 8px 10px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--white); }
.wf-filter-row label { font-size: 0.86rem; font-weight: 700; }
.wf-bar-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wf-bar-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 0.9rem; }
.wf-bar-track { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--light); overflow: hidden; }
.wf-bar-fill { height: 100%; background: var(--gold); border-radius: 999px; }
.wf-print-hint { font-size: 0.84rem; color: var(--text-muted); margin: 8px 0 0; }

/* The [hidden] attribute must beat the flex/grid display of these
   containers (same fix employer.css applies to .button[hidden]). */
.portal-form-field[hidden], .worker-workspace-hidden[hidden], #worker-workspace[hidden], #employer-tab-panel-workforce[hidden] { display: none !important; }
