/* FleetSpartan shared controls. FS-STYLE-PR1, from the approved preview section 3.
   Nothing adopts these classes yet. Colour literals stay in site.css and theme.css. */

/* icons (D5): Lucide inline SVG on a 24 grid */
.lu { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: none; flex-shrink: 0; vertical-align: -3px; }
.lu--18 { width: 18px; height: 18px; }
.lu--20 { width: 20px; height: 20px; }

/* page header (admin density, STYLE-BASE s6) */
.fs-page-head { display: flex; align-items: center; gap: 8px; padding: 12px 24px; border-bottom: 1px solid var(--fs-line); background: var(--fs-surface); }
.fs-page-head h1 { margin: 0; font-size: 18px; font-weight: 600; color: var(--fs-text-heading); }
.fs-page-head .fs-page-sub { font-size: 13px; color: var(--fs-muted); margin-left: 4px; }
.fs-page-head .fs-spacer { flex: 1; }
.fs-kicker { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fs-muted); }

/* buttons */
.fs-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: 6px; border: 1px solid transparent;
  font: 600 14px/1 var(--fs-font); color: var(--fs-ink); background: var(--fs-surface);
  cursor: pointer; white-space: nowrap; text-decoration: none; user-select: none;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.fs-btn:disabled, .fs-btn[aria-disabled="true"] { opacity: 0.5; cursor: default; pointer-events: none; }
.fs-btn--primary { background: var(--fs-accent); color: var(--fs-on-accent); }
.fs-btn--primary:hover { background: var(--fs-accent-hover); }
.fs-btn--primary:active { background: var(--fs-accent-hover); box-shadow: inset 0 0 0 100px var(--fs-accent-tint-12); }
.fs-btn--secondary { border-color: var(--fs-border-strong); }
.fs-btn--secondary:hover, .fs-btn--quiet:hover { background: var(--fs-surface-2); }
.fs-btn--secondary:active, .fs-btn--quiet:active { background: var(--fs-surface-2); box-shadow: inset 0 0 0 100px var(--fs-accent-tint-12); }
.fs-btn--quiet { background: transparent; }
.fs-btn--accent-outline { border-color: var(--fs-accent); color: var(--fs-accent); background: transparent; }
.fs-btn--accent-outline:hover { background: var(--fs-soft); color: var(--fs-on-soft); }
.fs-btn--danger { color: var(--fs-error-accent); }
.fs-btn--danger:hover { background: var(--fs-error-bg); color: var(--fs-error-text); }
.fs-btn--danger-fill { background: var(--fs-danger-fill); color: var(--fs-on-danger); }
.fs-btn--danger-fill:hover { background: var(--fs-danger-fill-hover); color: var(--fs-on-danger); }
.fs-btn--sm { height: 28px; padding: 0 10px; font-size: 13px; }
.fs-btn--icon { width: 32px; height: 32px; min-width: 32px; padding: 0; color: var(--fs-muted); }
.fs-btn--icon:hover { color: var(--fs-ink); background: var(--fs-surface-2); }
.fs-btn--icon .lu { width: 18px; height: 18px; }
.fs-btn--link { height: auto; padding: 0; background: none; border: 0; color: var(--fs-blue-accent); font-weight: 600; }
.fs-btn--link:hover { text-decoration: underline; }
.fs-btn-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fs-btn-group { display: flex; gap: 12px; }

