/* =============================================
   GLOBAL — Dashboard Pangan
   ============================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", sans-serif;
}

body {
  background: #f1f5f9;
  min-height: 100vh;
  margin-left: 220px;
  transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body.sidebar-collapsed {
  margin-left: 0;
}

/* ---- SIDEBAR ---- */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 220px;
  height: 100vh;
  background: #1e293b;
  color: white;
  padding: 16px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 1000;
  transform: translateX(0);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.sidebar.sidebar-collapsed {
  transform: translateX(-100%);
}

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

.sidebar-header-controls {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.sidebar .logo {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 4px;
}

.sidebar .logo-sub {
  font-size: 11px;
  color: #475569;
  margin-bottom: 24px;
}

.sidebar .nav-label {
  font-size: 10px;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
  margin-top: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #94a3b8;
  text-decoration: none;
  margin: 2px 0;
  padding: 9px 10px;
  border-radius: 7px;
  font-size: 13px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background 0.15s;
}

.nav-item:hover {
  background: #334155;
  color: #e2e8f0;
}

.nav-item.active {
  background: #334155;
  color: #f1f5f9;
  font-weight: 600;
}

.nav-item .nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item.active .nav-icon {
  opacity: 1;
}

.divider {
  border-top: 1px solid #334155;
  margin: 14px 0;
}

/* ---- PAGES ---- */
.page {
  display: none;
  padding: 20px;
  overflow: auto;
  min-width: 0;
}

.page.active {
  display: block;
}

/* ---- TOPBAR ---- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar h2 {
  font-size: 17px;
  font-weight: 700;
  color: #1e293b;
}

.toko-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
}

.badge-indo  { background: #fef3c7; color: #92400e; }
.badge-alfa  { background: #dbeafe; color: #1e40af; }
.badge-compare { background: #f3e8ff; color: #6b21a8; }

/* ---- LEGEND ---- */
.legend {
  display: inline-flex;
  gap: 14px;
  align-items: center;
  font-size: 11px;
  color: #64748b;
  background: white;
  border: 1px solid #e2e8f0;
  padding: 6px 12px;
  border-radius: 8px;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ---- CARDS ---- */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

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

.card {
  background: white;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.card .lbl  { font-size: 11px; color: #94a3b8; margin-bottom: 4px; }
.card .val  { font-size: 20px; font-weight: 700; color: #1e293b; }
.card .hint { font-size: 11px; color: #94a3b8; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .delta { font-size: 11px; margin-top: 4px; font-weight: 500; }

.delta-up { color: #b91c1c; }
.delta-dn { color: #15803d; }
.delta-eq { color: #94a3b8; }

/* ---- LAYOUT HELPERS ---- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.sec-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---- BADGES ---- */
.badge         { font-size: 11px; padding: 2px 8px; border-radius: 20px; font-weight: 500; }
.badge-red     { background: #fee2e2; color: #b91c1c; }
.badge-green   { background: #dcfce7; color: #15803d; }
.badge-gray    { background: #f1f5f9; color: #475569; }
.badge-blue    { background: #dbeafe; color: #1e40af; }
.badge-purple  { background: #f3e8ff; color: #6b21a8; }
.badge-yellow  { background: #fef9c3; color: #854d0e; }

/* ---- TABLE ---- */
.tbl-wrap {
  background: white;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
}

thead th {
  background: #f8fafc;
  padding: 9px 10px;
  text-align: left;
  font-weight: 600;
  color: #475569;
  font-size: 11px;
  border-bottom: 1px solid #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }

/* ---- CONTROLS ---- */
.controls {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

.controls input[type="text"] {
  padding: 5px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12px;
  background: white;
  width: 200px;
}

.controls select {
  padding: 5px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 12px;
  background: white;
}

/* ---- PAGINATION ---- */
.pgn {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 8px 10px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  flex-wrap: wrap;
}

.pgn button {
  padding: 4px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: white;
  font-size: 11px;
  cursor: pointer;
}

.pgn button:hover   { background: #f1f5f9; }
.pgn button.act     { background: #1e293b; color: white; border-color: #1e293b; }
.pgn button:disabled { opacity: 0.4; cursor: default; }
.pgn span { font-size: 11px; color: #64748b; }

/* ---- LINK BUTTON ---- */
.lnk {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 11px;
  text-decoration: none;
  border: 1px solid #bfdbfe;
}
.lnk:hover { background: #dbeafe; }

/* ---- EMPTY STATE ---- */
.empty-box {
  text-align: center;
  padding: 50px 20px;
  color: #94a3b8;
}
.empty-box .ico { font-size: 36px; margin-bottom: 12px; }
.empty-box p    { font-size: 13px; margin-bottom: 4px; line-height: 1.7; }

/* ---- PRICE COLORS ---- */
.hh { color: #b91c1c; font-weight: 600; }
.hl { color: #15803d; font-weight: 600; }
.hm { color: #334155; font-weight: 500; }

/* ---- ARROWS / DIFF ---- */
.arr-up  { color: #ef4444; font-size: 12px; }
.arr-dn  { color: #22c55e; font-size: 12px; }
.arr-eq  { color: #94a3b8; font-size: 12px; }
.arr-new { color: #3b82f6; font-size: 10px; font-weight: 700; }

.pdiff       { font-size: 10px; margin-left: 3px; padding: 1px 5px; border-radius: 3px; font-weight: 500; white-space: nowrap; }
.pdiff-up    { background: #fee2e2; color: #b91c1c; }
.pdiff-dn    { background: #dcfce7; color: #15803d; }

/* ---- UPLOAD PANEL ---- */
.upload-panel {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.upload-panel .up-title {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 10px;
}

.upload-row  { display: flex; gap: 12px; flex-wrap: wrap; }
.upload-slot { flex: 1; min-width: 180px; }

.upload-slot .slot-label {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 5px;
  font-weight: 500;
}

.file-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 7px;
  cursor: pointer;
  background: #f8fafc;
  transition: all 0.15s;
}

.file-btn:hover         { border-color: #94a3b8; background: #f1f5f9; }
.file-btn.loaded        { border-color: #22c55e; background: #f0fdf4; border-style: solid; }
.file-btn input         { display: none; }
.file-btn .dot          { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; flex-shrink: 0; }
.file-btn.loaded .dot   { background: #22c55e; }
.file-btn span          { font-size: 12px; color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-btn.loaded span   { color: #15803d; }

/* ============================================
   STORE PAGE REDESIGN — Hero + Themed styles
   ============================================ */

/* ---- HERO BANNER ---- */
.store-hero {
  position: relative;
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 18px;
  overflow: hidden;
  color: white;
}

.store-hero-indo {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 40%, #3b82f6 70%, #60a5fa 100%);
  box-shadow: 0 8px 32px rgba(37,99,235,0.35);
}

.store-hero-alfa {
  background: linear-gradient(135deg, #b91c1c 0%, #dc2626 40%, #ef4444 70%, #f87171 100%);
  box-shadow: 0 8px 32px rgba(220,38,38,0.35);
}

/* decorative floating circles */
.hero-bg-circles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hc {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
}
.hc1 { width: 160px; height: 160px; right: -40px;  top: -60px; }
.hc2 { width: 100px; height: 100px; right: 100px;  top: -30px; background: rgba(255,255,255,0.05); }
.hc3 { width:  70px; height:  70px; right: 60px;   bottom: -20px; }

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-icon {
  font-size: 36px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.2));
}

.hero-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1;
}

.hero-sub {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 4px;
  font-weight: 400;
}

.legend-hero {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  font-size: 11px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 6px 14px;
  border-radius: 30px;
  color: white;
}

.legend-hero span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ---- THEMED UPLOAD PANEL ---- */
.upload-panel-indo {
  border-top: 3px solid #2563eb;
}

.upload-panel-alfa {
  border-top: 3px solid #dc2626;
}

.file-btn-indo:hover { border-color: #2563eb; background: #eff6ff; }
.file-btn-indo.loaded { border-color: #16a34a; background: #f0fdf4; border-style: solid; }

.file-btn-alfa:hover { border-color: #dc2626; background: #fff1f2; }
.file-btn-alfa.loaded { border-color: #16a34a; background: #f0fdf4; border-style: solid; }

/* ---- THEMED STAT CARDS ---- */
.stat-card {
  border-left: 4px solid transparent;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.09);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 60px; height: 60px;
  border-radius: 0 10px 0 50%;
  opacity: 0.06;
}

.stat-card-indo { border-left-color: #2563eb; }
.stat-card-indo::before { background: #2563eb; }

.stat-card-alfa { border-left-color: #dc2626; }
.stat-card-alfa::before { background: #dc2626; }

.stat-card-green { border-left-color: #16a34a; }
.stat-card-green::before { background: #16a34a; }

.stat-card-red { border-left-color: #dc2626; }
.stat-card-red::before { background: #dc2626; }

.stat-icon {
  font-size: 18px;
  margin-bottom: 6px;
  display: block;
}

/* ---- THEMED TABLES ---- */
.tbl-themed { border-radius: 12px; overflow: hidden; }

.tbl-indo thead th { border-bottom: 2px solid #dbeafe; }
.tbl-indo thead { background: #eff6ff; }
.tbl-indo thead th { color: #1e40af; }
.tbl-indo .pgn { background: #eff6ff; border-top: 1px solid #dbeafe; }
.tbl-indo .pgn button.act { background: #2563eb; border-color: #2563eb; }
.tbl-indo .controls { background: #eff6ff; border-bottom: 1px solid #dbeafe; }
.tbl-indo .controls input, .tbl-indo .controls select { border-color: #bfdbfe; }
.tbl-indo .controls input:focus, .tbl-indo .controls select:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,0.1); }

.tbl-alfa thead th { border-bottom: 2px solid #fecaca; }
.tbl-alfa thead { background: #fff1f2; }
.tbl-alfa thead th { color: #991b1b; }
.tbl-alfa .pgn { background: #fff1f2; border-top: 1px solid #fecaca; }
.tbl-alfa .pgn button.act { background: #dc2626; border-color: #dc2626; }
.tbl-alfa .controls { background: #fff1f2; border-bottom: 1px solid #fecaca; }
.tbl-alfa .controls input, .tbl-alfa .controls select { border-color: #fca5a5; }
.tbl-alfa .controls input:focus, .tbl-alfa .controls select:focus { outline: none; border-color: #dc2626; box-shadow: 0 0 0 2px rgba(220,38,38,0.1); }

/* ---- SECTION TITLE DOT ---- */
.sec-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---- EMPTY STATE ---- */
.empty-store-icon {
  font-size: 52px;
  margin-bottom: 14px;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

/* ---- EXTRA BADGES ---- */
.badge-red-soft { background: #fee2e2; color: #b91c1c; font-size: 11px; padding: 2px 8px; border-radius: 20px; font-weight: 500; }

/* ---- SIDEBAR: active highlight matches page ---- */
#page-indomaret.active ~ * .nav-item-indo,
.nav-item.nav-item-indo.active { color: #60a5fa; }

/* ---- HERO LOGO IMAGE ---- */
.hero-logo-img {
  height: 80px;
  width: auto;
  max-width: 220px;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  background: white;
  padding: 6px 12px;
  object-fit: contain;
}



/* ---- LEGEND SOLID ---- */
.legend-solid {
  background: rgba(0,0,0,0.45) !important;
  border: 1.5px solid rgba(255,255,255,0.3) !important;
  padding: 7px 16px !important;
  border-radius: 30px !important;
  display: inline-flex !important;
  gap: 14px !important;
  align-items: center !important;
  backdrop-filter: blur(8px) !important;
}

/* outer span = label row (naik, turun, dsb) — putih */
.legend-solid > span {
  font-size: 12px !important;
  font-weight: 700 !important;
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  white-space: nowrap !important;
  color: white !important;
}

/* inner span = ikon warna — JANGAN dioverride putih */
.lgnd-up {
  font-size: 12px !important;
  font-weight: 900 !important;
  color: #ff6b6b !important;
}

.lgnd-dn {
  font-size: 12px !important;
  font-weight: 900 !important;
  color: #6ee7b7 !important;
}

.lgnd-eq {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #cbd5e1 !important;
  line-height: 1 !important;
}

.lgnd-new {
  background: #fde68a !important;
  color: #78350f !important;
  font-size: 9px !important;
  font-weight: 900 !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  letter-spacing: 0.5px !important;
}

/* ---- HERO STORE NAME (di samping logo) ---- */
.hero-store-name {
  font-size: 20px;
  font-weight: 800;
  color: white;
  letter-spacing: -0.3px;
  line-height: 1.1;
  text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.hero-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.82);
  margin-top: 3px;
  font-weight: 400;
}

.btn-danger { padding: 5px 14px; background: #ef4444; color: white; border: none; border-radius: 6px; font-size: 12px; cursor: pointer; font-weight: 500; }
.btn-danger:hover { background: #dc2626; }

/* ---- HERO BANNER — COMPARE & GRAFIK ---- */
.store-hero-compare {
  background: linear-gradient(135deg, #4c1d95 0%, #6d28d9 35%, #7c3aed 65%, #8b5cf6 100%);
  box-shadow: 0 8px 32px rgba(109,40,217,0.35);
}

.store-hero-grafik {
  background: linear-gradient(135deg, #0f4c81 0%, #0369a1 35%, #0284c7 65%, #38bdf8 100%);
  box-shadow: 0 8px 32px rgba(3,105,161,0.35);
}

/* hero-store-name (shared) */
.hero-store-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1;
  color: white;
}

/* legend-solid state for compare/grafik */
.legend-solid {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.25);
}

/* hero-logo-img override removed */

/* g-info-bar — remove old topbar style, use themed version */
.g-info-bar-themed {
  background: linear-gradient(90deg, #e0f2fe, #f0fdf4);
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  color: #0369a1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

/* ---- HERO STORE BADGE (pengganti img logo) ---- */
.hero-store-badge {
  width: 54px; height: 54px;
  border-radius: 14px;
  background: rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,0.25);
}

/* =============================================
   HAMBURGER BUTTON
   ============================================= */
.hamburger {
  display: flex;
  position: relative;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  transition: background 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.hamburger:hover {
  background: rgba(255, 255, 255, 0.15);
}

.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: #e2e8f0;
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}

/* hamburger selalu tampil 3 garis, tidak berubah jadi X */
.hamburger.is-open span:nth-child(1) { transform: none; }
.hamburger.is-open span:nth-child(2) { opacity: 1; }
.hamburger.is-open span:nth-child(3) { transform: none; }

/* Floating expand button when sidebar is collapsed */
.sidebar-expand-btn {
  display: none;
  position: fixed;
  left: 8px;
  top: 8px;
  z-index: 1050;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
}

body.sidebar-collapsed .sidebar-expand-btn {
  display: flex;
}

.sidebar-expand-btn:hover {
  background: #334155;
}

/* =============================================
   SIDEBAR OVERLAY (tap-to-close)
   ============================================= */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 950;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.sidebar-overlay.overlay-visible {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* =============================================
   RESPONSIVE BREAKPOINTS
   ============================================= */

/* --- Tablet landscape / small desktop (≤1100px) --- */
@media (max-width: 1100px) {
  .page { padding: 16px; }

  .upload-grid-4 { grid-template-columns: 1fr 1fr; }
}

/* --- Tablet portrait (≤900px) --- */
@media (max-width: 900px) {
  .page { padding: 14px; }

  /* tabel indomaret/alfamart */
  .price-table th, .price-table td { font-size: 12px; padding: 8px 10px; }
}

/* --- Mobile (≤768px) --- */
@media (max-width: 768px) {
  body {
    margin-left: 0;
  }

  /* Hide expand button on mobile */
  .sidebar-expand-btn {
    display: none !important;
  }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
  }
  .sidebar.sidebar-open {
    transform: translateX(0);
  }
  /* ignore desktop collapsed state on mobile */
  .sidebar.sidebar-collapsed {
    transform: translateX(-100%);
  }

  .sidebar-overlay { display: block; }

  .page {
    display: none;
    padding: 12px;
    padding-top: 56px; /* space for hamburger */
  }
  .page.active { display: block; }

  .topbar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .topbar h2 { font-size: 16px; }

  /* Indomaret / Alfamart page */
  .store-hero { padding: 16px !important; }
  .store-hero h1 { font-size: 18px !important; }

  /* Upload section */
  .cup-row { flex-direction: column; gap: 8px; }
  .cup-field { min-width: unset !important; width: 100%; }

  /* price table */
  .price-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .price-table th, .price-table td { font-size: 11px; padding: 7px 8px; white-space: nowrap; }

  /* compare page workspace */
  .cmp-workspace { grid-template-columns: 1fr !important; }
  .cmp-3tbl { grid-template-columns: 1fr !important; }
  .detail-panel-right { width: 100% !important; min-width: unset !important; }

  /* compare controls */
  .cus-controls { flex-direction: column; align-items: stretch; gap: 8px; }
  .cpt-tabs { flex-wrap: wrap; gap: 6px; }
  .cpt-btn { flex: 1; min-width: 90px; text-align: center; }
  .cus-search-wrap { width: 100%; }

  /* upload klontong slots */
  .cku-slots { flex-direction: column !important; }
  .cus-slot { width: 100% !important; }

  /* summary bar */
  .cmp-stat-bar { gap: 6px; }
  .csb-pill { font-size: 11px; padding: 4px 10px; }
  .csb-period-pill { margin-left: 0; }

  /* grafik page */
  .grafik-grid { grid-template-columns: 1fr !important; }
  .chart-card { min-width: unset !important; }

  /* fenomena */
  .news-grid { grid-template-columns: 1fr !important; }

  /* detail panel on mobile: slide-up from bottom */
  #detail-panel {
    position: fixed !important;
    bottom: 0; left: 0; right: 0;
    max-height: 70vh;
    overflow-y: auto;
    border-radius: 16px 16px 0 0 !important;
    box-shadow: 0 -4px 30px rgba(0,0,0,0.18);
    z-index: 500;
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
  }
  #detail-panel.panel-visible {
    transform: translateY(0);
  }
  /* Add drag handle */
  #detail-panel::before {
    content: '';
    display: block;
    width: 36px; height: 4px;
    background: #cbd5e1;
    border-radius: 2px;
    margin: 10px auto 6px;
  }

  /* Multi-select dropdown full width on mobile */
  .multisel-dropdown { position: fixed !important; left: 12px !important; right: 12px !important; width: auto !important; }

  /* store col on mobile: full width scrollable */
  .store-col { min-height: 280px; max-height: 50vh; }
  .col-list { max-height: 220px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
}

/* --- Small mobile (≤480px) --- */
@media (max-width: 480px) {
  .page { padding: 10px; padding-top: 54px; }
  .store-hero { border-radius: 10px !important; }
  .cpt-btn { font-size: 11px; padding: 6px 10px; }
  .price-table th, .price-table td { font-size: 10px; padding: 6px 6px; }
  .csb-pill { font-size: 10px; padding: 3px 8px; }
}
