/* ==========================================================================
   iOS & Android App Launchpad - Main Stylesheet
   Design Language: Corporate, Premium, Modern (VVDN Tech Inspired)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design System & CSS Variables
   -------------------------------------------------------------------------- */
:root {
  /* Common Palette / Brand Colors */
  --color-primary: #002B5C;      /* Deep Corporate Blue */
  --color-secondary: #005BAC;    /* Royal Blue */
  --color-accent: #00AEEF;       /* Cyan Accent */
  
  --color-qa: #10B981;           /* Green for QA */
  --color-uat: #F59E0B;          /* Orange for UAT */
  --color-prod: #EF4444;         /* Red for Production */
  
  /* Light Theme Specific Variables (Default) */
  --bg-color-raw: 244, 248, 252;
  --bg-color: rgb(var(--bg-color-raw));            /* #F4F8FC */
  --card-bg: #FFFFFF;
  --card-border: rgba(226, 232, 240, 0.8);
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --nav-bg: rgba(255, 255, 255, 0.75);
  --nav-border: rgba(226, 232, 240, 0.5);
  --modal-bg: #FFFFFF;
  --modal-backdrop: rgba(15, 23, 42, 0.4);
  
  --shadow-sm: 0 2px 4px rgba(0, 43, 92, 0.04);
  --shadow-md: 0 8px 30px rgba(0, 43, 92, 0.06);
  --shadow-lg: 0 20px 40px rgba(0, 43, 92, 0.08);
  
  --glow-btn: 0 4px 15px rgba(0, 174, 239, 0.3);
  --gradient-btn: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-accent) 100%);
  --gradient-hero: linear-gradient(135deg, #001e42 0%, #002B5C 40%, #005BAC 100%);
  
  --border-radius: 14px;
  --transition-smooth: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

[data-theme="dark"] {
  /* Dark Theme Variables */
  --bg-color-raw: 15, 23, 42;
  --bg-color: rgb(var(--bg-color-raw));            /* #0F172A */
  --card-bg: #1E293B;
  --card-border: rgba(51, 65, 85, 0.6);
  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #64748B;
  --nav-bg: rgba(15, 23, 42, 0.75);
  --nav-border: rgba(51, 65, 85, 0.5);
  --modal-bg: #1E293B;
  --modal-backdrop: rgba(0, 0, 0, 0.6);
  
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.4);
  
  --glow-btn: 0 4px 15px rgba(0, 174, 239, 0.4);
  --gradient-btn: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-accent) 100%);
  --gradient-hero: linear-gradient(135deg, #020617 0%, #070f1e 50%, #0f172a 100%);
}

/* --------------------------------------------------------------------------
   2. Reset & Typography
   -------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  padding-top: 76px; /* offset the fixed .main-header (out of flow) */
  transition: background-color 0.4s ease, color 0.4s ease;
}

body.auth-locked {
  overflow: hidden;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-smooth);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  outline: none;
  border: none;
  background: none;
}

button {
  cursor: pointer;
}

code {
  font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;
  background: rgba(0, 174, 239, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--color-accent);
}

/* Screen reader utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* --------------------------------------------------------------------------
   3. Loading Animation
   -------------------------------------------------------------------------- */
#loader-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-container {
  text-align: center;
}

.logo-spinner {
  width: 70px;
  height: 70px;
  margin: 0 auto 20px;
  border: 4px solid var(--color-primary);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

.loader-text {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   4. Tester Authentication Lock Overlay
   -------------------------------------------------------------------------- */
.tester-auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1500;
  background: radial-gradient(circle at 10% 20%, rgba(var(--bg-color-raw), 0.96) 0%, rgba(var(--bg-color-raw), 0.98) 90%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

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

.tester-auth-card {
  width: 100%;
  max-width: 440px;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 40px 32px;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(0, 91, 172, 0.05);
  text-align: center;
  animation: cardFadeIn 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) both;
}

.tester-auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.tester-auth-logo h3 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.tester-auth-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

.tester-auth-card .form-group {
  text-align: left;
  margin-bottom: 20px;
}

.tester-auth-card label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.tester-auth-card input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background-color: rgba(var(--bg-color-raw), 0.5);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: var(--transition-smooth);
}

.tester-auth-card input:focus {
  border-color: var(--color-accent);
  background-color: var(--card-bg);
  box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.15);
}

