/* Smooth panel surfaces shared by the dashboard metrics and customer key cards. */
.license-surface {
  --key-rgb: 11, 183, 131;
  position: relative !important;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(var(--key-rgb), 0.2) !important;
  background-color: #111111 !important;
  background-image:
    linear-gradient(112deg, rgba(var(--key-rgb), 0.105) 0%, rgba(var(--key-rgb), 0.045) 32%, transparent 64%),
    radial-gradient(125% 190% at -12% 18%, rgba(var(--key-rgb), 0.17) 0%, rgba(var(--key-rgb), 0.075) 36%, transparent 72%),
    linear-gradient(135deg, #181818 0%, #121212 58%, #0e0e0e 100%) !important;
  box-shadow: none !important;
}

/* Keep cards in their local layer so search popovers and shared modals can stack normally. */
.card.keys.license-surface { z-index: 0 !important; }

.license-surface::before {
  content: none;
}

.license-surface > .card-body {
  position: relative;
  z-index: 1;
}

.license-surface.key-tone-danger {
  --key-rgb: 255, 75, 75;
}

.license-surface.key-tone-neutral {
  --key-rgb: 116, 120, 128;
}

.license-surface.key-tone-warning {
  --key-rgb: 248, 231, 28;
}

.key-search-deck {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 7px;
  background: rgba(12, 12, 12, 0.86);
}

.key-search-console {
  position: relative;
  min-width: 0;
  margin: 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.key-search-console input {
  width: 100%;
  min-height: 44px;
  padding: 0 18px 0 46px !important;
  border: 1px solid rgba(255, 255, 255, 0.085) !important;
  border-radius: 5px !important;
  color: #d7d7d7;
  background: #101010 !important;
  font-size: 11px;
}

.key-search-console input:focus {
  border-color: rgba(248, 231, 28, 0.34) !important;
  box-shadow: 0 0 0 3px rgba(248, 231, 28, 0.045) !important;
}

.key-search-console > .search { left: 16px !important; z-index: 2; }
.key-search-actions { display: flex; gap: 8px; }
.key-search-filter-group { position: relative; }

.key-search-actions .key-search-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.085) !important;
  border-radius: 5px !important;
  color: #777 !important;
  background: #101010 !important;
  font-size: 17px;
}

.key-search-actions .key-search-button:hover,
.key-search-actions .key-search-button:focus-visible,
.key-search-actions .key-search-button.active,
.key-search-actions .key-search-button.filter-btn-active {
  border-color: rgba(248, 231, 28, 0.34) !important;
  color: #f8e71c !important;
  background: rgba(248, 231, 28, 0.055) !important;
  outline: 0;
}

.key-search-dropdown {
  position: absolute !important;
  top: calc(100% + 10px);
  right: 0;
  z-index: 100 !important;
  display: block !important;
  margin: 0 !important;
  border: 1px solid rgba(248, 231, 28, 0.16);
  border-radius: 6px !important;
  background: rgba(12, 12, 12, 0.98) !important;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.48);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-5px) scale(0.985);
  transform-origin: top right;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.key-search-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.key-game-dropdown {
  width: max-content;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px;
}

.key-filter-dropdown { width: 230px; padding: 7px; }
.key-filter-dropdown.is-open { display: flex !important; flex-direction: column; gap: 4px; }
.key-filter-dropdown .searchFilterText {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #848484;
  background: transparent;
  font-family: "JetBrains Mono", "Courier New", monospace;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.key-filter-dropdown .searchFilterText:hover,
.key-filter-dropdown .searchFilterText.filter-active {
  border-color: rgba(248, 231, 28, 0.18) !important;
  color: #f8e71c;
  background: rgba(248, 231, 28, 0.045) !important;
}

.key-game-dropdown #searchBarGameDiv label {
  overflow: hidden;
  border-color: rgba(255, 255, 255, 0.085) !important;
  border-radius: 5px;
  background: #141414;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.key-game-dropdown #searchBarGameDiv label:hover,
.key-game-dropdown #searchBarGameDiv label.filter-active {
  border-color: rgba(248, 231, 28, 0.54) !important;
  background: rgba(248, 231, 28, 0.06);
  transform: translateY(-1px);
}

.key-status-dial {
  position: relative;
  display: flex;
  min-height: 320px;
  flex-direction: column;
  margin: -4px 0 0;
  isolation: isolate;
}

.key-status-chart-stage {
  position: relative;
  height: 238px;
  flex: 0 0 238px;
  isolation: isolate;
}

.key-status-chart-stage canvas {
  position: relative;
  z-index: 1;
}

.key-status-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  margin-top: 18px;
}

.key-status-filter.nx-status-pill {
  appearance: none;
  width: 100%;
  min-width: 0;
  justify-content: center;
  white-space: normal;
  cursor: pointer;
  font-family: Sora, sans-serif;
  transition: opacity 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, filter 0.18s ease;
}

.key-status-filter:hover,
.key-status-filter:focus-visible {
  border-color: currentColor;
  box-shadow: 0 0 0 1px currentColor;
  outline: 0;
  transform: translateY(-1px);
}

