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

:root {
  --bg-dark: #090d16;
  --bg-card: rgba(17, 25, 40, 0.75);
  --bg-card-hover: rgba(26, 38, 57, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(99, 102, 241, 0.3);
  
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.15);
  --primary-hover: #4f46e5;
  --secondary: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dark: #1f2937;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font-sans: 'Outfit', sans-serif;
  --font-mono: 'Fira Code', monospace;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 40%);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Application Layout */
.app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
  width: 280px;
  background: rgba(10, 15, 26, 0.85);
  border-right: 1px solid var(--border-color);
  backdrop-filter: blur(20px);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2.5rem;
}

.brand-icon {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.brand-name {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(to right, #ffffff, #9ca3af);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-item button {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
  text-align: left;
}

.nav-item button:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.nav-item.active button {
  color: #ffffff;
  background: linear-gradient(90deg, var(--primary-glow) 0%, rgba(99, 102, 241, 0.02) 100%);
  border-left: 3px solid var(--primary);
  box-shadow: inset 5px 0 15px rgba(99, 102, 241, 0.05);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

/* Sandbox Switcher in Sidebar */
.sandbox-control {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sandbox-label {
  display: flex;
  flex-direction: column;
}

.sandbox-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.sandbox-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--warning);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* Main Content Area */
.main-content {
  flex-grow: 1;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  height: 100vh;
  overflow-y: auto;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.page-title h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.page-title p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.mode-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--warning);
  padding: 8px 14px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
}

.mode-badge.live {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.reseller-login-badge {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.reseller-login-badge:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--primary);
  color: white;
  transform: translateY(-1px);
}

/* Tab Views Container */
.tab-content-container {
  flex-grow: 1;
}

.tab-view {
  display: none;
  animation: fadeIn 0.4s ease;
}

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

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

/* Glass Card Components */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  backdrop-filter: blur(16px);
  transition: var(--transition);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.glass-card:hover {
  border-color: var(--border-color-hover);
  background: var(--bg-card-hover);
}

/* Dashboard Statistics Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(to right, #ffffff, #d1d5db);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-footer {
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change-up { color: var(--success); }
.stat-change-down { color: var(--danger); }

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

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.form-input {
  width: 100%;
  background: rgba(10, 15, 26, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: rgba(10, 15, 26, 0.8);
}

.btn {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-muted);
}

.btn-success {
  background: var(--success);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

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

/* Layout Split Panels */
.panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .panel-grid {
    grid-template-columns: 1fr;
  }
}

/* Package Card Selector Grid */
.packages-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
  .packages-grid {
    grid-template-columns: 1fr;
  }
}

.package-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
}

.package-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.02);
}

.package-card.selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
  box-shadow: 0 8px 24px var(--primary-glow);
}

.package-card.selected::before {
  content: '✓';
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--primary);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
}

.pack-popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
}

.pack-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-main);
}

.pack-price-vnd {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin: 10px 0;
}