.btn-block {
  width: 100%;
  height: 48px;
  margin-top: 10px;
}

.auth-error-msg {
  display: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-prod);
  margin-top: 16px;
}

/* --------------------------------------------------------------------------
   5. Header Navigation
   -------------------------------------------------------------------------- */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 76px;
  z-index: 1000;
  background-color: transparent;
  border-bottom: 1px solid transparent;
  transition: var(--transition-smooth);
}

.main-header.scrolled {
  background-color: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1400px;
  height: 100%;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-svg {
  filter: drop-shadow(0 2px 8px rgba(0, 174, 239, 0.2));
}

.logo-text {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  white-space: nowrap;
}

.logo-highlight {
  color: var(--color-accent);
}

.header-title-wrapper {
  flex-grow: 1;
  display: flex;
  justify-content: center;
}

.header-title-context {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(var(--bg-color-raw), 0.5);
  border: 1px solid var(--nav-border);
  padding: 6px 18px;
  border-radius: 20px;
  letter-spacing: 0.2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Persistent header Upload Build CTA — sized to align with the 38px account button */
.header-actions .header-upload-btn {
  height: 38px;
  padding: 0 16px;
  font-size: 0.85rem;
  gap: 8px;
}

.header-actions .header-upload-btn svg {
  width: 16px;
  height: 16px;
}

/* Clock display */
.header-clock {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(var(--bg-color-raw), 0.3);
  border: 1px solid var(--nav-border);
  white-space: nowrap;
}

.clock-icon {
  color: var(--color-accent);
}

/* Direct Profile Switcher Select Dropdown */
.role-profile-select {
  height: 38px;
  padding: 0 32px 0 16px;
  border-radius: 8px;
  background-color: rgba(var(--bg-color-raw), 0.5);
  border: 1px solid var(--nav-border);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  transition: var(--transition-smooth);
}

[data-theme="dark"] .role-profile-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23CBD5E1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

/* Auth overlay view-toggle links (Sign In <-> Register) */
.auth-toggle-link {
  font-size: 0.875rem;
  color: var(--color-secondary);
  font-weight: 500;
  text-decoration: none;
}

.auth-toggle-link:hover {
  text-decoration: underline;
}

[data-theme="dark"] .auth-toggle-link {
  color: var(--color-accent);
}

.role-profile-select:hover {
  background-color: var(--card-bg);
  border-color: var(--color-accent);
}

/* Theme toggle */
.theme-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(var(--bg-color-raw), 0.4);
  border: 1px solid var(--nav-border);
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

.theme-toggle-btn:hover {
  background: var(--card-bg);
  color: var(--color-accent);
  transform: scale(1.05);
}

/* API Settings button */
.api-settings-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(var(--bg-color-raw), 0.4);
  border: 1px solid var(--nav-border);
  color: var(--text-secondary);
  transition: var(--transition-smooth);
  cursor: pointer;
}

.api-settings-btn:hover {
  background: var(--card-bg);
  color: var(--color-accent);
  transform: scale(1.05);
}

[data-theme="light"] .moon-icon { display: block; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="dark"] .sun-icon { display: block; }

/* --------------------------------------------------------------------------
   Unified Account Menu (identity, guide, change password, settings, theme, logout)
   -------------------------------------------------------------------------- */
.account-menu-wrap {
  position: relative;
}

.account-menu-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 8px 0 4px;
  border-radius: 999px;
  background: rgba(var(--bg-color-raw), 0.4);
  border: 1px solid var(--nav-border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.account-menu-btn:hover {
  background: var(--card-bg);
  border-color: var(--color-accent);
}

.account-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-btn, var(--color-accent));
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  text-transform: uppercase;
}

.account-caret {
  transition: transform 0.2s ease;
}

