/* ==========================================================================
   Hindsight — Components
   Reusable building blocks. Each future screen composes from these.
   ========================================================================== */

/* ---- Card --------------------------------------------------------------- */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
}
.card--pad { padding: var(--s-5); }

/* ---- Section header (title + "View all" link) --------------------------- */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-4);
}

/* ---- Welcome / hero banner --------------------------------------------- */
.welcome {
  background: linear-gradient(180deg, var(--c-primary-600) 0%, var(--c-primary) 100%);
  border-radius: var(--r-xl);
  padding: var(--s-7);
  color: var(--c-on-primary);
}
.welcome__title {
  font-size: var(--fz-2xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.01em;
}
.welcome__subtitle {
  font-size: var(--fz-md);
  color: var(--c-on-primary-dim);
  margin-top: 4px;
}
.welcome__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
  margin-top: var(--s-6);
  max-width: 640px;
}

/* stat box (on translucent banner) */
.stat-box {
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--r-md);
  padding: var(--s-4);
}
.stat-box__num {
  font-size: var(--fz-2xl);
  font-weight: var(--fw-bold);
  line-height: 1;
}
.stat-box__label {
  font-size: var(--fz-sm);
  color: var(--c-on-primary-dim);
  margin-top: 6px;
}

/* ---- Quick-action tiles ------------------------------------------------- */
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
}
@media (min-width: 768px) {
  .action-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
.action-tile {
  display: block;
  text-align: left;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  box-shadow: var(--sh-card);
  transition: box-shadow var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}
.action-tile:hover {
  box-shadow: var(--sh-raise);
  transform: translateY(-2px);
}
.action-tile__icon {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--s-4);
}
.action-tile__icon--blue  { background: var(--c-primary-050); color: var(--c-primary); }
.action-tile__icon--green { background: var(--c-success-bg);  color: var(--c-success); }
.action-tile__title {
  font-size: var(--fz-md);
  font-weight: var(--fw-semibold);
  color: var(--c-ink);
}
.action-tile__desc {
  font-size: var(--fz-sm);
  color: var(--c-ink-3);
  margin-top: 2px;
}

/* ---- Status pill -------------------------------------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  font-size: var(--fz-xs);
  font-weight: var(--fw-semibold);
  padding: 4px 10px;
  border-radius: var(--r-pill);
  line-height: 1;
  white-space: nowrap;
}
.pill--completed   { background: var(--c-success-bg); color: var(--c-success); }
.pill--in-progress { background: var(--c-warning-bg); color: var(--c-warning); }
.pill--posted      { background: var(--c-info-bg);    color: var(--c-info); }
.pill--aog         { background: var(--c-danger-bg);  color: var(--c-danger); }

/* ---- AOG event card ----------------------------------------------------- */
.event-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
}
@media (min-width: 768px) {
  .event-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.event-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  padding: var(--s-5);
}
/* card-as-link (dashboard events point to the AOG hub) */
a.event-card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
a.event-card:hover { border-color: var(--c-border-strong); box-shadow: var(--sh-raise); }

.event-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--s-4);
}
.event-card__title {
  font-size: var(--fz-md);
  font-weight: var(--fw-semibold);
  color: var(--c-ink);
}
.event-card__desc {
  font-size: var(--fz-sm);
  color: var(--c-ink-2);
  margin-top: 3px;
}
.event-card__price {
  font-size: var(--fz-lg);
  font-weight: var(--fw-bold);
  color: var(--c-ink);
  white-space: nowrap;
}
.event-card__pills {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  margin-top: 8px;
}
.event-card__pill-row { display: flex; gap: 6px; }

/* meta row: location + duration */
.meta-row {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  margin-top: var(--s-4);
}
.meta-row__item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fz-sm);
  color: var(--c-ink-2);
}
.meta-row__item .icon { color: var(--c-ink-3); }

/* assignee row */
.assignee {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-4);
}
.assignee__avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--c-bg);
}
.assignee__name {
  font-size: var(--fz-sm);
  font-weight: var(--fw-medium);
  color: var(--c-ink);
}
.rating {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--fz-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-ink);
}
.rating .icon { color: var(--c-star); }

