/* ═══════════════════════════════════════════════════════════════
   CYKLBOARD — SUPER-ADMIN PANEL · CSS
   Exclusive styles for the Pepper Inc. global management view
   ═══════════════════════════════════════════════════════════════ */

/* ── SUPER-ADMIN SHELL ──────────────────────────────────────── */
.sa-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100dvh;
  background: var(--bg-main);
}

/* ── SIDEBAR ────────────────────────────────────────────────── */
.sa-sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
}

.sa-brand {
  padding: 1.75rem 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.sa-brand__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: rgba(232, 255, 0, 0.08);
  border: 1px solid rgba(232, 255, 0, 0.25);
  border-radius: 999px;
  padding: 0.2rem 0.625rem;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--primary-neon);
  margin-bottom: 0.75rem;
}

.sa-brand__badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary-neon);
  box-shadow: 0 0 6px var(--primary-neon);
  animation: pulse-dot 2s ease-in-out infinite;
}

.sa-brand__title {
  font-family: var(--font-condensed);
  font-size: 1.375rem;
  font-weight: 900;
  color: var(--text-high);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

.sa-brand__sub {
  font-size: 0.6875rem;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 0.2rem;
}

.sa-nav {
  padding: 1rem 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.sa-nav__btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.625rem 1rem;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-low);
  font-family: var(--font-family);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.sa-nav__btn:hover {
  color: var(--text-high);
  background: var(--bg-surface2);
}

.sa-nav__btn.active {
  color: var(--primary-neon);
  background: var(--primary-neon-glow2);
  border: 1px solid var(--border-neon);
}

.sa-nav__btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sa-sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
}

.sa-user-chip {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.75rem;
}

.sa-user-chip__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-neon);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8125rem;
  flex-shrink: 0;
}

.sa-user-chip__name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-high);
  line-height: 1.2;
}

.sa-user-chip__role {
  font-size: 0.625rem;
  color: var(--primary-neon);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── MAIN CONTENT ───────────────────────────────────────────── */
.sa-main {
  padding: 2.5rem;
  overflow-x: hidden;
}

.sa-view {
  display: none;
  animation: fadeInUp 300ms ease both;
}

.sa-view.active {
  display: block;
}

/* ── KPI GRID ───────────────────────────────────────────────── */
.sa-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.sa-kpi {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: border-color var(--transition-fast);
}

.sa-kpi:hover {
  border-color: rgba(232,255,0,0.2);
}

.sa-kpi__label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

.sa-kpi__value {
  font-family: var(--font-condensed);
  font-size: 2.25rem;
  font-weight: 900;
  color: var(--text-high);
  line-height: 1;
}

.sa-kpi__value--neon { color: var(--primary-neon); }
.sa-kpi__value--green { color: var(--color-success); }
.sa-kpi__value--blue { color: var(--color-info); }

.sa-kpi__sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ── STUDIOS SECTION ────────────────────────────────────────── */
.sa-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.sa-section-title {
  font-family: var(--font-condensed);
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--text-high);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sa-search {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.sa-search input {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-high);
  font-family: var(--font-family);
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  width: 220px;
  transition: border-color var(--transition-fast);
}

.sa-search input:focus {
  outline: none;
  border-color: rgba(232,255,0,0.4);
}

.sa-search input::placeholder {
  color: var(--text-muted);
}

/* ── STUDIOS GRID ───────────────────────────────────────────── */
.sa-studios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

/* ── STUDIO CARD ────────────────────────────────────────────── */
.sa-studio-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all var(--transition-fast);
  animation: fadeInUp 300ms ease both;
}

.sa-studio-card:hover {
  border-color: rgba(232,255,0,0.2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.sa-studio-card--inactive {
  opacity: 0.55;
  border-style: dashed;
}

.sa-studio-card__header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.sa-studio-card__swatch {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.1);
}

.sa-studio-card__info {
  flex: 1;
  min-width: 0;
}

.sa-studio-card__name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-high);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sa-studio-card__slug {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: monospace;
}

.sa-studio-card__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.sa-studio-stat {
  background: var(--bg-surface2);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  text-align: center;
}

.sa-studio-stat__label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  display: block;
}

.sa-studio-stat__value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-high);
}

.sa-plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.625rem;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sa-plan-badge--basic   { background: rgba(160,160,160,0.12); color: #a0a0a0; border: 1px solid rgba(160,160,160,0.2); }
.sa-plan-badge--pro     { background: rgba(0,200,255,0.10);   color: var(--color-info);    border: 1px solid rgba(0,200,255,0.25); }
.sa-plan-badge--elite   { background: rgba(232,255,0,0.08);   color: var(--primary-neon);  border: 1px solid rgba(232,255,0,0.25); }

.sa-studio-card__actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

/* ── MODAL (shared for create/edit studio) ──────────────────── */
.sa-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.sa-modal-overlay.is-open {
  display: flex;
}

.sa-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 540px;
  max-height: 90dvh;
  overflow-y: auto;
  animation: fadeInUp 250ms ease both;
}

.sa-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.sa-modal__title {
  font-family: var(--font-condensed);
  font-size: 1.25rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-high);
}

.sa-modal__close {
  width: 32px;
  height: 32px;
  background: var(--bg-surface2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-low);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sa-modal__close:hover {
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.sa-modal__close svg { width: 14px; height: 14px; }

.sa-modal__body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sa-modal__actions {
  display: flex;
  gap: 0.625rem;
  padding-top: 0.5rem;
}

/* Color preview swatch */
.sa-color-preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sa-color-preview input[type="color"] {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 0;
  background: none;
}

.sa-color-preview input[type="text"] {
  flex: 1;
}

/* ── EMPTY STATE ────────────────────────────────────────────── */
.sa-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
  grid-column: 1 / -1;
}

.sa-empty svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  opacity: 0.3;
}

/* ── ACCESS DENIED (shown while loading / unauthorized) ──────── */
.sa-access-denied {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100dvh;
  gap: 1rem;
  text-align: center;
  padding: 2rem;
}

.sa-access-denied__icon {
  font-size: 3rem;
  line-height: 1;
}

.sa-access-denied__title {
  font-family: var(--font-condensed);
  font-size: 2rem;
  font-weight: 900;
  color: var(--color-danger);
  text-transform: uppercase;
}

.sa-access-denied__msg {
  color: var(--text-muted);
  max-width: 380px;
}

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sa-layout {
    grid-template-columns: 1fr;
  }

  .sa-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .sa-main {
    padding: 1.5rem 1rem;
  }

  .sa-studios-grid {
    grid-template-columns: 1fr;
  }
}