/* fields */
.fs-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fs-field > label, .fs-label { font-size: 12px; font-weight: 600; color: var(--fs-text-heading); }
.fs-hint { font-size: 12px; color: var(--fs-muted); }
.fs-error-text { font-size: 12px; color: var(--fs-error-accent); }
.fs-input, .fs-select > select, .fs-textarea {
  height: 36px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--fs-border-strong);
  background: var(--fs-surface); color: var(--fs-ink); font: 400 14px/1.2 var(--fs-font); width: 100%; min-width: 0;
  transition: border-color 120ms ease;
}
.fs-textarea { height: auto; min-height: 72px; padding: 8px 12px; line-height: 1.45; }
.fs-input::placeholder { color: var(--fs-text-500); }
.fs-input:focus-visible, .fs-select > select:focus-visible, .fs-textarea:focus-visible { border-color: var(--fs-focus); outline: 2px solid var(--fs-focus); outline-offset: 2px; }
.fs-input[aria-invalid="true"], .fs-field--invalid .fs-input { border-color: var(--fs-error-accent); }
.fs-input:disabled, .fs-select > select:disabled { background: var(--fs-surface-2); opacity: 0.6; }
.fs-input--search { padding-left: 32px; background-repeat: no-repeat; background-position: 10px center; }
.fs-search { position: relative; display: flex; align-items: center; }
.fs-search .lu { position: absolute; left: 10px; color: var(--fs-muted); pointer-events: none; }
.fs-select { position: relative; display: inline-flex; width: 100%; color: var(--fs-ink); }
.fs-select > select { appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer; }
.fs-select::after { content: ""; position: absolute; right: 12px; top: 50%; width: 7px; height: 7px; margin-top: -5px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); pointer-events: none; color: var(--fs-muted); }
.fs-select--bar > select { height: var(--fs-bar-control); background: var(--fs-on-bar); color: var(--fs-ink-fill); border-color: transparent; font-weight: 600; font-size: 13px; }
.fs-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.fs-check input { width: 16px; height: 16px; accent-color: var(--fs-accent); margin: 0; }
.fs-switch { position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--fs-border-strong); border: 0; cursor: pointer; transition: background 120ms ease; }
.fs-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--fs-surface); transition: transform 120ms ease; }
.fs-switch[aria-checked="true"] { background: var(--fs-accent); }
.fs-switch[aria-checked="true"]::after { transform: translateX(16px); }

/* filter chips, segmented control, count badge, status pills (three things kept apart) */
.fs-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--fs-border-strong); background: var(--fs-surface); color: var(--fs-ink);
  font: 600 13px/1 var(--fs-font); cursor: pointer; transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.fs-chip:hover { background: var(--fs-surface-2); }
.fs-chip[aria-pressed="true"] { background: var(--fs-accent); border-color: var(--fs-accent); color: var(--fs-on-accent); }
.fs-chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.fs-segmented { display: inline-flex; height: 32px; border: 1px solid var(--fs-border-strong); border-radius: 999px; overflow: hidden; background: var(--fs-surface); }
.fs-segmented > button {
  appearance: none; border: 0; background: transparent; padding: 0 12px; min-width: 40px; height: 100%;
  font: 600 13px/1 var(--fs-font); color: var(--fs-ink); cursor: pointer; border-right: 1px solid var(--fs-border-strong);
  transition: background 120ms ease, color 120ms ease;
}
.fs-segmented > button:last-child { border-right: 0; }
.fs-segmented > button:hover { background: var(--fs-surface-2); }
.fs-segmented > button[aria-pressed="true"], .fs-segmented > button[aria-checked="true"] { background: var(--fs-accent); color: var(--fs-on-accent); }
.fs-segmented > button:focus-visible { outline-offset: -2px; }
.fs-segmented--sm { height: 28px; }
.fs-segmented--sm > button { font-size: 12px; padding: 0 10px; min-width: 0; }
.fs-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--fs-surface-2); color: var(--fs-ink); font: 600 11px/1 var(--fs-font); font-variant-numeric: tabular-nums; }
.fs-count--urgent { background: var(--fs-danger-fill); color: var(--fs-on-danger); }
.fs-pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font: 600 11px/1 var(--fs-font); white-space: nowrap; background: var(--fs-surface-2); color: var(--fs-muted); }
.fs-pill--grid { border-radius: 4px; height: 20px; }
.fs-pill--ok { background: var(--fs-success-bg); color: var(--fs-success-text); }
.fs-pill--warn { background: var(--fs-warning-bg); color: var(--fs-warning-text); }
.fs-pill--danger { background: var(--fs-error-bg); color: var(--fs-error-text); }
.fs-pill--info { background: var(--fs-blue-light); color: var(--fs-blue-dark); }
.fs-pill--soft { background: var(--fs-soft); color: var(--fs-on-soft); }
.fs-pill--muted { background: var(--fs-surface-2); color: var(--fs-muted); }
.fs-pill__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.fs-pill__dot--fleetio { background: var(--fs-fleetio-accent); }
.fs-pill__dot--wex { background: var(--fs-wex-accent); }
.fs-pill--dashed { background: transparent; border: 1px dashed var(--fs-border-strong); color: var(--fs-muted); }