/* ---- Tech card grid ----------------------------------------------------- */
/* Mobile: horizontal scroller. Desktop: responsive grid. */
.tech-scroller {
  display: flex;
  gap: var(--s-4);
  overflow-x: auto;
  padding-bottom: var(--s-2);
  margin-inline: calc(var(--page-pad) * -1);
  padding-inline: var(--page-pad);
  scrollbar-width: none;
}
.tech-scroller::-webkit-scrollbar { display: none; }

.tech-card {
  flex: 0 0 180px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  padding: var(--s-5);
}

@media (min-width: 900px) {
  .tech-scroller {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    overflow: visible;
    margin-inline: 0;
    padding-inline: 0;
    padding-bottom: 0;
  }
  .tech-card { flex: initial; }
}
.tech-card__head {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}
.tech-card__avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--c-bg);
  flex-shrink: 0;
}
.tech-card__name {
  font-size: var(--fz-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-ink);
  line-height: 1.25;
}
.tech-card__status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fz-xs);
  margin-top: 3px;
}
.tech-card__status::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tech-card__status--available { color: var(--c-success); }
.tech-card__status--available::before { background: var(--c-success); }
.tech-card__status--busy { color: var(--c-warning); }
.tech-card__status--busy::before { background: var(--c-warning); }

.tech-card__rows { display: flex; flex-direction: column; gap: var(--s-3); }
.tech-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--fz-sm);
}
.tech-card__row-label { color: var(--c-ink-3); }
.tech-card__row-value {
  color: var(--c-ink);
  font-weight: var(--fw-medium);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--s-4);
}
.tag {
  font-size: var(--fz-xs);
  font-weight: var(--fw-medium);
  color: var(--c-ink);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  padding: 4px 10px;
  border-radius: var(--r-pill);
}

/* ==========================================================================
   FORM COMPONENTS — reusable across all form screens
   ========================================================================== */

/* Page heading block (title + subtitle) — reuse on any inner page */
.page-head { margin-bottom: var(--s-6); }
.page-head__title {
  font-size: var(--fz-2xl);
  font-weight: var(--fw-bold);
  color: var(--c-ink);
  letter-spacing: -0.01em;
}
.page-head__subtitle {
  font-size: var(--fz-md);
  color: var(--c-ink-2);
  margin-top: 4px;
}

/* Form card — a grouped section of fields */
.form-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  padding: var(--s-6);
}
.form-card + .form-card { margin-top: var(--s-4); }

.form-card__head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}
.form-card__icon {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  background: var(--c-primary-050);
  color: var(--c-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.form-card__title {
  font-size: var(--fz-lg);
  font-weight: var(--fw-semibold);
  color: var(--c-ink);
}
.form-card__hint {
  font-size: var(--fz-sm);
  color: var(--c-ink-3);
  margin-top: 1px;
}

/* Field grid — 1 or 2 columns */
.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
}
@media (min-width: 640px) {
  .field-grid--2 { grid-template-columns: 1fr 1fr; }
}
.field--full { grid-column: 1 / -1; }

/* Single field */
.field { display: flex; flex-direction: column; gap: var(--s-2); }
.field__label {
  font-size: var(--fz-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-ink);
}
.field__label .req { color: var(--c-danger); margin-left: 2px; }
.field__hint {
  font-size: var(--fz-xs);
  color: var(--c-ink-3);
}

/* Inputs / select / textarea — shared base */
.input,
.textarea,
.select {
  width: 100%;
  font-family: var(--font-base);
  font-size: var(--fz-base);
  color: var(--c-ink);
  background: var(--c-surface);
  border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md);
  padding: 12px 14px;
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder,
.textarea::placeholder { color: var(--c-ink-3); }

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-050);
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.55; }

/* Select with custom chevron */
.select-wrap { position: relative; }
.select-wrap::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 9px; height: 9px;
  border-right: 2px solid var(--c-ink-3);
  border-bottom: 2px solid var(--c-ink-3);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}
.select { padding-right: 38px; cursor: pointer; }