.pack-price-usd {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.pack-features {
  list-style: none;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.pack-features li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pack-features li::before {
  content: '•';
  color: var(--primary);
  font-size: 1.25rem;
}

/* Device Lists table */
.data-table-container {
  overflow-x: auto;
}

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

.data-table th {
  padding: 14px 16px;
  border-bottom: 2px solid var(--border-color);
  color: var(--text-muted);
  font-weight: 600;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr {
  transition: var(--transition);
}

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

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge.active { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.status-badge.pending { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.status-badge.revoked { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

/* iOS UDID Step Guide */
.steps-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.step-item {
  display: flex;
  gap: 16px;
  background: rgba(255, 255, 255, 0.01);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.step-num {
  background: var(--primary-glow);
  border: 1px solid var(--primary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: var(--primary);
  flex-shrink: 0;
}

.step-body h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.step-body p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Pay2S Modal VietQR Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.payment-modal {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 480px;
  max-width: 95%;
  padding: 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: scale(0.9);
  transition: var(--transition);
}

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

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  color: #ffffff;
}

.qr-code-img {
  width: 250px;
  height: 250px;
  background: #ffffff;
  padding: 10px;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.payment-details {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
}

.detail-lbl { color: var(--text-muted); }
.detail-val { font-weight: bold; color: white; display: flex; align-items: center; gap: 6px; }

.copy-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
}

.copy-btn:hover {
  background: var(--primary);
  color: white;
}

.pulse-spinner {
  width: 12px;
  height: 12px;
  background-color: var(--warning);
  border-radius: 50%;
  animation: pulse 1.5s infinite ease-in-out;
  display: inline-block;
  margin-right: 6px;
}

@keyframes pulse {
  0% { transform: scale(0.8); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.8); opacity: 0.5; }
}

/* API Log Console Widget */
.console-widget {
  background: #07090e;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  font-family: var(--font-mono);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 300px;
}

.console-header {
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.console-dots {
  display: flex;
  gap: 6px;
}

.console-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.console-dot.red { background: #ef4444; }
.console-dot.yellow { background: #f59e0b; }
.console-dot.green { background: #10b981; }

.console-body {
  padding: 14px;
  overflow-y: auto;
  flex-grow: 1;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.console-line {
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-all;
}

.console-line .timestamp { color: rgba(255, 255, 255, 0.3); margin-right: 8px; }
.console-line .source { font-weight: bold; border-radius: 3px; padding: 1px 4px; margin-right: 6px; }
.console-line .source.SYSTEM { background: rgba(99, 102, 241, 0.15); color: var(--primary); }
.console-line .source.MUACERT { background: rgba(6, 182, 212, 0.15); color: var(--secondary); }
.console-line .source.PAY2S { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.console-line .source.WEBHOOK { background: rgba(16, 185, 129, 0.15); color: var(--success); }

.console-line.REQUEST { color: #5bc0be; }
.console-line.RESPONSE { color: #cdd6f4; }
.console-line.SUCCESS { color: var(--success); }
.console-line.WARNING { color: var(--warning); }
.console-line.ERROR { color: var(--danger); }
.console-line.INFO { color: var(--text-muted); }

/* Quick Simulator Panel inside modal/UI */
.simulation-helper {
  background: rgba(245, 158, 11, 0.05);
  border: 1px dashed rgba(245, 158, 11, 0.3);
  padding: 12px;
  border-radius: var(--radius-md);
  margin-top: 10px;
  font-size: 0.8rem;
  text-align: left;
}

.simulation-helper h5 {
  color: var(--warning);
  margin-bottom: 6px;
  font-weight: 600;
}

/* ==================================================
   📱 MOBILE & TABLET RESPONSIVE STYLE SYSTEM (iOS/iPadOS)
   ================================================== */
@media (max-width: 1024px) {
  html {
    font-size: 13.5px; /* Proportionally scales all rem-based units by 15% */
  }

  body {
    flex-direction: column;
    overflow-x: hidden;
  }

  .app-container {
    flex-direction: column;
    overflow-x: hidden;
  }

  /* 📱 iOS Native Bottom Navigation Bar (Glassmorphic) */
  .sidebar {
    position: fixed;
    top: auto; /* Reset desktop top: 0; to prevent full height stretching */
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: calc(58px + env(safe-area-inset-bottom, 0px));
    background: rgba(10, 16, 28, 0.85);
    border-right: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    z-index: 999;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
  }

  /* Hide brand logo and logout/footer at the bottom nav on mobile/tablet */
  .sidebar .brand,
  .sidebar .sidebar-footer,
  .sidebar .sandbox-control {
    display: none !important;
  }

  .sidebar .nav-menu {
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    height: 100%;
    gap: 0;
  }

  .sidebar .nav-menu .nav-item {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    max-width: 200px; /* Centers buttons nicely on landscape iPads */
  }

  .sidebar .nav-menu .nav-item button {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px 0;
    font-size: 0.62rem;
    font-weight: 500;
    text-align: center;
    border-left: none;
    border-bottom: none;
    border-radius: 0;
    width: 100%;
    height: 100%;
    color: var(--text-muted);
    background: none !important;
  }

  /* Hide vertical lines and set active glow states for iOS bottom icons */
  .sidebar .nav-menu .nav-item.active button {
    color: var(--primary);
    border-left: none;
    box-shadow: none;
  }

  .sidebar .nav-menu .nav-item button svg {
    width: 16px;
    height: 16px;
    transition: var(--transition);
  }

  .sidebar .nav-menu .nav-item.active button svg {
    color: var(--primary);
    transform: translateY(-1px);
    filter: drop-shadow(0 0 4px rgba(99, 102, 241, 0.6));
  }

  /* Main scrollable body spacing */
  .main-content {
    padding: 0.75rem;
    padding-bottom: calc(75px + env(safe-area-inset-bottom, 0px)); /* Leaves room so content is not blocked by bottom bar */
    height: auto;
    overflow-y: visible;
    gap: 0.75rem;
  }

  header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 6px;
  }

  .page-title h1 {
    font-size: 1.25rem;
  }

  .page-title p {
    font-size: 0.75rem;
  }

  /* Glass Card compact overrides for Mobile/Tablet */
  .glass-card {
    padding: 0.85rem;
    border-radius: var(--radius-md);
  }

  /* Hero Banner compact adjustments */
  .hero-section {
    padding: 1.25rem 0.85rem;
    margin-bottom: 0.75rem;
    border-radius: var(--radius-md);
  }

  .hero-section h2 {
    font-size: 1.2rem;
    line-height: 1.2;
    margin-bottom: 4px;
  }

  .hero-section p {
    font-size: 0.75rem;
    margin-bottom: 0.85rem;
    line-height: 1.4;
  }

  .features-list {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    margin-top: 0.85rem;
  }

  .feature-box h4 {
    font-size: 0.8rem;
  }

  .feature-box p {
    font-size: 0.72rem;
  }

  /* Grid spacing compressions */
  .packages-grid {
    gap: 0.75rem;
    margin-bottom: 0.75rem;
  }

  .panel-grid {
    gap: 0.75rem;
  }

  /* Price selector cards responsive styling */
  .package-card {
    padding: 0.85rem;
    border-radius: var(--radius-md);
  }

  .pack-name {
    font-size: 0.9rem;
    margin-bottom: 2px;
  }

  .pack-price-vnd {
    font-size: 1.15rem;
    margin: 4px 0;
  }

  .pack-price-usd {
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
  }

  .pack-features {
    padding-top: 4px;
    gap: 2px;
  }

  .pack-features li {
    font-size: 0.72rem;
  }

  /* Form Elements compression */
  .form-group {
    margin-bottom: 0.75rem;
  }

  .form-group label {
    font-size: 0.72rem;
    margin-bottom: 4px;
  }

  .form-input {
    padding: 8px 12px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
  }

  /* VietQR Payment Modal scaling */
  .payment-modal {
    padding: 1rem 0.85rem;
    max-width: 92%;
  }

  .qr-code-img {
    width: 170px;
    height: 170px;
    margin: 0.75rem 0;
  }

  .payment-details {
    padding: 6px 10px;
    font-size: 0.75rem;
    gap: 4px;
    margin-bottom: 0.75rem;
  }

  .detail-row {
    padding: 1px 0;
  }

  /* Data Table scaling on mobile */
  .data-table th, .data-table td {
    padding: 8px 6px;
    font-size: 0.75rem;
  }

  .btn {
    padding: 8px 14px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
  }

  /* Compress terminal logger on mobile to fit screen natively */
  .console-widget {
    height: 170px !important;
  }
  .console-body {
    padding: 8px;
    font-size: 0.7rem;
  }
  .console-header {
    padding: 6px 12px;
    font-size: 0.72rem;
  }
  
  /* Hide mock helper inside modal entirely for production look */
  .simulation-helper {
    display: none !important;
  }
}

/* 📱 Extremely Compact Overrides for iPhones / Androids under 480px width */
@media (max-width: 480px) {
  html {
    font-size: 12px; /* Scale root size down further for standard mobile screens */
  }

  .main-content {
    padding: 0.5rem;
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    gap: 0.5rem;
  }

  .glass-card {
    padding: 0.75rem;
  }

  .hero-section {
    padding: 1rem 0.75rem;
    margin-bottom: 0.5rem;
  }

  /* Force table horizontal scroll seamlessly within screen */
  .data-table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table th, .data-table td {
    padding: 6px 4px;
    font-size: 0.7rem;
    white-space: nowrap; /* Prevent ugly wraps in cells */
  }
}
