@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg-dark: #090d16;
  --bg-card: rgba(22, 30, 46, 0.8);
  --bg-card-hover: rgba(30, 41, 64, 0.9);
  --border-color: rgba(255, 255, 255, 0.08);

  --accent-primary: #6366f1;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --accent-glow: rgba(99, 102, 241, 0.35);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.15);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-glow: 0 10px 30px -10px var(--accent-glow);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(168, 85, 247, 0.12) 0%, transparent 40%);
  background-attachment: fixed;
}

h1,
h2,
h3,
h4 {
  font-family: 'Outfit', sans-serif;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Header Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2.5rem;
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 700;
  color: var(--text-primary);
  -webkit-text-fill-color: initial;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand > span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: var(--accent-gradient);
  -webkit-background-clip: border-box;
  background-clip: border-box;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  -webkit-text-fill-color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  box-shadow: var(--shadow-glow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.nav-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

.nav-btn.active {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
}

/* Auth Center Container */
.auth-container {
  max-width: 440px;
  margin: 4rem auto;
  width: 100%;
  padding: 0 1.5rem;
}

.auth-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
}

/* Container & Layout */
.main-container {
  max-width: 1280px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  width: 100%;
  flex: 1;
}

/* Card Styling */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.5);
}

/* Metric Cards */
.metric-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.metric-value {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0.75rem 0 0.25rem 0;
  font-family: 'Outfit', sans-serif;
}

.metric-subtext {
  font-size: 0.825rem;
  color: var(--text-muted);
}

/* Badges */
.badge {
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

/* Form Controls */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.required-mark {
  color: var(--danger, #ef4444);
  font-weight: 600;
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Password Input with Toggle Button */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrapper .form-input {
  padding-right: 2.75rem;
}

.password-toggle-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: var(--radius-sm);
  font-size: 1.15rem;
  line-height: 1;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
  z-index: 2;
  user-select: none;
}

.password-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-50%) scale(1.12);
}

.password-toggle-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.password-toggle-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-primary);
}

.match-hint {
  font-size: 0.75rem;
  margin-top: 0.35rem;
  transition: color 0.2s ease;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-glow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 25px -5px var(--accent-glow);
  text-decoration: none;
  color: #fff;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
}

/* Google OAuth & Social Auth Buttons */
.btn-google {
  background: #ffffff;
  color: #1f2937;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.75rem 1.25rem;
  min-height: 48px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-decoration: none;
  width: 100%;
  font-family: inherit;
  user-select: none;
}

.btn-google:hover {
  background: #f8fafc;
  color: #111827;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -2px rgba(0, 0, 0, 0.35);
  text-decoration: none;
}

.btn-google:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-google:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.4);
}

.btn-google:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.google-icon-svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: block;
}

/* OAuth Divider */
.oauth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.775rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.oauth-divider::before,
.oauth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.oauth-divider span {
  padding: 0 1rem;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: #111827;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  max-width: 500px;
  width: 90%;
  padding: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

/* Gallery Photo Grid (Responsive Mobile-First with Zero CLS) */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-top: 1.5rem;
}

@media (min-width: 640px) {
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
  }
}

@media (min-width: 1024px) {
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
  }
}

.photo-card {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #1e293b;
  aspect-ratio: 3 / 2;
  border: 1px solid var(--border-color);
  contain: layout paint;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

/* Skeleton Shimmer Placeholder (Module 5 Phase 5) */
@keyframes skeletonShimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.photo-card.skeleton {
  background: linear-gradient(
    90deg,
    rgba(22, 30, 46, 0.8) 0%,
    rgba(45, 55, 75, 0.9) 50%,
    rgba(22, 30, 46, 0.8) 100%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.7s infinite ease-in-out;
  border-color: rgba(255, 255, 255, 0.06);
}

.photo-card.skeleton .photo-overlay,
.photo-card.skeleton .photo-select-btn {
  display: none;
}

.photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}

.photo-img.loaded {
  opacity: 1;
}

.photo-card:hover .photo-img.loaded {
  transform: scale(1.04);
}

.photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 60%);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0.8rem;
  opacity: 0;
  transition: opacity 0.25s;
}

.photo-card:hover .photo-overlay {
  opacity: 1;
}