.account-menu-btn[aria-expanded="true"] .account-caret {
  transform: rotate(180deg);
}

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 250px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 1100;
  display: none;
}

.account-menu.open {
  display: block;
}

.account-menu-identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
}

.account-identity-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  word-break: break-all;
}

.account-identity-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.account-menu-divider {
  height: 1px;
  background: var(--card-border);
  margin: 6px 4px;
}

.account-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.account-menu-item:hover {
  background: rgba(0, 174, 239, 0.1);
  color: var(--color-accent);
}

.account-menu-item svg {
  flex-shrink: 0;
  color: var(--text-muted);
}

.account-menu-item:hover svg {
  color: var(--color-accent);
}

.account-menu-item-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.account-menu-item-danger:hover svg {
  color: #dc2626;
}

/* Mobile Menu Toggle */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  z-index: 1001;
}

.mobile-menu-btn span {
  width: 100%;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition-smooth);
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   6. Mobile Drawer Menu
   -------------------------------------------------------------------------- */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 300px;
  height: 100vh;
  z-index: 999;
  background-color: var(--card-bg);
  box-shadow: var(--shadow-lg);
  border-left: 1px solid var(--card-border);
  transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  padding: 100px 24px 30px;
  display: flex;
  flex-direction: column;
}

.mobile-drawer.active {
  right: 0;
}

.mobile-drawer-role-select {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
}

.mobile-drawer-role-select label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: auto;
}

.mobile-nav-link {
  font-size: 1.1rem;
  font-weight: 600;
  padding: 8px 0;
  border-bottom: 1px solid rgba(var(--bg-color-raw), 0.5);
  color: var(--text-primary);
}

.mobile-nav-link.active {
  color: var(--color-accent);
}

.mobile-nav-link:hover {
  color: var(--color-accent);
}

.mobile-clock-row {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--card-border);
}

/* --------------------------------------------------------------------------
   7. Shared UI accents
   -------------------------------------------------------------------------- */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-accent);
  box-shadow: 0 0 0 0 rgba(0, 174, 239, 0.7);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 174, 239, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(0, 174, 239, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 174, 239, 0);
  }
}

/* --------------------------------------------------------------------------
   Buttons Custom Styling
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: var(--border-radius);
  transition: var(--transition-smooth);
}

.btn-primary {
  background: var(--gradient-btn);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 174, 239, 0.5);
  opacity: 0.95;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.4);
}

/* .btn-secondary is white-on-translucent-white (built for dark hero backgrounds); on the white
   .modal-dialog surface it renders invisible. Give modal Cancel buttons legible, theme-aware
   styling (same tokens as .btn-outline). Inline-styled buttons keep their own colors. */
.modal-dialog .btn-secondary {
  background: var(--card-bg);
  color: var(--text-primary);
  border: 1px solid var(--card-border);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.modal-dialog .btn-secondary:hover {
  background: rgba(var(--bg-color-raw), 0.6);
  border-color: var(--text-muted);
  color: var(--text-primary);
  transform: translateY(-2px);
}

/* Light-context outline button (used in the catalog toolbar) */
.btn-outline {
  background: var(--card-bg);
  color: var(--text-primary);
  border: 1px solid var(--card-border);
}

.btn-outline:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  transform: translateY(-2px);
}

/* Catalog header toolbar actions — align with the 40px search box */
.filters-and-search-row .btn {
  height: 40px;
  padding: 0 18px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.filters-and-search-row .btn svg {
  width: 16px;
  height: 16px;
}

/* --------------------------------------------------------------------------
   8. Navigation Tabs
   -------------------------------------------------------------------------- */
.tab-navigation-bar {
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 76px;
  z-index: 900;
  transition: var(--transition-smooth);
}

.tab-navigation-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  gap: 30px;
}

.nav-tab-btn {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 3px solid transparent;
  transition: var(--transition-smooth);
  position: relative;
}

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

.nav-tab-btn.active {
  color: var(--color-secondary);
  border-bottom-color: var(--color-secondary);
}

