/* ==========================================================================
   MTR APK AppStore - Master Stylesheet & Animations
   Theme: Deep Obsidian & MTR Electric Blue / Cyan
   ========================================================================== */

:root {
  --bg-deep: #060911;
  --bg-surface: #0d1322;
  --bg-card: rgba(16, 24, 42, 0.82);
  --bg-card-solid: #111a2e;
  --bg-elevated: #17233d;
  --mtr-blue: #1e90ff;
  --mtr-cyan: #00d4ff;
  --mtr-royal: #3b82f6;
  --mtr-purple: #8b5cf6;
  --mtr-emerald: #10b981;
  --mtr-amber: #f59e0b;
  --mtr-danger: #ef4444;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-subtle: rgba(56, 189, 248, 0.16);
  --border-glow: rgba(0, 212, 255, 0.45);
  --shadow-heavy: 0 25px 60px -15px rgba(0, 0, 0, 0.85);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

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

html, body {
  min-height: 100vh;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background Cyber Grid & Ambient Aura */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(30, 144, 255, 0.14) 0%, transparent 45%),
    radial-gradient(circle at 80% 75%, rgba(0, 212, 255, 0.11) 0%, transparent 50%),
    linear-gradient(180deg, #05080f 0%, #0a101d 100%);
}

.ambient-bg::before {
  content: '';
  position: absolute;
  inset: -100px;
  background-image:
    linear-gradient(rgba(30, 144, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 144, 255, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  transform: perspective(600px) rotateX(35deg);
  animation: gridPan 18s linear infinite;
}

@keyframes gridPan {
  0% { transform: perspective(600px) rotateX(35deg) translateY(0); }
  100% { transform: perspective(600px) rotateX(35deg) translateY(48px); }
}

/* ==========================================================================
   ANIMATED LOGIN PAGE (LOGIN BOX & LOGO ANIMATIONS)
   ========================================================================== */

.login-viewport {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  perspective: 1200px;
}

/* Animated Outer Login Box Wrapper with Spinning Neon Border Beam */
.login-box-shell {
  position: relative;
  width: 100%;
  max-width: 455px;
  border-radius: calc(var(--radius-xl) + 3px);
  padding: 3px;
  overflow: hidden;
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.88),
    0 0 45px rgba(30, 144, 255, 0.22);
  animation:
    loginBoxEntrance 0.95s cubic-bezier(0.16, 1, 0.3, 1) forwards,
    loginBoxBreathing 5s ease-in-out 1s infinite alternate;
  transform-style: preserve-3d;
  will-change: transform;
}

/* Rotating Conic Neon Beam around the Login Box */
.login-box-shell::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 60deg,
    var(--mtr-cyan) 110deg,
    var(--mtr-blue) 160deg,
    transparent 200deg,
    transparent 260deg,
    #60a5fa 320deg,
    var(--mtr-cyan) 360deg
  );
  animation: borderBeamSpin 4.5s linear infinite;
  z-index: 0;
}

.login-box-inner {
  position: relative;
  z-index: 1;
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.96) 0%, rgba(9, 13, 24, 0.98) 100%);
  backdrop-filter: blur(22px);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2.25rem 2.25rem;
  text-align: center;
  overflow: hidden;
}

/* Subtle scanning light sweep inside the login box */
.login-box-inner::after {
  content: '';
  position: absolute;
  top: -120%;
  left: -50%;
  width: 200%;
  height: 60%;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(0, 212, 255, 0.04),
    transparent
  );
  transform: rotate(-15deg);
  animation: interiorScanSweep 7s ease-in-out infinite;
  pointer-events: none;
}