.fav-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.fav-btn.active {
  background: #ec4899;
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 15, 0.96);
  backdrop-filter: blur(20px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox-modal.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: linear-gradient(to bottom, rgba(9, 13, 22, 0.95), transparent);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1010;
  transition: opacity 0.3s;
}

.lightbox-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 4rem 1rem;
}

.lightbox-img-wrapper {
  width: 90vw;
  height: 80vh;
  max-width: 90vw;
  max-height: 80vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
}

/* Floating Minimalist Image Viewer HUD Controls (Google Photos / iOS Style) */
.image-viewer-controls {
  position: absolute;
  bottom: 4.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 1020;
  opacity: 0.88;
  transition: opacity 0.25s ease, transform 0.25s ease;
  user-select: none;
}

.image-viewer-controls:hover,
.image-viewer-controls:focus-within {
  opacity: 1;
}

.iv-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  background: transparent;
  border: none;
  color: #f1f5f9;
  font-size: 1.1rem;
  font-weight: 500;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, color 0.15s ease;
}

.iv-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.iv-btn:active {
  transform: scale(0.92);
}

.iv-scale-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: #cbd5e1;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  min-width: 52px;
  text-align: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.iv-scale-badge:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

@media (max-width: 640px) {
  .image-viewer-controls {
    bottom: 5.25rem;
    padding: 0.25rem 0.5rem;
  }
  .iv-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }
}

.lightbox-img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
  user-select: none;
}

.lightbox-img-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 1;
  pointer-events: none;
  transition: opacity 0.3s ease-in-out;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
}

.lightbox-img-high {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.18s ease-out;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
}

.lightbox-img-high.loaded {
  opacity: 1;
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background 0.2s, transform 0.2s;
  z-index: 1010;
}

.lightbox-nav-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-50%) scale(1.08);
}

.lightbox-nav-btn.prev {
  left: 1.5rem;
}

.lightbox-nav-btn.next {
  right: 1.5rem;
}

.lightbox-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: linear-gradient(to top, rgba(9, 13, 22, 0.95), transparent);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1010;
}

/* Comment Drawer in Lightbox */
.comment-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  max-width: 90vw;
  height: 100%;
  background: #0f172a;
  border-left: 1px solid var(--border-color);
  z-index: 1050;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.comment-drawer.open {
  right: 0;
}

.comment-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.comment-list {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comment-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
}

.comment-author {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  margin-bottom: 0.35rem;
}

.comment-author-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent-primary);
}

.comment-author-badge.studio {
  background: rgba(236, 72, 153, 0.2);
  color: #ec4899;
}

.comment-content {
  font-size: 0.85rem;
  color: #e2e8f0;
  line-height: 1.4;
}

.comment-input-area {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: #0b1120;
}

/* WhatsApp/Instagram style quoted reply box */
.comment-reply-quote {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--accent-primary, #6366f1);
  border-radius: 4px;
  padding: 0.35rem 0.6rem;
  margin-bottom: 0.45rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.comment-reply-quote:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(2px);
}

.comment-reply-quote.studio-parent {
  border-left-color: #ec4899;
}

.reply-quote-author {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-primary, #818cf8);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.15rem;
}

.comment-reply-quote.studio-parent .reply-quote-author {
  color: #f472b6;
}

.reply-quote-text {
  font-size: 0.75rem;
  color: var(--text-secondary, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  margin: 0;
  line-height: 1.3;
}

.reply-target-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(99, 102, 241, 0.12);
  border-left: 3px solid var(--accent-primary, #6366f1);
  border-radius: 4px;
  padding: 0.4rem 0.75rem;
  font-size: 0.78rem;
  color: var(--text-primary);
  animation: fadeIn 0.2s ease;
}

.reply-target-banner.studio-style {
  background: rgba(236, 72, 153, 0.12);
  border-left-color: #ec4899;
}

@keyframes commentPulse {
  0% {
    background: rgba(99, 102, 241, 0.45);
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.6);
  }
  100% {
    background: transparent;
    box-shadow: none;
  }
}

.comment-highlight-pulse {
  animation: commentPulse 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

/* Sticky Bottom Selection Bar */
.sticky-selection-bar {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(16px);
  border-radius: 100px;
  padding: 0.75rem 1.75rem;
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.8), var(--shadow-glow);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  z-index: 900;
  max-width: 95vw;
}

.progress-pill {
  width: 140px;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 4px;
  transition: width 0.3s;
}