/* Main Views Display */
.portal-main-view {
  display: none;
}

.portal-main-view.active {
  display: block;
}

/* --------------------------------------------------------------------------
   9. Statistics Section
   -------------------------------------------------------------------------- */
.stats-section {
  padding: 30px 0 20px;
}

.section-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.stat-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-sm);
  border-radius: var(--border-radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(0, 174, 239, 0.3);
}

.stat-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.blue-bg { background: rgba(0, 91, 172, 0.1); color: var(--color-secondary); }
.cyan-bg { background: rgba(0, 174, 239, 0.1); color: var(--color-accent); }
.green-bg { background: rgba(16, 185, 129, 0.1); color: var(--color-qa); }
.red-bg { background: rgba(239, 68, 68, 0.1); color: var(--color-prod); }
.violet-bg { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.amber-bg { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.stat-value {
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   10. Applications Section
   -------------------------------------------------------------------------- */
.apps-section {
  padding: 20px 0 80px;
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 20px;
}

.section-title {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.filters-and-search-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Catalog search */
.catalog-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.catalog-search-box input {
  width: 220px;
  height: 40px;
  padding: 0 16px 0 38px;
  border-radius: 8px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.catalog-search-box input:focus {
  width: 260px;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.15);
}

.catalog-search-box .search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

/* Environment filters */
.filters-container {
  display: flex;
  gap: 4px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 4px;
  border-radius: 8px;
}

.filter-btn {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 6px;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

.filter-btn:hover {
  color: var(--text-primary);
  background: rgba(var(--bg-color-raw), 0.5);
}

.filter-btn.active {
  background: var(--color-primary);
  color: #FFFFFF;
}

/* App grid */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

/* Card Styling */
.app-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  animation: cardFadeIn 0.5s ease-out both;
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-accent);
}

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

/* Ribbons and Badges */
.card-ribbon {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 4px;
  z-index: 5;
}

.badge-qa { background: rgba(16, 185, 129, 0.12); color: var(--color-qa); }
.badge-uat { background: rgba(245, 158, 11, 0.12); color: var(--color-uat); }
.badge-prod { background: rgba(239, 68, 68, 0.12); color: var(--color-prod); }

.new-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--color-accent);
  color: #FFFFFF;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 174, 239, 0.4);
}

/* Card Content Details */
.card-meta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  margin-top: 10px;
}

.app-icon-container {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(var(--bg-color-raw), 0.5) 0%, rgba(var(--bg-color-raw), 0.8) 100%);
  border: 1px solid var(--card-border);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

.app-icon-svg {
  border-radius: 12px;
}

.app-name-block {
  display: flex;
  flex-direction: column;
}

.app-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.app-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Small inline "rename" affordance beside the project title. */
.app-name-edit {
  background: transparent;
  border: none;
  padding: 2px;
  line-height: 0;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  transition: var(--transition-smooth);
}

.app-name-edit:hover {
  color: var(--color-primary);
  background: rgba(0, 43, 92, 0.08);
}

.app-release-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Platform theming — iOS = blue, Android = green */
.app-card.platform-ios     { border-top: 3px solid var(--color-secondary); }
.app-card.platform-android { border-top: 3px solid #10B981; }
.app-card.platform-ios:hover     { border-color: var(--color-secondary); }
.app-card.platform-android:hover { border-color: #10B981; }

.app-card.platform-ios .app-icon-container {
  border-color: rgba(0, 91, 172, 0.25);
  background: linear-gradient(135deg, rgba(0, 91, 172, 0.08) 0%, rgba(0, 174, 239, 0.14) 100%);
}
.app-card.platform-android .app-icon-container {
  border-color: rgba(16, 185, 129, 0.25);
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.08) 0%, rgba(16, 185, 129, 0.14) 100%);
}

/* Platform logo badge to the right of the card title */
.platform-logo {
  margin-left: auto;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.platform-logo.plat-ios     { background: rgba(0, 91, 172, 0.1);  color: var(--color-secondary); }
.platform-logo.plat-android { background: rgba(16, 185, 129, 0.12); color: #059669; }

.app-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  flex-grow: 1;
}

/* Grid parameters inside Card */
.card-details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px 14px;
  background: rgba(var(--bg-color-raw), 0.4);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  margin-bottom: 20px;
}