/* Input with a leading affix (e.g. $ for budget) */
.input-affix { position: relative; }
.input-affix__sym {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--fz-base);
  color: var(--c-ink-3);
  pointer-events: none;
}
.input-affix .input { padding-left: 30px; }
.input-affix__unit {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--fz-sm);
  color: var(--c-ink-3);
  pointer-events: none;
}

/* ---- Checkbox row (agreements, opt-ins) ---- */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  margin-top: var(--s-4);
}
.check-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  flex-shrink: 0;
  accent-color: var(--c-primary);
  cursor: pointer;
}
.check-row label {
  font-size: var(--fz-sm);
  color: var(--c-ink-2);
  line-height: 1.5;
  cursor: pointer;
}
.check-row a {
  color: var(--c-primary);
  font-weight: var(--fw-semibold);
}

/* Segmented control (e.g. priority Low/Med/High) */
.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 4px;
}
.segmented__opt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  font-size: var(--fz-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-ink-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
}
.segmented__opt:hover { color: var(--c-ink); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented__opt::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: .45;
}
.segmented input:checked + .segmented__opt {
  background: var(--c-surface);
  color: var(--c-ink);
  box-shadow: var(--sh-card);
}
.segmented input:checked + .segmented__opt.is-low    { color: var(--c-success); }
.segmented input:checked + .segmented__opt.is-medium { color: var(--c-warning); }
.segmented input:checked + .segmented__opt.is-high   { color: var(--c-danger); }
.segmented input:checked + .segmented__opt::before { opacity: 1; }

/* Read-only / derived value display (e.g. coordinates) */
.readonly-val {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fz-base);
  color: var(--c-ink-2);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 12px 14px;
}
.readonly-val .icon { color: var(--c-ink-3); }

/* Form action bar (sticky on mobile) */
.form-actions {
  display: flex;
  gap: var(--s-3);
  justify-content: flex-end;
  margin-top: var(--s-6);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  font-family: var(--font-base);
  font-size: var(--fz-md);
  font-weight: var(--fw-semibold);
  padding: 13px 24px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: filter var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
}
.btn--primary {
  background: var(--c-primary);
  color: var(--c-on-primary);
}
.btn--primary:hover { background: var(--c-primary-700); }
.btn--ghost {
  background: var(--c-surface);
  color: var(--c-ink);
  border: 1px solid var(--c-border-strong);
}
.btn--ghost:hover { background: var(--c-bg); }
.btn--block { width: 100%; }

@media (max-width: 560px) {
  .form-actions {
    flex-direction: column-reverse;
    position: sticky;
    bottom: 0;
    background: var(--c-bg);
    padding: var(--s-4) 0;
    margin-inline: calc(var(--page-pad) * -1);
    padding-inline: var(--page-pad);
    border-top: 1px solid var(--c-border);
  }
  .form-actions .btn { width: 100%; }
}

/* wrapper so the eye toggle / check can sit inside the field */
.pw-field { position: relative; }
.pw-field .input { padding-right: 76px; }

/* eye toggle button */
.pw-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border: 0; background: none; color: var(--c-ink-3); cursor: pointer;
  border-radius: var(--r-sm);
}
.pw-toggle:hover { color: var(--c-ink); background: var(--c-bg); }
.pw-toggle svg { width: 20px; height: 20px; }
.pw-toggle .pw-toggle-slash { display: none; }
.pw-toggle.is-visible .pw-toggle-slash { display: block; }

/* live match check (confirm field) */
.pw-match {
  position: absolute; right: 48px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  color: var(--c-success); opacity: 0;
  transition: opacity var(--dur-fast) var(--ease); pointer-events: none;
}
.pw-match svg { width: 20px; height: 20px; }
.pw-field.is-match .pw-match { opacity: 1; }