/* Card Selection Indicators */
.photo-select-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.6);
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;
}

.photo-card.selected .photo-select-btn {
  background: var(--accent-primary);
  border-color: #fff;
  color: #fff;
  box-shadow: 0 0 12px var(--accent-primary);
}

.comment-badge {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-secondary);
  backdrop-filter: blur(6px);
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

/* ==========================================================================
   Workspace URL Slug Preview & Inline Customization
   ========================================================================== */

.workspace-preview-box {
  margin-top: 0.6rem;
  padding: 0.85rem 1rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px dashed rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: all 0.25s ease;
}

.workspace-preview-box:hover {
  border-color: rgba(99, 102, 241, 0.6);
  background: rgba(15, 23, 42, 0.85);
}

.workspace-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.workspace-url-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.workspace-url-text {
  font-family: 'Outfit', monospace;
  font-size: clamp(0.82rem, 2.5vw, 0.92rem);
  word-break: break-all;
  display: inline-flex;
  align-items: baseline;
  gap: 0.1rem;
}

.workspace-url-prefix {
  color: var(--text-muted);
}

.workspace-url-slug {
  color: #a5b4fc;
  font-weight: 600;
  transition: color 0.2s;
}

.btn-slug-edit {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
  min-height: 36px;
}

.btn-slug-edit:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.15);
}

.btn-slug-edit:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Slug Drawer */
.slug-drawer {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  animation: slugSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slugSlideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slug-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.2rem;
}

.slug-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.slug-prefix-addon {
  position: absolute;
  left: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
  user-select: none;
  font-size: 0.95rem;
  pointer-events: none;
}

.slug-input {
  padding-left: 1.85rem !important;
  padding-right: 2.5rem !important;
  font-family: 'Outfit', monospace;
  font-size: 0.9rem;
}

.slug-status-indicator {
  position: absolute;
  right: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  pointer-events: none;
}

.btn-text-action {
  background: none;
  border: none;
  color: var(--accent-primary);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: inherit;
  transition: color 0.2s, background 0.2s;
  min-height: 32px;
}

.btn-text-action:hover {
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.1);
  text-decoration: none;
}

.slug-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.slug-status-text {
  font-size: 0.76rem;
  font-weight: 500;
  margin-top: 0.15rem;
}

.slug-status-text.available {
  color: var(--success);
}

.slug-status-text.taken {
  color: var(--warning);
}

.slug-status-text.error {
  color: var(--danger);
}

/* ==========================================================================
   Responsive Enhancements (Mobile-First)
   ========================================================================== */
@media (max-width: 639px) {
  .navbar {
    padding: 1rem 1.25rem;
  }

  .auth-container {
    padding: 0 1rem;
    margin: 2rem auto;
  }

  .auth-card {
    padding: 1.75rem 1.25rem;
    border-radius: var(--radius-md);
  }

  .form-input,
  .btn-primary {
    min-height: 48px;
    font-size: 1rem;
  }

  .btn-slug-edit {
    min-height: 44px;
    padding: 0.4rem 0.8rem;
  }

  .btn-text-action {
    min-height: 44px;
    padding: 0.4rem 0.6rem;
  }
}

@media (min-width: 640px) {
  .auth-container {
    margin: 3.5rem auto;
  }
}

@media (min-width: 1024px) {
  .auth-container {
    margin: 4.5rem auto;
  }
}

/* ==========================================================================
   Protected Route Anti-FOUC & Auth Veil
   ========================================================================== */
html.auth-pending body {
  visibility: hidden !important;
  opacity: 0 !important;
}

#auth-loading-veil {
  position: fixed;
  inset: 0;
  background-color: var(--bg-dark);
  background-image:
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(168, 85, 247, 0.12) 0%, transparent 40%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  transition: opacity 0.25s ease-out, visibility 0.25s ease-out;
}

#auth-loading-veil.veil-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-veil-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--accent-primary);
  border-right-color: #a855f7;
  border-radius: 50%;
  animation: auth-veil-spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  margin-bottom: 1.25rem;
}

.auth-veil-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.02em;
}

@keyframes auth-veil-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   Module 5: Studio Uploader & Workstation Styles (TASK M5-401)
   ========================================================================== */

.uploader-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.uploader-dropzone {
  border: 2px dashed rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.4);
  padding: clamp(1.5rem, 3.5vw, 2.75rem);
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.uploader-dropzone:hover,
.uploader-dropzone.dragover {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.2);
  transform: translateY(-2px);
}