.detail-item {
  display: flex;
  flex-direction: column;
}

.detail-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Action buttons */
.card-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.install-btn {
  background: var(--gradient-btn);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.9rem;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--glow-btn);
  transition: var(--transition-smooth);
}

.install-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 174, 239, 0.45);
}

.install-btn-svg {
  transition: transform 0.3s ease;
}

.install-btn:hover .install-btn-svg {
  transform: translateY(2px);
}

.secondary-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.action-btn-outline {
  background: transparent;
  border: 1px solid var(--card-border);
  height: 38px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-smooth);
}

.action-btn-outline:hover {
  background: rgba(var(--bg-color-raw), 0.5);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

/* The card's primary owner actions — gently highlighted so they stand out from the plain
   outline actions (Notes / History / …). Icons inherit the color via currentColor. */
.action-btn-outline.btn-card-upload,
.action-btn-outline.btn-share {
  background: rgba(0, 91, 172, 0.08);
  border-color: rgba(0, 91, 172, 0.35);
  color: var(--color-secondary);
}

.action-btn-outline.btn-card-upload:hover,
.action-btn-outline.btn-share:hover {
  background: rgba(0, 91, 172, 0.14);
  border-color: var(--color-secondary);
  color: var(--color-secondary);
}

/* --------------------------------------------------------------------------
   11. Tester Directory Management Panel
   -------------------------------------------------------------------------- */
.tester-management-section {
  padding: 40px 0 80px;
}

.inline-add-form {
  margin-top: 14px;
}

.inline-group {
  display: flex;
  gap: 10px;
}

.inline-group input {
  flex-grow: 1;
  height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background-color: var(--bg-color);
  color: var(--text-primary);
}

.inline-group input:focus {
  border-color: var(--color-accent);
  background-color: var(--card-bg);
}

.btn-delete-tester {
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-prod);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: 6px;
  transition: var(--transition-smooth);
}

.btn-delete-tester:hover {
  background-color: var(--color-prod);
  color: #FFFFFF;
}

/* Tester Groups (TestFlight-style distribution) */
.group-card {
  background-color: var(--bg-color);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.group-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.group-card-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.group-subsection {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--card-border);
}

.group-subsection-title {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.member-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(0, 174, 239, 0.08);
  border: 1px solid rgba(0, 174, 239, 0.2);
  border-radius: 20px;
  padding: 4px 6px 4px 12px;
}

.chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.9rem;
  line-height: 1;
  color: var(--color-prod);
  background: rgba(239, 68, 68, 0.1);
  transition: var(--transition-smooth);
}

.chip-remove:hover {
  background-color: var(--color-prod);
  color: #FFFFFF;
}

.assignment-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--card-border);
}

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

.assignment-app-name {
  font-weight: 700;
  color: var(--text-primary);
  min-width: 140px;
}

.assignment-mode {
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background-color: var(--card-bg);
  color: var(--text-primary);
  font-size: 0.85rem;
}

.version-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  padding: 8px 0 0 12px;
}

.version-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: none;
  cursor: pointer;
}

.version-check input {
  width: auto;
  height: auto;
}

/* Build-level assignment tree: each version stacks, with its builds indented under it */
.version-checks {
  flex-direction: column;
  align-items: flex-start;
}

.assignment-version {
  width: 100%;
}

.version-select-all {
  font-weight: 700;
}

.version-all-hint {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.92em;
}

.build-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 6px 0 2px 22px;
}

.build-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
}

.build-check input {
  width: auto;
  height: auto;
}

/* Developer scope switcher (tester catalog toolbar) */
.developer-scope-select {
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background-color: var(--card-bg);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.developer-scope-select:focus {
  border-color: var(--color-accent);
}

/* Typeahead suggestions (group member input) */
.typeahead-wrap {
  position: relative;
  flex-grow: 1;
}

.typeahead-wrap .new-member-email {
  width: 100%;
}

.suggestion-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  max-height: 220px;
  overflow-y: auto;
}

