/* ==========================================================================
   SaberTask Design System — reusable tokens + form/control primitives.
   Source of truth for buttons, inputs, dropdowns, toggles, etc. so components
   don't re-declare control styling. Imported globally from index.html.

   Two ways to consume:
   1. Native HTML  → use the .st-* primitive classes (.st-input, .st-btn-*, …).
   2. MudBlazor    → wrap a region in .st-form; the adapter at the bottom
                     reskins Mud outlined inputs/selects/pickers to match.
   ========================================================================== */

:root {
  /* ---------- Color · Primary (product) ---------- */
  --st-primary-50:  #EEF1FE;
  --st-primary-100: #DCE2FD;
  --st-primary-light: #EEF3FE;   /* product tint bg / active row */
  --st-primary-border: #C7D8FD;
  --st-primary:        #4A76F9;   /* product brand (admin + app) */
  --st-primary-hover:  #3561E0;   /* == MudTheme PrimaryDarken (single hover blue) */
  --st-primary-focus-ring: rgba(74, 118, 249, 0.15);

  /* ---------- Color · Neutrals (slate) ---------- */
  --st-white:        #FFFFFF;
  --st-bg:           #F8FAFC;
  --st-bg-alt:       #F1F5F9;
  --st-surface-alt:  #FAFBFD;   /* second column / total strips */
  --st-border:       #E8EDF5;
  --st-border-hover: #CBD5E1;
  --st-border-light: #F1F5F9;
  --st-subtle:       #94A3B8;   /* muted/placeholder + section meta */
  --st-muted:        #64748B;   /* secondary text */
  --st-text:         #1E293B;   /* primary text */
  --st-text-strong:  #0A0F18;   /* headings / input text */

  /* ---------- Color · Semantic (== MudTheme palette: one value per semantic) ---------- */
  --st-success:        #22C55E;
  --st-success-dark:   #047857;
  --st-success-light:  #F0FDF4;
  --st-warning:        #F97316;
  --st-warning-light:  #FFF7ED;
  --st-error:          #EF4444;
  --st-error-dark:     #B91C1C;
  --st-error-light:    #FEF2F2;

  /* ---------- Type ---------- */
  --st-font-heading: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  --st-font-body:    'Inter', system-ui, -apple-system, sans-serif;

  /* ---------- Radii ---------- */
  --st-radius-sm:   6px;
  --st-radius:      8px;    /* button / input / chip */
  --st-radius-md:   12px;   /* card / dropdown / popover */
  --st-radius-lg:   16px;   /* modal */
  --st-radius-full: 9999px;

  /* ---------- Spacing (8-pt) ---------- */
  --st-space-1: 4px;  --st-space-2: 8px;  --st-space-3: 12px;
  --st-space-4: 16px; --st-space-5: 20px; --st-space-6: 24px; --st-space-8: 32px;

  /* ---------- Shadows ---------- */
  --st-shadow-sm: 0 1px 2px rgba(10, 15, 24, 0.06);
  --st-shadow:    0 4px 12px rgba(15, 23, 42, 0.06);
  --st-shadow-md: 0 8px 20px rgba(15, 23, 42, 0.08);
  --st-shadow-popover: 0 18px 40px -10px rgba(10,15,24,0.25), 0 0 0 1px rgba(10,15,24,0.04);
  --st-shadow-modal:   0 24px 80px -16px rgba(10,15,24,0.35), 0 0 0 1px rgba(10,15,24,0.04);

  /* ---------- Motion ---------- */
  --st-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --st-duration-fast: 150ms;
}

/* ==========================================================================
   Page header — title row used by the PageHeader component
   ========================================================================== */
.st-page-header { margin-bottom: var(--st-space-4); }
.st-page-header__inner {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--st-space-4); flex-wrap: wrap;
}
.st-page-header__titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-page-header__actions { display: flex; align-items: center; gap: var(--st-space-2); flex-shrink: 0; }
/* At the top of the main content column (replacing the old full-width topbar) the header
   is a full-bleed sticky bar — background + divider run edge to edge — while the inner row
   is constrained to .st-content's max-width so the title lines up with the content below. */
