/* Password show/hide toggle — shared component.
   Extracted from components.css (CSS split, CLAUDE.md §12).
   Consumed by frontend/js/utils.js (used on Login and Settings'
   Change Password form, among others).
   Dark-theme overrides are colocated at the bottom of this file
   instead of a separate far-away tail block. */
@layer components {

/* ── ALL2: Password show/hide toggle ─────────────────────────────────────── */
.pw-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.pw-wrapper .input {
  padding-right: 2.5rem;
  width: 100%;
}
.pw-toggle {
  position: absolute;
  right: var(--space-2);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: var(--space-1);
  color: var(--muted);
  line-height: 1;
  flex-shrink: 0;
}
.pw-toggle:hover { color: var(--text); }


@media (pointer: coarse), (max-width: 600px) {
  .pw-wrapper .input { padding-right: 3.5rem; }
  .pw-toggle { min-width: 44px; min-height: 44px; right: var(--space-1); }
}

/* ── Token select (components/token-select.js) ─────────────────────────────
   Removable value tokens plus a typed combobox. Used by the roster search
   builder (features/roster/search/builder.js). */
.token-select { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); min-width: 0; }
.token-select-tokens { display: contents; list-style: none; margin: 0; padding: 0; }
.token-select-token {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  padding: 1px 2px 1px var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--info-bg);
  color: var(--text);
  font-size: var(--text-sm);
}
.token-select-token > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.token-select-remove {
  min-width: 22px;
  min-height: 22px;
  padding: 0;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}
.token-select-remove:hover { color: var(--danger); background: var(--danger-bg); }
.token-select-remove:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.token-select-combo { position: relative; flex: 1 1 10rem; min-width: 8rem; max-width: 16rem; }
.token-select-input { width: 100%; }
.token-select-list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 2px);
  left: 0;
  width: max(100%, 14rem);
  max-height: 16rem;
  overflow-y: auto;
  margin: 0;
  padding: var(--space-1) 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-overlay);
}
.token-select-list[hidden] { display: none; }
.token-select-option { padding: var(--space-1) var(--space-3); cursor: pointer; font-size: var(--text-sm); }
.token-select-option:hover,
.token-select-option.is-active { background: var(--hover-tint); color: var(--text); }
.token-select-empty { padding: var(--space-1) var(--space-3); color: var(--muted); font-size: var(--text-sm); }


/* ── Absence form (components/absence-form.js) ────────────────────────────
   Type as a choice group, the date pair on one row with one format hint,
   and the non-default coverage shapes behind a disclosure. */
.absence-type-choices { border: 0; padding: 0; margin-inline: 0; }
.absence-type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: var(--space-2); }
.absence-type-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-weight: 600;
  cursor: pointer;
}
.absence-type-option:has(input:checked) { border-color: var(--primary); background: var(--p-50); color: var(--p-600); }
.absence-type-option:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.absence-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--space-3); margin-bottom: var(--space-2); }
.absence-dates .form-group { margin-bottom: 0; }
.absence-dates .date-format-hint { grid-column: 1 / -1; }
/* The sick type's expected-last-day quick choices and best-guess note, under both dates. */
.absence-sick-end { grid-column: 1 / -1; display: grid; gap: var(--space-1); margin-top: var(--space-2); }
@media (max-width: 600px) {
  .absence-sick-end .segmented { display: grid; grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Report recovery (features/leave/recovery.js): quick choices over the return date, the shift preview, the withdraw line. */
.recovery-return .segmented { margin-bottom: var(--space-2); flex-wrap: wrap; }
.recovery-preview { display: grid; gap: var(--space-1); margin-bottom: var(--space-3); padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-sunk); }
.recovery-preview-heading { margin: 0; font-size: var(--text-sm); font-weight: 600; }
.recovery-preview-list { margin: 0 0 var(--space-1); padding-left: var(--space-4); font-size: var(--text-sm); }
.recovery-withdraw { display: grid; gap: var(--space-1); margin-top: var(--space-3); padding-top: var(--space-2); border-top: 1px solid var(--border); }
@media (max-width: 600px) {
  .recovery-return .segmented { display: grid; grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.absence-effect { margin: 0 0 var(--space-2); }
.absence-coverage { margin-bottom: var(--space-3); }
.absence-coverage > summary { cursor: pointer; color: var(--primary); font-size: var(--text-sm); font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.absence-coverage[open] > summary { margin-bottom: var(--space-2); }
@media (pointer: coarse) {
  .absence-type-option, .absence-coverage > summary { min-height: 44px; }
}

/* ── Edit in place (components/inline-edit.js) ──────────────────────────────
   A value with its Edit button; editing swaps it for labelled fields with
   Save and Cancel on the same row, and hints, a warning ("Save anyway") or an
   error as text underneath. Colours come from tokens, so dark theme follows. */
.inline-edit { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.inline-edit--editing { display: block; }
.inline-edit-value { min-width: 0; overflow-wrap: anywhere; }
.inline-edit-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2) var(--space-3); }
.inline-edit-field { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.inline-edit-field--number .input { width: 8rem; }
/* A checkbox list (type 'choices') takes the full row; Save and Cancel follow below it. */
.inline-edit-field--choices { flex: 1 1 100%; margin: 0; padding: 0; border: 0; }
.inline-edit-field--choices > legend { margin-bottom: var(--space-1); padding: 0; color: var(--text); font-size: var(--text-sm); font-weight: 500; }
.inline-edit-actions { display: flex; gap: var(--space-2); }
.inline-edit-hint,
.inline-edit-warning,
.inline-edit-error { margin: var(--space-2) 0 0; }
.inline-edit-warning {
  padding: var(--space-2) var(--space-3);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius-sm);
  background: var(--warning-bg);
  color: var(--text);
}
@media (pointer: coarse) {
  .inline-edit-actions .btn { min-height: 44px; }
}

/* ── Inline confirm (components/inline-confirm.js) ──────────────────────────
   A non-undoable decision inside a dialog or side panel, asked at the item:
   the question, the confirm button and Cancel on an amber strip. Tokens only,
   so dark theme follows. */
.inline-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); margin-top: var(--space-1); padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); background: var(--warning-bg); color: var(--text); font-size: var(--text-sm); }
.inline-confirm-question { min-width: 0; overflow-wrap: anywhere; }
.inline-confirm-row > td { padding-top: 0; }
} /* @layer components */
