/* Copyright (c) 2026 DamPhi Enterprises. All rights reserved. Proprietary and confidential: licensed for use only; copying, modifying or distributing it without written permission is not allowed. */
/* =====================================================================
   WORKERS AND SUBCONTRACTS
   ---------------------------------------------------------------------
   Styles of the Workers and Subcontracts screens (paid extras). Only
   used when the company has them on; built on the shared tokens.
   ===================================================================== */

/* === SECTION: WORKERS LIST === */
.wf-filter { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.wf-filter::-webkit-scrollbar { display: none; }
.wf-filter .segmented { flex-wrap: nowrap; }
.wf-filter .segmented button { white-space: nowrap; }
.wf-count { opacity: 0.7; font-variant-numeric: tabular-nums; margin-left: 2px; }
.wf-row .list-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.wf-row .list-title .badge, .wf-sub-row .list-title .badge { font-size: 11px; padding: 2px 8px; }
.list-row.is-inactive { opacity: 0.62; }
.wf-inactive > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
.wf-inactive > summary::-webkit-details-marker { display: none; }
.wf-inactive > summary::before { content: "+"; font-weight: 800; width: 1em; }
.wf-inactive[open] > summary::before { content: "\2212"; }
.wf-inactive[open] > summary { margin-bottom: var(--sp-3); }
/* === /SECTION: WORKERS LIST === */

/* === SECTION: WORKER FORM === */
/* Fields that only apply to one type of worker. */
#wf-form .wf-only-sub, #wf-form .wf-only-agency { display: none; }
#wf-form[data-type="subcontractor"] .wf-only-sub { display: flex; }
#wf-form[data-type="agency"] .wf-only-agency { display: flex; }
#wf-form[data-type="subcontractor"] .wf-not-sub { display: none; }
.wf-error { display: none; color: var(--bad); font-weight: 700; }
.wf-error.is-on { display: block; }
/* === /SECTION: WORKER FORM === */

/* === SECTION: USERS === */
.users-list { margin: 0; padding: 0; list-style: none; }
.users-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4); }
.users-row.is-off { opacity: .6; }
.users-main { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.users-name { margin: 0; }
.users-sub { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.users-email { overflow-wrap: anywhere; }
.users-actions { flex: 0 0 auto; }
.users-edit { margin-top: var(--sp-3); }
.role-pick { display: grid; gap: 8px; }
@media (min-width: 720px) { .role-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.role-pick-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--surface-line); border-radius: 10px; cursor: pointer; }
.role-pick-item input { margin-top: 3px; }
.role-pick-item span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.role-pick-item small { color: var(--surface-sub); font-size: var(--fs-xs); }
.role-pick-item:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
/* === /SECTION: USERS === */

/* === SECTION: SUBCONTRACTS === */
a.wf-sub-row { color: inherit; text-decoration: none; }
a.wf-sub-row:hover .list-title, a.wf-sub-row:focus-visible .list-title { text-decoration: underline; }
.wf-sub-row .list-end { flex-direction: row; align-items: center; gap: 6px; }
.wf-sub-row .list-end svg { width: 18px; height: 18px; color: var(--surface-sub); }
.wf-sub-row .list-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.wf-stat-text { font-size: var(--fs-lg); }
.wf-status { display: flex; flex-wrap: wrap; max-width: 100%; }
.wf-status button { white-space: nowrap; flex: 1 1 auto; }
.wf-hours-x { width: 36px; height: 36px; }
.wf-hours-x svg { width: 16px; height: 16px; }
.wf-facts { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 8px 16px; margin: 0; }
.wf-facts dt { font-weight: 700; font-size: var(--fs-sm); color: var(--surface-sub); }
.wf-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.wf-facts a { color: inherit; }
@media (max-width: 599px) {
  .wf-facts { grid-template-columns: 1fr; gap: 2px; }
  .wf-facts dd { margin-bottom: 10px; }
}
/* Sub form: pick an existing subcontractor or enter a new one. */
#wf-sub-form .wf-pick-row { gap: var(--sp-2); align-items: stretch; flex-wrap: nowrap; }
#wf-sub-form .wf-pick-row .select { min-width: 0; }
#wf-sub-form .wf-new-sub { display: none; border: 1.5px dashed var(--surface-line); border-radius: var(--radius-md); padding: 12px; margin: 0; }
#wf-sub-form[data-new="yes"] .wf-new-sub { display: flex; }
#wf-sub-form[data-new="yes"] .wf-pick-sub { display: none; }
.wf-new-sub legend { padding: 0 4px; }
/* Hours on site */
.wf-hours-form { display: grid; grid-template-columns: 1fr 90px; gap: var(--sp-3); align-items: end; }
.wf-hours-form .wf-hours-note { grid-column: 1 / -1; }
.wf-hours-form .btn { grid-column: 1 / -1; justify-self: start; }
@media (min-width: 768px) {
  .wf-hours-form { grid-template-columns: 170px 90px 1fr auto; }
  .wf-hours-form .wf-hours-note, .wf-hours-form .btn { grid-column: auto; }
}
/* === /SECTION: SUBCONTRACTS === */
