/* ============================================================
   HubKu Mobile CSS — Responsive Fix untuk semua halaman
   ============================================================ */

/* ── Reset dasar ── */
html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }

/* ── Layout App (Sidebar pages) ── */
@media (max-width: 768px) {

  /* Seluruh halaman */
  html, body {
    width: 100%;
    overflow-x: hidden;
  }

  /* App container */
  .app {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100dvh !important;
    overflow: visible !important;
    position: relative !important;
  }

  /* Sidebar jadi drawer */
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 82% !important;
    max-width: 280px !important;
    height: 100dvh !important;
    transform: translateX(-100%) !important;
    z-index: 200 !important;
    overflow-y: auto !important;
    transition: transform 0.3s ease !important;
  }

  .sidebar.open {
    transform: translateX(0) !important;
    box-shadow: 4px 0 32px rgba(0,0,0,0.7) !important;
  }

  /* Main content — full width */
  .main {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100vw !important;
    height: auto !important;
    min-height: 100vh !important;
    overflow-x: hidden !important;
    flex: none !important;
    margin-left: 0 !important;
  }

  /* Topbar */
  .topbar {
    width: 100% !important;
    padding: 12px 16px !important;
    box-sizing: border-box !important;
  }

  /* Konten halaman */
  .pcontent {
    width: 100% !important;
    max-width: 100% !important;
    padding: 14px 14px 80px !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    margin: 0 !important;
  }

  /* Semua card dan grid */
  .card, .sc2, .feat-card, .testi-card {
    width: 100% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
  }

  /* Stat grid */
  .sg {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    width: 100% !important;
  }

  /* Quick links grid */
  .quick-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .quick-card {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 12px 10px !important;
    gap: 8px !important;
    overflow: hidden !important;
  }

  .quick-icon {
    width: 34px !important;
    height: 34px !important;
    flex-shrink: 0 !important;
  }

  .quick-body {
    min-width: 0 !important;
    flex: 1 !important;
    overflow: hidden !important;
  }

  .quick-label {
    font-size: 12px !important;
    white-space: normal !important;
    word-break: break-word !important;
    line-height: 1.2 !important;
  }

  .quick-desc {
    font-size: 10px !important;
    white-space: normal !important;
    word-break: break-word !important;
    line-height: 1.2 !important;
  }

  /* Tabel — bisa scroll horizontal */
  .tbl-wrap, table {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    display: block !important;
  }

  /* Grid 2 kolom → 1 kolom */
  .dg, .ll, .pl, .stat-grid {
    grid-template-columns: 1fr !important;
    width: 100% !important;
  }

  /* Tombol hamburger */
  .mob-btn { display: grid !important; }

  /* Bottom nav */
  .bottom-nav { display: flex !important; }

  /* Toast */
  .tc { bottom: 72px !important; right: 14px !important; left: 14px !important; }
  .toast { max-width: 100% !important; }

  /* Notifikasi dropdown */
  .notif-drop {
    width: calc(100vw - 28px) !important;
    right: 0 !important;
    left: auto !important;
  }

  /* Tema panel */
  .dash-theme-panel {
    position: fixed !important;
    left: 14px !important;
    right: 14px !important;
    width: auto !important;
    bottom: auto !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
  }

  /* Theme grid */
  .theme-grid, .layout-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* URL box */
  .url-box { flex-wrap: wrap !important; }

  /* Chart container */
  .chart-wrap, canvas {
    width: 100% !important;
    max-width: 100% !important;
  }



  /* Tema layout */
  .tema-layout {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* Stats layout */
  .stats-layout {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* Form 2 kolom → 1 kolom */
  .form-row-2 {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* Kelola tautan .ll */
  .ll {
    grid-template-columns: 1fr !important;
  }

  /* Profil .pl */
  .pl {
    grid-template-columns: 1fr !important;
  }

  /* QR Code layout */
  .qr-layout {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* Export layout */
  .exp-layout {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .filter-row {
    grid-template-columns: 1fr !important;
  }

  .fmt-grid {
    grid-template-columns: 1fr !important;
  }

  .stat-row {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Overlay */
  .ov { display: none; }
  .ov.open { display: block; }

  /* Halaman non-sidebar */
  .page-wrap, .wrap {
    padding: 20px 16px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .form-card, .card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Input — cegah zoom iOS */
  input, textarea, select {
    font-size: 16px !important;
    max-width: 100% !important;
  }
}

/* ── Small Phone (≤480px) ── */
@media (max-width: 480px) {
  .pcontent {
    padding: 12px 12px 80px !important;
  }

  .sg {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .sc2 {
    padding: 12px 10px !important;
  }

  .quick-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .topbar {
    padding: 10px 12px !important;
  }

  .hero-title {
    font-size: clamp(28px, 8vw, 42px) !important;
  }
}

/* ── Very Small (≤360px) ── */
@media (max-width: 360px) {
  .pcontent { padding: 10px 10px 80px !important; }
  .sg { grid-template-columns: 1fr 1fr !important; }
}