.uploader-dropzone-icon {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  margin-bottom: 0.75rem;
  display: inline-block;
  animation: float-icon 3s ease-in-out infinite;
}

@keyframes float-icon {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

.uploader-dropzone-title {
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.uploader-dropzone-desc {
  font-size: clamp(0.8rem, 1.4vw, 0.875rem);
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 1.25rem;
  line-height: 1.5;
}

.uploader-btn-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.uploader-badge-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1rem;
}

.uploader-badge {
  font-size: 0.725rem;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

/* Interrupted Resumable Upload Sessions Banner (Module 5) */
.uploader-interrupted-banner {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.uploader-interrupted-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

@media (min-width: 640px) {
  .uploader-interrupted-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.uploader-interrupted-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--warning, #f59e0b);
}

.uploader-interrupted-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.uploader-interrupted-item {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}

@media (min-width: 640px) {
  .uploader-interrupted-item {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.uploader-interrupted-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.uploader-interrupted-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.uploader-interrupted-details {
  min-width: 0;
  flex: 1;
}

.uploader-interrupted-filename {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uploader-interrupted-progress {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uploader-interrupted-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

/* Upload Workstation Overview Bar */
.uploader-status-bar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(22, 30, 46, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

@media (min-width: 768px) {
  .uploader-status-bar {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.uploader-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem 1rem;
  flex: 1;
  min-width: 0;
}

@media (min-width: 640px) {
  .uploader-stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
}

.uploader-stat-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.uploader-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  white-space: nowrap;
}

.uploader-stat-value {
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uploader-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

/* Upload Progress Window / Queue Items */
.uploader-queue-container {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.uploader-queue-container::-webkit-scrollbar {
  width: 6px;
}

.uploader-queue-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.uploader-item-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.uploader-item-card:hover {
  background: rgba(22, 30, 46, 0.8);
  border-color: rgba(255, 255, 255, 0.15);
}

.uploader-item-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.uploader-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.uploader-item-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.uploader-item-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uploader-item-meta {
  font-size: 0.725rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.uploader-progress-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.uploader-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-gradient);
  transition: width 0.2s ease;
  border-radius: 3px;
}

.uploader-progress-fill.completed {
  background: var(--success);
}

.uploader-progress-fill.failed {
  background: var(--danger);
}

.uploader-progress-fill.paused {
  background: var(--warning);
}

.uploader-item-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.uploader-icon-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.8rem;
}

.uploader-icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.25);
}

.uploader-icon-btn.danger:hover {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.4);
}

/* Clean High-Contrast Gallery Delete Icon Button */
.delete-icon-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #ef4444;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  padding: 0;
}

.delete-icon-btn:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.45);
  transform: translateY(-1px);
}

.delete-icon-btn svg {
  display: block;
}

/* ===================================================================
   Module 6: Gallery Media Explorer & Photo Management (MED-EPIC-04)
   =================================================================== */
.studio-photo-card {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(22, 30, 46, 0.7);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.studio-photo-card:hover {
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  transform: translateY(-2px);
}

.studio-photo-card.selected {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.12);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.3);
}

.studio-photo-thumb-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  background: #0f172a;
  overflow: hidden;
}

.studio-photo-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.studio-photo-card:hover .studio-photo-thumb {
  transform: scale(1.04);
}

