/* ─────────────────────────────────────────────────────────────
   customer_facility.css  —  cmf-* namespace
   Customer Manage Facility / Facility Hub
   ───────────────────────────────────────────────────────────── */

/* ── Page shell ────────────────────────────────────────────── */

.cmf-page {
  padding: var(--csb-pad, 1.5rem);
  padding-top: 2rem;
  max-width: 900px;
}

/* ── Flash messages ─────────────────────────────────────────── */

.cmf-flash {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem 1rem;
  border-radius: var(--csb-radius, 8px);
  font-size: .875rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
}

.cmf-flash--notice {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.cmf-flash--alert {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* ── Hero banner (registration page) ───────────────────────── */

.cmf-hero {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  background: linear-gradient(135deg, #1e3a5f 0%, #1d4ed8 100%);
  color: #fff;
  border-radius: var(--csb-radius, 8px);
  padding: 2rem;
  margin-bottom: 1.75rem;
}

.cmf-hero__icon .material-icons-sharp {
  font-size: 3rem;
  opacity: .85;
}

.cmf-hero__title {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 .35rem;
}

.cmf-hero__lead {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 .5rem;
  opacity: .95;
}

.cmf-hero__text {
  font-size: .9rem;
  opacity: .85;
  line-height: 1.6;
  margin: 0;
}

/* ── Page header (edit page) ────────────────────────────────── */

.cmf-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.cmf-page-header__title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--csb-text, #1e293b);
  margin: 0 0 .2rem;
}

.cmf-page-header__sub {
  font-size: .875rem;
  color: var(--csb-muted, #64748b);
  margin: 0;
}

/* ── Facility Hub hero (inside sc-hero, white palette) ─────────── */

.cmf-hub-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: -5rem;
  padding-top: 1.6rem;
  padding-bottom: 1.7rem;
}

.cmf-hub-hero__icon {
  font-size: 3.2rem;
  color: #fff;
}

.cmf-hub-hero__title {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 .15rem;
}

.cmf-hub-hero__sub {
  font-size: .95rem;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 0;
}

/* ── Hub page header ─────────────────────────────────────────── */

.cmf-hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.cmf-hub-header__left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cmf-hub-header__icon {
  font-size: 2.5rem;
  color: var(--csb-primary, #1d4ed8);
}

.cmf-hub-header__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--csb-text, #1e293b);
  margin: 0 0 .15rem;
}

.cmf-hub-header__sub {
  font-size: .8rem;
  color: var(--csb-muted, #64748b);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 0;
}

/* ── Stats row ──────────────────────────────────────────────── */

.cmf-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--csb-gap, 1rem);
  margin-bottom: 1.25rem;
}

.cmf-stat-card {
  background: var(--csb-surface, #fff);
  border: 1px solid var(--csb-border, #e2e8f0);
  border-radius: var(--csb-radius, 8px);
  padding: 1.25rem 1rem;
  text-align: center;
}

.cmf-stat-card__value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--csb-primary, #1d4ed8);
  line-height: 1;
  margin-bottom: .3rem;
}

.cmf-stat-card__label {
  font-size: .8rem;
  color: var(--csb-muted, #64748b);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ── Facility info card ─────────────────────────────────────── */

.cmf-info-card {
  margin-bottom: 1.25rem;
  padding: 1.5rem;
}

.cmf-info-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  font-size: .9rem;
  font-weight: 600;
  color: var(--csb-text, #1e293b);
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--csb-border, #e2e8f0);
}

.cmf-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.cmf-info-grid__item {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
}

.cmf-info-grid__icon {
  font-size: 1.1rem;
  color: var(--csb-primary, #1d4ed8);
  margin-top: .1rem;
  flex-shrink: 0;
}

.cmf-info-grid__label {
  font-size: .75rem;
  color: var(--csb-muted, #64748b);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .15rem;
}

.cmf-info-grid__value {
  font-size: .9rem;
  color: var(--csb-text, #1e293b);
  line-height: 1.5;
}

/* ── Section cards (staff, product keys) ───────────────────── */

.cmf-section-card {
  margin-bottom: 1.25rem;
  padding: 1.5rem;
}

.cmf-section-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: .75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--csb-border, #e2e8f0);
}

.cmf-section-card__title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .95rem;
  font-weight: 600;
  color: var(--csb-text, #1e293b);
}

/* ── Staff list ─────────────────────────────────────────────── */

.cmf-staff-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.cmf-staff-row {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .65rem .75rem;
  border-radius: calc(var(--csb-radius, 8px) - 2px);
  background: var(--csb-bg, #f8fafc);
  border: 1px solid var(--csb-border, #e2e8f0);
}

.cmf-staff-row__avatar {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--csb-primary, #1d4ed8);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cmf-staff-row__info {
  flex: 1;
  min-width: 0;
}

.cmf-staff-row__name {
  font-size: .9rem;
  font-weight: 600;
  color: var(--csb-text, #1e293b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmf-staff-row__email {
  font-size: .8rem;
  color: var(--csb-muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmf-staff-row__badge {
  font-size: .7rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.cmf-staff-row__badge--manager {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

/* ── Empty state ────────────────────────────────────────────── */

.cmf-empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--csb-muted, #64748b);
}

.cmf-empty-state__icon {
  font-size: 2.5rem;
  opacity: .4;
  display: block;
  margin-bottom: .75rem;
}

.cmf-empty-state__title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--csb-text, #1e293b);
  margin-bottom: .3rem;
}

.cmf-empty-state__text {
  font-size: .85rem;
  margin-bottom: 1.25rem;
}

/* ── Action tiles ───────────────────────────────────────────── */

.cmf-action-grid {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-bottom: 1.25rem;
}

.cmf-action-tile {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--csb-surface, #fff);
  border: 1px solid var(--csb-border, #e2e8f0);
  border-radius: var(--csb-radius, 8px);
  text-decoration: none;
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s, background .18s;
}

a.cmf-action-tile:hover {
  border-color: var(--csb-primary, #1d4ed8);
  box-shadow: 0 4px 16px rgba(29, 78, 216, .08);
  background: #fafbff;
}

.cmf-action-tile--muted {
  opacity: .6;
  cursor: default;
}

.cmf-action-tile__icon {
  width: 3rem;
  height: 3rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cmf-action-tile__icon .material-icons-sharp {
  font-size: 1.5rem;
  color: #fff;
}

.cmf-action-tile__icon--blue  { background: var(--csb-primary, #1d4ed8); }
.cmf-action-tile__icon--green { background: #16a34a; }
.cmf-action-tile__icon--slate  { background: #64748b; }
.cmf-action-tile__icon--purple { background: #7c3aed; }

.cmf-action-tile__body {
  flex: 1;
  min-width: 0;
}

.cmf-action-tile__title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--csb-text, #1e293b);
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .2rem;
}

.cmf-action-tile__desc {
  font-size: .82rem;
  color: var(--csb-muted, #64748b);
  line-height: 1.5;
}

.cmf-action-tile__badge {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .15rem .45rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.cmf-action-tile__arrow {
  font-size: 1.4rem;
  color: var(--csb-border, #e2e8f0);
  flex-shrink: 0;
  transition: color .18s;
}

a.cmf-action-tile:hover .cmf-action-tile__arrow {
  color: var(--csb-primary, #1d4ed8);
}

/* ── Registration / Edit form ───────────────────────────────── */

.cmf-form-card {
  margin-bottom: 1.5rem;
  padding: 1.75rem;
}

/* Suppress the cdp-card lift/shadow hover inherited from the base card */
.cdp-card.cmf-form-card:hover {
  transform: none;
  box-shadow: none;
}

.cmf-form-card__header {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--csb-border, #e2e8f0);
}

.cmf-form-card__icon {
  font-size: 1.75rem;
  color: var(--csb-primary, #1d4ed8);
}

.cmf-form-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--csb-text, #1e293b);
}

.cmf-form-card__sub {
  font-size: .8rem;
  color: var(--csb-muted, #64748b);
  margin-top: .1rem;
}

.cmf-form__section-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--csb-muted, #64748b);
  margin: 1.25rem 0 .75rem;
}

.cmf-form__row {
  display: flex;
  gap: .9rem;
  flex-wrap: wrap;
}

.cmf-form__field {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin-bottom: .75rem;
}

.cmf-form__field--full  { width: 100%; }
.cmf-form__field--half  { flex: 1 1 calc(50% - .45rem); min-width: 180px; }
.cmf-form__field--grow  { flex: 1 1 200px; }
.cmf-form__field--sm    { flex: 0 0 90px; }

.cmf-form__label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--csb-text, #1e293b);
}

.cmf-form__hint {
  font-size: .78rem;
  color: var(--csb-muted, #64748b);
  margin: 0;
}

.cmf-form__input {
  height: var(--csb-control-h, 2.4rem);
  padding: 0 .75rem;
  border: 1px solid var(--csb-border, #e2e8f0);
  border-radius: calc(var(--csb-radius, 8px) - 2px);
  font-size: .9rem;
  font-family: var(--csb-font, inherit);
  color: var(--csb-text, #1e293b);
  background: var(--csb-surface, #fff);
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
  box-sizing: border-box;
}

/* Hover — subtle slate tint to signal interactivity */
.cmf-form__input:hover:not(:focus) {
  border-color: #94a3b8;
}

/* Focus / selected — primary blue with glow ring */
.cmf-form__input:focus {
  outline: none;
  border-color: var(--csb-primary, #1d4ed8);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, .12);
}

.cmf-form__actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--csb-border, #e2e8f0);
  flex-wrap: wrap;
}

/* ── Validation errors ──────────────────────────────────────── */

.cmf-errors {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--csb-radius, 8px);
  padding: 1rem;
  margin-bottom: 1.25rem;
  font-size: .875rem;
  color: #991b1b;
}

.cmf-errors__icon {
  font-size: 1.25rem;
  color: #b91c1c;
  flex-shrink: 0;
  margin-top: .05rem;
}

.cmf-errors__list {
  margin: .35rem 0 0 1rem;
  padding: 0;
}

/* ── Buttons ────────────────────────────────────────────────── */

.cmf-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  height: var(--csb-control-h, 2.4rem);
  padding: 0 1.1rem;
  border-radius: calc(var(--csb-radius, 8px) - 2px);
  font-size: .875rem;
  font-weight: 600;
  font-family: var(--csb-font, inherit);
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}

.cmf-btn--primary {
  background: var(--csb-primary, #1d4ed8);
  color: #fff;
  border-color: var(--csb-primary, #1d4ed8);
}

.cmf-btn--primary:hover {
  background: var(--csb-primary-hover, #1e40af);
  border-color: var(--csb-primary-hover, #1e40af);
}

.cmf-btn--ghost {
  background: transparent;
  color: var(--csb-text, #1e293b);
  border-color: var(--csb-border, #e2e8f0);
}

.cmf-btn--ghost:hover {
  background: var(--csb-bg, #f8fafc);
  border-color: #cbd5e1;
}

.cmf-btn--sm {
  height: 2.2rem;
  padding: 0 .6rem;
  font-size: .78rem;
}

/* ── Responsive ─────────────────────────────────────────────── */

/* Phone */
@media (max-width: 640px) {
  .cmf-stats-row {
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
  }

  .cmf-stat-card__value {
    font-size: 1.5rem;
  }

  .cmf-hub-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .cmf-hero {
    flex-direction: column;
    gap: .75rem;
    padding: 1.25rem;
  }

  .cmf-form__field--half,
  .cmf-form__field--grow,
  .cmf-form__field--sm {
    flex: 1 1 100%;
  }
}

/* Desktop — min-width: 1024px only. Tablet and phone are unaffected. */
@media (min-width: 1024px) {

  /* Give the page room to breathe at full width */
  .cmf-page {
    max-width: none;
    padding: 2rem 2.5rem;
  }

  /* Action tiles: side-by-side card layout */
  .cmf-action-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  .cmf-action-tile {
    flex-direction: column;
    align-items: flex-start;
    gap: .75rem;
    padding: 1.5rem;
    min-height: 160px;
  }

  /* Arrow moves to bottom-right of the card */
  .cmf-action-tile__arrow {
    align-self: flex-end;
    margin-top: auto;
  }

  /* Row 1: Staff (2fr) + Receipts (1fr) */
  .cmf-hub-row--top {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.25rem;
    align-items: start;
  }

  /* Row 2: Facility Details (1fr) + Access Keys (1fr) */
  .cmf-hub-row--bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: start;
  }

  /* Info grid stacks to single column in the narrower bottom cells */
  .cmf-hub-row--bottom .cmf-info-grid {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════════════════════════
   FACILITY STORE  — sp-card action overrides (cmf-fs-*)
   Uses sp-* classes from store_products.css for layout/design.
   cmf-fs-* handles only the quantity+checkout form inside cards.
   ══════════════════════════════════════════════════════════════ */

/* Remove cdp-main padding on pages that manage their own edge-to-edge layout */
.cdp-main--flush { padding: 0; }

/* Extra bottom breathing room inside cdp-main */
.cmf-fs-page { padding-bottom: 3rem; }

/* sc-hero banner — only bleed when the hero is nested inside cmf-page (store page).
   On the checkout page the hero sits directly in cdp-main--flush, so no negative
   margin is needed there and applying one would pull it under the site header. */
.cmf-page .cmf-fs-breadcrumb-hero {
  margin: -2rem calc(-1 * var(--csb-pad, 1.5rem)) 0;
}

@media (min-width: 1024px) {
  .cmf-page .cmf-fs-breadcrumb-hero { margin: -2rem -2.5rem 0; }
}

/* Make the sp-card__actions column stack and remove default flex wrapping */
.cmf-fs-actions {
  flex-direction: column;
  align-items: stretch;
  padding-top: 0;
}

.cmf-fs-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: .875rem;
}

/* Qty row: label | stepper | subtotal */
.cmf-fs-qty-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 0 .25rem;
  border-top: 1px solid var(--sp-border, #e2e8f0);
}

.cmf-fs-qty-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--sp-text-muted, #64748b);
  flex-shrink: 0;
}

.cmf-fs-subtotal {
  font-size: 1rem;
  font-weight: 700;
  color: var(--sp-text, #0f172a);
  margin-left: auto;
  white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════════
   FACILITY STORE  — legacy cmf-* card styles (kept for reference)
   ══════════════════════════════════════════════════════════════ */

.cmf-store-grid {
  display: grid;
  gap: 1.25rem;
}

.cmf-product-card {
  padding: 1.5rem;
}

.cmf-product-card__header {
  display: flex;
  align-items: center;
  gap: .875rem;
  margin-bottom: 1rem;
}

.cmf-product-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.cmf-product-card__icon .material-icons-sharp { font-size: 22px; }

.cmf-product-card__name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--csb-text);
}

.cmf-product-card__type {
  font-size: .8rem;
  color: var(--csb-text-secondary);
}

.cmf-product-card__desc {
  font-size: .875rem;
  color: var(--csb-text-secondary);
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.cmf-product-card__price {
  display: flex;
  align-items: baseline;
  gap: .4rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--csb-border);
}

.cmf-product-card__price-amount {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--csb-text);
}

.cmf-product-card__price-per {
  font-size: .8rem;
  color: var(--csb-text-secondary);
}

.cmf-product-card__qty-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.cmf-qty-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--csb-border);
  border-radius: var(--csb-radius, 8px);
  overflow: hidden;
  height: 40px;
}

.cmf-qty-input__btn {
  width: 36px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--csb-surface-raised, #f8fafc);
  border: none;
  cursor: pointer;
  color: var(--csb-text-secondary);
  transition: background .15s, color .15s;
  flex-shrink: 0;
}

.cmf-qty-input__btn:hover { background: var(--csb-border); color: var(--csb-text); }
.cmf-qty-input__btn .material-icons-sharp { font-size: 18px; }

.cmf-qty-input__field {
  width: 56px;
  height: 40px;
  border: none;
  border-left: 1px solid var(--csb-border);
  border-right: 1px solid var(--csb-border);
  text-align: center;
  font-size: .95rem;
  font-weight: 600;
  color: var(--csb-text);
  background: var(--csb-surface, #fff);
  outline: none;
  -moz-appearance: textfield;
}

.cmf-qty-input__field::-webkit-inner-spin-button,
.cmf-qty-input__field::-webkit-outer-spin-button { -webkit-appearance: none; }

.cmf-product-card__total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  font-size: .9rem;
  color: var(--csb-text-secondary);
}

.cmf-product-card__total-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--csb-text);
}

.cmf-btn--full { width: 100%; justify-content: center; }

@media (min-width: 1024px) {
  .cmf-store-grid {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  }
}

/* ══════════════════════════════════════════════════════════════
   FACILITY CHECKOUT  (fco- prefix)
   Form sections, sidebar, and layout reuse sco-* classes from
   store_checkout.css — only facility-specific overrides live here.
   ══════════════════════════════════════════════════════════════ */

/* Match the store checkout body background */
.fco-page-bg {
  background: #f1f5f9;
  padding-bottom: 3rem;
}

/* sco-layout inside cdp-main: fill available width instead of centering at 1080px */
.fco-layout-override {
  max-width: none;
  margin: 0;
}

/* Quantity row inside the seat-qty sco-section__body */
.fco-qty-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.fco-qty-total {
  font-size: .9rem;
  color: var(--csb-text-secondary);
  margin-left: auto;
}

.fco-qty-total strong { color: var(--csb-text); font-size: 1rem; }

/* Loading overlay — fixed backdrop; inner card uses sco-loading-overlay__* from store_checkout.css.
   Must use :not([hidden]) — both [hidden] and a class selector have specificity [0,1,0], and the
   author stylesheet wins over the UA stylesheet's [hidden]{display:none} if using the same value. */
.fco-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.fco-loading-overlay:not([hidden]) {
  display: flex;
}

/* ══════════════════════════════════════════════════════════════
   FACILITY ORDER RECEIPT
   ══════════════════════════════════════════════════════════════ */

.fco-confirmation-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  border: 1px solid #86efac;
  border-radius: var(--csb-radius, 10px);
  margin-bottom: 1.25rem;
}

.fco-confirmation-banner__icon {
  font-size: 2.25rem;
  color: #16a34a;
  flex-shrink: 0;
}

.fco-confirmation-banner__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #15803d;
}

.fco-confirmation-banner__sub {
  font-size: .875rem;
  color: #166534;
  margin-top: .2rem;
}

.fco-receipt-card { padding: 0; }

.fco-receipt-card .cmf-section-card__header {
  padding: 1rem 1.5rem .75rem;
}

.fco-receipt-number {
  font-family: monospace;
  font-size: .8rem;
  color: var(--csb-text-secondary);
  background: var(--csb-surface-raised, #f8fafc);
  padding: .2rem .5rem;
  border-radius: 4px;
  border: 1px solid var(--csb-border);
}

.fco-receipt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem 1rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--csb-border);
}

.fco-receipt-row {
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

.fco-receipt-row__label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--csb-text-secondary);
  font-weight: 600;
}

.fco-receipt-row__value { font-size: .9rem; color: var(--csb-text); }

.fco-receipt-items {
  padding: .75rem 1.5rem;
  border-bottom: 1px solid var(--csb-border);
}

.fco-receipt-items__header {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: .75rem;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--csb-text-secondary);
  font-weight: 600;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--csb-border);
  margin-bottom: .5rem;
}

.fco-receipt-items__row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: .75rem;
  font-size: .875rem;
  color: var(--csb-text);
  padding: .35rem 0;
}

.fco-receipt-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  font-weight: 700;
  font-size: .95rem;
  color: var(--csb-text);
}

.fco-receipt-total__amount { font-size: 1.2rem; color: var(--csb-primary, #3b82f6); }

/* ── Facility Receipts list (cmf-receipts-list-*) ───────────────────── */

.cmf-hub-row { margin-bottom: 1.25rem; }

.cmf-receipts-list { padding: 0 0 .5rem; }

.cmf-receipts-list__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .65rem 1.25rem;
  border-bottom: 1px solid var(--csb-border);
}
.cmf-receipts-list__row:last-child { border-bottom: none; }
.cmf-receipts-list__row:hover { background: #f8fafc; }

.cmf-receipts-list__meta {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 0;
}
.cmf-receipts-list__number {
  font-family: monospace;
  font-size: .78rem;
  color: var(--csb-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cmf-receipts-list__date {
  font-size: .75rem;
  color: var(--csb-text-secondary);
}

.cmf-receipts-list__detail {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .15rem;
  flex-shrink: 0;
}
.cmf-receipts-list__amount {
  font-size: .9rem;
  font-weight: 700;
  color: var(--csb-text);
}
.cmf-receipts-list__card {
  font-size: .75rem;
  color: var(--csb-text-secondary);
}

/* ── Access Key Cards (cmf-ak-*) ───────────────────────────────────── */

.cmf-ak-page { padding-bottom: 3rem; }

.cmf-ak-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 4rem 2rem;
  gap: 1.25rem;
}
.cmf-ak-empty__icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}
.cmf-ak-empty__icon .material-icons-sharp { font-size: 2rem; }
.cmf-ak-empty__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--csb-text);
}
.cmf-ak-empty__sub {
  font-size: .9rem;
  color: var(--csb-text-secondary);
  line-height: 1.6;
  max-width: 380px;
}

.cmf-ak-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* ── Single key card ── */
.cmf-ak-card {
  border: 1px solid var(--csb-border);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cmf-ak-card__header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.25rem .75rem;
  border-bottom: 1px solid var(--csb-border);
}
.cmf-ak-card__icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cmf-ak-card__icon .material-icons-sharp { font-size: 1.25rem; }

.cmf-ak-card__icon--pending  { background: #f1f5f9; color: #fbbf24; }
.cmf-ak-card__icon--invited  { background: #eff6ff; color: #3b82f6; }
.cmf-ak-card__icon--active   { background: #f0fdf4; color: #16a34a; }

.cmf-ak-card__meta { flex: 1; min-width: 0; }
.cmf-ak-card__label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--csb-text-secondary);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.cmf-ak-card__key-id {
  font-size: .8rem;
  color: var(--csb-text-secondary);
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmf-ak-badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}
.cmf-ak-badge--pending  { background: #fee2e2; color: #b91c1c; }
.cmf-ak-badge--invited  { background: #fef3c7; color: #b45309; }
.cmf-ak-badge--active   { background: #dcfce7; color: #15803d; }

.cmf-ak-card__body { padding: 1rem 1.25rem 1.25rem; display: flex; flex-direction: column; gap: .75rem; }

.cmf-ak-card__email {
  font-size: .875rem;
  color: var(--csb-text);
  font-weight: 500;
  word-break: break-all;
}
.cmf-ak-card__email-label {
  font-size: .75rem;
  color: var(--csb-text-secondary);
  margin-bottom: .2rem;
}

/* Invite form */
.cmf-ak-invite-form { display: flex; flex-direction: column; gap: .5rem; }
.cmf-ak-invite-input {
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid var(--csb-border);
  border-radius: 8px;
  font-size: .875rem;
  color: var(--csb-text);
  outline: none;
  transition: border-color .15s;
  box-sizing: border-box;
}
.cmf-ak-invite-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.12); }

/* Card action buttons */
.cmf-ak-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, opacity .15s;
  white-space: nowrap;
}
.cmf-ak-btn--primary { background: #3b82f6; color: #fff; }
.cmf-ak-btn--primary:hover { background: #2563eb; }
.cmf-ak-btn--danger { background: #fee2e2; color: #b91c1c; }
.cmf-ak-btn--danger:hover { background: #fecaca; }
.cmf-ak-btn--ghost { background: transparent; color: var(--csb-text, #1e293b); border: 1px solid var(--csb-border, #e2e8f0); }
.cmf-ak-btn--ghost:hover { background: var(--csb-bg, #f8fafc); border-color: #cbd5e1; }
.cmf-ak-btn .material-icons-sharp { font-size: .95rem; }

/* ── Transfer Facility (cmf-transfer-*) ─────────────────────────── */

.cmf-transfer-row {
  display: flex;
  align-items: stretch;
  gap: 1rem;
}

.cmf-transfer-owner-card { flex: 1; }
.cmf-transfer-row > .cmf-section-card:last-of-type { flex: 1.4; }
.cmf-transfer-row .cdp-card { transition: none; }
.cmf-transfer-row .cdp-card:hover { transform: none; box-shadow: var(--cdp-shadow); }

.cmf-transfer-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: center;
}
.cmf-transfer-arrow__icon {
  width: 64px;
  height: 64px;
  background: #16a34a;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cmf-transfer-arrow__icon .material-icons-sharp {
  font-size: 2.6rem;
  color: #fff;
  font-variation-settings: 'wght' 700;
}

.cmf-transfer-owner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  padding: 1.5rem 1.5rem 2rem;
}
.cmf-transfer-owner__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--csb-primary, #1d4ed8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  flex-shrink: 0;
}
.cmf-transfer-owner__info { display: flex; flex-direction: column; gap: .35rem; }
.cmf-transfer-owner__name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--csb-text);
}
.cmf-transfer-owner__email {
  font-size: .85rem;
  color: var(--csb-text-secondary);
}
.cmf-transfer-owner__username {
  display: inline-block;
  font-size: .78rem;
  font-family: monospace;
  background: #f1f5f9;
  color: var(--csb-text-secondary);
  padding: .2rem .6rem;
  border-radius: 999px;
  border: 1px solid var(--csb-border);
}

.cmf-transfer-warning {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.cmf-transfer-warning__icon {
  font-size: 1.5rem;
  color: #ea580c;
  flex-shrink: 0;
  margin-top: .1rem;
}
.cmf-transfer-warning__title {
  font-size: .9rem;
  font-weight: 700;
  color: #9a3412;
  margin-bottom: .3rem;
}
.cmf-transfer-warning__text {
  font-size: .85rem;
  color: #c2410c;
  line-height: 1.6;
}

.cmf-transfer-form { padding: 1.25rem 1.5rem 1.5rem; }

.cmf-transfer-form__fields {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-bottom: 1.5rem;
}

.cmf-transfer-form__group { display: flex; flex-direction: column; gap: .35rem; }

.cmf-transfer-form__label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--csb-text-secondary);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.cmf-transfer-form__input {
  padding: .55rem .85rem;
  border: 1px solid var(--csb-border);
  border-radius: 8px;
  font-size: .9rem;
  color: var(--csb-text);
  outline: none;
  transition: border-color .15s;
}
.cmf-transfer-form__input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}

.cmf-transfer-form__hint {
  font-size: .78rem;
  color: var(--csb-text-secondary);
  margin: 0;
}

.cmf-transfer-form__actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  justify-content: flex-end;
}

.cmf-btn--danger {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
}
.cmf-btn--danger:hover { background: #b91c1c; border-color: #b91c1c; }