/* requirements list inside customAlert */
.pw-reqs { list-style: none; margin: var(--s-2) 0 0; padding: 0; text-align: left; }
.pw-reqs li {
  display: flex; align-items: center; gap: var(--s-2);
  font-size: var(--fz-sm); padding: 5px 0; color: var(--c-ink-2);
}
.pw-reqs li .pw-reqs-icon {
  width: 18px; height: 18px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.pw-reqs li .pw-reqs-icon svg { width: 16px; height: 16px; }
.pw-reqs li.is-met     { color: var(--c-ink); }
.pw-reqs li.is-met     .pw-reqs-icon { color: var(--c-success); }
.pw-reqs li.is-missing .pw-reqs-icon { color: var(--c-danger); }

/* error (default) */
.customAlert--error .customAlert-icon {
  background: var(--c-danger-bg);
  color: var(--c-danger);
}

/* success */
.customAlert--success .customAlert-icon {
  background: var(--c-success-bg);
  color: var(--c-success);
}
.customAlert--success .customAlert-btn {
  background: var(--c-success);
}
.customAlert--success .customAlert-btn:hover {
  filter: brightness(.95);
}

/* ==========================================================================
   ROLE PICKER — choose Operator vs Technician
   ========================================================================== */

.role-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.role-card {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  width: 100%;
  text-align: left;
  background: var(--c-surface);
  border: 1.5px solid var(--c-border-strong);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
}
.role-card:hover {
  border-color: var(--c-primary);
  box-shadow: var(--sh-card);
}
.role-card.is-selected {
  border-color: var(--c-primary);
  background: var(--c-primary-050);
  box-shadow: 0 0 0 3px var(--c-primary-050);
}

.role-card__icon {
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  background: var(--c-primary-050);
  color: var(--c-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.role-card.is-selected .role-card__icon {
  background: var(--c-primary);
  color: var(--c-on-primary);
}
.role-card__icon .icon { width: 26px; height: 26px; }

.role-card__body { flex: 1; min-width: 0; }
.role-card__title {
  display: block;
  font-size: var(--fz-md);
  font-weight: var(--fw-semibold);
  color: var(--c-ink);
}
.role-card__desc {
  display: block;
  font-size: var(--fz-sm);
  color: var(--c-ink-2);
  margin-top: 2px;
  line-height: 1.5;
}

/* radio check indicator on the right */
.role-card__check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--c-border-strong);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--dur-fast) var(--ease),
              background var(--dur-fast) var(--ease);
}
.role-card__check .icon {
  width: 14px; height: 14px;
  color: #fff;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease);
}
.role-card.is-selected .role-card__check {
  border-color: var(--c-primary);
  background: var(--c-primary);
}
.role-card.is-selected .role-card__check .icon { opacity: 1; }


/* ==========================================================================
   CUSTOM ALERT — fully namespaced to avoid CSS collisions
   ========================================================================== */
#customAlert-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 27, 45, .45);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-5);
  animation: customAlert-fade var(--dur) var(--ease);
}
.customAlert {
  width: 100%;
  max-width: 400px;
  background: var(--c-surface);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-raise);
  padding: var(--s-6);
  text-align: center;
  animation: customAlert-rise var(--dur) var(--ease);
}

@keyframes customAlert-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes customAlert-rise {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  #customAlert-backdrop,
  .customAlert { animation: none; }
}

/* --- unchanged from before --- */
.customAlert-icon {
  width: 52px; height: 52px;
  margin: 0 auto var(--s-4);
  border-radius: var(--r-pill);
  display: flex; align-items: center; justify-content: center;
  background: var(--c-danger-bg);
  color: var(--c-danger);
}
.customAlert-icon svg { width: 26px; height: 26px; }
.customAlert-title {
  font-size: var(--fz-lg);
  font-weight: var(--fw-bold);
  color: var(--c-ink);
}
.customAlert-body {
  font-size: var(--fz-base);
  color: var(--c-ink-2);
  margin-top: var(--s-2);
  line-height: 1.55;
}
.customAlert-actions { margin-top: var(--s-6); }
.customAlert-btn {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-base);
  font-size: var(--fz-md);
  font-weight: var(--fw-semibold);
  padding: 13px 24px;
  border-radius: var(--r-md);
  cursor: pointer;
  border: 0;
  background: var(--c-primary);
  color: var(--c-on-primary);
}
.customAlert-btn:hover { background: var(--c-primary-700); }
.customAlert-invalid {
  border-color: var(--c-danger) !important;
  box-shadow: 0 0 0 3px var(--c-danger-bg) !important;
}