.studio-photo-select-box {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 5;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  border-radius: 4px;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.studio-photo-select-box input {
  accent-color: var(--accent-primary);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.studio-photo-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #f87171;
  border-radius: 4px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.2s, background 0.2s, transform 0.2s;
  padding: 0;
}

.studio-photo-delete-btn:hover {
  opacity: 1;
  background: #ef4444;
  color: #ffffff;
  transform: scale(1.1);
}

.studio-photo-meta {
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: rgba(15, 23, 42, 0.6);
}

.studio-photo-filename {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.studio-photo-submeta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.studio-photo-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.studio-photo-badge.ready {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.studio-photo-badge.pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Lightbox HD Indicator Badge (Progressive High-Res Loading) */
.hd-badge {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.hd-badge.ready {
  background: rgba(16, 185, 129, 0.15) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.hd-badge.loading {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

/* ===================================================================
   Module 7: Studio Plan & Billing Portal, Checkout Drawer & Pricing UI
   Responsive Web Design Standards: Mobile-First progressive enhancement
   =================================================================== */

/* 1. Subnavigation Bar */
.studio-subnav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.studio-subnav::-webkit-scrollbar {
  display: none;
}

.studio-subnav-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  font-size: 0.88rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.studio-subnav-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.studio-subnav-btn.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #fff;
  font-weight: 600;
}

.subnav-plan-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--accent-gradient);
  color: #fff;
}

/* 2. Billing Subscription Card */
.billing-card {
  padding: 1.5rem;
}

.billing-sub-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 640px) {
  .billing-sub-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.billing-quota-track {
  background: rgba(255, 255, 255, 0.06);
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
}

.billing-quota-fill {
  height: 100%;
  transition: width 0.4s ease;
}

/* 3. Referral Wallet Card */
.billing-wallet-card {
  padding: 1.5rem;
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.04);
}

.billing-wallet-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .billing-wallet-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.billing-wallet-left {
  flex: 1;
}

.billing-wallet-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.wallet-stat-box {
  background: rgba(255, 255, 255, 0.03);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.wallet-stat-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
}

.wallet-stat-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  font-family: 'Outfit', sans-serif;
}

.billing-wallet-right {
  min-width: 280px;
  max-width: 400px;
  width: 100%;
}

.referral-input-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.referral-input-group .form-input {
  font-size: 0.82rem;
  min-height: 44px;
}

.referral-input-group .btn-primary {
  min-height: 44px;
  white-space: nowrap;
  font-size: 0.82rem;
  padding: 0 1rem;
}

/* 4. Segmented Billing Cycle Switcher */
.cycle-switcher-wrapper {
  display: flex;
  justify-content: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.25rem 0;
}

.cycle-switcher {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  padding: 4px;
  gap: 4px;
}

.cycle-pill {
  min-height: 44px;
  padding: 0.5rem 1rem;
  border-radius: 40px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.cycle-pill:hover {
  color: var(--text-primary);
}

.cycle-pill.active {
  background: var(--accent-gradient);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
}

.cycle-pill-badge {
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
}

.cycle-pill-badge.badge-hot {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-weight: 700;
}

/* 5. Responsive Plan Cards Grid */
.plan-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (min-width: 640px) {
  .plan-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .plan-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.plan-card {
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.plan-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.4);
}

.plan-card.featured {
  border: 2px solid var(--accent-primary);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.18);
}

.plan-card.current-plan-card {
  border: 2px solid rgba(16, 185, 129, 0.6);
}

.plan-badge-featured {
  position: absolute;
  top: -12px;
  right: 16px;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.plan-badge-current {
  position: absolute;
  top: -12px;
  left: 16px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}

.plan-card-title {
  margin: 0.25rem 0 0.35rem 0;
  font-size: 1.25rem;
  color: #fff;
}

.plan-card-desc {
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin: 0 0 1.25rem 0;
  min-height: 2.4em;
}

.plan-card-pricing {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.plan-effective-price {
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
}

.plan-effective-price .currency {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 600;
  color: var(--text-secondary);
}

.plan-effective-price .price-val {
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  font-weight: 800;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  line-height: 1;
}

.plan-effective-price .period {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: 0.25rem;
}

.plan-billing-recap {
  margin-top: 0.45rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.plan-savings-pill {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.plan-features-list {
  list-style: none;
  margin: 0 0 1.5rem 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1;
}

.plan-features-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.plan-features-list .checkmark {
  color: #34d399;
  font-weight: bold;
}

.plan-select-btn {
  min-height: 44px;
  width: 100%;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 6. Tax Invoices Table */
.invoice-table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.invoices-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

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

.invoices-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.invoice-dl-btn {
  min-height: 36px;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.invoice-dl-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: #a5b4fc;
}

/* 7. Slide-Over Checkout Drawer & Mobile Bottom Sheet */
.checkout-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.checkout-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.checkout-drawer {
  position: fixed;
  background: rgba(15, 23, 42, 0.98);
  border-left: 1px solid var(--border-color);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  z-index: 1001;
  /* Mobile First: Bottom Sheet on small screens */
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 92vh;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 640px) {
  .checkout-drawer {
    /* Desktop & Tablet: Slide-over drawer from right */
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: 480px;
    max-width: 95vw;
    max-height: 100vh;
    border-radius: 0;
    transform: translateX(100%);
  }
}

.checkout-drawer.active {
  transform: translate(0, 0);
}

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

.checkout-close-btn {
  min-width: 44px;
  min-height: 44px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.checkout-close-btn:hover {
  color: #fff;
}

.checkout-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.checkout-two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .checkout-two-col {
    grid-template-columns: 1fr 1fr;
  }
}

.checkout-section {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.checkout-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 0.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.checkout-section-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 0 0.85rem 0;
}

.checkout-summary-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.summary-row.discount-row {
  color: #34d399;
}

.summary-row.subtotal-row {
  border-top: 1px dashed var(--border-color);
  padding-top: 0.5rem;
  margin-top: 0.25rem;
  color: var(--text-primary);
}

.summary-row.total-row {
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
  margin-top: 0.25rem;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.total-amount {
  color: #a5b4fc;
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
}

.summary-warnings {
  margin-top: 0.5rem;
  padding: 0.5rem;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.checkout-drawer-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.95);
}

.checkout-alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  margin-bottom: 1rem;
}

/* --- Account & Workspace Settings Workstation (EPIC 05) --- */
.settings-tabs-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.settings-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  min-height: 44px;
}

.settings-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.settings-tab-btn.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  font-weight: 600;
}

.settings-tab-pane {
  animation: fadeIn 0.25s ease-out;
}

.settings-grid-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .settings-grid-layout {
    grid-template-columns: 2fr 1fr;
  }
}

.settings-card {
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  margin-bottom: 1.5rem;
}

.settings-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.35rem 0;
  color: #fff;
}

.settings-card-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0 0 1.5rem 0;
  line-height: 1.45;
}

