/* =====================================================================
 * FlexOps Shared Component Styles
 * =====================================================================
 * Styles for shared Blazor components: SkeletonLoader, EmptyState, LoadingIndicator.
 * Import AFTER flexops-tokens.css.
 *
 * Copyright (c) 2021-2026 by FlexOps, LLC. All rights reserved.
 * =================================================================== */

/* -----------------------------------------------------------------
 * Skeleton Loader
 * ----------------------------------------------------------------- */

@keyframes flexops-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.flexops-skeleton-line {
  background-image: linear-gradient(
    90deg,
    var(--flexops-gray-100) 25%,
    var(--flexops-gray-200) 50%,
    var(--flexops-gray-100) 75%
  );
  background-size: 200% 100%;
  animation: flexops-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--flexops-radius-sm);
}

/* Dark mode: the gray-100/200 track is bright on the dark page. Shimmer
   between two dark surfaces instead so the skeleton reads as a dark placeholder. */
[data-theme="dark"] .flexops-skeleton-line {
  background-image: linear-gradient(
    90deg,
    var(--flexops-bg-tertiary) 25%,
    var(--flexops-border-primary) 50%,
    var(--flexops-bg-tertiary) 75%
  );
}

.flexops-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(var(--skeleton-cols, 4), 1fr);
  gap: var(--flexops-space-4);
}

@media (max-width: 768px) {
  .flexops-skeleton-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .flexops-skeleton-grid {
    grid-template-columns: 1fr;
  }
}

.flexops-skeleton-card {
  border: 1px solid var(--flexops-border-secondary);
  border-radius: var(--flexops-radius-xl);
  padding: var(--flexops-space-6);
  background: var(--flexops-bg-primary);
  min-height: 120px;
}

.flexops-skeleton-table {
  border: 1px solid var(--flexops-border-secondary);
  border-radius: var(--flexops-radius-lg);
  overflow: hidden;
}

.flexops-skeleton-table-header {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: var(--flexops-space-4);
  padding: var(--flexops-space-3) var(--flexops-space-4);
  background: var(--flexops-bg-secondary);
  border-bottom: 1px solid var(--flexops-border-secondary);
}

.flexops-skeleton-table-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: var(--flexops-space-4);
  padding: var(--flexops-space-3) var(--flexops-space-4);
  border-bottom: 1px solid var(--flexops-border-tertiary);
}

.flexops-skeleton-table-row:last-child {
  border-bottom: none;
}

.flexops-skeleton-lines {
  display: flex;
  flex-direction: column;
  gap: var(--flexops-space-3);
}

/* -----------------------------------------------------------------
 * Loading Indicator
 * ----------------------------------------------------------------- */