/* Invalid field highlight (paired with customAlert) */
.customAlert-invalid {
  border-color: var(--c-danger) !important;
  box-shadow: 0 0 0 3px var(--c-danger-bg) !important;
}


/* ---- Generic spinner ---- */
.generic-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: generic-spinner-spin .7s linear infinite;
}
@keyframes generic-spinner-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .generic-spinner { animation-duration: 1.4s; }
}

.generic-spinner--center {
  margin: var(--s-8) auto;
}

.generic-spinner--sm { width: 20px; height: 20px; border-width: 2px; }
.generic-spinner--lg { width: 60px; height: 60px; border-width: 4px; }

/* Spinner button*/
.generic-spinner--btn {
  width: 18px;
  height: 18px;
  border-width: 2px;
  border-color: rgba(255, 255, 255, .4);
  border-top-color: #fff;
}

.generic-spinner-overlay {
  position: fixed;
  inset: 0;
  z-index: 1900;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .7);
}


/* ==========================================================================
   USER MENU — chip dropdown (user-driven items)
   ========================================================================== */

/* anchor point for the dropdown */
.app-header__right { position: relative; }

.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 52px;              /* clears the hamburger */
  width: 280px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-raise);
  z-index: 60;
  overflow: hidden;
  animation: user-menu-in .15s var(--ease);
}
@keyframes user-menu-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .user-menu { animation: none; }
}

/* head: identity block */
.user-menu__head {
  padding: var(--s-5);
  border-bottom: 1px solid var(--c-border);
}
.user-menu__id {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.user-menu__avatar {
  width: 44px; height: 44px;
  border-radius: var(--r-pill);
  background: var(--c-primary-050);
  color: var(--c-primary);
  font-size: var(--fz-sm);
  font-weight: var(--fw-bold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user-menu__meta { min-width: 0; }
.user-menu__name {
  font-size: var(--fz-md);
  font-weight: var(--fw-semibold);
  color: var(--c-ink);
}
.user-menu__email {
  font-size: var(--fz-sm);
  color: var(--c-ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* role pill (owner / member / tech …) */
.user-menu__role {
  display: inline-block;
  margin-top: var(--s-3);
  font-size: var(--fz-sm);
  font-weight: var(--fw-semibold);
  color: var(--c-ink);
  background: var(--c-bg);
  border-radius: var(--r-pill);
  padding: 5px 14px;
}

/* availability line */
.user-menu__status {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--fz-base);
  color: var(--c-ink);
  margin-top: var(--s-3);
}
.user-menu__status::before {
  content: "";
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--c-success);
  flex-shrink: 0;
}

/* body: menu items */
.user-menu__body { padding: var(--s-2) 0; }

.user-menu__item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 11px var(--s-5);
  font-size: var(--fz-base);
  color: var(--c-ink);
  transition: background var(--dur-fast) var(--ease);
}
.user-menu__item:hover { background: var(--c-bg); }
.user-menu__item .icon {
  width: 19px; height: 19px;
  color: var(--c-ink-2);
  flex-shrink: 0;
}

.user-menu__divider {
  height: 1px;
  background: var(--c-border);
  margin: var(--s-2) 0;
}

/* mobile: full-width sheet under the header */
@media (max-width: 480px) {
  .user-menu {
    right: 0;
    left: auto;
    width: calc(100vw - 32px);
    max-width: 320px;
  }
}



/* Danger zone */
.danger-zone {
  border: 1px solid var(--c-danger-bg);
  background: color-mix(in srgb, var(--c-danger-bg) 35%, var(--c-surface));
  border-radius: var(--r-lg);
  padding: var(--s-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin-top: var(--s-4);
}
.danger-zone__text { min-width: 0; }
.danger-zone__title {
  font-size: var(--fz-md);
  font-weight: var(--fw-semibold);
  color: var(--c-danger);
}
.danger-zone__hint {
  font-size: var(--fz-sm);
  color: var(--c-ink-2);
  margin-top: 2px;
}
.btn--danger {
  background: var(--c-danger);
  color: #fff;
  flex-shrink: 0;
}
.btn--danger:hover { filter: brightness(.95); }