.suggestion-item {
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.suggestion-item:hover,
.suggestion-item.active {
  background: rgba(0, 174, 239, 0.1);
  color: var(--color-accent);
}

/* Upload modal: prominent file-first step & auto-detect hints */
.upload-file-step {
  padding: 14px;
  border: 1px dashed var(--color-accent);
  border-radius: 10px;
  background: rgba(0, 174, 239, 0.05);
}

.upload-step-hint {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Danger variant for card actions (Delete Build / Delete Project) */
.action-btn-outline.btn-danger {
  color: var(--color-prod);
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.25);
}

.action-btn-outline.btn-danger:hover {
  background-color: var(--color-prod);
  border-color: var(--color-prod);
  color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   12. Super Admin Dashboard (User lists & Storage Telemetry)
   -------------------------------------------------------------------------- */
.admin-section {
  padding: 40px 0 80px;
}

/* Folder Storage metrics */
.storage-gauge-panel {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.storage-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.storage-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.storage-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
}

.storage-title {
  color: var(--text-secondary);
}

.storage-value-text {
  color: var(--color-secondary);
}

.progress-bar-container {
  height: 12px;
  background-color: rgba(var(--bg-color-raw), 0.7);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--card-border);
}

.progress-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.progress-bar-fill.ipa-bar {
  background: linear-gradient(90deg, var(--color-secondary) 0%, var(--color-accent) 100%);
}

.progress-bar-fill.apk-bar {
  background: linear-gradient(90deg, #059669 0%, #10B981 100%);
}

/* Default usage bar (developer + admin storage) + over-quota state */
.progress-bar-fill#usage-quota-bar {
  background: linear-gradient(90deg, var(--color-secondary) 0%, var(--color-accent) 100%);
}
.progress-bar-fill.over-quota,
.progress-bar-fill#usage-quota-bar.over-quota {
  background: linear-gradient(90deg, #dc2626 0%, #f59e0b 100%);
}

/* --------------------------------------------------------------------------
   Storage banner + policy controls + notifications
   -------------------------------------------------------------------------- */
.storage-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #7c2d12;
  background: #fef3c7;
  border-bottom: 1px solid #f59e0b;
}
.storage-banner.banner-danger {
  color: #7f1d1d;
  background: #fee2e2;
  border-bottom-color: #dc2626;
}
.storage-banner svg { flex-shrink: 0; }
.storage-banner-text { flex: 1; }
.storage-banner-link {
  font-weight: 700;
  color: inherit;
  text-decoration: underline;
  white-space: nowrap;
}
[data-theme="dark"] .storage-banner { color: #fde68a; background: rgba(245, 158, 11, 0.14); }
[data-theme="dark"] .storage-banner.banner-danger { color: #fecaca; background: rgba(220, 38, 38, 0.16); }

.storage-policy-row {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}
.storage-policy-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.storage-policy-field input {
  width: 180px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--bg-color);
  color: var(--text-primary);
  font-size: 0.9rem;
}
.quota-edit-input {
  width: 64px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  background: var(--bg-color);
  color: var(--text-primary);
  font-size: 0.8rem;
}
.notification-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  font-size: 0.82rem;
}

/* Admin lists layout */
.admin-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 30px;
  align-items: start;
}

.admin-box {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.admin-box-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.admin-box-title svg {
  color: var(--color-secondary);
}

.admin-box-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* Admin tables styling */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--card-border);
  border-radius: 8px;
}

.logs-table-wrapper {
  max-height: 380px;
  overflow-y: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.admin-table th, .admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--card-border);
}

.admin-table th {
  background-color: rgba(var(--bg-color-raw), 0.5);
  font-weight: 700;
  color: var(--text-secondary);
  position: sticky;
  top: 0;
  z-index: 10;
}

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

