/* ===== PANEL SHARED ===== */
.panel-overlay { display:none; position:fixed; inset:0; z-index:5000; background:var(--gray-100); overflow-y:auto; }
.panel-overlay.open { display:block; }
.panel-wrap { max-width:860px; margin:0 auto; min-height:100vh; display:flex; flex-direction:column; background:var(--gray-50); font-family:'Inter',-apple-system,sans-serif; }
.admin-badge-dot { position:absolute;top:4px;right:4px;min-width:16px;height:16px;background:#ef4444;color:#fff;font-size:9px;font-weight:700;border-radius:99px;display:inline-flex;align-items:center;justify-content:center;padding:0 4px;line-height:1; }

/* Top bar */
.panel-topbar { background:var(--green-700); padding:0 16px; height:52px; display:flex; align-items:center; gap:10px; position:sticky; top:0; z-index:60; flex-shrink:0; }
.panel-topbar-title { font-size:16px; font-weight:800; color:#fff; letter-spacing:-.5px; }
.panel-topbar-spacer { flex:1; }
.panel-mode-switch { display:flex; background:rgba(0,0,0,.25); border-radius:99px; padding:3px; gap:2px; }
.panel-mode-btn { padding:4px 14px; border-radius:99px; font-weight:700; font-size:12px; cursor:pointer; transition:all .15s; background:transparent; color:rgba(255,255,255,.8); border:none; font-family:inherit; }
.panel-mode-btn.active { background:#fff; color:var(--green-700); }
.panel-back-btn { width:36px; height:36px; display:grid; place-items:center; border-radius:8px; color:#fff; cursor:pointer; transition:var(--transition); background:rgba(255,255,255,.15); border:none; font-size:18px; }
.panel-back-btn:hover { background:rgba(255,255,255,.3); }

/* Content area */
.panel-content { flex:1; padding:16px 14px 90px; overflow-y:auto; }

/* Bottom nav */
.panel-bottomnav { position:fixed; bottom:0; left:0; right:0; background:#fff; border-top:1px solid var(--gray-200); display:flex; z-index:60; max-width:860px; margin:0 auto; overflow-x:auto; scrollbar-width:none; -webkit-overflow-scrolling:touch; }
.panel-bottomnav::-webkit-scrollbar { display:none; }
.panel-nav-btn { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; padding:10px 6px; cursor:pointer; border:none; background:transparent; font-family:inherit; border-top:2px solid transparent; transition:var(--transition); position:relative; }
.panel-nav-btn.active { border-top-color:var(--green-700); }
.panel-nav-btn .pn-icon { font-size:18px; line-height:1; }
.panel-nav-btn .pn-label { font-size:9px; font-weight:600; color:var(--gray-400); line-height:1; white-space:nowrap; }
.panel-nav-btn.active .pn-label { color:var(--green-700); }
.panel-nav-badge { position:absolute; top:2px; right:calc(50% - 18px); background:var(--red-500); color:#fff; font-size:8px; font-weight:700; min-width:14px; height:14px; border-radius:99px; display:grid; place-items:center; padding:0 3px; }

/* Stat cards */
.stat-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:16px; }
.stat-card { background:#f8fdf9; border:1px solid #dcfce7; border-radius:12px; padding:14px 12px; }
.stat-label { font-size:11px; color:var(--gray-500); font-weight:600; margin-bottom:4px; text-transform:uppercase; letter-spacing:.4px; }
.stat-value { font-size:20px; font-weight:700; color:var(--gray-900); margin-bottom:2px; }
.stat-sub { font-size:11px; }
.stat-sub.green { color:var(--green-700); }
.stat-sub.orange { color:#d97706; }

/* Cards */
.p-card { background:#fff; border:1px solid var(--gray-200); border-radius:12px; padding:14px; margin-bottom:12px; }
.p-card-title { font-size:13px; font-weight:700; color:var(--gray-900); margin-bottom:10px; }

/* Chart bars */
.chart-bars { display:flex; align-items:flex-end; gap:6px; height:60px; }
.chart-bar-col { flex:1; display:flex; flex-direction:column; align-items:center; gap:4px; }
.chart-bar { width:100%; border-radius:4px 4px 0 0; transition:height .3s; }
.chart-bar.highlight { background:var(--green-700); }
.chart-bar.normal { background:#bbf7d0; }
.chart-bar-label { font-size:9px; color:var(--gray-400); }

/* List items */
.p-list-item { display:flex; justify-content:space-between; align-items:center; padding:8px 0; border-bottom:1px solid var(--gray-100); }
.p-list-item:last-child { border-bottom:none; }
.p-list-primary { font-size:13px; font-weight:600; color:var(--gray-900); }
.p-list-secondary { font-size:11px; color:var(--gray-500); }
.p-list-right { text-align:right; }

/* Warning box */
.p-warning { background:#fef3c7; border:1px solid #fcd34d; border-radius:12px; padding:14px; }
.p-warning-title { font-size:13px; font-weight:700; color:#92400e; margin-bottom:8px; }
.p-warning-item { font-size:13px; color:#78350f; margin-bottom:4px; }

/* Pill / Status badge */
.p-pill { font-size:11px; font-weight:600; padding:3px 10px; border-radius:99px; display:inline-block; white-space:nowrap; }
.p-pill-aktif { background:#dcfce7; color:#16a34a; }
.p-pill-habis { background:#fee2e2; color:#dc2626; }
.p-pill-menunggu { background:#fef3c7; color:#d97706; }
.p-pill-dikemas { background:#dbeafe; color:#2563eb; }
.p-pill-dikirim { background:#ede9fe; color:#7c3aed; }
.p-pill-selesai { background:#dcfce7; color:#16a34a; }
.p-pill-dibatalkan { background:#fee2e2; color:#dc2626; }

/* Buttons */
.p-btn { display:inline-flex; align-items:center; gap:5px; border-radius:8px; font-weight:600; cursor:pointer; border:none; transition:opacity .15s; font-family:inherit; font-size:13px; padding:9px 16px; }
.p-btn-sm { font-size:12px; padding:5px 10px; }
.p-btn-default { background:var(--gray-100); color:var(--gray-700); }
.p-btn-primary { background:var(--green-700); color:#fff; }
.p-btn-danger { background:#fee2e2; color:#dc2626; }
.p-btn-outline { background:transparent; color:var(--green-700); border:1.5px solid var(--green-700); }
.p-btn-full { width:100%; justify-content:center; }
.p-btn:hover { opacity:.85; }

/* Product row */
.p-product-row { display:flex; gap:12px; align-items:flex-start; }
.p-product-icon { width:48px; height:48px; background:#f0fdf4; border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:24px; flex-shrink:0; }
.p-product-body { flex:1; min-width:0; }
.p-product-name { font-size:14px; font-weight:700; color:var(--gray-900); }
.p-product-cat { font-size:11px; color:var(--gray-500); margin-bottom:4px; }
.p-product-meta { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.p-product-price { font-size:14px; font-weight:700; color:var(--green-700); }
.p-product-stock { font-size:11px; color:var(--gray-500); }
.p-product-actions { display:flex; gap:6px; flex-shrink:0; }

/* Search input */
.p-search { width:100%; padding:9px 12px; border:1.5px solid var(--gray-200); border-radius:8px; font-size:13px; margin-bottom:12px; box-sizing:border-box; outline:none; font-family:inherit; }
.p-search:focus { border-color:var(--green-500); box-shadow:0 0 0 3px rgba(3,172,14,.1); }

/* Filter chips */
.p-filters { display:flex; gap:6px; overflow-x:auto; margin-bottom:14px; padding-bottom:4px; scrollbar-width:none; }
.p-filters::-webkit-scrollbar { display:none; }
.p-filter-chip { flex-shrink:0; padding:5px 12px; border-radius:99px; font-size:12px; font-weight:600; border:none; cursor:pointer; font-family:inherit; transition:var(--transition); }
.p-filter-chip.active { background:var(--green-700); color:#fff; }
.p-filter-chip:not(.active) { background:var(--gray-100); color:var(--gray-700); }

/* Order card */
.p-order-card { cursor:pointer; }
.p-order-card:hover { border-color:var(--green-200); }
.p-order-header { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:6px; }
.p-order-id { font-size:14px; font-weight:700; }
.p-order-buyer { font-size:13px; color:var(--gray-700); }
.p-order-items { font-size:12px; color:var(--gray-500); }
.p-order-footer { display:flex; justify-content:space-between; margin-top:6px; }
.p-order-total { font-size:13px; font-weight:700; color:var(--green-700); }
.p-order-date { font-size:11px; color:var(--gray-400); }

/* Panel Modal */
.p-modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:100; display:flex; align-items:flex-end; justify-content:center; }
.p-modal { background:#fff; width:100%; max-width:500px; border-radius:16px 16px 0 0; padding:20px 16px 32px; max-height:85vh; overflow-y:auto; }
.p-modal-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; }
.p-modal-title { font-size:16px; font-weight:700; }
.p-modal-close { background:var(--gray-100); border:none; border-radius:8px; width:32px; height:32px; cursor:pointer; font-size:18px; display:flex; align-items:center; justify-content:center; font-family:inherit; }
.p-modal-close:hover { background:var(--gray-200); }

/* Form */
.p-form-group { margin-bottom:12px; }
.p-form-label { display:block; font-size:12px; font-weight:600; color:var(--gray-700); margin-bottom:4px; }
.p-form-input, .p-form-select, .p-form-textarea {
  width:100%; padding:9px 12px; border:1.5px solid var(--gray-200); border-radius:8px;
  font-size:13px; color:var(--gray-900); background:#fff; outline:none; box-sizing:border-box; font-family:inherit;
}
.p-form-input:focus, .p-form-select:focus, .p-form-textarea:focus { border-color:var(--green-500); box-shadow:0 0 0 3px rgba(3,172,14,.1); }
.p-form-textarea { resize:none; }

/* Emoji picker */
.p-emoji-grid { display:flex; gap:8px; margin-bottom:12px; flex-wrap:wrap; }
.p-emoji-btn { width:36px; height:36px; font-size:20px; border-radius:8px; cursor:pointer; display:grid; place-items:center; border:1px solid var(--gray-200); background:#fff; transition:var(--transition); }
.p-emoji-btn.selected { border:2px solid var(--green-700); background:#dcfce7; }

/* Toggle switch */
.p-toggle { width:40px; height:22px; border-radius:11px; border:none; cursor:pointer; position:relative; transition:background .2s; }
.p-toggle.on { background:var(--green-700); }
.p-toggle.off { background:var(--gray-300); }
.p-toggle-knob { position:absolute; top:2px; width:18px; height:18px; border-radius:9px; background:#fff; transition:left .2s; }

/* Progress bar */
.p-progress { height:6px; background:var(--gray-100); border-radius:99px; overflow:hidden; }
.p-progress-fill { height:100%; background:var(--green-700); border-radius:99px; transition:width .3s; }

/* Customer avatar */
.p-avatar { width:40px; height:40px; border-radius:20px; background:#dcfce7; display:flex; align-items:center; justify-content:center; font-size:14px; font-weight:700; color:var(--green-700); flex-shrink:0; }
.p-avatar-lg { width:60px; height:60px; border-radius:30px; font-size:22px; margin:0 auto 8px; }

/* Notification item */
.p-notif { display:flex; gap:12px; cursor:pointer; }
.p-notif-icon { font-size:22px; flex-shrink:0; }
.p-notif-body { flex:1; }
.p-notif-msg { font-size:13px; }
.p-notif-msg.unread { font-weight:700; }
.p-notif-time { font-size:11px; color:var(--gray-400); margin-top:4px; }
.p-notif-dot { width:8px; height:8px; border-radius:4px; background:var(--green-700); flex-shrink:0; margin-top:4px; }

/* User product grid */
.p-user-product-grid { display:grid; grid-template-columns:repeat(2, 1fr); gap:8px; }
.p-user-product {
  background:#fff; border:1px solid var(--gray-200); border-radius:10px;
  overflow:hidden; box-shadow:0 1px 4px rgba(0,0,0,.05); transition:var(--transition);
}
.p-user-product:active { transform:scale(.98); }
.p-user-product-img { font-size:36px; text-align:center; margin-bottom:8px; }
.p-user-product-name {
  font-size:12px; font-weight:600; margin-bottom:2px; line-height:1.35;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
  min-height:32px; color:var(--gray-800);
}
.p-user-product-cat { font-size:10px; color:var(--gray-400); margin-bottom:4px; }
.p-user-product-price { font-size:14px; font-weight:800; color:var(--green-700); margin-bottom:6px; }
.p-user-product-buy { width:100%; padding:8px 0; background:var(--green-700); color:#fff; border:none; border-radius:8px; font-size:12px; font-weight:700; cursor:pointer; font-family:inherit; transition:var(--transition); min-height:36px; }
.p-user-product-buy:hover { background:var(--green-800); }

/* Flash sale horizontal */
.p-flash-scroll { display:flex; gap:8px; overflow-x:auto; padding-bottom:4px; scrollbar-width:none; -webkit-overflow-scrolling:touch; }
.p-flash-scroll::-webkit-scrollbar { display:none; }
.p-flash-item { flex-shrink:0; width:110px; border:1px solid var(--gray-200); border-radius:10px; padding:8px; text-align:center; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.04); }
.p-flash-img { font-size:28px; margin-bottom:4px; }
.p-flash-name { font-size:10px; font-weight:600; margin-bottom:2px; line-height:1.3; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.p-flash-old { font-size:10px; color:var(--red-500); font-weight:700; text-decoration:line-through; }
.p-flash-price { font-size:12px; font-weight:800; color:var(--green-700); }
.p-flash-buy { width:100%; margin-top:6px; padding:4px 0; background:var(--green-700); color:#fff; border:none; border-radius:6px; font-size:11px; font-weight:600; cursor:pointer; font-family:inherit; }

/* Cart item */
.p-cart-item { display:flex; gap:12px; align-items:center; }
.p-cart-img { width:44px; height:44px; background:#f0fdf4; border-radius:10px; display:flex; align-items:center; justify-content:center; font-size:22px; flex-shrink:0; }
.p-cart-info { flex:1; min-width:0; }
.p-cart-name { font-size:13px; font-weight:700; display:-webkit-box; -webkit-line-clamp:1; -webkit-box-orient:vertical; overflow:hidden; }
.p-cart-price { font-size:13px; color:var(--green-700); font-weight:700; }
.p-cart-qty { display:flex; align-items:center; gap:6px; }
.p-cart-qty-btn { width:30px; height:30px; border-radius:6px; border:1px solid var(--gray-200); background:var(--gray-50); cursor:pointer; font-weight:700; font-family:inherit; display:grid; place-items:center; min-height:30px; min-width:30px; }
.p-cart-qty-val { font-size:14px; font-weight:700; min-width:20px; text-align:center; }
.p-cart-del { margin-left:4px; background:none; border:none; color:var(--red-500); cursor:pointer; font-size:16px; }

/* Voucher input */
.p-voucher-row { display:flex; gap:8px; }
.p-voucher-input { flex:1; padding:8px 12px; border:1.5px solid var(--gray-200); border-radius:8px; font-size:13px; outline:none; font-family:inherit; }
.p-voucher-input:focus { border-color:var(--green-500); }

/* Summary */
.p-summary-row { display:flex; justify-content:space-between; font-size:13px; margin-bottom:8px; }
.p-summary-label { color:var(--gray-500); }
.p-summary-total { display:flex; justify-content:space-between; font-size:16px; font-weight:800; padding-top:8px; border-top:1.5px solid var(--gray-200); }
.p-summary-total .green { color:var(--green-700); }

/* Address card */
.p-addr-card { border-radius:10px; padding:12px; margin-bottom:10px; }
.p-addr-card.main { border:1px solid #bbf7d0; background:#f0fdf4; }
.p-addr-card:not(.main) { border:1px solid var(--gray-200); background:#fff; }
.p-addr-header { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:4px; }
.p-addr-label-group { display:flex; gap:6px; align-items:center; }
.p-addr-label { font-size:13px; font-weight:700; }
.p-addr-main-badge { font-size:10px; font-weight:600; background:#dcfce7; color:var(--green-700); padding:1px 6px; border-radius:99px; }

/* Banner */
.p-banner { background:linear-gradient(135deg,var(--green-700),#166534); border-radius:12px; padding:16px; margin-bottom:16px; color:#fff; }
.p-banner-sub { font-size:11px; opacity:.8; margin-bottom:4px; }
.p-banner-title { font-size:18px; font-weight:800; margin-bottom:4px; }
.p-banner-desc { font-size:12px; opacity:.9; }

/* ETA box */
.p-eta { background:#f0fdf4; border-radius:8px; padding:6px 10px; margin-top:8px; font-size:12px; color:var(--green-700); font-weight:600; }

/* Section title */
.p-section-title { font-size:15px; font-weight:700; margin-bottom:10px; color:var(--gray-900); }

/* Empty state */
.p-empty { text-align:center; padding:48px 20px; }
.p-empty-icon { font-size:44px; margin-bottom:10px; }
.p-empty-title { font-size:15px; font-weight:700; margin-bottom:6px; }
.p-empty-desc { font-size:13px; color:var(--gray-500); }

/* Couriers checkbox */
.p-checkbox-row { display:flex; align-items:center; gap:8px; margin-bottom:6px; cursor:pointer; }
.p-checkbox-row input[type="checkbox"] { accent-color:var(--green-700); width:16px; height:16px; }
.p-checkbox-row span { font-size:13px; }

/* Status change buttons */
.p-status-grid { display:flex; gap:6px; flex-wrap:wrap; }
.p-status-btn { padding:5px 10px; border-radius:8px; font-size:11px; font-weight:600; cursor:pointer; font-family:inherit; transition:var(--transition); }
.p-status-btn.active { border:2px solid var(--green-700); background:#dcfce7; color:var(--green-700); }
.p-status-btn:not(.active) { border:1px solid var(--gray-200); background:#fff; color:var(--gray-700); }

/* ===== TYPOGRAPHY & TOUCH TARGETS ===== */
.p-btn, .panel-back-btn, .panel-nav-btn, .p-modal-close, .p-cart-qty-btn, .p-cart-del { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; }

/* ===== IMAGE CONSISTENCY ===== */
.pu-prod-thumb, .pu-flash-thumb, .pu-cart-thumb, .pu-wish-thumb {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1;
  position: relative;
  overflow: hidden;
}
.pu-prod-thumb img, .pu-flash-thumb img, .pu-cart-thumb img, .pu-wish-thumb img {
  width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0;
}

/* ===== RESPONSIVE BREAKPOINTS (Mobile-First) ===== */
.panel-bottomnav { padding-bottom: env(safe-area-inset-bottom, 0); }

/* Small Phone (< 360px) */
@media(max-width: 359px) {
  .p-user-product-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .p-user-product-name { font-size: 11px; }
  .p-user-product-price { font-size: 12px; }
  .p-banner-title { font-size: 16px; }
  .p-flash-item { width: 100px; }
}

/* Normal Phone (>= 360px) - default 2 columns */
@media(min-width: 360px) {
  .p-user-product-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

/* Large Phone (>= 480px) */
@media(min-width: 480px) {
  .p-user-product-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .p-banner { border-radius: 12px; }
}

/* Tablet (>= 768px) */
@media(min-width: 768px) {
  .p-user-product-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .p-user-product-name { font-size: 13px; }
  .p-user-product-price { font-size: 15px; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .panel-bottomnav { left: 50%; transform: translateX(-50%); padding-bottom: 0; }
  .p-modal { border-radius: 16px; margin-bottom: 40px; }
  .p-modal-overlay { align-items: center; }
  .p-banner-title { font-size: 22px; }
}

/* Desktop (>= 1024px) */
@media(min-width: 1024px) {
  .p-user-product-grid { grid-template-columns: repeat(5, 1fr); gap: 14px; }
}