/* tabs (sections of a page) */
.fs-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--fs-line); }
.fs-tabs > [role="tab"] { appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 8px 12px; font: 600 14px/1.2 var(--fs-font); color: var(--fs-muted); cursor: pointer; transition: color 120ms ease; }
.fs-tabs > [role="tab"]:hover { color: var(--fs-ink); }
.fs-tabs > [role="tab"][aria-selected="true"] { color: var(--fs-ink); border-bottom-color: var(--fs-accent); }

/* table */
.fs-table-wrap { overflow: auto; border: 1px solid var(--fs-line); border-radius: 8px; background: var(--fs-surface); }
.fs-table { width: 100%; border-collapse: collapse; font-size: 13px; color: var(--fs-ink); }
.fs-table th { position: sticky; top: 0; z-index: 1; height: 36px; padding: 0 12px; text-align: left; background: var(--fs-surface); border-bottom: 1px solid var(--fs-line); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fs-muted); white-space: nowrap; }
.fs-table td { height: 40px; padding: 0 12px; border-top: 1px solid var(--fs-line); white-space: nowrap; }
.fs-table tr:first-child td { border-top: 0; }
.fs-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.fs-table .mono { font-family: var(--fs-mono); font-size: 12px; }
.fs-table tbody tr:hover { background: var(--fs-surface-2); }
.fs-table tr[aria-selected="true"], .fs-table tr[aria-selected="true"]:hover { background: var(--fs-soft); }
.fs-table th.sort { cursor: pointer; }
.fs-table th.sort .lu { width: 12px; height: 12px; vertical-align: -2px; margin-left: 4px; }
.fs-grid-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 0 0 12px; }
.fs-grid-toolbar .fs-spacer { flex: 1; }
.fs-grid-toolbar .fs-search { flex: 0 1 280px; min-width: 180px; }
.fs-grid-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 0 0; font-size: 13px; color: var(--fs-muted); }
.fs-grid-foot .fs-spacer { flex: 1; }
.fs-pager { display: inline-flex; align-items: center; gap: 8px; }
.fs-card { background: var(--fs-surface); border: 1px solid var(--fs-line); border-radius: 8px; padding: 16px; box-shadow: var(--fs-shadow-1); }
.fs-card--grid { padding: 12px 16px; margin: 8px 16px; }
.fs-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px; background: var(--fs-surface); border: 1px solid var(--fs-line); border-radius: 8px; box-shadow: var(--fs-shadow-1); }
.fs-stat__value { font-size: 18px; font-weight: 700; color: var(--fs-text-heading); font-variant-numeric: tabular-nums; }
.fs-stat__label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fs-muted); }
.fs-stat--attention { box-shadow: inset 3px 0 0 var(--fs-error-accent), var(--fs-shadow-1); }
.fs-stat--attention .fs-stat__value { color: var(--fs-error-accent); }