@keyframes loginBoxEntrance {
  0% {
    opacity: 0;
    transform: translateY(55px) scale(0.88) rotateX(14deg);
    filter: blur(10px);
  }
  65% {
    opacity: 1;
    transform: translateY(-6px) scale(1.015) rotateX(-2deg);
    filter: blur(0px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotateX(0deg);
    filter: blur(0px);
  }
}

@keyframes loginBoxBreathing {
  0% {
    box-shadow:
      0 25px 60px rgba(0, 0, 0, 0.85),
      0 0 30px rgba(30, 144, 255, 0.18);
  }
  100% {
    box-shadow:
      0 32px 75px rgba(0, 0, 0, 0.92),
      0 0 55px rgba(0, 212, 255, 0.36);
  }
}

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

@keyframes interiorScanSweep {
  0% { top: -100%; }
  50% { top: 160%; }
  100% { top: 160%; }
}

/* Error Shake & Success Warp States for Login Box */
.login-box-shell.shake-error {
  animation: loginErrorShake 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97) both !important;
}

.login-box-shell.warp-success {
  animation: loginSuccessWarp 0.75s cubic-bezier(0.4, 0, 0.2, 1) forwards !important;
}

@keyframes loginErrorShake {
  0%, 100% { transform: translateX(0); }
  15%, 45%, 75% { transform: translateX(-11px) rotate(-1deg); }
  30%, 60%, 90% { transform: translateX(11px) rotate(1deg); }
}

@keyframes loginSuccessWarp {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  40% {
    transform: scale(1.05);
    box-shadow: 0 0 90px rgba(0, 212, 255, 0.85);
  }
  100% {
    transform: scale(1.22) translateY(-25px);
    opacity: 0;
    filter: blur(12px);
  }
}

/* Animated MTR Skull Logo Stage */
.logo-stage {
  position: relative;
  width: 156px;
  height: 156px;
  margin: 0 auto 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Orbital Energy Rings Around the Logo */
.logo-orbit-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px dashed rgba(0, 212, 255, 0.38);
  animation: orbitSpin 12s linear infinite;
}

.logo-orbit-ring-inner {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--mtr-cyan);
  border-bottom-color: var(--mtr-blue);
  animation: orbitSpinReverse 6.5s linear infinite;
  filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.65));
}

.logo-aura-pulse {
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30, 144, 255, 0.42) 0%, rgba(0, 212, 255, 0.12) 55%, transparent 72%);
  animation: auraPulse 3s ease-in-out infinite alternate;
}

.animated-mtr-logo {
  position: relative;
  z-index: 2;
  width: 132px;
  height: 132px;
  object-fit: contain;
  animation:
    mtrLogoFloat 3.8s ease-in-out infinite,
    mtrLogoGlow 2.8s ease-in-out infinite alternate;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.animated-mtr-logo:hover {
  transform: scale(1.14) rotate(-6deg);
}

@keyframes mtrLogoFloat {
  0%, 100% {
    transform: translateY(0px) rotate(0deg) scale(1);
  }
  25% {
    transform: translateY(-9px) rotate(-2.5deg) scale(1.03);
  }
  50% {
    transform: translateY(-13px) rotate(1.5deg) scale(1.05);
  }
  75% {
    transform: translateY(-6px) rotate(2.5deg) scale(1.02);
  }
}

@keyframes mtrLogoGlow {
  0% {
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.7))
            drop-shadow(0 0 12px rgba(30, 144, 255, 0.55));
  }
  100% {
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.85))
            drop-shadow(0 0 28px rgba(0, 212, 255, 0.95));
  }
}

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

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

@keyframes auraPulse {
  0% { transform: scale(0.88); opacity: 0.55; }
  100% { transform: scale(1.16); opacity: 1; }
}

/* Login Typography & Staggered Form Controls */
.login-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #ffffff 0%, #93c5fd 50%, var(--mtr-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.3rem;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.65rem;
}

.form-group {
  text-align: left;
  margin-bottom: 1.15rem;
  opacity: 0;
  animation: staggerFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.form-group:nth-child(1) { animation-delay: 0.25s; }
.form-group:nth-child(2) { animation-delay: 0.38s; }

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

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #93c5fd;
  margin-bottom: 0.42rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.25s ease, transform 0.25s ease;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: rgba(6, 10, 20, 0.85);
  border: 1.5px solid rgba(59, 130, 246, 0.24);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  padding: 0.8rem 1rem 0.8rem 2.65rem;
  transition: all 0.25s ease;
  outline: none;
}

