/* ====================================================================
   HIEU APP HUB & COCKPIT - MODERN APPLE DARK DESIGN SYSTEM
   Author: KTS Nguyễn Trọng Hiếu
   Platform: tweaks-factory.duckdns.org (Server Factory)
   ==================================================================== */

:root {
  --bg-main: #0b0f19;
  --bg-card: rgba(22, 27, 34, 0.75);
  --bg-card-hover: rgba(30, 38, 49, 0.85);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-card-hover: rgba(56, 139, 253, 0.35);
  
  --text-main: #f0f6fc;
  --text-muted: #8b949e;
  --text-dim: #6e7681;
  
  --apple-blue: #2f81f7;
  --apple-blue-hover: #388bfd;
  --apple-cyan: #30b0c7;
  --apple-green: #238636;
  --apple-green-hover: #2ea043;
  --apple-purple: #a371f7;
  --apple-amber: #d29922;
  --apple-red: #f85149;
  
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 16px 36px rgba(0, 0, 0, 0.55), 0 0 20px rgba(56, 139, 253, 0.2);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(47, 129, 247, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 60%, rgba(163, 113, 247, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(48, 176, 199, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* ====================================================================
   1. NAVIGATION BAR
   ==================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-card);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.brand-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, #fff 40%, #8b949e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
}

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

.nav-links {
  display: flex;
  gap: 12px;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

/* 2-in-1 Mode Toggle */
.mode-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px;
  border-radius: 20px;
  border: 1px solid var(--border-card);
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: transparent;
  border: none;
  border-radius: 16px;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-btn.active {
  background: var(--apple-blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(47, 129, 247, 0.4);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background-color: #30d158;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px #30d158;
  animation: pulse-dot-anim 1.8s infinite;
}

@keyframes pulse-dot-anim {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(48, 209, 88, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(48, 209, 88, 0); }
}

/* ====================================================================
   2. MAIN CONTAINER & HERO
   ==================================================================== */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.hero {
  text-align: center;
  padding: 36px 16px 28px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(47, 129, 247, 0.12);
  color: #58a6ff;
  border: 1px solid rgba(56, 139, 253, 0.3);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 18px;
}

.hero-title {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1.15;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #ffffff 40%, #c9d1d9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  max-width: 760px;
  margin: 0 auto 28px;
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
}

.hero-desc strong {
  color: #fff;
}

/* Trust Bar */
.trust-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 960px;
  margin: 0 auto;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(22, 27, 34, 0.6);
  border: 1px solid var(--border-card);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  text-align: left;
}

.trust-icon {
  font-size: 22px;
}

.trust-val {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
}

.trust-label {
  font-size: 11px;
  color: var(--text-muted);
}

/* ====================================================================
   3. FILTER & SEARCH SECTION
   ==================================================================== */
.filter-section {
  background: rgba(22, 27, 34, 0.65);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 28px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.search-wrapper {
  position: relative;
  margin-bottom: 14px;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--text-dim);
}

.search-input {
  width: 100%;
  background: rgba(11, 15, 25, 0.8);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 13px 40px 13px 44px;
  color: #fff;
  font-size: 14.5px;
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px rgba(47, 129, 247, 0.2);
  background: rgba(11, 15, 25, 0.95);
}

.clear-search-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  cursor: pointer;
}

/* Quick Tags */
.quick-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.quick-tag-label {
  font-size: 12px;
  color: var(--text-dim);
  margin-right: 4px;
}

.quick-tag {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 11.5px;
  padding: 4px 9px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-tag:hover {
  background: rgba(47, 129, 247, 0.15);
  border-color: var(--apple-blue);
  color: #fff;
}

/* Category Chips */
.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.chip.active {
  background: var(--apple-blue);
  color: #fff;
  border-color: var(--apple-blue);
  box-shadow: 0 2px 10px rgba(47, 129, 247, 0.4);
}

/* Device Filter Bar */
.device-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  background: rgba(11, 15, 25, 0.6);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.04);
  margin-bottom: 14px;
}

.device-filter-label {
  font-size: 12px;
  font-weight: 600;
  color: #58a6ff;
  white-space: nowrap;
}

.device-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.device-chip {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.device-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.device-chip.active {
  background: rgba(48, 176, 199, 0.2);
  border-color: var(--apple-cyan);
  color: #79c0ff;
  font-weight: 600;
}

/* Filter Footer */
.filter-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--text-muted);
  padding-top: 6px;
}

.view-switcher {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border-card);
}

.switch-view-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.switch-view-btn.active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* ====================================================================
   4. PRODUCTS GRID & PRODUCT CARDS
   ==================================================================== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.product-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-card-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* Card Header */