.st-main > .st-page-header {
  margin-bottom: 0;
  position: sticky; top: 0; z-index: 20;
  background: var(--st-white);
  border-bottom: 1px solid var(--st-border);
}
.st-main > .st-page-header > .st-page-header__inner {
  max-width: 1600px; width: 100%; box-sizing: border-box;
  margin: 0 auto; padding: var(--st-space-4) var(--st-space-6);
}
@media (max-width: 768px) {
  .st-main > .st-page-header { position: static; }
  .st-main > .st-page-header > .st-page-header__inner { padding: var(--st-space-4); }
}

/* ==========================================================================
   Connectivity banner (offline / server unreachable)
   ========================================================================== */
.st-conn-banner {
  position: sticky; top: 0; z-index: 1400;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 7px 16px;
  background: var(--st-warning); color: var(--st-white);
  font-size: 13px; font-weight: 600;
  box-shadow: var(--st-shadow-sm);
}

/* ==========================================================================
   Error / load-failure state (ErrorState component)
   ========================================================================== */
.st-error-state {
  padding: 48px 24px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.st-error-state__icon { font-size: 40px !important; color: var(--st-subtle); margin-bottom: 8px; }
.st-error-state__title { font-weight: 600; color: var(--st-text); }
.st-error-state__detail { color: var(--st-subtle); max-width: 460px; word-break: break-word; }
.st-error-state__action { margin-top: 12px; }

/* Empty ("nothing here yet") state */
.st-empty-state {
  padding: 48px 24px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.st-empty-state__icon { font-size: 44px !important; color: var(--st-border-hover); margin-bottom: 8px; }
.st-empty-state__title { font-weight: 600; color: var(--st-text); }
.st-empty-state__hint { color: var(--st-subtle); max-width: 420px; }
.st-empty-state__action { margin-top: 16px; }

/* ==========================================================================
   Section header — uppercase 11px label with optional leading icon
   ========================================================================== */
.st-section-title {
  margin: 0 0 12px;
  font-family: var(--st-font-body);
  font-size: 11px; font-weight: 700;
  color: var(--st-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  display: flex; align-items: center; gap: 6px;
}
.st-section-title svg,
.st-section-title .mud-icon-root { width: 14px; height: 14px; font-size: 14px; color: var(--st-subtle); }

/* ==========================================================================
   Field + label (top-label style)
   ========================================================================== */
.st-field { display: flex; flex-direction: column; gap: 6px; }
.st-field > label {
  font-size: 12px; font-weight: 600; color: var(--st-text);
  display: flex; align-items: center; gap: 4px;
}
.st-field > label .req { color: var(--st-primary); }
.st-field .st-hint { font-size: 11px; color: var(--st-subtle); margin-top: 2px; }

/* ==========================================================================
   Inputs / selects / textareas (native)
   ========================================================================== */
.st-input, .st-select, .st-textarea {
  width: 100%;
  background: var(--st-white);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  padding: 10px 12px;
  font-family: var(--st-font-body);
  font-size: 14px; color: var(--st-text-strong);
  outline: none;
  transition: border-color var(--st-duration-fast), box-shadow var(--st-duration-fast), background var(--st-duration-fast);
}
.st-input::placeholder, .st-textarea::placeholder { color: var(--st-subtle); }
.st-input:hover, .st-select:hover, .st-textarea:hover { border-color: var(--st-border-hover); }
.st-input:focus, .st-select:focus, .st-textarea:focus {
  border-color: var(--st-primary);
  box-shadow: 0 0 0 3px var(--st-primary-focus-ring);
}
.st-input:disabled, .st-select:disabled, .st-textarea:disabled {
  background: var(--st-bg); color: var(--st-subtle); cursor: not-allowed; border-color: var(--st-border-light);
}
.st-textarea { resize: vertical; min-height: 90px; line-height: 1.5; }

/* Custom select with caret */
.st-select-wrap { position: relative; }
.st-select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer; }
.st-select-wrap > .st-caret {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--st-subtle); pointer-events: none;
}

/* Field + trailing action button (the "+" add-new) */
.st-with-action { display: flex; align-items: stretch; gap: 8px; }
.st-with-action > .st-select-wrap, .st-with-action > .st-input, .st-with-action > div { flex: 1; min-width: 0; }
/* Strip MudBlazor's field margins so the field wrapper height == the input box height;
   the stretched action button then matches the input box exactly (square, same height). */
.st-with-action .mud-input-control { margin-top: 0 !important; margin-bottom: 0 !important; }
.st-action-btn {
  width: 40px; flex-shrink: 0; align-self: stretch;
  border: 1px solid var(--st-border); background: var(--st-white); border-radius: var(--st-radius);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--st-muted); cursor: pointer;
  transition: border-color var(--st-duration-fast), background var(--st-duration-fast), color var(--st-duration-fast);
}
.st-action-btn:hover { border-color: var(--st-primary); color: var(--st-primary); background: #F5F8FF; }
.st-action-btn svg, .st-action-btn .mud-icon-root { width: 16px; height: 16px; font-size: 16px; }
/* Compact square hairline icon button for card actions (same visual language as .st-action-btn). */
.st-icon-btn {
  width: 32px; height: 32px; flex-shrink: 0; padding: 0;
  border: 1px solid var(--st-border); background: var(--st-white); border-radius: var(--st-radius);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--st-muted); cursor: pointer;
  transition: border-color var(--st-duration-fast), background var(--st-duration-fast), color var(--st-duration-fast);
}
.st-icon-btn:hover:not(:disabled) { border-color: var(--st-primary); color: var(--st-primary); background: #F5F8FF; }
.st-icon-btn:disabled { opacity: 0.45; cursor: default; }
.st-icon-btn svg, .st-icon-btn .mud-icon-root { width: 18px; height: 18px; font-size: 18px; }
/* A MudTooltip-wrapped "?" help icon inside .st-with-action: bare icon (no button box),
   only as wide as the icon, vertically centered next to the input. */
.st-with-action > .mud-tooltip-root { flex: 0 0 auto; align-self: center; display: inline-flex; }
.st-help-btn {
  width: auto; min-width: 0; padding: 0; border: none; background: transparent;
  color: var(--st-subtle); cursor: help;
}
.st-help-btn:hover { border: none; background: transparent; color: var(--st-primary); }
.st-help-btn .mud-icon-root, .st-help-btn svg { width: 18px; height: 18px; font-size: 18px; }

/* Currency / unit suffix */
.st-input-suffix { position: relative; }
.st-input-suffix .st-suffix {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 12px; font-weight: 600; color: var(--st-subtle); pointer-events: none;
}
.st-input-suffix input { padding-right: 48px; }

/* Validation */
.st-input.invalid, .st-select.invalid, .st-textarea.invalid {
  border-color: #FCA5A5; background: #FFFBFB;
}
.st-error { font-size: 11px; color: var(--st-error-dark); display: flex; align-items: center; gap: 4px; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.st-btn {
  font-family: var(--st-font-body);
  border-radius: var(--st-radius); padding: 9px 18px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; white-space: nowrap;
  transition: background var(--st-duration-fast), border-color var(--st-duration-fast), color var(--st-duration-fast), box-shadow var(--st-duration-fast);
}
.st-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--st-primary-focus-ring); }
.st-btn-primary {
  background: var(--st-primary); color: var(--st-white); border-color: var(--st-primary);
  box-shadow: 0 1px 2px rgba(74,118,249,0.25);
}
.st-btn-primary:hover { background: var(--st-primary-hover); border-color: var(--st-primary-hover); }
.st-btn-primary:disabled, .st-btn-primary[aria-disabled="true"] {
  background: #C7D2FE; border-color: #C7D2FE; cursor: not-allowed; box-shadow: none;
}
.st-btn-ghost { background: var(--st-white); color: var(--st-muted); border-color: var(--st-border); }
.st-btn-ghost:hover { background: var(--st-bg-alt); color: var(--st-text-strong); border-color: var(--st-border-hover); }
.st-btn-danger { background: var(--st-white); color: var(--st-error); border-color: #FCA5A5; }
.st-btn-danger:hover { background: var(--st-error-light); border-color: var(--st-error); }
.st-btn svg, .st-btn .mud-icon-root { width: 14px; height: 14px; font-size: 14px; }

/* ==========================================================================
   Segmented control
   ========================================================================== */
.st-segmented { display: inline-flex; padding: 3px; background: var(--st-bg-alt); border-radius: 9px; width: 100%; }
.st-segmented button {
  flex: 1; border: none; background: transparent; padding: 8px 14px;
  font-family: var(--st-font-body); font-size: 13px; font-weight: 600;
  color: var(--st-muted); cursor: pointer; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background var(--st-duration-fast), color var(--st-duration-fast), box-shadow var(--st-duration-fast);
}
.st-segmented button.active {
  background: var(--st-white); color: var(--st-primary);
  box-shadow: 0 1px 2px rgba(10,15,24,0.06), 0 0 0 1px rgba(10,15,24,0.04);
}
.st-segmented button:disabled {
  opacity: 0.4; cursor: not-allowed; color: var(--st-muted);
  background: transparent; box-shadow: none;
}

/* ==========================================================================
   Toggle (switch) row
   ========================================================================== */
.st-toggle-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--st-white); border: 1px solid var(--st-border); border-radius: 10px;
  cursor: pointer; transition: border-color var(--st-duration-fast), background var(--st-duration-fast);
}
.st-toggle-row:hover { border-color: var(--st-border-hover); }
.st-toggle-row.on { border-color: var(--st-primary); background: #F5F8FF; }
.st-toggle-row .info { flex: 1; min-width: 0; }
.st-toggle-row .info .t { font-size: 13px; font-weight: 600; color: var(--st-text-strong); line-height: 1.25; }
.st-toggle-row .info .d { font-size: 11px; color: var(--st-muted); margin-top: 2px; }
.st-toggle {
  position: relative; width: 36px; height: 20px; flex-shrink: 0;
  background: var(--st-border-hover); border-radius: 99px; transition: background .2s;
}
.st-toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  background: #fff; border-radius: 50%; box-shadow: 0 1px 2px rgba(10,15,24,0.18); transition: transform .2s var(--st-ease);
}
.st-toggle.on { background: var(--st-primary); }
.st-toggle.on::after { transform: translateX(16px); }