.form-input.no-icon, .form-select, .form-textarea {
  padding-left: 0.95rem;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--mtr-cyan);
  background: rgba(11, 19, 36, 0.95);
  box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.14), 0 0 18px rgba(30, 144, 255, 0.25);
}

.input-wrapper:focus-within .input-icon {
  color: var(--mtr-cyan);
  transform: scale(1.1);
}

.password-toggle-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: color 0.2s;
}

.password-toggle-btn:hover {
  color: var(--mtr-cyan);
}

/* Primary Animated Login Button */
.btn-login-submit {
  position: relative;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.92rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #1d4ed8 0%, var(--mtr-blue) 50%, var(--mtr-cyan) 100%);
  background-size: 200% 200%;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 10px 25px -5px rgba(30, 144, 255, 0.55);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation:
    staggerFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.5s backwards,
    gradientShift 4s ease infinite;
}

.btn-login-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px -4px rgba(0, 212, 255, 0.72);
}

.btn-login-submit:active {
  transform: translateY(0);
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.login-alert {
  margin-bottom: 1.1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 500;
  display: none;
  align-items: center;
  gap: 0.55rem;
  text-align: left;
}

.login-alert.error {
  display: flex;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.login-alert.success {
  display: flex;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
}

/* Quick Role Fill Chips on Login Page */
.quick-accounts-panel {
  margin-top: 1.5rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  opacity: 0;
  animation: staggerFadeUp 0.6s ease 0.65s forwards;
}

.quick-accounts-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.quick-Account-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
}

.account-pill {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #bae6fd;
  padding: 0.36rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.account-pill:hover {
  background: rgba(30, 144, 255, 0.22);
  border-color: var(--mtr-cyan);
  transform: translateY(-1px);
  color: #fff;
}

/* ==========================================================================
   MAIN APK APPSTORE SHELL & NAVIGATION
   ========================================================================== */

.app-layout {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(9, 14, 26, 0.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.8rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-logo-nav {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.6));
  animation: navLogoFloat 4s ease-in-out infinite;
}

@keyframes navLogoFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(-3deg); }
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.brand-title span {
  background: linear-gradient(90deg, var(--mtr-cyan), var(--mtr-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tagline {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.85);
  padding: 0.32rem;
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.nav-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.52rem 1rem;
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
}

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

.nav-tab-btn.active {
  background: linear-gradient(135deg, var(--mtr-blue), #1d4ed8);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(30, 144, 255, 0.4);
}

/* User Profile & Role Badge in Header */
.user-toolbar {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(17, 26, 46, 0.9);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
}

.user-name-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.58rem;
  border-radius: 999px;
}

.role-badge.admin {
  background: rgba(0, 212, 255, 0.16);
  color: var(--mtr-cyan);
  border: 1px solid rgba(0, 212, 255, 0.45);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.22);
}

.role-badge.publisher {
  background: rgba(139, 92, 246, 0.18);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.45);
}

.role-badge.user {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--mtr-blue), var(--mtr-cyan));
  color: #040914;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(0, 212, 255, 0.5);
}

.btn-outline {
  background: rgba(15, 23, 42, 0.75);
  border-color: rgba(148, 163, 184, 0.25);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--mtr-cyan);
  color: #ffffff;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.38);
  color: #fca5a5;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.28);
  color: #ffffff;
}

/* Main Content Container */
.main-container {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 1.75rem;
  flex: 1;
}

/* Store Hero Banner */
.hero-banner {
  position: relative;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 85% 50%, rgba(0, 212, 255, 0.22), transparent 55%),
    linear-gradient(135deg, #0f172a 0%, #102347 60%, #0c1933 100%);
  border: 1px solid var(--border-glow);
  padding: 2.2rem 2.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  overflow: hidden;
  box-shadow: var(--shadow-heavy);
}

.hero-content {
  max-width: 640px;
  z-index: 1;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(0, 212, 255, 0.14);
  border: 1px solid rgba(0, 212, 255, 0.35);
  color: var(--mtr-cyan);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.85rem;
}

.hero-title {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.18;
  margin-bottom: 0.65rem;
}

.hero-desc {
  color: #cbd5e1;
  font-size: 0.96rem;
  margin-bottom: 1.35rem;
}