/* --------------------------------------------------------------------------
   13. Popup Modals & QR Code Simulated Container
   -------------------------------------------------------------------------- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--modal-backdrop);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.modal-dialog {
  position: relative;
  z-index: 2;
  width: 90%;
  max-width: 520px;
  background-color: var(--modal-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.modal.active .modal-dialog {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--card-border);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.modal-close {
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  max-height: 60vh;
  overflow-y: auto;
}

/* Simulated QR Container */
.simulated-qrcode-container {
  width: 200px;
  height: 200px;
  margin: 0 auto;
  padding: 16px;
  background-color: #FFFFFF;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: center;
  align-items: center;
}

.simulated-qrcode-container svg {
  display: block;
}

.modal-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.app-details-mini {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-app-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--bg-color);
  border: 1px solid var(--card-border);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.app-details-mini h4 {
  font-size: 1rem;
  font-weight: 800;
}

.app-details-mini p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.modal-divider {
  border: 0;
  height: 1px;
  background-color: var(--card-border);
  margin-bottom: 20px;
}

.notes-subtitle {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.notes-list {
  list-style: none;
}

.notes-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 10px;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.notes-list li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-accent);
}

/* Empty-state line (no bullet) */
.notes-list li.notes-empty {
  padding-left: 0;
  font-style: italic;
}
.notes-list li.notes-empty::before { display: none; }

/* Release-notes edit affordances */
.notes-edit-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.notes-edit-icon:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.notes-edit-textarea {
  width: 100%;
  min-height: 140px;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  line-height: 1.5;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--bg-color);
  color: var(--text-primary);
  resize: vertical;
}
.notes-edit-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

/* Timeline style */
.history-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background-color: rgba(var(--bg-color-raw), 0.3);
  border: 1px solid var(--card-border);
  border-radius: 8px;
}

.history-version-badge {
  background-color: var(--color-primary);
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
}

.history-status-txt {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.history-link {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-accent);
}

.history-link:hover {
  text-decoration: underline;
}

/* Per-build delete action inside the Version History list (owner / Super Admin). */
.history-delete-btn {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--color-prod);
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.28);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.history-delete-btn:hover {
  background-color: var(--color-prod);
  border-color: var(--color-prod);
  color: #FFFFFF;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: flex-end;
}

/* Upload build form custom styles */
.upload-form .form-group {
  margin-bottom: 20px;
}

.upload-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.upload-form select, .upload-form input[type="text"], .upload-form input[type="number"], .upload-form input[type="url"] {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-size: 0.95rem;
}

.upload-form select:focus, .upload-form input:focus {
  border-color: var(--color-accent);
  background-color: var(--card-bg);
}

/* Project name locked to a specific project (upload opened from a card). */
.upload-form input.locked {
  background-color: var(--bg-muted, rgba(0, 0, 0, 0.04));
  color: var(--text-muted);
  cursor: not-allowed;
  font-weight: 700;
}
.upload-form input.locked:focus {
  border-color: var(--card-border);
  background-color: var(--bg-muted, rgba(0, 0, 0, 0.04));
}

.upload-form .form-row {
  display: flex;
  gap: 16px;
}

.upload-form .form-row .col {
  flex: 1;
}

.modal-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.spinner-inline {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 174, 239, 0.2);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin-inline 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin-inline {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   14. Scroll-to-Top Button
   -------------------------------------------------------------------------- */
.scroll-to-top-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--gradient-btn);
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(0, 174, 239, 0.35);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  z-index: 100;
  transition: var(--transition-smooth);
}

.scroll-to-top-btn.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 174, 239, 0.5);
}

/* --------------------------------------------------------------------------
   15. Footer
   -------------------------------------------------------------------------- */
.portal-footer {
  background-color: #030a1c;
  color: #CBD5E1;
  padding: 80px 0 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 40px;
  margin-bottom: 60px;
}

.brand-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-logo-text {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #FFFFFF;
}

.footer-desc {
  font-size: 0.85rem;
  line-height: 1.6;
  color: #94A3B8;
  max-width: 320px;
}

.footer-heading {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #FFFFFF;
  margin-bottom: 24px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  font-size: 0.9rem;
  color: #94A3B8;
}