/* ==========================================================================
   Radio group (inline cards)
   ========================================================================== */
.st-radio-group { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.st-radio {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--st-white); border: 1px solid var(--st-border); border-radius: var(--st-radius);
  cursor: pointer; font-size: 13px; font-weight: 600; color: #475569;
  transition: border-color var(--st-duration-fast), background var(--st-duration-fast), color var(--st-duration-fast);
}
.st-radio:hover { border-color: var(--st-border-hover); }
.st-radio.on { border-color: var(--st-primary); background: #F5F8FF; color: var(--st-text-strong); }
.st-radio .dot {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--st-border-hover);
  background: #fff; flex-shrink: 0; position: relative; transition: border-color var(--st-duration-fast);
}
.st-radio.on .dot { border-color: var(--st-primary); }
.st-radio.on .dot::after { content: ""; position: absolute; inset: 2px; background: var(--st-primary); border-radius: 50%; }

/* ==========================================================================
   Attachments dropzone + chips
   ========================================================================== */
.st-attach {
  border: 1.5px dashed var(--st-border-hover); border-radius: 10px; padding: 14px 16px;
  display: flex; align-items: center; gap: 12px; background: var(--st-white);
  transition: border-color var(--st-duration-fast), background var(--st-duration-fast);
}
.st-attach:hover { border-color: var(--st-primary); background: #F5F8FF; }
.st-attach .icn {
  width: 32px; height: 32px; border-radius: var(--st-radius); background: var(--st-bg-alt); color: var(--st-primary);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.st-attach .body { flex: 1; min-width: 0; }
.st-attach .body .ttl { font-size: 13px; font-weight: 600; color: var(--st-text-strong); }
.st-attach .body .meta { font-size: 11px; color: var(--st-muted); margin-top: 1px; }
.st-attach-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.st-attach-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px 5px 10px;
  background: var(--st-bg-alt); border-radius: var(--st-radius-sm);
  font-size: 12px; color: var(--st-text); font-weight: 500;
}
.st-attach-chip .x {
  width: 16px; height: 16px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--st-subtle); cursor: pointer;
}
.st-attach-chip .x:hover { background: #fff; color: var(--st-error); }

/* ==========================================================================
   Inline create popover (anchored under a field)
   ========================================================================== */
.st-field-anchor { position: relative; }
.st-popover {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: #fff; border: 1px solid var(--st-border); border-radius: var(--st-radius-md);
  box-shadow: var(--st-shadow-popover); padding: 16px; z-index: 10;
}
.st-popover h4 {
  margin: 0 0 12px; font-family: var(--st-font-heading);
  font-size: 14px; font-weight: 800; color: var(--st-text-strong); letter-spacing: -0.01em;
}

/* ==========================================================================
   MudBlazor adapter — wrap a region in .st-form to reskin Mud outlined
   inputs / selects / numeric / date pickers to the design tokens. Keeps the
   Mud component behaviour; only restyles border, radius, focus, colors.
   ========================================================================== */
/* Neutralize MudBlazor's per-field margins (e.g. .mud-input-control-margin-dense = 4px 0) so
   vertical spacing in a .st-form layout is driven ONLY by the container's gap — guaranteeing
   every field is evenly spaced regardless of control type (TextField vs Select vs Autocomplete). */
.st-form .mud-input-control { margin: 0 !important; }

.st-form .mud-input.mud-input-outlined .mud-input-outlined-border {
  border-color: var(--st-border);
  border-radius: var(--st-radius);
  transition: border-color var(--st-duration-fast), box-shadow var(--st-duration-fast);
}
.st-form .mud-input.mud-input-outlined:hover:not(.mud-disabled):not(.mud-error) .mud-input-outlined-border {
  border-color: var(--st-border-hover);
}
.st-form .mud-input.mud-input-outlined.mud-focused:not(.mud-error) .mud-input-outlined-border {
  border-color: var(--st-primary) !important;
  border-width: 1px;
  box-shadow: 0 0 0 3px var(--st-primary-focus-ring);
}
.st-form .mud-input-control-input-container { background: var(--st-white); border-radius: var(--st-radius); }
.st-form .mud-input-root { font-family: var(--st-font-body); font-size: 14px; color: var(--st-text-strong); }
.st-form .mud-input-label { font-family: var(--st-font-body); color: var(--st-muted); }
.st-form .mud-input.mud-input-outlined.mud-focused:not(.mud-error) .mud-input-label { color: var(--st-primary); }
.st-form .mud-input.mud-input-outlined .mud-input-slot { color: var(--st-text-strong); }
.st-form .mud-input.mud-disabled .mud-input-outlined-border { border-color: var(--st-border-light); }

/* Mud buttons inside .st-form → align to .st-btn look */
.st-form .mud-button-root.mud-button-filled-primary {
  background-color: var(--st-primary); border-radius: var(--st-radius);
  box-shadow: 0 1px 2px rgba(74,118,249,0.25); text-transform: none; font-weight: 600;
}
.st-form .mud-button-root.mud-button-filled-primary:hover { background-color: var(--st-primary-hover); }
.st-form .mud-button-root.mud-button-text { text-transform: none; font-weight: 600; color: #475569; }

/* Mud switches inside .st-form → product blue */
.st-form .mud-switch .mud-switch-track { border-radius: 99px; }
.st-form .mud-switch.mud-checked .mud-switch-track { background-color: var(--st-primary); }

/* Mud autocomplete inside .st-form → make it read like a native .st-select:
   white fill, hairline border, 8px radius, 14px text, subtle placeholder + caret. */
.st-form .mud-autocomplete .mud-input.mud-input-outlined { background: var(--st-white); }
.st-form .mud-autocomplete .mud-input-outlined-border { border-color: var(--st-border); border-radius: var(--st-radius); }
.st-form .mud-autocomplete .mud-input-control-input-container { min-height: 40px; }
.st-form .mud-autocomplete .mud-input-slot,
.st-form .mud-autocomplete input { font-size: 14px; color: var(--st-text-strong); }
.st-form .mud-autocomplete input::placeholder { color: var(--st-subtle); opacity: 1; }
.st-form .mud-autocomplete .mud-input-adornment-end .mud-icon-root { color: var(--st-subtle); font-size: 20px; }

/* ==========================================================================
   Suffix alias + date inputs (used by .st-input-suffix .suffix)
   ========================================================================== */
.st-input-suffix .suffix {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 12px; font-weight: 600; color: var(--st-subtle); pointer-events: none;
}
.st-date-wrap { position: relative; }
.st-date-range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ==========================================================================
   Help icon + tooltip (e.g. next to a field label)
   ========================================================================== */
.st-help {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid var(--st-border-hover); color: var(--st-subtle);
  font-size: 10px; font-weight: 700; cursor: help; margin-left: 2px; outline: none;
  transition: color var(--st-duration-fast), border-color var(--st-duration-fast);
}
.st-help:hover, .st-help:focus-visible { color: var(--st-primary); border-color: var(--st-primary); }
.st-help-tip {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(4px);
  background: var(--st-text-strong); color: #fff;
  font-size: 12px; font-weight: 500; line-height: 1.45; text-transform: none; letter-spacing: 0;
  padding: 8px 10px; border-radius: var(--st-radius); width: max-content; max-width: 220px;
  box-shadow: var(--st-shadow-popover); opacity: 0; pointer-events: none;
  transition: opacity var(--st-duration-fast); z-index: 5; white-space: normal;
}
.st-help:hover .st-help-tip, .st-help:focus-visible .st-help-tip { opacity: 1; }

/* ==========================================================================
   Workers list (team members + akkord split)
   ========================================================================== */
.st-workers { border: 1px solid var(--st-border); background: #fff; border-radius: 10px; overflow: hidden; }
.st-workers-head {
  display: flex; align-items: center; justify-content: space-between; padding: 9px 14px;
  background: var(--st-bg-alt); font-size: 11px; font-weight: 700; color: var(--st-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.st-workers-head .cnt { font-size: 11px; font-weight: 600; color: var(--st-subtle); text-transform: none; letter-spacing: 0; }
.st-worker { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--st-border-light); }
.st-worker:first-of-type { border-top: none; }
.st-worker:not(.on) { background: var(--st-surface-alt); }
.st-worker:not(.on) .nm { color: var(--st-subtle); }
.st-check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; flex: 1; min-width: 0; }
.st-check .box {
  width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--st-border-hover);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background var(--st-duration-fast), border-color var(--st-duration-fast); color: transparent;
}
.st-check.on .box { background: var(--st-primary); border-color: var(--st-primary); color: #fff; }
.st-check .nm { font-size: 13px; font-weight: 500; color: var(--st-text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-worker-split { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.st-worker-split .lockbtn {
  width: 26px; height: 26px; border-radius: 6px; border: none; background: transparent; color: var(--st-subtle);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--st-duration-fast), color var(--st-duration-fast);
}
.st-worker-split .lockbtn:hover { background: var(--st-bg-alt); color: var(--st-text); }
.st-worker-split .lockbtn.on { color: var(--st-primary); background: var(--st-primary-light); }
.st-worker-split .pct input {
  width: 58px; border: 1px solid var(--st-border); background: #fff; border-radius: 6px;
  padding: 5px 22px 5px 8px; font: 600 13px var(--st-font-body); color: var(--st-text-strong);
  outline: none; text-align: right; -moz-appearance: textfield;
}
.st-worker-split .pct { position: relative; }
.st-worker-split .pct input::-webkit-outer-spin-button,
.st-worker-split .pct input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.st-worker-split .pct input:focus { border-color: var(--st-primary); box-shadow: 0 0 0 3px var(--st-primary-focus-ring); }
.st-worker-split .pct .u { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 600; color: var(--st-subtle); pointer-events: none; }
.st-worker-split .dkk { font-size: 12px; color: var(--st-muted); font-weight: 500; min-width: 78px; text-align: right; font-variant-numeric: tabular-nums; }
.st-workers-total { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; background: var(--st-surface-alt); border-top: 1px solid var(--st-border-light); }
.st-workers-total .lbl { font-size: 11px; font-weight: 600; color: var(--st-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.st-workers-total .v { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.st-workers-total.ok .v { color: var(--st-success-dark); }
.st-workers-total.warn .v { color: var(--st-error-dark); }

/* Footer urgent toggle (mock places "Mark as urgent" in the footer) */
.st-urgent {
  display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600;
  color: var(--st-text); cursor: pointer; user-select: none; padding: 6px 10px 6px 4px; border-radius: var(--st-radius);
}
.st-urgent:hover { background: var(--st-bg); }
.st-urgent.on { color: #B91C1C; }
.st-urgent .ic { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; background: var(--st-bg-alt); color: var(--st-subtle); }
.st-urgent.on .ic { background: #FEE2E2; color: #B91C1C; }

/* ==========================================================================
   Task creation/edit popup (CreateTaskDialog) layout & chrome.
   Kept here (static CSS) rather than an in-component <style> so tweaks show on
   a hard refresh without a WASM rebuild.
   ========================================================================== */
.st-dialog .mud-dialog { border-radius: var(--st-radius-lg); max-width: 1040px; }
.st-dialog-title { display: flex; align-items: center; gap: 12px; }
.st-dialog-title .icon-tile {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--st-primary-light); color: var(--st-primary);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.st-dialog-title .icon-tile .mud-icon-root { font-size: 20px; }
.st-dialog-title .ttl {
  font-family: var(--st-font-heading);
  font-size: 18px; font-weight: 800; color: var(--st-text-strong); letter-spacing: -0.01em;
}
.st-dialog .mud-dialog-title { border-bottom: 1px solid var(--st-border); padding-bottom: 16px; }
.st-dialog .mud-dialog-actions { border-top: 1px solid var(--st-border); padding: 14px 24px; gap: 10px; }
/* Full-bleed body so the two columns reach the dialog edges (right column is a tinted panel). */
.st-dialog .mud-dialog-content { padding: 0; }
.st-dialog-body { position: relative; padding: 0; }
.st-dialog-body > .st-error { margin: 16px 24px 0; }
/* minmax(0, 1fr) (not bare 1fr = minmax(auto, 1fr)) so a long selected value — e.g. a
   location "Name — Address" — can't inflate its column's min-content and steal width from
   the other. min-width:0 lets the column clip its content instead of spilling over. */
.st-dialog-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; }
.st-dialog-grid .st-dialog-col { display: flex; flex-direction: column; gap: 24px; padding: 22px 24px; min-width: 0; }
.st-dialog-grid .st-dialog-col + .st-dialog-col { background: #FAFBFD; border-left: 1px solid var(--st-border-light); }
.st-dialog-grid .st-section { display: flex; flex-direction: column; gap: 10px; }
.st-dropzone-overlay {
  position: absolute; inset: 0; z-index: 100; pointer-events: none;
  background: rgba(74,118,249,0.06); border: 2px dashed var(--st-primary); border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  color: var(--st-primary); font-weight: 600;
}
@media (max-width: 860px) {
  .st-dialog-grid { grid-template-columns: 1fr; }
  .st-dialog-grid .st-dialog-col + .st-dialog-col { border-left: none; border-top: 1px solid var(--st-border-light); }
}

/* ==========================================================================
   Utility vocabulary — inline-style migration. See CONVENTION.
   ========================================================================== */
/* CONVENTION — prefer, in order:
   1. MudBlazor utilities for layout/flex/spacing on the 4px scale
      (d-flex, flex-column, flex-1, align-center, justify-*, gap-1..6, pa-/px-/py-/mt-/mb-/ml-* = n*4px);
   2. these token-backed st-* utilities for what MudBlazor lacks — the --st-* colors,
      the type scale, and the design's off-4px-grid spacing (2/6/10/14px, padding:10px 16px…);
   3. a scoped Pages/<Page>.razor.css class for page-specific structure (cards, tiles, grids).
   Only data-driven values stay inline (Style="@(...)"). Every hex/radius design-system.css
   already names resolves to its token. */
.st-text-muted { color: var(--st-muted); }
.st-text-subtle { color: var(--st-subtle); }
.st-text-body { color: var(--st-text); }
.st-text-primary { color: var(--st-primary); }
.st-text-slate { color: #475569; }
.st-text-red { color: var(--st-error); }
.st-text-amber { color: #92400E; }
.st-text-crimson { color: #991B1B; }
.st-text-blue { color: #1D4ED8; }
.st-bg-muted { background: var(--st-bg); }
.st-bg-white { background: var(--st-white); }
.st-min-w-0 { min-width: 0; }
.st-border-0 { border: none; }
.st-border-collapse { border-collapse: collapse; }
.st-nowrap { white-space: nowrap; }
.st-mono { font-family: monospace; }
.st-ov-visible { overflow: visible; }
.st-fs-11 { font-size: 11px; }
.st-fs-12 { font-size: 12px; }
.st-fs-13 { font-size: 13px; }
.st-fs-14 { font-size: 14px; }
.st-fs-15 { font-size: 15px; }
.st-fs-18 { font-size: 18px; }
.st-fs-24 { font-size: 24px; }
.st-fs-40 { font-size: 40px; }
.st-fs-48 { font-size: 48px; }
.st-fw-400 { font-weight: 400; }
.st-fw-500 { font-weight: 500; }
.st-fw-600 { font-weight: 600; }
.st-fw-700 { font-weight: 700; }
.st-ta-center { text-align: center; }
.st-ta-left { text-align: left; }
.st-ta-right { text-align: right; }
.st-ls { letter-spacing: 0.05em; }
.st-py-2 { padding-top: 2px;padding-bottom: 2px; }
.st-py-6 { padding-top: 6px;padding-bottom: 6px; }
.st-py-10 { padding-top: 10px;padding-bottom: 10px; }
.st-py-1 { padding-top: 1px;padding-bottom: 1px; }
.st-px-6 { padding-left: 6px;padding-right: 6px; }
.st-px-10 { padding-left: 10px;padding-right: 10px; }
.st-gap-6 { gap: 6px; }
.st-gap-2 { gap: 2px; }
.st-gap-10 { gap: 10px; }
.st-mb-2 { margin-bottom: 2px; }
.st-ml-6 { margin-left: 6px; }
.st-mt-2 { margin-top: 2px; }
.st-mt-6 { margin-top: 6px; }
.st-mb-6 { margin-bottom: 6px; }
.st-mt-10 { margin-top: 10px; }
.st-mb-14 { margin-bottom: 14px; }
.st-mb-10 { margin-bottom: 10px; }
.st-panel { border: 1px solid var(--st-border);border-radius: var(--st-radius-md); }
.st-truncate { overflow: hidden;text-overflow: ellipsis;white-space: nowrap; }
.st-callout-warn { background: var(--st-warning-light);border: 1px solid #FED7AA;border-radius: var(--st-radius); }
.st-callout-error { background: var(--st-error-light);border: 1px solid #FECACA;border-radius: var(--st-radius); }
.st-callout-info { background: #EFF6FF;border: 1px solid #BFDBFE;border-radius: var(--st-radius); }
/* Settings dialog boxes (portal-rendered; scoped CSS cannot reach them). */
.st-set-flexbasis-06 { flex: 1; }
.st-set-x-28 { padding-top: 4px; }
.st-set-x-62 { padding-top: 8px; }
.st-set-mnw-63 { min-width: 140px; }
.st-set-mnw-64 { min-width: 150px; }
.st-set-mnw-65 { min-width: 120px; }
.st-set-x-66 { display: block; }
.st-set-x-67 { cursor: pointer; }
.st-set-x-68 { width: 1px;height: 1px;opacity: 0;position: absolute;pointer-events: none; }
.st-set-mw-69 { max-width: 120px; }

/* ─── Work-request conversation thread (shared by the staff triage dialog, the customer
   portal, and the public /r/{id} page; dialogs are portal-rendered, hence global). ─── */
.st-thread { display: flex; flex-direction: column; gap: 10px; max-height: 340px; overflow-y: auto; padding: 2px; }
.st-thread-msg { max-width: 82%; padding: 10px 14px; border-radius: var(--st-radius-md); font-size: 14px; line-height: 1.45; color: var(--st-text); white-space: pre-wrap; word-break: break-word; }
.st-thread-msg-own { align-self: flex-end; background: var(--st-primary-light); border: 1px solid var(--st-primary-border); }
.st-thread-msg-other { align-self: flex-start; background: var(--st-bg-alt); border: 1px solid var(--st-border); }
.st-thread-msg-system { align-self: center; background: transparent; border: none; color: var(--st-muted); font-size: 12.5px; padding: 2px 8px; }
.st-thread-meta { font-size: 11.5px; color: var(--st-subtle); margin-top: 4px; }
.st-thread-author { font-size: 12px; font-weight: 600; color: var(--st-muted); margin-bottom: 2px; }
.st-thread-photo { max-width: 140px; max-height: 140px; border-radius: var(--st-radius); border: 1px solid var(--st-border); object-fit: cover; cursor: pointer; }
.st-thread-unread-dot { display: inline-block; width: 8px; height: 8px; border-radius: var(--st-radius-full); background: var(--st-primary); flex-shrink: 0; }