.key-status-filter.is-active {
  border-color: currentColor;
  box-shadow: 0 0 0 1px currentColor, 0 8px 20px rgba(0, 0, 0, 0.34);
  transform: translateY(-1px);
}

.key-status-legend.has-active .key-status-filter:not(.is-active) {
  opacity: 0.38;
  filter: saturate(0.45);
}

.dashboard-metric {
  --metric-rgb: 248, 231, 28;
  --metric-accent: #f8e71c;
  position: relative;
  overflow: visible;
  border-radius: 10px;
  animation-delay: var(--metric-delay, 0s);
}

.dashboard-shell.body-bg::before {
  display: none;
}

.dashboard-metric-card.card {
  position: relative;
  min-height: 148px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(var(--metric-rgb), 0.22);
  border-radius: 10px;
  background-clip: padding-box;
  background-color: #111111;
  background-image:
    linear-gradient(108deg, rgba(var(--metric-rgb), 0.105) 0%, rgba(var(--metric-rgb), 0.035) 34%, transparent 62%),
    linear-gradient(135deg, #181818 0%, #111111 64%, #0d0d0d 100%);
  box-shadow: none !important;
}

.dashboard-metric-card::before {
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 0;
  z-index: 0;
  width: 2px;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(180deg, var(--metric-accent), rgba(var(--metric-rgb), 0.12) 72%, transparent);
  content: "";
}

.dashboard-metric-card > * {
  position: relative;
  z-index: 1;
}

.dashboard-metric-icon {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  margin-bottom: 9px;
  border: 1px solid rgba(var(--metric-rgb), 0.22);
  border-radius: 8px;
  color: var(--metric-accent) !important;
  background: rgba(var(--metric-rgb), 0.055);
}

.dashboard-metric.metric-spent {
  --metric-rgb: 255, 93, 93;
  --metric-accent: #ff5d5d;
}

.dashboard-metric.metric-topups {
  --metric-rgb: 11, 183, 131;
  --metric-accent: #0bb783;
}

.dashboard-metric.metric-orders {
  --metric-rgb: 80, 145, 255;
  --metric-accent: #5091ff;
}

.dashboard-shell.is-konami-found .dashboard-metric-card {
  animation: dashboardSecretPulse 1.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.dashboard-shell.is-konami-found .dashboard-metric:nth-child(2) .dashboard-metric-card {
  animation-delay: 0.08s;
}

.dashboard-shell.is-konami-found .dashboard-metric:nth-child(3) .dashboard-metric-card {
  animation-delay: 0.16s;
}

.dashboard-shell.is-konami-found .dashboard-metric:nth-child(4) .dashboard-metric-card {
  animation-delay: 0.24s;
}

@keyframes dashboardSecretPulse {
  0% { border-color: rgba(var(--metric-rgb), 0.22); transform: translateY(0); }
  28% { border-color: rgba(248, 231, 28, 0.82); transform: translateY(-5px); }
  58% { border-color: rgba(255, 255, 255, 0.32); transform: translateY(0); }
  100% { border-color: rgba(var(--metric-rgb), 0.22); transform: translateY(0); }
}

.dashboard-feature-card.card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 8px;
  background-color: #111111;
  background-image:
    linear-gradient(112deg, rgba(248, 231, 28, 0.055), transparent 36%),
    linear-gradient(135deg, #171717, #101010 70%);
  box-shadow: none !important;
}

.dashboard-feature-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: 0;
  width: 3px;
  background: linear-gradient(180deg, #f8e71c, rgba(248, 231, 28, 0.08) 75%, transparent);
  content: "";
}

.dashboard-feature-card::after {
  position: absolute;
  top: -30px;
  right: -20px;
  z-index: 0;
  width: 190px;
  height: 150px;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 16px);
  content: "";
  pointer-events: none;
}

.dashboard-feature-card > * {
  position: relative;
  z-index: 1;
}

.dashboard-shell .swiper-announcements {
  overflow: hidden;
  background: #101010;
}

.dashboard-shell .swiper-announcements .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #101010;
}

.dashboard-shell .swiper-announcements .dashboard-slide-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 360px;
  flex: 0 0 auto;
  object-fit: contain;
}

@media (max-width: 640px) {
  .key-status-dial {
    min-height: 310px;
  }

  .key-status-chart-stage { height: 230px; flex-basis: 230px; }
  .key-status-legend { gap: 6px; margin-top: 14px; }

  .dashboard-metric-card.card {
    min-height: 138px;
  }

  .dashboard-feature-card::after {
    opacity: 0.72;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-shell.is-konami-found .dashboard-metric-card {
    animation: none;
    border-color: rgba(248, 231, 28, 0.62);
  }
}

@media (min-width: 1600px) and (min-aspect-ratio: 21 / 9) {
  .dashboard-shell .swiper-announcements {
    height: 425px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: #101010;
  }

  .dashboard-shell .swiper-announcements .swiper-wrapper {
    height: 100%;
  }

  .dashboard-shell .swiper-announcements .swiper-slide {
    height: 100%;
  }

  .dashboard-shell .swiper-announcements .dashboard-slide-image {
    max-height: 425px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .license-surface,
  .dashboard-metric-card.card,
  .dashboard-feature-card.card {
    transition: none;
  }
}