.settings-form-row {
  margin-bottom: 1.25rem;
}

.settings-form-row label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.settings-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.6);
  color: #fff;
  font-size: 0.9rem;
  transition: border-color 0.2s;
  box-sizing: border-box;
  min-height: 44px;
}

.settings-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.settings-input[readonly] {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  cursor: not-allowed;
}

.slug-input-wrapper {
  display: flex;
  align-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.6);
  overflow: hidden;
}

.slug-prefix {
  padding: 0.75rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border-right: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.slug-input-field {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.75rem 1rem;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  min-height: 44px;
}

.slug-status-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.35rem;
}

.slug-status-badge.available {
  color: #34d399;
}

.slug-status-badge.invalid {
  color: #f87171;
}

.slug-status-badge.checking {
  color: #fbbf24;
}

.settings-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-toggle-row:last-child {
  border-bottom: none;
}

.settings-toggle-label {
  font-weight: 500;
  font-size: 0.88rem;
  color: #fff;
}

.settings-toggle-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

/* Toggle Switch Component */
.switch-control {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.switch-control input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 34px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.switch-control input:checked + .switch-slider {
  background: var(--accent-gradient);
}

.switch-control input:checked + .switch-slider:before {
  transform: translateX(22px);
}

/* Session Cards */
.session-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  transition: border-color 0.2s;
}

.session-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

/* Settings Alert Banner */
.settings-alert-banner {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
  font-weight: 500;
  animation: fadeIn 0.2s ease-in;
}

.settings-alert-banner.alert-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.settings-alert-banner.alert-danger {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
}

.auth-provider-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
}

.auth-provider-pill.google {
  background: rgba(66, 133, 244, 0.12);
  border-color: rgba(66, 133, 244, 0.3);
  color: #93c5fd;
}



/* ==========================================================================
   EPIC 04 — Responsive Super Admin BI & Governance Console (.admin-*)
   Mobile-First (<640px base) -> Progressive min-width (640, 768, 1024, 1280)
   ========================================================================== */

.admin-main {
  width: 100%;
  max-width: 1440px;
  margin: 1rem auto 2.5rem auto;
  padding: 0 clamp(0.85rem, 2vw, 2rem);
  flex: 1;
}