/* empty, loading, spinner */
.fs-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px; text-align: center; font-size: 14px; color: var(--fs-muted); }
.fs-spinner { width: 20px; height: 20px; border: 2px solid var(--fs-soft); border-top-color: var(--fs-accent); border-radius: 50%; animation: fs-spin 0.9s linear infinite; }
@keyframes fs-spin { to { transform: rotate(360deg); } }
/* banner (page-level notice) and toast */
.fs-banner { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 6px; border-left: 3px solid var(--fs-blue-accent); background: var(--fs-blue-light); color: var(--fs-blue-dark); font-size: 13px; }
.fs-banner--warn { border-left-color: var(--fs-warning-accent); background: var(--fs-warning-bg); color: var(--fs-warning-text); }
.fs-banner--danger { border-left-color: var(--fs-error-accent); background: var(--fs-error-bg); color: var(--fs-error-text); }
.fs-banner--ok { border-left-color: var(--fs-success-accent); background: var(--fs-success-bg); color: var(--fs-success-text); }
.fs-banner .fs-btn--icon { margin-left: auto; color: inherit; }
.fs-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: min(440px, calc(100vw - 32px)); display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 8px; background: var(--fs-accent); color: var(--fs-on-accent); box-shadow: var(--fs-shadow-2); font-size: 14px; font-weight: 600; z-index: 1200; }
.fs-toast .fs-btn--link { color: inherit; text-decoration: underline; }
.fs-toast--error { background: var(--fs-danger-fill); color: var(--fs-on-danger); }

/* menu and dialog */
.fs-menu { min-width: 280px; max-width: 300px; padding: 8px; background: var(--fs-surface); border: 1px solid var(--fs-line); border-radius: 12px; box-shadow: var(--fs-shadow-2); color: var(--fs-ink); }
.fs-menu__header { display: flex; align-items: flex-start; gap: 12px; padding: 8px 10px 12px; border-bottom: 1px solid var(--fs-line); margin-bottom: 8px; }
.fs-menu__who { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.fs-menu__name { font-size: 14px; font-weight: 600; color: var(--fs-text-heading); }
.fs-menu__email { font-size: 12px; color: var(--fs-muted); overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.fs-avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--fs-soft); color: var(--fs-on-soft); font: 600 12px/1 var(--fs-font); flex-shrink: 0; }
.fs-menu__item { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 6px; color: var(--fs-ink); font-size: 14px; text-decoration: none; cursor: pointer; background: none; border: 0; width: 100%; font-family: inherit; text-align: left; transition: background 120ms ease; }
.fs-menu__item:hover { background: var(--fs-surface-2); }
.fs-menu__item .lu { width: 18px; height: 18px; color: var(--fs-muted); }
.fs-menu__item--danger { color: var(--fs-error-accent); }
.fs-menu__item--danger .lu { color: inherit; }
.fs-menu__item--danger:hover { background: var(--fs-error-bg); }
.fs-menu__item--theme { cursor: default; justify-content: space-between; }
.fs-menu__item--theme:hover { background: transparent; }
.fs-menu__divider { height: 1px; background: var(--fs-line); margin: 8px 0; }
.fs-menu__item .fs-spacer { flex: 1; }
.fs-scrim { position: fixed; inset: 0; background: var(--fs-scrim); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.fs-dialog { width: min(440px, calc(100vw - 32px)); background: var(--fs-surface); color: var(--fs-ink); border: 1px solid var(--fs-line); border-radius: 12px; box-shadow: var(--fs-shadow-2); padding: 24px; }
.fs-dialog--form { width: min(700px, calc(100vw - 32px)); padding: 0; }
.fs-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fs-dialog__title { margin: 0; font-size: 18px; font-weight: 600; color: var(--fs-text-heading); }
.fs-dialog__body { margin: 8px 0 0; font-size: 14px; color: var(--fs-muted); line-height: 1.5; }
.fs-dialog__stays { margin: 8px 0 0; font-size: 14px; color: var(--fs-ink); }
.fs-dialog__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.fs-dialog--form .fs-dialog__head { padding: 16px 24px; border-bottom: 1px solid var(--fs-line); }
.fs-dialog--form .fs-dialog__content { padding: 24px; }
.fs-dialog--form .fs-dialog__actions { margin: 0; padding: 16px 24px; border-top: 1px solid var(--fs-line); }

/* P2: in dark, a pressed chip or page-size segment uses the quiet soft pair.
   The bright accent stays on the one primary button. */
html[data-theme="dark"] .fs-chip[aria-pressed="true"],
html[data-theme="dark"] .fs-segmented > button[aria-pressed="true"],
html[data-theme="dark"] .fs-segmented > button[aria-checked="true"] {
  background: var(--fs-soft);
  color: var(--fs-on-soft);
  border-color: transparent;
}
