/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  --environment-banner-height: 2.25rem;
  --environment-amber: #f59e0b;
  --environment-amber-strong: #d97706;
  --environment-ink: #1e293b;
}

.environment-banner {
  position: sticky;
  top: 0;
  z-index: 60;
  min-height: var(--environment-banner-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 1rem;
  color: var(--environment-ink);
  background:
    repeating-linear-gradient(
      135deg,
      #f59e0b 0,
      #f59e0b 0.75rem,
      #fbbf24 0.75rem,
      #fbbf24 1.5rem
    );
  box-shadow: 0 1px 0 rgba(120, 53, 15, 0.25), 0 10px 30px rgba(146, 64, 14, 0.18);
}

.environment-banner__inner {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  max-width: 100%;
  border: 1px solid rgba(120, 53, 15, 0.25);
  border-radius: 999px;
  background: rgba(255, 251, 235, 0.92);
  padding: 0.25rem 0.85rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.environment-banner__dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #dc2626;
  box-shadow: 0 0 0 0.2rem rgba(220, 38, 38, 0.14);
}

.environment-banner__label {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.environment-banner__message {
  font-size: 0.75rem;
  font-weight: 600;
  color: #78350f;
}

.environment-staging .app-header {
  top: var(--environment-banner-height);
  border-bottom-color: rgba(245, 158, 11, 0.35);
}

.environment-staging .app-sidebar {
  top: calc(4rem + var(--environment-banner-height));
  border-right-color: rgba(245, 158, 11, 0.3);
  background:
    linear-gradient(180deg, rgba(255, 251, 235, 0.58), rgba(255, 255, 255, 0.72)),
    rgba(255, 255, 255, 0.5);
}

.environment-staging .auth-shell {
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, 0.26), transparent 22rem),
    linear-gradient(135deg, #fffbeb 0%, #f8fafc 46%, #fff7ed 100%);
}

@media (max-width: 640px) {
  .environment-banner {
    align-items: stretch;
    padding-inline: 0.75rem;
  }

  .environment-banner__inner {
    justify-content: center;
    width: 100%;
    border-radius: 0.75rem;
  }

  .environment-banner__message {
    display: none;
  }
}

/* ── "View as role" banner ─────────────────────────────────────────
   The owner is wearing another role. Violet so it never reads as the
   amber staging banner. FIXED rather than sticky: <body> is h-full
   (one viewport tall), so a sticky child stops sticking after the
   first screen of scrolling; the body gets matching top padding so
   nothing renders underneath. Exactly one row tall, always — the
   header and sidebar offsets below depend on it (the label, hint and
   role name give way; the two controls never wrap). */
:root {
  --role-preview-banner-height: 2.25rem;
}

.role-preview-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: var(--role-preview-banner-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.75rem;
  color: #2e1065;
  background: linear-gradient(90deg, #ede9fe 0%, #ddd6fe 50%, #ede9fe 100%);
  box-shadow: 0 1px 0 rgba(76, 29, 149, 0.25), 0 8px 24px rgba(76, 29, 149, 0.12);
}

.role-previewing {
  padding-top: var(--role-preview-banner-height);
}

.role-preview-banner__inner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  max-width: 100%;
}

.role-preview-banner__label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #5b21b6;
}

.role-preview-banner__role {
  font-size: 0.85rem;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-preview-banner__hint {
  font-size: 0.75rem;
  font-weight: 500;
  color: #4c1d95;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-preview-banner__control {
  flex-shrink: 0;
  white-space: nowrap;
}

/* Native <details> used as a dropdown menu (header "View as", banner
   "Switch role"): no disclosure triangle in any engine. */
details.app-menu > summary {
  list-style: none;
}

details.app-menu > summary::-webkit-details-marker {
  display: none;
}

.role-previewing .app-header {
  top: var(--role-preview-banner-height);
  border-bottom-color: rgba(124, 58, 237, 0.35);
}

.role-previewing .app-sidebar {
  top: calc(4rem + var(--role-preview-banner-height));
}

/* Flash toasts float at top-4 with z-50; both banners sit above them,
   so push the toasts below whatever banners are showing. */
.role-previewing .app-toasts {
  top: calc(1rem + var(--role-preview-banner-height));
}

.environment-staging .app-toasts {
  top: calc(1rem + var(--environment-banner-height));
}

/* Both banners: the preview bar is fixed on top; the staging banner
   (sticky, in flow) slides in right under it. */
.environment-staging.role-previewing .environment-banner {
  top: var(--role-preview-banner-height);
}

.environment-staging.role-previewing .app-header {
  top: calc(var(--environment-banner-height) + var(--role-preview-banner-height));
}

.environment-staging.role-previewing .app-sidebar {
  top: calc(4rem + var(--environment-banner-height) + var(--role-preview-banner-height));
}

.environment-staging.role-previewing .app-toasts {
  top: calc(1rem + var(--environment-banner-height) + var(--role-preview-banner-height));
}