.footer-links a:hover {
  color: var(--color-accent);
  padding-left: 4px;
}

.footer-contact-info {
  font-size: 0.85rem;
  color: #94A3B8;
  margin-bottom: 20px;
}

.footer-support-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.footer-support-btn:hover {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: 0 4px 15px rgba(0, 174, 239, 0.4);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
  color: #64748B;
}

.footer-policy-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-policy-links a:hover {
  color: var(--color-accent);
}

.divider-dot {
  color: rgba(255, 255, 255, 0.1);
}

/* --------------------------------------------------------------------------
   16. Responsive Breakpoints
   -------------------------------------------------------------------------- */

/* Tablet Devices (max-width: 1024px) */
@media (max-width: 1024px) {
  html {
    font-size: 15px;
  }
  
  .header-container {
    padding: 0 24px;
  }
  
  .header-title-wrapper {
    display: none;
  }

  .apps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .admin-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }
}

/* Mobile Devices (max-width: 768px) */
@media (max-width: 768px) {
  body {
    padding-top: 64px; /* matches the 64px mobile header */
  }

  .main-header {
    height: 64px;
  }
  
  .main-header.scrolled {
    background-color: var(--card-bg);
  }
  
  .header-clock, .role-switcher-box {
    display: none; /* Handled in drawer */
  }

  /* Collapse the header upload CTA to icon-only so it fits beside avatar + hamburger */
  .header-actions .header-upload-btn span {
    display: none;
  }
  .header-actions .header-upload-btn {
    padding: 0;
    width: 38px;
    justify-content: center;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .tab-navigation-bar {
    top: 64px;
  }
  
  .tab-navigation-container {
    gap: 16px;
    padding: 0 16px;
    overflow-x: auto;
    white-space: nowrap;
  }
  
  .nav-tab-btn {
    font-size: 0.85rem;
  }
  
  .stats-section {
    padding: 20px 0 10px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 16px;
  }
  
  .section-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 0 16px 16px;
  }
  
  .filters-and-search-row {
    flex-direction: column;
    width: 100%;
    align-items: stretch;
    gap: 12px;
  }
  
  .catalog-search-box input {
    width: 100%;
  }
  
  .catalog-search-box input:focus {
    width: 100%;
  }
  
  .filters-container {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }
  
  .apps-section .section-container {
    padding: 0;
  }
  
  .apps-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 0 16px;
  }
  
  .inline-group {
    flex-direction: column;
  }
  
  .inline-group button {
    width: 100%;
  }
  
  .storage-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .admin-section .section-container {
    padding: 0 16px;
  }
  
  .tester-auth-card {
    padding: 30px 20px;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

/* --- Admin: approval setting + publish toggles --- */
.admin-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  margin: 4px 0 16px;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: rgba(var(--bg-color-raw), 0.4);
}
.admin-setting-text { display: flex; flex-direction: column; gap: 2px; }
.admin-setting-label { font-weight: 600; font-size: 0.9rem; color: var(--text-primary); }
.admin-setting-hint { font-size: 0.75rem; color: var(--text-muted); max-width: 46ch; }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .switch-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--text-muted); opacity: 0.5;
  border-radius: 24px; transition: 0.2s;
}
.switch .switch-slider::before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: 0.2s;
}
.switch input:checked + .switch-slider { background: var(--color-primary); opacity: 1; }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }
.switch input:focus-visible + .switch-slider { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.switch.switch-sm { width: 38px; height: 20px; vertical-align: middle; }
.switch.switch-sm .switch-slider::before { height: 14px; width: 14px; }
.switch.switch-sm input:checked + .switch-slider::before { transform: translateX(18px); }

/* Status pill next to per-user toggle */
.status-pill {
  display: inline-block; margin-left: 8px; vertical-align: middle;
  font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 10px;
}
.status-pill.status-active { background: rgba(16,185,129,0.14); color: #059669; }
.status-pill.status-pending { background: rgba(245,158,11,0.16); color: #B45309; }