.hero-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.stat-metric {
  background: rgba(6, 10, 20, 0.58);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 0.65rem 1.1rem;
  border-radius: 12px;
}

.stat-metric-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--mtr-cyan);
}

.stat-metric-label {
  font-size: 0.74rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-logo-showcase {
  width: 155px;
  height: 155px;
  object-fit: contain;
  animation: mtrLogoFloat 4.2s ease-in-out infinite, mtrLogoGlow 3s ease-in-out infinite alternate;
  flex-shrink: 0;
}

/* Filter & Search Bar */
.store-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.65rem;
  flex-wrap: wrap;
}

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

.cat-pill {
  background: rgba(16, 24, 42, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.48rem 0.95rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cat-pill:hover {
  border-color: var(--mtr-cyan);
  color: var(--text-primary);
}

.cat-pill.active {
  background: var(--mtr-blue);
  border-color: var(--mtr-cyan);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(30, 144, 255, 0.45);
}

.search-box {
  position: relative;
  min-width: 280px;
  flex: 1;
  max-width: 380px;
}

.search-box input {
  width: 100%;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box input:focus {
  border-color: var(--mtr-cyan);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}

.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* APK Cards Grid */
.apk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(325px, 1fr));
  gap: 1.25rem;
}

.apk-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}

.apk-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.75), 0 0 24px rgba(0, 212, 255, 0.16);
}

.featured-ribbon {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  color: #090d16;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 0.05em;
}

.apk-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.95rem;
}

.apk-icon {
  width: 62px;
  height: 62px;
  border-radius: 15px;
  background: radial-gradient(circle, rgba(30, 144, 255, 0.22), rgba(9, 13, 22, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 6px;
  object-fit: contain;
  flex-shrink: 0;
}

.apk-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.apk-pkg {
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', Consolas, monospace;
  color: var(--text-muted);
  word-break: break-all;
}

.apk-meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.meta-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.18rem 0.55rem;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.8);
  color: #bae6fd;
  border: 1px solid rgba(56, 189, 248, 0.18);
}

.apk-desc {
  font-size: 0.87rem;
  color: var(--text-secondary);
  margin-bottom: 1.15rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.apk-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  gap: 0.6rem;
}

.apk-stats-mini {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.apk-card-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* ==========================================================================
   USER PERMISSION MANAGER PANEL (ADMIN, PUBLISHER, USER LEVELS)
   ========================================================================== */

.section-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-heavy);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.permission-legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.65rem;
}

.perm-tier-card {
  background: rgba(10, 16, 30, 0.78);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.05rem 1.2rem;
}

.perm-tier-card h4 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  font-size: 0.95rem;
}

.perm-tier-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.perm-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.perm-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.perm-table td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  font-size: 0.9rem;
  vertical-align: middle;
}

.perm-table tr:hover td {
  background: rgba(30, 144, 255, 0.05);
}

.role-select-inline {
  background: #0a101f;
  color: var(--text-primary);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  padding: 0.42rem 0.7rem;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.role-select-inline:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 6, 14, 0.82);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

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

.modal-dialog {
  background: #0f172a;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.85rem;
  box-shadow: var(--shadow-heavy);
  animation: modalPop 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.92) translateY(14px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.4rem;
  cursor: pointer;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.toast-msg {
  background: #0f172a;
  border-left: 4px solid var(--mtr-cyan);
  border-top: 1px solid rgba(56, 189, 248, 0.3);
  border-right: 1px solid rgba(56, 189, 248, 0.3);
  border-bottom: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--text-primary);
  padding: 0.85rem 1.2rem;
  border-radius: 10px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.75);
  font-size: 0.88rem;
  font-weight: 600;
  animation: staggerFadeUp 0.25s ease forwards;
}

.toast-msg.error {
  border-left-color: var(--mtr-danger);
}

@media (max-width: 768px) {
  .hero-banner {
    flex-direction: column-reverse;
    text-align: center;
    padding: 1.65rem;
  }
  .hero-stats-row {
    justify-content: center;
  }
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
  .topbar {
    padding: 0.8rem 1rem;
  }
}