.admin-header-bar {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.admin-header-title {
  font-size: clamp(1.25rem, 2.2vw + 0.45rem, 1.85rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.admin-header-subtitle {
  color: var(--text-secondary);
  font-size: clamp(0.82rem, 0.5vw + 0.72rem, 0.94rem);
  margin-top: 0.25rem;
}

.admin-header-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.admin-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.75);
  color: var(--text-secondary);
}

.admin-pill.pill-safe {
  background: var(--success-bg);
  border-color: rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.admin-pill.pill-warn {
  background: var(--warning-bg);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.admin-pill.pill-danger {
  background: var(--danger-bg);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* Horizontal Scrollable Tab Bar (Mobile-First >=44px Tap Targets) */
.admin-tab-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.35rem;
  margin-bottom: 1.5rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  scrollbar-width: thin;
}

.admin-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0.55rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.admin-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.admin-tab-btn.active {
  color: #fff;
  background: rgba(99, 102, 241, 0.24);
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 4px 14px -4px var(--accent-glow);
}

.admin-tab-pane {
  display: none;
  animation: fadeIn 0.18s ease-out;
}

.admin-tab-pane.active {
  display: block;
}

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

/* Buttons & Tap Target Standardization */
.admin-btn,
.admin-btn-sm,
.admin-btn-danger,
.admin-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-color);
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.admin-btn-sm {
  padding: 0.45rem 0.8rem;
  font-size: 0.8rem;
}

.admin-btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.admin-btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.22);
}

.admin-btn-danger {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.admin-btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.28);
  color: #fff;
}

.admin-btn:disabled,
.admin-btn-sm:disabled,
.admin-btn-danger:disabled,
.admin-btn-ghost:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.admin-switch-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 48px;
}

/* Alert Banners */
.admin-alert {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.95rem 1.15rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-color);
  font-size: 0.87rem;
}

.admin-alert-danger {
  background: rgba(239, 68, 68, 0.13);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fecaca;
}

.admin-alert-info {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
}

.admin-alert-warning {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fde68a;
}

/* Responsive Grids (Mobile-First 1-col base) */
.admin-kpi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.admin-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: clamp(1rem, 1.5vw, 1.35rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.4rem;
}

.admin-kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.4rem, 2.2vw + 0.45rem, 2rem);
  font-weight: 700;
  line-height: 1.15;
}

.admin-split-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.admin-filter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.admin-config-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.admin-section-header {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.admin-section-title {
  font-size: clamp(1rem, 1vw + 0.75rem, 1.25rem);
}

.admin-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: clamp(1rem, 2vw, 1.5rem);
  margin-bottom: 1.25rem;
}

.admin-card .form-input,
.admin-card .form-select,
.admin-drawer .form-input,
.admin-drawer .form-select,
.admin-modal .form-input,
.admin-modal .form-select {
  min-height: 44px;
}

/* Data Tables with Safe Mobile Horizontal Scroll */
.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: rgba(9, 13, 22, 0.45);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
  font-size: 0.84rem;
}

.admin-table th,
.admin-table td {
  padding: 0.75rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}

.admin-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: rgba(15, 23, 42, 0.85);
  white-space: nowrap;
}

.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

/* Progress Meter */
.admin-progress-track {
  width: 100%;
  min-width: 90px;
  height: 7px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.3rem;
}

.admin-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent-gradient);
}

/* Pagination Bar */
.admin-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.admin-pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Slide-Over Tenant Drawer */
.admin-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(4px);
  z-index: 900;
  display: none;
  justify-content: flex-end;
}

.admin-drawer-backdrop.open {
  display: flex;
}

.admin-drawer {
  width: 100%;
  height: 100%;
  background: #0b1120;
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: -15px 0 45px rgba(0, 0, 0, 0.65);
}

.admin-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.9);
}

.admin-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.admin-subtabs {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 0.4rem;
  margin-bottom: 1.15rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-color);
}

/* Modal System */
.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.admin-modal-backdrop.open {
  display: flex;
}

.admin-modal {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8);
}

.admin-modal-lg {
  max-width: 760px;
}

.admin-modal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.admin-json-pre {
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.9rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #e2e8f0;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 360px;
}

/* Config Card Rows */
.admin-config-item {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.admin-config-row-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.admin-config-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: #c7d2fe;
  word-break: break-all;
}

.admin-config-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.admin-config-actions .form-input {
  flex: 1;
  min-width: 140px;
}

/* Toast Stack */
.admin-toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  left: 1rem;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  pointer-events: none;
}

.admin-toast {
  pointer-events: auto;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  background: #0f172a;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.admin-toast.toast-success {
  border-color: rgba(16, 185, 129, 0.55);
  background: rgba(6, 78, 59, 0.92);
  color: #d1fae5;
}