.flexops-loading-indicator {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--rz-info, #4aa3ff);
  border-radius: 8px;
  background: var(--rz-info-lighter, #d9ecff);
  color: var(--rz-text-color, #1f2937);
}

/* Dark mode: the rz-info light-blue wash reads as a glaring pale box on the
   dark page. Use a neutral dark surface instead. */
[data-theme="dark"] .flexops-loading-indicator {
  background: var(--flexops-bg-tertiary);
  border-color: var(--flexops-border-primary);
  color: var(--flexops-text-primary);
}

.flexops-loading-indicator.centered {
  justify-content: flex-start;
  max-width: none;
  width: 100%;
}

.flexops-loading-label {
  font-size: 0.95rem;
  line-height: 1.35;
}

.flexops-loading-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.flexops-loading-surface {
  background: var(--flexops-bg-primary, #fff);
  border: 1px solid var(--flexops-border-secondary, #d8d4dd);
  border-radius: 8px;
  box-shadow: var(--flexops-shadow-xs, 0 1px 2px rgba(15, 23, 42, 0.04));
  box-sizing: border-box;
  padding: 1.25rem;
  width: 100%;
}

.flexops-loading-surface.centered {
  align-items: center;
  display: flex;
  justify-content: center;
}

/* -----------------------------------------------------------------
 * Page Status Alerts
 * ----------------------------------------------------------------- */

.flexops-page-status-alert--info.rz-alert {
  background: var(--flexops-bg-primary, #fff) !important;
  border: 1px solid var(--flexops-border-secondary, #d8d4dd) !important;
  border-left: 4px solid var(--flexops-brand-500, #8D59CF) !important;
  border-radius: 8px !important;
  box-shadow: var(--flexops-shadow-xs, 0 1px 2px rgba(15, 23, 42, 0.04));
  color: var(--flexops-text-primary, #1c1a21) !important;
}

.flexops-page-status-alert--info .rz-alert-message,
.flexops-page-status-alert--info .rz-alert-title {
  color: var(--flexops-text-primary, #1c1a21) !important;
}

.flexops-page-status-alert--info .rzi {
  color: var(--flexops-brand-600, #6C3BAA) !important;
}

.rz-alert.rz-alert-info {
  background: var(--flexops-bg-primary, #fff) !important;
  border: 1px solid var(--flexops-border-secondary, #d8d4dd) !important;
  border-left: 4px solid var(--flexops-brand-500, #8D59CF) !important;
  border-radius: 8px !important;
  box-shadow: var(--flexops-shadow-xs, 0 1px 2px rgba(15, 23, 42, 0.04));
  color: var(--flexops-text-primary, #1c1a21) !important;
}

.rz-alert.rz-alert-info .rz-alert-message,
.rz-alert.rz-alert-info .rz-alert-title {
  color: var(--flexops-text-primary, #1c1a21) !important;
}

.rz-alert.rz-alert-info .rzi {
  color: var(--flexops-brand-600, #6C3BAA) !important;
}

.flexops-info-callout.rz-alert,
.rz-alert.flexops-info-callout {
  background: var(--flexops-bg-primary, #fff) !important;
  border: 1px solid var(--flexops-border-secondary, #d8d4dd) !important;
  border-left: 4px solid var(--flexops-brand-500, #8D59CF) !important;
  border-radius: 8px !important;
  box-shadow: var(--flexops-shadow-xs, 0 1px 2px rgba(15, 23, 42, 0.04));
  color: var(--flexops-text-primary, #1c1a21) !important;
}

.flexops-info-callout.rz-alert .rz-alert-message,
.rz-alert.flexops-info-callout .rz-alert-message,
.flexops-info-callout.rz-alert .rz-alert-title,
.rz-alert.flexops-info-callout .rz-alert-title {
  color: var(--flexops-text-primary, #1c1a21) !important;
}

.flexops-info-callout.rz-alert .rzi,
.rz-alert.flexops-info-callout .rzi {
  color: var(--flexops-brand-600, #6C3BAA) !important;
}

/* -----------------------------------------------------------------
 * Empty State
 * ----------------------------------------------------------------- */

.flexops-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--flexops-space-12) var(--flexops-space-6);
  min-height: 280px;
}

.flexops-empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--flexops-radius-xl);
  background: var(--flexops-bg-brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--flexops-space-4);
}

.flexops-empty-state-icon .rzi {
  font-size: 28px;
  color: var(--flexops-brand-600);
}

.flexops-empty-state-title {
  font-family: var(--flexops-font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--flexops-text-primary);
  margin: 0 0 var(--flexops-space-2) 0;
}

.flexops-empty-state-description {
  font-family: var(--flexops-font-body);
  font-size: 0.875rem;
  color: var(--flexops-text-tertiary);
  max-width: 360px;
  margin: 0;
  line-height: 1.5;
}

/* -----------------------------------------------------------------
 * Error Panel (ErrorPanel.razor — PortalErrorBoundary / CustomErrorBoundary
 * fallback). Mirrors the empty-state card treatment with a danger-tinted
 * heading. Uses semantic tokens, so it flips with [data-theme="dark"].
 * ----------------------------------------------------------------- */

.portal-error-boundary {
  display: flex;
  justify-content: center;
  padding: var(--flexops-space-8) var(--flexops-space-4);
}

.portal-error-boundary__panel {
  width: 100%;
  max-width: 520px;
  padding: var(--flexops-space-8) var(--flexops-space-6);
  background: var(--flexops-bg-primary);
  border: 1px solid var(--flexops-border-primary);
  border-radius: var(--flexops-radius-xl);
  box-shadow: var(--flexops-shadow-sm);
  text-align: center;
}

.portal-error-boundary__title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--flexops-space-2);
  font-family: var(--flexops-font-body);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--flexops-text-primary);
  margin: 0 0 var(--flexops-space-2) 0;
}

.portal-error-boundary__title .rzi {
  color: var(--rz-danger, #DC2626);
}

.portal-error-boundary__message {
  font-family: var(--flexops-font-body);
  font-size: 0.875rem;
  color: var(--flexops-text-tertiary);
  line-height: 1.5;
  max-width: 400px;
  margin: 0 auto var(--flexops-space-5) auto;
}

.portal-error-boundary__actions {
  display: flex;
  gap: var(--flexops-space-3);
  justify-content: center;
  flex-wrap: wrap;
}

.portal-error-boundary__details {
  margin-top: var(--flexops-space-5);
  text-align: left;
}

.portal-error-boundary__details summary {
  cursor: pointer;
  font-size: 0.8125rem;
  color: var(--flexops-text-tertiary);
}

.portal-error-boundary__details pre {
  margin-top: var(--flexops-space-2);
  padding: var(--flexops-space-3);
  background: var(--flexops-bg-tertiary);
  border-radius: var(--flexops-radius-sm);
  font-size: 0.75rem;
  color: var(--flexops-text-secondary);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* -----------------------------------------------------------------
 * Rate Option Cards
 * Shared rate-shopping card treatment for Ship Manager and portals.
 * ----------------------------------------------------------------- */

.flexops-rate-order-method {
  color: var(--rz-text-secondary-color, var(--flexops-text-secondary, #666));
  font-size: 12px;
  line-height: 1.25;
  margin: 0 0 6px;
  padding: 0 2px;
}

.flexops-rate-order-method strong {
  color: var(--rz-text-color, var(--flexops-text-primary, #333));
  font-weight: 600;
}

.flexops-rate-card {
  align-items: center;
  background-color: var(--flexops-bg-tertiary);
  border: 2px solid var(--rz-border-color, #b8bcbf);
  border-radius: 8px;
  box-shadow: var(--flexops-shadow-sm, 0 1px 3px rgba(15, 23, 42, 0.06));
  box-sizing: border-box;
  display: flex;
  height: 80px;
  justify-content: space-between;
  padding: 12px 20px;
  transition:
    background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out,
    box-shadow 0.15s ease-in-out;
  width: 100%;
}

.flexops-rate-card:hover {
  background-color: var(--flexops-bg-primary);
  border-color: var(--rz-primary, #005ea2);
  box-shadow: var(--flexops-shadow-md, 0 3px 10px rgba(15, 23, 42, 0.12));
}

.flexops-rate-card--current {
  background-color: var(--flexops-brand-50, #F7F1FD);
  border-color: var(--flexops-brand-300, #CDB1F1);
}

.flexops-rate-card--current:hover {
  border-color: var(--flexops-brand-500, #8D59CF);
}

/* Dark mode: the light brand-50 wash is a bright panel on the dark surface. */
[data-theme="dark"] .flexops-rate-card--current {
  background-color: color-mix(in srgb, var(--flexops-brand-500) 16%, transparent);
  border-color: color-mix(in srgb, var(--flexops-brand-500) 45%, transparent);
}

.flexops-rate-card--selectable {
  cursor: pointer;
}

.flexops-rate-card--selectable:focus-visible {
  border-color: var(--flexops-brand-500, #8D59CF);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--flexops-brand-500, #8D59CF) 18%, transparent),
    var(--flexops-shadow-sm, 0 1px 3px rgba(15, 23, 42, 0.06));
  outline: none;
}

.flexops-rate-card__content {
  align-items: center;
  display: flex;
  flex: 1;
  gap: 15px;
}

.flexops-rate-card__logo-container {
  flex: 0 0 auto;
}

.flexops-rate-card__logo {
  height: 30px;
  width: 30px;
}

.flexops-rate-card__service-container {
  flex: 1;
  margin: 0;
  min-width: 0;
  padding: 0;
}

.flexops-rate-card__service {
  color: var(--rz-text-color, #333);
  display: block;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-align: left;
}

.flexops-rate-card__current-badge {
  background-color: var(--flexops-brand-100, #F0E6FC);
  border-radius: 999px;
  color: var(--flexops-brand-700, #5C368C);
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 4px;
  padding: 2px 7px;
  width: fit-content;
}

.flexops-rate-card__info-container {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: right;
}

.flexops-rate-card__price {
  color: var(--rz-text-color, #333);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.flexops-rate-card__delivery {
  color: var(--rz-text-color, #333);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
}

.flexops-rate-card__delivery--secondary {
  font-size: 0.85rem;
  opacity: 0.85;
}

.flexops-rate-card__button-container {
  flex: 0 0 auto;
}

.flexops-rate-card__buy-button {
  background-color: var(--rz-primary, #005ea2);
  border: none;
  border-radius: 3px;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  padding: 5px 10px;
  transition: background-color 0.2s ease-in-out;
}

.flexops-rate-card__buy-button:hover {
  background-color: var(--rz-primary-dark, #003e73);
}

/* -----------------------------------------------------------------
 * Portal Page Composition
 * Reusable page-level patterns for Settings Hub, API Portal, and
 * Identity Portal. Portal-specific accent comes from --portal-accent.
 * ----------------------------------------------------------------- */

.flexops-portal-hero {
  border: 1px solid var(--color-border-secondary);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, var(--color-bg-primary) 0%, var(--color-bg-secondary) 100%);
  box-shadow: var(--shadow-sm);
  padding: var(--flexops-space-6);
}

/* Back link on detail pages. Sits in the hero's vertical stack, so it must not
   stretch to the full column width. */
.flexops-portal-hero__back {
  align-self: flex-start;
}

/* Muted body text. Pages inlined `style="color: var(--rz-text-secondary-color)"`
   ~80 times; these classes point at the SAME vars, so rendering is unchanged —
   but the colour is now retargetable from one place instead of per element. */
.flexops-text-secondary {
  color: var(--rz-text-secondary-color);
}

.flexops-text-tertiary {
  color: var(--rz-text-tertiary-color);
}

.flexops-portal-hero__eyebrow {
  color: var(--color-text-tertiary);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.flexops-portal-hero__title {
  color: var(--color-text-primary);
  font-size: 1.875rem;
  font-weight: 650;
  line-height: 1.2;
  margin: 0;
}

/* FocusOnNavigate moves focus to this h1 on every route change so screen
   readers announce the new page; the focus is for announcement only, not
   interaction (the h1 is not actionable). Hide the browser's default
   outline so it doesn't read as a stray click target. */
.flexops-portal-hero__title:focus,
.flexops-portal-hero__title:focus-visible {
  outline: none;
}

.flexops-portal-hero__copy {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
  max-width: 720px;
}

.flexops-portal-readiness-grid,
.flexops-portal-action-grid {
  display: grid;
  gap: var(--flexops-space-4);
}

.flexops-portal-readiness-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.flexops-portal-action-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.flexops-portal-readiness-item,
.flexops-portal-action-card,
.flexops-portal-preview-panel {
  border: 1px solid var(--color-border-secondary);
  border-radius: var(--radius-xl);
  background: var(--color-bg-primary);
  box-shadow: var(--shadow-xs);
}

.flexops-portal-readiness-item {
  padding: var(--flexops-space-4);
}

.flexops-portal-section {
  border: 1px solid var(--color-border-secondary);
  border-radius: var(--radius-xl);
  background: var(--color-bg-primary);
  box-shadow: var(--shadow-xs);
  padding: var(--flexops-space-5);
}

.flexops-portal-section__header {
  align-items: flex-start;
  display: flex;
  gap: var(--flexops-space-4);
  justify-content: space-between;
  margin-bottom: var(--flexops-space-4);
}

.flexops-portal-section__title {
  color: var(--color-text-primary);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.3;
  margin: 0;
}

.flexops-portal-section__copy {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
  margin: var(--flexops-space-1) 0 0;
}

.flexops-portal-form-grid {
  display: grid;
  gap: var(--flexops-space-4);
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.flexops-portal-form-grid > * {
  grid-column: span 12;
}

.flexops-portal-field--half {
  grid-column: span 6;
}

.flexops-portal-field--third {
  grid-column: span 4;
}

.flexops-portal-empty-state {
  align-items: center;
  border: 1px dashed var(--color-border-secondary);
  border-radius: var(--radius-xl);
  color: var(--color-text-secondary);
  display: flex;
  flex-direction: column;
  gap: var(--flexops-space-2);
  justify-content: center;
  min-height: 176px;
  padding: var(--flexops-space-6);
  text-align: center;
}

.flexops-portal-inline-stat {
  min-width: 0;
}

.flexops-portal-inline-stat__label {
  color: var(--color-text-tertiary);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 var(--flexops-space-1);
  text-transform: uppercase;
}

.flexops-portal-inline-stat__value {
  color: var(--color-text-primary);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.35;
  margin: 0;
  overflow-wrap: anywhere;
}

.flexops-portal-action-card {
  /* Resets so a <button> card renders identically to the <a> cards. */
  appearance: none;
  color: inherit;
  cursor: pointer;
  display: block;
  font: inherit;
  min-height: 168px;
  padding: var(--flexops-space-5);
  text-align: inherit;
  text-decoration: none;
  transition:
    border-color var(--flexops-transition-fast),
    box-shadow var(--flexops-transition-fast),
    transform var(--flexops-transition-fast);
  width: 100%;
}

.flexops-portal-action-card:hover {
  border-color: var(--color-border-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.flexops-portal-action-card:focus-visible {
  border-color: var(--portal-accent, var(--rz-primary));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--portal-accent, var(--rz-primary)) 18%, transparent), var(--shadow-sm);
  outline: none;
}

.flexops-portal-action-card--primary {
  border-color: color-mix(in srgb, var(--portal-accent, var(--rz-primary)) 32%, var(--color-border-secondary));
  background: linear-gradient(180deg, color-mix(in srgb, var(--portal-accent, var(--rz-primary)) 8%, var(--color-bg-primary)), var(--color-bg-primary));
}

.flexops-portal-icon-box {
  align-items: center;
  background: color-mix(in srgb, var(--portal-accent, var(--rz-primary)) 12%, transparent);
  border-radius: var(--radius-lg);
  color: var(--portal-accent, var(--rz-primary));
  display: inline-flex;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.flexops-portal-preview-panel {
  padding: var(--flexops-space-5);
}

.flexops-portal-preview-surface {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-secondary);
  border-radius: var(--radius-xl);
  padding: var(--flexops-space-5);
}

.flexops-portal-swatch {
  border: 1px solid var(--color-border-secondary);
  border-radius: var(--radius-lg);
  height: 48px;
  width: 48px;
}

.flexops-portal-sticky-preview {
  position: sticky;
  top: var(--flexops-space-6);
}

.flexops-portal-code-block {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-secondary);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  padding: var(--flexops-space-4);
}

@media (max-width: 960px) {
  .flexops-portal-readiness-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flexops-portal-sticky-preview {
    position: static;
  }
}

@media (max-width: 560px) {
  .flexops-portal-hero {
    padding: var(--flexops-space-4);
  }

  .flexops-portal-hero__title {
    font-size: 1.5rem;
  }

  .flexops-portal-readiness-grid {
    grid-template-columns: 1fr;
  }

  .flexops-portal-section {
    padding: var(--flexops-space-4);
  }

  .flexops-portal-section__header {
    flex-direction: column;
  }

  .flexops-portal-field--half,
  .flexops-portal-field--third {
    grid-column: span 12;
  }
}

/* -----------------------------------------------------------------
 * Button Hover Effects (opt-in, website-aligned)
 * Apply via class to RadzenButton: class="fx-sheen" or class="fx-tilt"
 * Reserve for primary CTAs — not every button.
 * ----------------------------------------------------------------- */

/* Metallic sheen sweep — for primary CTAs ("Create", "Save", "Buy Label") */
.rz-button.fx-sheen {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.rz-button.fx-sheen::after {
  content: '';
  position: absolute;
  inset: -60% -25%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.38) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: translateX(-85%) rotate(-15deg);
  transition: transform 900ms cubic-bezier(0.22, 0.98, 0.41, 1),
              opacity 300ms ease-in-out;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

.rz-button.fx-sheen:not(:disabled):hover::after {
  transform: translateX(120%) rotate(-15deg);
  opacity: 0.35;
}

.rz-button.fx-sheen > * {
  position: relative;
  z-index: 2;
}

/* Richer interactive grid rows. */
.rz-data-grid .rz-data-row {
  transition: background-color var(--flexops-transition-fast);
}

/* Elastic 3D tilt — for featured/hero buttons */
.rz-button.fx-tilt {
  perspective: 900px;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 200ms cubic-bezier(0.22, 0.98, 0.41, 1),
              box-shadow 200ms cubic-bezier(0.22, 0.98, 0.41, 1) !important;
}

.rz-button.fx-tilt:not(:disabled):hover {
  transform: translateY(-4px) rotateX(8deg);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.rz-button.fx-tilt:not(:disabled):active {
  transform: translateY(-2px) rotateX(4deg);
  box-shadow: 0 6px 10px rgba(15, 23, 42, 0.06);
}

@media (prefers-reduced-motion: reduce) {
  .rz-button.fx-sheen::after,
  .rz-button.fx-tilt {
    transition: none !important;
  }
  .rz-button.fx-sheen:not(:disabled):hover::after {
    opacity: 0;
  }
  .rz-button.fx-tilt:not(:disabled):hover {
    transform: none;
  }
}


/* -----------------------------------------------------------------
 * Skip Navigation — WCAG 2.4.1
 * ----------------------------------------------------------------- */

.skip-link,
.flexops-skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 9999;
}

.skip-link:focus,
.flexops-skip-link:focus {
  position: fixed;
  top: 10px;
  left: 10px;
  width: auto;
  height: auto;
  padding: 0.75rem 1.5rem;
  background: var(--flexops-bg-primary, #fff);
  color: var(--flexops-text-primary, #1C1A21);
  border: 2px solid var(--flexops-brand-600, #6C3BAA);
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}


/* -----------------------------------------------------------------
 * Utility Animations
 * ----------------------------------------------------------------- */

.flexops-fade-in {
  animation: flexops-fadeIn 300ms ease-out;
}

@keyframes flexops-fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.flexops-pulse {
  animation: flexops-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes flexops-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

.flexops-spin {
  animation: flexops-spin 1s linear infinite;
}

@keyframes flexops-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}


/* -----------------------------------------------------------------
 * Responsive Utilities
 * ----------------------------------------------------------------- */

@media (max-width: 768px) {
  .flexops-hide-mobile { display: none !important; }
}

@media (min-width: 769px) {
  .flexops-hide-desktop { display: none !important; }
}


/* -----------------------------------------------------------------
 * Reduced Motion — WCAG 2.3.3
 * ----------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .flexops-fade-in,
  .flexops-pulse,
  .flexops-spin,
  .flexops-skeleton-line {
    animation: none !important;
  }
}

/* =====================================================================
 * Command palette (Ctrl+K) — global (RCL scoped CSS is not bundled in the
 * consuming apps here, so these live in the global sheet). Classes are
 * uniquely prefixed, so global scope is safe.
 * ===================================================================== */
.flexops-cmdk-backdrop {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  background: rgba(10, 13, 18, 0.45);
  backdrop-filter: blur(2px);
  animation: flexops-cmdk-fade 120ms ease-out;
}
.flexops-cmdk-panel {
  width: min(640px, calc(100vw - 2rem));
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--flexops-bg-primary);
  border: 1px solid var(--flexops-border-secondary);
  border-radius: var(--flexops-radius-xl);
  box-shadow: var(--flexops-shadow-2xl, 0 24px 48px -12px rgba(10, 13, 18, 0.25));
  animation: flexops-cmdk-pop 120ms ease-out;
}
.flexops-cmdk-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--flexops-border-secondary);
  color: var(--flexops-fg-tertiary);
}
.flexops-cmdk-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--flexops-font-body);
  font-size: 1rem;
  color: var(--flexops-text-primary);
}
.flexops-cmdk-input::placeholder { color: var(--flexops-text-placeholder); }
.flexops-cmdk-input:focus-visible {
  outline: 2px solid var(--flexops-brand-500, #8D59CF);
  outline-offset: 2px;
  border-radius: 4px;
}
.flexops-cmdk-kbd {
  font-family: var(--flexops-font-mono);
  font-size: 0.6875rem;
  padding: 0.125rem 0.375rem;
  border: 1px solid var(--flexops-border-primary);
  border-radius: var(--flexops-radius-sm);
  color: var(--flexops-text-tertiary);
  background: var(--flexops-bg-secondary);
}
.flexops-cmdk-list { list-style: none; margin: 0; padding: 0.375rem; overflow-y: auto; }
.flexops-cmdk-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.625rem;
  border-radius: var(--flexops-radius-md);
  color: var(--flexops-text-secondary);
  cursor: pointer;
  user-select: none;
}
.flexops-cmdk-item .rz-icon { font-size: 1.125rem; color: var(--flexops-fg-tertiary); }
.flexops-cmdk-item.is-selected { background: var(--flexops-bg-brand-primary); color: var(--flexops-text-primary); }
.flexops-cmdk-item.is-selected .rz-icon { color: var(--flexops-fg-brand-primary); }
.flexops-cmdk-label { flex: 1; font-size: 0.875rem; }
.flexops-cmdk-group { font-size: 0.75rem; color: var(--flexops-text-tertiary); }
.flexops-cmdk-empty { padding: 1.25rem; text-align: center; color: var(--flexops-text-tertiary); font-size: 0.875rem; }
@keyframes flexops-cmdk-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes flexops-cmdk-pop {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .flexops-cmdk-backdrop, .flexops-cmdk-panel { animation: none; }
}

/* -----------------------------------------------------------------
 * Circuit reconnect overlay (Blazor Server)
 * Blazor toggles .components-reconnect-{show,failed,rejected} on the
 * #components-reconnect-modal element. Rendered by the shared
 * <ReconnectModal /> component; branded per portal via --portal-accent
 * and theme-aware via the semantic --color-* tokens.
 * ----------------------------------------------------------------- */
#components-reconnect-modal.flexops-reconnect {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: color-mix(in srgb, #101828 55%, transparent);
  backdrop-filter: blur(2px);
}

/* Blazor adds one of these classes to reveal the overlay. */
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
  display: flex;
}

.flexops-reconnect__card {
  width: 100%;
  max-width: 22rem;
  padding: 1.75rem;
  text-align: center;
  background: var(--color-bg-primary, #ffffff);
  color: var(--color-text-primary, #101828);
  border-top: 4px solid var(--portal-accent, var(--rz-primary, #7c3aed));
  border-radius: var(--flexops-radius-lg, 12px);
  box-shadow: var(--shadow-lg, 0 20px 40px rgba(16, 24, 40, 0.18));
}

/* Show only the state matching the class Blazor set. */
.flexops-reconnect__state { display: none; }
#components-reconnect-modal.components-reconnect-show .flexops-reconnect__state--show { display: block; }
#components-reconnect-modal.components-reconnect-failed .flexops-reconnect__state--failed { display: block; }
#components-reconnect-modal.components-reconnect-rejected .flexops-reconnect__state--rejected { display: block; }

.flexops-reconnect__title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-primary, #101828);
}

.flexops-reconnect__text {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--color-text-secondary, #475467);
}

.flexops-reconnect__spinner {
  width: 2.25rem;
  height: 2.25rem;
  margin: 0 auto 1rem;
  border: 3px solid color-mix(in srgb, var(--portal-accent, #7c3aed) 25%, transparent);
  border-top-color: var(--portal-accent, #7c3aed);
  border-radius: 50%;
  animation: flexops-reconnect-spin 0.8s linear infinite;
}

@keyframes flexops-reconnect-spin { to { transform: rotate(360deg); } }

.flexops-reconnect__btn {
  appearance: none;
  cursor: pointer;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  /* Decision A: primary actions are brand purple, never the per-portal accent. */
  background: var(--rz-primary, #6C3BAA);
  border: none;
  border-radius: var(--flexops-radius-sm, 8px);
}

.flexops-reconnect__btn:hover { filter: brightness(0.94); }
.flexops-reconnect__btn:focus-visible { outline: 2px solid var(--rz-primary, #6C3BAA); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .flexops-reconnect__spinner { animation: none; }
}

/* File-picker button: a <label> wrapping a .visually-hidden <InputFile>, styled to sit
   flush with the RadzenButtons beside it. Pair with the rz-button utility classes so it
   inherits Radzen's size/variant rather than redefining them. */
.flexops-file-button {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
}


/* =================================================================
   FLAT-SECTION PRIMITIVES

   The portals compose pages by wrapping every section in a bordered,
   shadowed RadzenCard. Nested card padding is what makes the screens read
   as an admin tool. These primitives are the alternative the Wallet design
   uses: a flat page, sections separated by a rule, one hero number, and a
   plain table.

   No Radzen involved — Radzen's component anatomy is what we keep having to
   fight. These are plain elements on the existing FlexOps tokens.
   ================================================================= */

/* ---- Hero stat: the page's one important number ---- */
.fx-stat__label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin: 0 0 0.25rem;
}

.fx-stat__row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.fx-stat__value {
  margin: 0;
  font-size: 3rem;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--color-text-primary);
  font-variant-numeric: tabular-nums;
}

/* ---- Section: a heading with a rule, instead of a card ---- */
.fx-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border-secondary);
  margin-bottom: 1.25rem;
}

.fx-section__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

/* ---- Tab strip (Overview / Settings) ---- */
.fx-tabs {
  display: flex;
  gap: 1.25rem;
  border-bottom: 1px solid var(--color-border-secondary);
  margin-bottom: 1.25rem;
}

.fx-tab {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 0.5rem 0.125rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.fx-tab:hover { color: var(--color-text-primary); }

.fx-tab--active {
  color: var(--color-brand-700);
  border-bottom-color: var(--color-brand-600);
}

.fx-tab:focus-visible {
  outline: 2px solid var(--color-brand-600);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* ---- Definition list: label -> value rows ---- */
.fx-dl {
  display: grid;
  grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
  row-gap: 0.875rem;
  column-gap: 1rem;
  margin: 0;
}

.fx-dl dt {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.fx-dl dd {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-primary);
}

/* ---- Bordered row (payment methods) ---- */
.fx-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--color-border-secondary);
  border-radius: var(--radius-lg);
  background: var(--color-bg-primary);
}

.fx-row__body { display: flex; flex-direction: column; gap: 0.125rem; min-width: 0; }
.fx-row__title { font-size: 0.875rem; font-weight: 500; color: var(--color-text-primary); }
.fx-row__meta { font-size: 0.75rem; color: var(--color-text-secondary); }

/* ---- Status pill with a leading dot ---- */
.fx-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.fx-pill::before {
  content: "";
  width: 0.375rem;
  height: 0.375rem;
  border-radius: var(--radius-full);
  background: currentColor;
  flex: none;
}

/* No -50 stop exists on the semantic ramps, so tint from the 600 rather than
   minting new tokens. */
.fx-pill--success {
  color: var(--color-success-700);
  background: color-mix(in srgb, var(--color-success-600) 10%, transparent);
  border-color: var(--color-success-200);
}

.fx-pill--warning {
  color: var(--color-warning-700);
  background: color-mix(in srgb, var(--color-warning-600) 10%, transparent);
  border-color: var(--color-warning-200);
}

.fx-pill--error {
  color: var(--color-error-700);
  background: color-mix(in srgb, var(--color-error-600) 10%, transparent);
  border-color: var(--color-error-200);
}

.fx-pill--neutral {
  color: var(--color-gray-700);
  background: color-mix(in srgb, var(--color-gray-700) 8%, transparent);
  border-color: var(--color-gray-200);
}

/* ---- Table: plain <table>, not RadzenDataGrid.

   The grid's filter row, dense rows and heavy borders are its loudest
   admin-tool signals, and a transaction list needs none of its machinery
   (virtualisation, grouping, filter operators). This is less markup AND a
   closer match to the design. Reach for RadzenDataGrid only when the data
   genuinely needs it. ---- */
.fx-table-wrap {
  border: 1px solid var(--color-border-secondary);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.fx-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.fx-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border-secondary);
}

.fx-table td {
  padding: 1rem;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border-secondary);
}

.fx-table tbody tr:last-child td { border-bottom: 0; }
.fx-table tbody tr:hover td { background: var(--color-bg-secondary); }

.fx-table__strong { color: var(--color-text-primary); font-weight: 500; }
.fx-table__num { font-variant-numeric: tabular-nums; font-weight: 500; }

/* These land on the <td> itself, so they must outrank `.fx-table td` (0,1,1) —
   an unqualified `.fx-table__num--neg` (0,1,0) loses the cascade and the amount
   silently renders in the default body grey. Qualify with the element. */
.fx-table td.fx-table__num--pos { color: var(--color-success-600); }
.fx-table td.fx-table__num--neg { color: var(--color-error-600); }

/* Not-yet-settled money. Status outranks direction: a pending row is amber whether
   it is a debit or a credit, because "has this actually happened" matters more than
   which way it went. */
.fx-table td.fx-table__num--pending { color: var(--color-warning-600); }

/* ---- Sortable header: a real <button> inside the <th> so it is keyboard
   reachable and screen readers announce it. Sort state goes on the th's
   aria-sort, not on the button. ---- */
.fx-th-sort {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
}

.fx-th-sort:hover { color: var(--color-text-primary); }

.fx-th-sort:focus-visible {
  outline: 2px solid var(--color-brand-600);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

.fx-th-sort__caret {
  font-size: 0.875rem;
  line-height: 1;
  opacity: 0.35;
}

/* Only the active column shows a solid caret. */
[aria-sort="ascending"] .fx-th-sort__caret,
[aria-sort="descending"] .fx-th-sort__caret { opacity: 1; }

/* ---- Pager ---- */
.fx-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
}

.fx-pager__pages { display: flex; align-items: center; gap: 0.125rem; }

.fx-pager__btn,
.fx-pager__page {
  appearance: none;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 0.375rem 0.75rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.fx-pager__btn {
  border-color: var(--color-border-secondary);
  background: var(--color-bg-primary);
  box-shadow: var(--shadow-xs);
}

.fx-pager__btn:hover:not(:disabled),
.fx-pager__page:hover:not(:disabled) { background: var(--color-bg-secondary); }

.fx-pager__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.fx-pager__page--active {
  background: var(--color-bg-secondary);
  color: var(--color-text-primary);
  font-weight: 600;
}

.fx-pager__gap {
  padding: 0 0.25rem;
  color: var(--color-text-tertiary);
  font-size: 0.875rem;
}

.fx-pager__btn:focus-visible,
.fx-pager__page:focus-visible {
  outline: 2px solid var(--color-brand-600);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .fx-stat__value { font-size: 2.25rem; }
  .fx-dl { grid-template-columns: minmax(0, 1fr); row-gap: 0.25rem; }
  .fx-dl dd { margin-bottom: 0.625rem; }
  .fx-pager__pages { display: none; }
}