.card-header {
  display: flex;
  gap: 14px;
  margin-bottom: 12px;
}

.product-icon {
  width: 58px;
  height: 58px;
  border-radius: 13px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-title-wrap {
  flex: 1;
  min-width: 0;
}

.card-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.badge-version {
  background: rgba(56, 139, 253, 0.15);
  color: #58a6ff;
  border: 1px solid rgba(56, 139, 253, 0.3);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  letter-spacing: 0.2px;
}

.badge-status {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
  text-transform: uppercase;
}

.badge-green { background: rgba(35, 134, 54, 0.2); color: #3fb950; border: 1px solid rgba(63, 185, 80, 0.3); }
.badge-blue { background: rgba(56, 139, 253, 0.2); color: #58a6ff; border: 1px solid rgba(88, 166, 255, 0.3); }
.badge-purple { background: rgba(163, 113, 247, 0.2); color: #d2a8ff; border: 1px solid rgba(210, 168, 255, 0.3); }
.badge-cyan { background: rgba(48, 176, 199, 0.2); color: #79c0ff; border: 1px solid rgba(121, 192, 255, 0.3); }
.badge-amber { background: rgba(210, 153, 34, 0.2); color: #e3b341; border: 1px solid rgba(227, 179, 65, 0.3); }

.product-name {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-tagline {
  font-size: 12.5px;
  color: #79c0ff;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 10px;
}

.product-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
  flex: 1;
}

/* Features List */
.features-list {
  list-style: none;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.feature-item {
  font-size: 11.5px;
  color: #c9d1d9;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.4;
}

.feature-check {
  color: #3fb950;
  font-weight: bold;
  flex-shrink: 0;
}

/* Platform Pills */
.platform-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
}

.platform-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 6px;
}

/* Pricing Box */
.price-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.price-main {
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
}

.price-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* Card Actions */
.card-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-primary-action {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--apple-blue) 0%, #1f6feb 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(47, 129, 247, 0.3);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary-action:hover {
  background: linear-gradient(135deg, var(--apple-blue-hover) 0%, #388bfd 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(47, 129, 247, 0.45);
}

.btn-secondary-action {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-secondary-action:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-group-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

/* ====================================================================
   5. LIST MODE (THU GỌN)
   ==================================================================== */
.products-grid.list-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.products-grid.list-view .product-card {
  padding: 12px 16px;
  flex-direction: row;
  align-items: center;
  gap: 16px;
}

.products-grid.list-view .card-header {
  margin-bottom: 0;
  align-items: center;
  flex: 0 0 280px;
}

.products-grid.list-view .product-desc,
.products-grid.list-view .features-list {
  display: none;
}

.products-grid.list-view .platform-row {
  margin-bottom: 0;
  flex: 1;
}

.products-grid.list-view .price-box {
  margin-bottom: 0;
  background: transparent;
  border: none;
  padding: 0;
  flex: 0 0 130px;
  text-align: right;
  flex-direction: column;
  align-items: flex-end;
}

.products-grid.list-view .card-actions {
  flex: 0 0 210px;
}

/* ====================================================================
   6. QUICK INSTALLATION GUIDE
   ==================================================================== */
.guide-section {
  background: rgba(22, 27, 34, 0.7);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 30px;
}

.guide-header {
  margin-bottom: 18px;
}

.guide-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.guide-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.guide-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.guide-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.guide-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.guide-tab.active {
  background: rgba(47, 129, 247, 0.2);
  border-color: var(--apple-blue);
  color: #58a6ff;
}

.guide-tab-content {
  display: none;
}

.guide-tab-content.active {
  display: block;
}

.guide-steps {
  display: flex;
  align-items: center;
  gap: 14px;
}

.step-card {
  flex: 1;
  background: rgba(11, 15, 25, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.step-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--apple-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(47, 129, 247, 0.4);
}

.step-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.step-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.step-desc strong {
  color: #c9d1d9;
}

.step-arrow {
  font-size: 16px;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* ====================================================================
   7. LICENSE LOOKUP
   ==================================================================== */
.license-section {
  background: rgba(22, 27, 34, 0.7);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 30px;
}

.license-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.license-icon {
  font-size: 26px;
}

.license-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.license-desc {
  font-size: 12.5px;
  color: var(--text-muted);
}

.license-form {
  display: flex;
  gap: 10px;
  max-width: 600px;
  margin-bottom: 12px;
}

.license-input {
  flex: 1;
}

.btn-primary {
  background: var(--apple-blue);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--apple-blue-hover);
}

/* ====================================================================
   8. FOOTER
   ==================================================================== */
.store-footer {
  border-top: 1px solid var(--border-card);
  padding-top: 32px;
  margin-top: 36px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 28px;
  margin-bottom: 28px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.footer-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.footer-name {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.footer-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.footer-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 440px;
}

.footer-heading {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.footer-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.footer-list strong {
  color: #c9d1d9;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--text-dim);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 14px;
}

.footer-domain {
  font-family: monospace;
  color: #58a6ff;
}

/* ====================================================================
   9. MODALS & POPUPS
   ==================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: #161b22;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 420px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  animation: modal-pop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-content.modal-large {
  max-width: 580px;
}

@keyframes modal-pop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.modal-product-header {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-product-icon {
  width: 48px;
  height: 48px;
  border-radius: 11px;
}

.modal-product-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--apple-blue);
  letter-spacing: 0.5px;
}

.modal-product-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.modal-product-version {
  font-size: 12px;
  color: #3fb950;
  font-weight: 600;
}

.modal-instruction {
  font-size: 12.5px;
  color: #c9d1d9;
  margin-bottom: 14px;
  line-height: 1.5;
}

/* Variant List */
.variant-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 14px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.variant-card {
  background: rgba(11, 15, 25, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}

.variant-card:hover {
  border-color: rgba(56, 139, 253, 0.4);
  background: rgba(22, 27, 34, 0.9);
}

.variant-card.highlight {
  border-color: var(--apple-green);
  background: rgba(35, 134, 54, 0.1);
}

.variant-info {
  flex: 1;
}

.variant-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.variant-target {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.variant-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-dl-direct {
  background: var(--apple-blue);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-dl-direct:hover {
  background: var(--apple-blue-hover);
}

.btn-copy-link {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  padding: 6px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-copy-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.modal-footer-note {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
}

.qr-preview {
  width: 220px;
  height: 220px;
  margin: 12px auto;
  display: block;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
}

/* ====================================================================
   10. TOAST NOTIFICATION
   ==================================================================== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(22, 27, 34, 0.95);
  border: 1px solid var(--apple-green);
  color: #fff;
  padding: 10px 18px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 2000;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ====================================================================
   11. LIVE COCKPIT VIEW & TELEMETRY
   ==================================================================== */
.cockpit-view {
  display: none;
}

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

.cockpit-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #fff;
}

.app-filter-select {
  background: rgba(22, 27, 34, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  outline: none;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.kpi-label { font-size: 11.5px; color: var(--text-muted); margin-bottom: 4px; }
.kpi-val { font-size: 24px; font-weight: 800; color: #fff; margin-bottom: 2px; }
.kpi-sub { font-size: 11px; color: var(--text-dim); }

.kpi-blue { border-left: 3px solid var(--apple-blue); }
.kpi-cyan { border-left: 3px solid var(--apple-cyan); }
.kpi-emerald { border-left: 3px solid #10b981; }
.kpi-green { border-left: 3px solid var(--apple-green); }
.kpi-purple { border-left: 3px solid var(--apple-purple); }
.kpi-amber { border-left: 3px solid var(--apple-amber); }

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.leaderboard-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 12px;
}

.lb-title { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.lb-stats { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11.5px; color: var(--text-muted); }

.cockpit-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.feed-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
  border-left: 2px solid rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
}

.feed-item.feed-payment { border-left-color: #3fb950; }
.feed-item.feed-download { border-left-color: var(--apple-cyan); }
.feed-title { font-weight: 600; color: #fff; }
.feed-desc { color: var(--text-muted); font-size: 11px; }
.feed-time { color: var(--text-dim); font-size: 10.5px; }

/* ====================================================================
   12. RESPONSIVE BREAKPOINTS
   ==================================================================== */
@media (max-width: 1024px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .trust-bar { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .leaderboard-grid { grid-template-columns: repeat(2, 1fr); }
  .cockpit-split { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .navbar { padding: 10px 16px; }
  .nav-links { display: none; }
  .hero-title { font-size: 28px; }
  .products-grid { grid-template-columns: 1fr; }
  .trust-bar { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .guide-steps { flex-direction: column; }
  .step-arrow { transform: rotate(90deg); margin: -4px 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .license-form { flex-direction: column; }
}

/* ====================================================================
   13. ZONE HUB LIVE MONITOR WIDGET (SẾP QUẢN TRỊ & THEO DÕI)
   ==================================================================== */
.zh-monitor-banner {
  background: linear-gradient(135deg, rgba(14, 23, 42, 0.95), rgba(15, 23, 42, 0.85));
  border: 1px solid rgba(14, 165, 233, 0.35);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 20px 24px;
  margin-bottom: 28px;
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}

.zh-monitor-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #0ea5e9, #10b981, #f59e0b, #0ea5e9);
  background-size: 200% 100%;
  animation: zhGlowBar 4s linear infinite;
}

@keyframes zhGlowBar {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

.zh-monitor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.zh-monitor-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.zh-monitor-badge {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #38bdf8;
  text-transform: uppercase;
}

.zh-monitor-sub {
  font-size: 11.5px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 6px;
}

.zh-monitor-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.zh-monitor-time {
  font-size: 11px;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.zh-refresh-btn {
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(14, 165, 233, 0.4);
  color: #38bdf8;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.zh-refresh-btn:hover {
  background: rgba(14, 165, 233, 0.3);
  transform: scale(1.03);
}

.zh-refresh-btn:active {
  transform: scale(0.97);
}

.zh-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.zh-stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.zh-stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(14, 165, 233, 0.3);
}

.zh-stat-icon {
  font-size: 26px;
  line-height: 1;
}

.zh-stat-content {
  flex: 1;
  min-width: 0;
}

.zh-stat-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.zh-stat-value {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.zh-stat-value small {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.zh-stat-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zh-stat-desc b {
  color: #38bdf8;
}

.zh-stat-card.success .zh-stat-desc b {
  color: #34d399;
}

.zh-stat-card.accent .zh-stat-desc b {
  color: #fbbf24;
}

.zh-stat-val-split {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.zh-sep {
  color: var(--text-dim);
  font-weight: 300;
}

@media (max-width: 1024px) {
  .zh-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .zh-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .zh-monitor-banner { padding: 14px 12px; }
  .zh-stat-card { padding: 10px; gap: 8px; flex-direction: column; text-align: center; }
  .zh-stat-icon { font-size: 22px; }
  .zh-stat-value { font-size: 18px; }
  .zh-stat-desc { font-size: 10px; white-space: normal; line-height: 1.3; }
}

.zh-ip-badge {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.zh-apps-table-wrapper {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.zh-table-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
}

.zh-table-tag {
  font-size: 11px;
  color: var(--apple-cyan);
  background: rgba(14, 165, 233, 0.1);
  padding: 2px 8px;
  border-radius: 6px;
}

.table-responsive {
  overflow-x: auto;
}

.zh-breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.zh-breakdown-table th {
  color: var(--text-dim);
  font-weight: 700;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
}

.zh-breakdown-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  vertical-align: middle;
}

.app-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-cell-icon {
  font-size: 18px;
}

.app-cell-sub {
  font-size: 10.5px;
  color: var(--text-muted);
}

.badge-count {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 11.5px;
}

.badge-count.dl {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

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

.badge-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.badge-status.success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.badge-status.info {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.badge-status.normal {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.badge-status.muted {
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
}

.zh-breakdown-table tr.row-highlight {
  background: rgba(14, 165, 233, 0.08);
  border-left: 3px solid #38bdf8;
}

.zh-breakdown-table tr.row-disabled {
  opacity: 0.6;
}

/* ====================================================================
   14. CARD TELEMETRY BOX (HIỂN THỊ TRỰC TIẾP TRÊN THẺ ZONE HUB)
   ==================================================================== */
.card-telemetry-box {
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.25);
  border-radius: 12px;
  padding: 12px;
  margin: 12px 0;
}

.card-telemetry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ct-title {
  font-size: 11px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.ct-sync {
  font-size: 10px;
  color: var(--text-dim);
}

.card-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
}

.card-telemetry-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 6px 4px;
}

.ct-val {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}

.ct-val small {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
}

.ct-lbl {
  font-size: 9.5px;
  color: var(--text-dim);
  margin-top: 2px;
  text-transform: uppercase;
}

.card-telemetry-sub {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card-telemetry-sub b {
  color: #38bdf8;
}

.ct-sep {
  color: var(--text-dim);
}

/* ====================================================================
   15. COCKPIT ZONE HUB SPOTLIGHT (DÀNH CHO LIVE COCKPIT)
   ==================================================================== */
.cockpit-zonehub-spotlight {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12) 0%, rgba(30, 41, 59, 0.7) 100%);
  border: 1px solid rgba(14, 165, 233, 0.35);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.czh-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.czh-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.czh-badge {
  font-size: 13px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.czh-sub {
  font-size: 11px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 6px;
}

.czh-time {
  font-size: 11.5px;
  color: #34d399;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.czh-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.czh-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.czh-card:hover {
  transform: translateY(-2px);
  border-color: rgba(14, 165, 233, 0.4);
}

.czh-icon {
  font-size: 24px;
  line-height: 1;
}

.czh-lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.czh-val {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.czh-val small {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.czh-subtext {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.czh-subtext b {
  color: #38bdf8;
}

@media (max-width: 1200px) {
  .czh-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .czh-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .czh-card {
    padding: 10px;
    flex-direction: column;
    text-align: center;
  }
  .czh-val {
    font-size: 18px;
  }
}