.admin-toast.toast-error {
  border-color: rgba(239, 68, 68, 0.55);
  background: rgba(127, 29, 29, 0.94);
  color: #fee2e2;
}

.admin-toast.toast-warning {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(120, 53, 15, 0.94);
  color: #fef3c7;
}

/* Mobile-First Progressive Enhancement Breakpoints */
@media (min-width: 640px) {
  .admin-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-config-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-toast-container {
    left: auto;
    width: 390px;
  }
}

@media (min-width: 768px) {
  .admin-header-bar {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .admin-section-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .admin-drawer {
    max-width: 680px;
  }
  .admin-tab-bar {
    flex-wrap: wrap;
  }
}

@media (min-width: 1024px) {
  .admin-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .admin-split-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .admin-drawer {
    max-width: 760px;
  }
}

@media (min-width: 1280px) {
  .admin-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .admin-config-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ==========================================================================
   Global Non-Blocking Toast & Dialog System (E2-03) + Vanity Portfolio Grid
   ========================================================================== */
.ui-toast-container {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: none;
}

@media (min-width: 640px) {
  .ui-toast-container {
    top: 1.25rem;
    bottom: auto;
    left: auto;
    right: 1.25rem;
    width: min(420px, calc(100vw - 2.5rem));
  }
}

.ui-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  color: #f8fafc;
  backdrop-filter: blur(14px);
  animation: ui-toast-in 0.22s ease-out;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.ui-toast--closing {
  opacity: 0;
  transform: translateY(-6px);
}

.ui-toast--success {
  border-color: rgba(16, 185, 129, 0.55);
}

.ui-toast--error {
  border-color: rgba(239, 68, 68, 0.6);
}

.ui-toast--warning {
  border-color: rgba(245, 158, 11, 0.6);
}

.ui-toast__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

.ui-toast--success .ui-toast__icon {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.ui-toast--error .ui-toast__icon {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.ui-toast--warning .ui-toast__icon {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.ui-toast__body {
  flex: 1;
  font-size: clamp(0.85rem, 1.4vw, 0.92rem);
  line-height: 1.45;
  white-space: pre-line;
  word-break: break-word;
}

.ui-toast__close {
  min-width: 44px;
  min-height: 44px;
  margin: -0.5rem -0.5rem -0.5rem 0;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 1.25rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
}

.ui-toast__close:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
}

@keyframes ui-toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ui-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10060;
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.ui-dialog-card {
  width: 100%;
  max-width: 460px;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 1rem;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  color: #f8fafc;
}

.ui-dialog-title {
  margin: 0 0 0.65rem;
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  font-weight: 700;
  color: #f8fafc;
}

.ui-dialog-message {
  margin: 0 0 1.25rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #cbd5e1;
  white-space: pre-line;
  word-break: break-word;
}

.ui-dialog-input {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 1.25rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(15, 23, 42, 0.9);
  color: #f8fafc;
  font-size: 0.9rem;
}

.ui-dialog-input:focus {
  outline: none;
  border-color: var(--accent-primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.ui-dialog-actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.65rem;
}

@media (min-width: 480px) {
  .ui-dialog-actions {
    flex-direction: row;
    justify-content: flex-end;
  }
}

.ui-dialog-btn {
  min-height: 44px;
  padding: 0.6rem 1.15rem;
  border-radius: 0.65rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, transform 0.1s ease;
}

.ui-dialog-btn--secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
}

.ui-dialog-btn--secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.ui-dialog-btn--primary {
  background: var(--accent-primary, #6366f1);
  color: #ffffff;
}

.ui-dialog-btn--primary:hover {
  filter: brightness(1.08);
}

.ui-dialog-btn--danger {
  background: #dc2626;
  color: #ffffff;
}

.ui-dialog-btn--danger:hover {
  background: #b91c1c;
}

/* Public Studio Portfolio Gallery Grid (/s/{studio}) */
.studio-portfolio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

@media (min-width: 640px) {
  .studio-portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .studio-portfolio-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.studio-portfolio-card {
  display: flex;
  flex-direction: column;
  border-radius: 1rem;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.18);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.studio-portfolio-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.38);
}

.studio-portfolio-cover {
  aspect-ratio: 16 / 10;
  width: 100%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(15, 23, 42, 0.9));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.studio-portfolio-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.studio-portfolio-body {
  padding: 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}
