
/* ==========================================================================
   Sync Finger Prints modal (fp-sync)
   Tokens only - no raw hex - so the panel follows the light and dark themes.
   ========================================================================== */

.fp-sync__header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.fp-sync__count {
  font-size: 12px;
  font-weight: 600;
  color: var(--rw-text-light, #6B7280);
  background: var(--rw-surface, #f8fafc);
  border: 1px solid var(--rw-border, #E2E5EA);
  border-radius: 999px;
  padding: 4px 8px;
  white-space: nowrap;
}

/* Buttons: exactly one filled button in this modal, so Sync is unmistakably primary. */
.fp-sync__btn-primary,
.fp-sync__btn-primary:hover,
.fp-sync__btn-primary:focus {
  background: var(--rw-primary, #0E52C1);
  color: var(--rw-white, #FFFFFF);
  border: 1px solid var(--rw-primary, #0E52C1);
  min-height: 40px;
  font-weight: 600;
}
.fp-sync__btn-primary:hover { background: var(--rw-primary-dark, #1A5AE6); border-color: var(--rw-primary-dark, #1A5AE6); }
.fp-sync__btn-caret { border-left-color: var(--rw-primary-dark, #1A5AE6); }

.fp-sync__btn-secondary {
  background: var(--rw-card-bg, #FFFFFF);
  color: var(--rw-text, #1F2937);
  border: 1px solid var(--rw-border, #E2E5EA);
  border-radius: var(--radius-md, 8px);
  min-height: 40px;
  padding: 8px 16px;
  font-weight: 500;
}
.fp-sync__btn-secondary:hover { background: var(--rw-surface, #f8fafc); }

/* Mouse click leaves no ring - Bootstrap's button:focus would otherwise keep a halo on the chip
   after you toggle it, which reads as "still selected". Keyboard focus still shows one, below. */
.fp-sync .btn:focus,
.fp-sync .fp-sync__segment:focus,
.fp-sync__search-clear:focus {
  outline: none;
  box-shadow: none;
}

/* box-shadow, not outline: an outline draws a rounded RECTANGLE around a 999px pill, which stacked
   on the chip border and read as a double ring. A shadow follows border-radius exactly. */
.fp-sync .btn:focus-visible,
.fp-sync .fp-sync__segment:focus-visible,
.fp-sync__search-input:focus-visible,
.fp-sync__search-clear:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 82, 193, 0.25);
}

.fp-sync__hint {
  margin: 0 0 16px;
  color: var(--rw-text-light, #6B7280);
  font-size: 13px;
  line-height: 1.5;
}

/* Sync progress */
.fp-sync__progress { max-width: 360px; margin: 16px auto 0; }

.fp-sync__progress-track {
  height: 8px;
  border-radius: 999px;
  background: var(--rw-surface, #f8fafc);
  border: 1px solid var(--rw-border, #E2E5EA);
  overflow: hidden;
}

.fp-sync__progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--rw-primary, #0E52C1);
  transition: width 240ms ease;
}

/* Indeterminate: a stripe sweeping the track, for the phases whose size we cannot know yet.
   No width transition here, or the sweep fights the 240ms easing above. */
.fp-sync__progress-track.is-indeterminate .fp-sync__progress-fill {
  width: 40%;
  transition: none;
  animation: fpSyncSweep 1.2s ease-in-out infinite;
}

@keyframes fpSyncSweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}

@media (prefers-reduced-motion: reduce) {
  .fp-sync__progress-track.is-indeterminate .fp-sync__progress-fill {
    animation: none;
    width: 100%;
    opacity: 0.4;
  }
}

.fp-sync__progress-label {
  margin-top: 8px;
  font-size: 12px;
  color: var(--rw-text-light, #6B7280);
  /* Tabular figures stop the label jittering as the counter climbs. */
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  .fp-sync__progress-fill { transition: none; }
}

/* Advisory, not an error - the sync is working; this only warns against interrupting it.
   Amber TEXT on a tinted surface rather than white on amber, which fails AA (same call as
   fp-validate__timer). Both tokens are redefined for the dark theme, so this follows it.
   Width matches .fp-sync__progress so the two stack as one column, and text-align is reset
   because .fp-sync__busy centres everything - centred multi-line prose is hard to read. */
.fp-sync__notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 360px;
  margin: 16px auto 0;
  padding: 8px 16px;
  text-align: left;
  font-size: 13px;
  line-height: 1.5;
  color: var(--rw-warning-text, #92400e);
  background: var(--rw-warning-bg, #fffbeb);
  border: 1px solid var(--rw-warning, #f4986d);
  border-radius: var(--radius-md, 8px);
}
/* Nudge the glyph onto the first line's baseline rather than the flex cross-axis top. */
.fp-sync__notice i { margin-top: 2px; }

.fp-sync__busy { text-align: center; padding: 48px 16px; }
.fp-sync__busy i { color: var(--rw-primary, #0E52C1); }
.fp-sync__busy h4 { margin: 16px 0 0; color: var(--rw-text, #1F2937); font-size: 16px; font-weight: 600; }
.fp-sync__busy p { margin: 4px 0 0; color: var(--rw-text-light, #6B7280); font-size: 13px; }

/* Toolbar: search grows, type chips pinned right. */
.fp-sync__toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.fp-sync__search { position: relative; flex: 1 1 240px; min-width: 200px; }

.fp-sync__search-icon {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--rw-text-light, #6B7280);
  font-size: 13px;
  pointer-events: none;
}

.fp-sync__search-input {
  width: 100%;
  min-height: 40px;
  padding: 8px 32px;
  font-size: 13px;
  color: var(--rw-text, #1F2937);
  background: var(--rw-card-bg, #FFFFFF);
  border: 1px solid var(--rw-border, #E2E5EA);
  border-radius: var(--radius-md, 8px);
}
.fp-sync__search-input:focus { border-color: var(--rw-primary, #0E52C1); }

.fp-sync__search-clear {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--rw-text-light, #6B7280);
  border-radius: 999px;
}
.fp-sync__search-clear:hover { color: var(--rw-text, #1F2937); background: var(--rw-surface, #f8fafc); }

.fp-sync__filter { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* The control names itself. The previous version carried an aria-label only, so for a sighted user
   the two pills had nothing saying they filtered anything. */
.fp-sync__filter-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--rw-text-light, #6B7280);
}

/* Segmented, single-select: exactly one segment is always filled, so the resting state reads as a
   control. The old pair of chips styled only the EXCLUDED one, which meant the default view - both
   types showing - was two flat outlines and a number, indistinguishable from a statistics readout.
   Track is 4px padding + 30px segment + 1px border = 40px, matching .fp-sync__search-input beside it. */
.fp-sync__segmented {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 4px;
  background: var(--rw-surface, #f8fafc);
  border: 1px solid var(--rw-border, #E2E5EA);
  border-radius: 999px;
}

.fp-sync__segment {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 4px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--rw-text-light, #6B7280);
  background: transparent;
  border: 0;
  border-radius: 999px;
  white-space: nowrap;
}
.fp-sync__segment:hover { color: var(--rw-text, #1F2937); background: var(--rw-hover-bg, #eef2f7); }

/* Fill and weight change together, so the selected segment is never signalled by colour alone.
   Soft primary rather than a solid one: Sync is the modal's primary action and must stay loudest. */
.fp-sync__segment.is-active {
  font-weight: 600;
  color: var(--rw-primary, #0E52C1);
  background: var(--rw-primary-light, #EEF3FF);
}
.fp-sync__segment.is-active:hover {
  color: var(--rw-primary, #0E52C1);
  background: var(--rw-primary-light, #EEF3FF);
}

/* Borderless: a bordered badge inside a segmented track reads as a box in a box. */
.fp-sync__segment-count {
  min-width: 20px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  color: var(--rw-text-light, #6B7280);
  background: var(--rw-card-bg, #FFFFFF);
}
.fp-sync__segment.is-active .fp-sync__segment-count {
  color: var(--rw-primary, #0E52C1);
  background: var(--rw-card-bg, #FFFFFF);
}

/* List */
.fp-sync__list {
  list-style: none;
  margin: 0;
  padding: 0;
  /* 6 rows at the 56px row height, so a typical outlet roster fits without scrolling. */
  max-height: 336px;
  overflow-y: auto;
  border: 1px solid var(--rw-border, #E2E5EA);
  border-radius: var(--radius-md, 8px);
  background: var(--rw-card-bg, #FFFFFF);
}

/* Fixed row height keeps the list a clean grid even when a user has no roles or no date. */
.fp-sync__row {
  padding: 8px 16px;
  min-height: 56px;
  border-bottom: 1px solid var(--rw-border, #E2E5EA);
}
.fp-sync__row:last-child { border-bottom: 0; }
.fp-sync__row:hover { background: var(--rw-surface, #f8fafc); }

.fp-sync__row-main { display: flex; align-items: center; gap: 16px; }

/* flex + min-width:0 lets a long name ellipsize instead of pushing the pill out of column. */
.fp-sync__name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--rw-text, #1F2937);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Type sits in a fixed right-hand column so the eye scans one line, not a ragged edge.
   Quiet by design: it is metadata, not an action - the name stays the loudest thing in the row.
   Carried by the pill TEXT, never by colour alone. */
.fp-sync__pill {
  flex: 0 0 auto;
  margin-left: auto;
  min-width: 88px;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.fp-sync__pill--deployment {
  color: var(--rw-primary, #0E52C1);
  background: var(--rw-primary-light, #EEF3FF);
}
.fp-sync__pill--enterprise {
  color: var(--rw-text-light, #6B7280);
  background: var(--rw-surface, #f8fafc);
  border-color: var(--rw-border, #E2E5EA);
}

/* Reserved height so a row with no roles and no date does not collapse shorter than its siblings. */
.fp-sync__row-meta {
  margin-top: 2px;
  min-height: 16px;
  font-size: 12px;
  color: var(--rw-text-light, #6B7280);
}
.fp-sync__dot { margin: 0 4px; }

/* Skeletons match the real row height, so the list does not jump when data lands. */
.fp-sync__skeletons {
  border: 1px solid var(--rw-border, #E2E5EA);
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
}
.fp-sync__skel-row { padding: 8px 16px; border-bottom: 1px solid var(--rw-border, #E2E5EA); }
.fp-sync__skel-row:last-child { border-bottom: 0; }
.fp-sync__skel-line {
  height: 8px;
  border-radius: 4px;
  background: var(--rw-surface, #f8fafc);
  animation: fpSyncPulse 1.4s ease-in-out infinite;
}
.fp-sync__skel-line--name { width: 40%; margin-bottom: 8px; }
.fp-sync__skel-line--meta { width: 24%; }

@keyframes fpSyncPulse {
  0%   { opacity: 1; }
  50%  { opacity: 0.4; }
  100% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .fp-sync__skel-line { animation: none; }
}

/* Empty and error states */
.fp-sync__state { padding: 32px 24px; }
.fp-sync__state-icon { font-size: 24px; color: var(--rw-text-light, #6B7280); margin-bottom: 8px; }
.fp-sync__state-icon--danger { color: var(--rw-danger, #ef4444); }
.fp-sync__state h4 { margin-bottom: 4px; }
.fp-sync__state p { margin: 0 0 16px; color: var(--rw-text-light, #6B7280); font-size: 13px; }

@media (max-width: 768px) {
  .fp-sync__filter { margin-left: 0; width: 100%; }
  .fp-sync__segmented { flex: 1 1 auto; }
  .fp-sync__segment { flex: 1 1 auto; justify-content: center; padding: 4px 8px; }
}
