:root{
  --orange:#FB4B1E; --orange-2:#FF7A3D; --orange-soft:#FFEDE7;
  --ink:#1a1a1a; --muted:#8a8a8a; --line:#eceae6; --bg:#f6f5f2;
  --green:#16A34A; --amber:#B26A00; --red:#C0392B; --purple:#6C4BF6;
}
*{box-sizing:border-box}
body{margin:0;font-family:'Plus Jakarta Sans',system-ui,-apple-system,Segoe UI,Roboto,sans-serif;background:var(--bg);color:var(--ink)}
a{color:inherit;text-decoration:none}
.ms{font-family:'Material Symbols Rounded';font-weight:400;line-height:1;vertical-align:middle;-webkit-font-smoothing:antialiased}

/* ---------- Shell dashboard (kasir/owner/admin) ---------- */
.shell{display:flex;min-height:100vh}
.sidebar{width:230px;flex:none;display:flex;flex-direction:column;padding:18px 14px;color:#cbb8ac}
.sidebar--kasir{background:#241d19}
.sidebar--owner{background:#fff;border-right:1px solid var(--line);color:#6b6560}
.sidebar--admin{background:#1a1730;color:#a29fc0}
.brand{display:flex;align-items:center;gap:10px;padding:4px 8px 16px;font-weight:800;font-size:17px}
.brand .logo{width:34px;height:34px;border-radius:9px;background:var(--orange);display:flex;align-items:center;justify-content:center}
.brand .logo .ms{color:#fff;font-size:20px}
.sidebar--owner .brand{color:var(--ink)}
.sidebar--owner .brand span b{color:var(--orange)}
.nav{display:flex;align-items:center;gap:11px;padding:10px 13px;border-radius:10px;font-size:13px;font-weight:600;margin-bottom:2px;color:inherit}
.nav .ms{font-size:20px}
.nav .badge{margin-left:auto;font-size:9px;font-weight:800;padding:1px 6px;border-radius:8px;background:var(--orange);color:#fff}
.sidebar--kasir .nav.on{background:linear-gradient(90deg,var(--orange),var(--orange-2));color:#fff}
.sidebar--owner .nav.on{background:var(--orange-soft);color:var(--orange);font-weight:800}
.sidebar--admin .nav.on{background:linear-gradient(90deg,#6C4BF6,#8B6CFF);color:#fff}
.side-foot{margin-top:auto;display:flex;align-items:center;gap:9px;padding:12px 8px 0;border-top:1px solid rgba(255,255,255,.08)}
.sidebar--owner .side-foot{border-top:1px solid var(--line)}
.side-foot .av{width:34px;height:34px;border-radius:50%;background:var(--orange-soft);display:flex;align-items:center;justify-content:center;color:var(--orange);font-weight:800}
.main{flex:1;min-width:0;display:flex;flex-direction:column}
.topbar{background:#fff;border-bottom:1px solid var(--line);padding:14px 26px;display:flex;align-items:center;gap:14px}
.topbar h1{margin:0;font-size:19px;font-weight:800}
.content{padding:22px 26px;overflow-y:auto}

/* ---------- Kartu, KPI, tabel ---------- */
.grid{display:grid;gap:14px}
.grid-kpi{grid-template-columns:repeat(4,1fr)}
.grid-2{grid-template-columns:1fr 1fr}
.grid-2-wide{grid-template-columns:1.5fr 1fr}
.grid-3{grid-template-columns:repeat(3,1fr)}
.card{background:#fff;border:1px solid var(--line);border-radius:14px;min-width:0}
.kpi{padding:16px 17px}
.kpi .top{display:flex;align-items:center;justify-content:space-between}
.kpi .lbl{font-size:11.5px;color:var(--muted);font-weight:600}
.kpi .ic{width:30px;height:30px;border-radius:9px;background:var(--orange-soft);display:flex;align-items:center;justify-content:center;flex:none}
.kpi .ic .ms{font-size:18px;color:var(--orange)}
.kpi .val{font-size:23px;font-weight:800;margin-top:10px;word-break:break-word}
.kpi .delta{font-size:11px;margin-top:3px;font-weight:600;color:var(--green)}
.table{width:100%;border-collapse:collapse;font-size:12.5px}
.table thead th{background:#faf9f7;color:var(--muted);font-size:11px;font-weight:800;text-align:left;padding:12px 16px;letter-spacing:.3px}
.table tbody td{border-top:1px solid #f4f4f4;padding:12px 16px;vertical-align:middle}
.pill{font-size:10.5px;font-weight:800;padding:3px 9px;border-radius:8px;display:inline-flex;align-items:center;gap:4px}
.pill.green{background:#EAF6EE;color:var(--green)} .pill.amber{background:#FFF4E5;color:var(--amber)}
.pill.red{background:#FEE9E7;color:var(--red)} .pill.orange{background:var(--orange-soft);color:var(--orange)}
.btn{display:inline-flex;align-items:center;gap:7px;font-weight:800;font-size:13px;padding:10px 18px;border-radius:10px;border:0;cursor:pointer;font-family:inherit}
.btn-primary{background:var(--orange);color:#fff} .btn-green{background:var(--green);color:#fff}
.btn-ghost{background:#fff;border:1px solid var(--line);color:#555}
.btn-purple{background:linear-gradient(90deg,#6C4BF6,#8B6CFF);color:#fff}
.flash{padding:11px 16px;border-radius:11px;font-size:13px;font-weight:600;margin-bottom:16px}
.flash.ok{background:#EAF6EE;color:var(--green)} .flash.err{background:#FEE9E7;color:var(--red)}
.dash-row{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:16px}
.dash-list-item{display:flex;align-items:center;gap:11px;padding:9px 0;border-bottom:1px solid #f5f5f5;min-width:0}
.dash-list-item .meta{flex:1;min-width:0}
.dash-list-item .meta .nm{font-size:12.5px;font-weight:700;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dash-list-item .meta .sub{font-size:10.5px;color:var(--muted)}
.dash-list-item .aside{flex:none;text-align:right}

/* ---------- Product form (owner/kasir) ---------- */
.product-form-shell{max-width:820px;margin:0 auto 26px}
.product-back{font-size:13px;color:var(--muted);display:inline-flex;align-items:center;gap:5px;margin-bottom:14px;font-weight:700}
.product-form{display:grid;gap:12px;padding-bottom:72px}
.product-tip{display:flex;align-items:flex-start;gap:10px;background:#FFF8E9;border:1px solid #FFE0AE;color:#6F4A00;border-radius:13px;padding:12px 14px;font-size:12.5px;font-weight:600;line-height:1.45}
.product-tip .ms{font-size:19px;color:#F59E0B;flex:none;margin-top:1px}
.product-section{background:#fff;border:1px solid var(--line);border-radius:16px;overflow:hidden}
.product-section.pad{padding:16px}
.product-section-title{font-size:13px;font-weight:800;margin:0 0 12px;display:flex;align-items:center;gap:7px}
.product-photo-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.product-photo-head .product-section-title{margin:0}
.product-photo-count{font-size:11px;color:#9aa0a6;font-weight:700;flex:none}
.product-photo-grid{display:flex;gap:12px;flex-wrap:wrap;align-items:flex-start}
.product-photo-previews{display:contents}
.product-photo-thumb{width:112px;height:112px;border-radius:12px;background:#f2f2f2;border:1px solid var(--line);overflow:hidden;position:relative;flex:none}
.product-photo-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.product-photo-thumb .product-photo-badge{position:absolute;left:0;right:0;bottom:0;background:#FB4B1E;color:#fff;font-size:8.5px;font-weight:800;text-align:center;padding:3px 0;letter-spacing:.01em}
.product-photo-thumb .product-photo-remove{position:absolute;top:5px;right:5px;width:22px;height:22px;border:0;border-radius:50%;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.18);display:flex;align-items:center;justify-content:center;cursor:pointer;padding:0;color:#C0392B;line-height:1}
.product-photo-thumb .product-photo-remove .ms{font-size:14px}
.product-photo-thumb .product-photo-remove:hover{background:#FFF5F3}
.product-photo-box{width:112px;height:112px;border:1.5px dashed #D88B78;border-radius:12px;background:#fff;color:#C65A44;display:flex;align-items:center;justify-content:center;text-align:center;font-size:12px;font-weight:800;line-height:1.25;cursor:pointer;position:relative;overflow:hidden;flex:none}
.product-photo-box.is-hidden{display:none}
.product-photo-box .ms{display:block;font-size:22px;margin-bottom:4px}
.product-photo-box input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;font-size:0;border:0;padding:0;margin:0}
.product-photo-note{font-size:11.5px;color:var(--muted);line-height:1.5;align-self:center;max-width:420px}

/* Video produk — selaras dengan grid foto */
.product-video-section{margin-top:18px;padding-top:16px;border-top:1px dashed #ebe6e2}
.product-video-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.product-video-head .product-section-title{margin:0}
.product-video-optional{font-size:11px;color:#9aa0a6;font-weight:700;flex:none}
.product-video-grid{display:flex;gap:12px;flex-wrap:wrap;align-items:flex-start}
.product-video-box{width:112px;height:112px;border:1.5px dashed #D88B78;border-radius:12px;background:#fff;color:#C65A44;display:flex;align-items:center;justify-content:center;text-align:center;font-size:12px;font-weight:800;line-height:1.25;cursor:pointer;position:relative;overflow:hidden;flex:none;margin:0}
.product-video-box.is-hidden{display:none}
.product-video-box .ms{display:block;font-size:22px;margin-bottom:4px}
.product-video-box input[type="file"]{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;font-size:0;border:0;padding:0;margin:0}
.product-video-preview{width:112px;height:112px;border-radius:12px;background:#1a1a1a;border:1px solid var(--line);overflow:hidden;position:relative;flex:none}
.product-video-preview[hidden]{display:none!important}
.product-video-preview video{width:100%;height:100%;object-fit:cover;display:block;background:#111}
.product-video-badge{position:absolute;left:0;right:0;bottom:0;background:#FB4B1E;color:#fff;font-size:8.5px;font-weight:800;text-align:center;padding:3px 0;letter-spacing:.01em;z-index:1}
.product-video-remove{position:absolute;top:5px;right:5px;z-index:2;width:22px;height:22px;border:0;border-radius:50%;background:#fff;box-shadow:0 1px 4px rgba(0,0,0,.18);display:flex;align-items:center;justify-content:center;cursor:pointer;padding:0;color:#C0392B;line-height:1}
.product-video-remove .ms{font-size:14px}
.product-video-remove:hover{background:#FFF5F3}
.product-video-play{position:absolute;inset:0;z-index:1;border:0;background:rgba(0,0,0,.28);color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0;padding-bottom:14px}
.product-video-play .ms{font-size:36px;opacity:.95;filter:drop-shadow(0 1px 4px rgba(0,0,0,.35))}
.product-video-play:hover{background:rgba(0,0,0,.38)}
.product-video-note{font-size:11.5px;color:var(--muted);line-height:1.5;align-self:center;max-width:420px}
.product-video-status{margin-top:8px;font-size:11.5px;color:#2e7d32;font-weight:600}
.product-video-status:empty{display:none}
.product-video-status.is-error{color:#C0392B}
.product-video-progress{margin-top:8px;background:#f0ebe7;border-radius:999px;height:8px;overflow:hidden;position:relative}
.product-video-progress[hidden]{display:none!important}
.product-video-progress-bar{height:100%;width:0;background:linear-gradient(90deg,#FB4B1E,#FF8A3D);border-radius:999px;transition:width .15s ease}
.product-video-modal{position:fixed;inset:0;z-index:9999;display:flex;align-items:center;justify-content:center;padding:20px}
.product-video-modal-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.55)}
.product-video-modal-panel{position:relative;width:min(720px,100%);background:#000;border-radius:14px;overflow:hidden;box-shadow:0 16px 48px rgba(0,0,0,.35)}
.product-video-modal-panel video{width:100%;max-height:80vh;display:block;background:#000}
.product-video-modal-close{position:absolute;top:10px;right:10px;z-index:2;width:34px;height:34px;border:0;border-radius:50%;background:rgba(255,255,255,.92);color:#333;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0}
.product-video-modal-close .ms{font-size:18px}

.product-fields{display:grid;gap:0}
.product-row{display:grid;grid-template-columns:190px 1fr;gap:14px;align-items:center;padding:15px 16px;border-top:1px solid #f2f0ee}
.product-row:first-child{border-top:0}
.product-row-label{display:flex;align-items:center;gap:9px;font-size:14px;font-weight:800;color:#2d2d2d;min-width:0}
.product-row-label .ms{font-size:21px;color:#6c7075;flex:none}
.product-row-label small{font-size:10.5px;color:var(--muted);font-weight:700;margin-left:2px}
.req{color:#d64545}
.product-control{min-width:0}
.product-control.inline{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.product-input,.product-select,.product-textarea{width:100%;border:1px solid transparent;background:#fff;border-radius:10px;padding:10px 0;font-family:inherit;font-size:14px;color:var(--ink);outline:none;text-align:right}
.product-input::placeholder,.product-textarea::placeholder{color:#b8b8b8}
.product-textarea{min-height:72px;resize:vertical;text-align:left;line-height:1.5}
.product-select{appearance:none}
.product-input:focus,.product-select:focus,.product-textarea:focus{border-color:#FFD3C6;padding-left:11px;padding-right:11px;background:#FFFCFB}
.product-counter{font-size:11.5px;color:#b0b0b0;margin-top:4px;text-align:right}
.product-multi-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.product-mini-field label{display:block;font-size:11px;font-weight:800;color:var(--muted);margin-bottom:4px}
.product-mini-field .product-input{text-align:left;border:1px solid var(--line);padding:10px 11px}
.product-switch-line{display:flex;align-items:center;justify-content:space-between;gap:12px}
.product-switch{position:relative;display:inline-flex;width:44px;height:25px;flex:none}
.product-switch input{opacity:0;width:0;height:0}
.product-switch span{position:absolute;inset:0;border-radius:999px;background:#e8e8e8;transition:.18s;box-shadow:inset 0 1px 3px rgba(0,0,0,.08)}
.product-switch span:before{content:"";position:absolute;width:21px;height:21px;left:2px;top:2px;background:#fff;border-radius:50%;transition:.18s;box-shadow:0 2px 6px rgba(0,0,0,.18)}
.product-switch input:checked + span{background:var(--green)}
.product-switch input:checked + span:before{transform:translateX(19px)}
.product-muted-action{display:flex;align-items:center;justify-content:space-between;gap:10px;color:#3f3f3f;font-size:14px;font-weight:800}
.product-muted-action span:last-child{color:var(--muted);font-weight:700;font-size:12.5px}

/* Grosir bertingkat */
.wholesale-builder{display:grid;gap:10px}
.wholesale-list{display:grid;gap:8px}
.wholesale-row{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;align-items:end}
.wholesale-field label{display:block;font-size:11px;font-weight:700;color:#666;margin-bottom:4px}
.wholesale-remove{width:40px;height:40px;border:1px solid var(--line);border-radius:9px;background:#fff;color:#C0392B;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;padding:0;flex:none}
.wholesale-remove .ms{font-size:18px}
.wholesale-remove:hover{background:#FFF5F3;border-color:#F5C4BC}
.wholesale-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.wholesale-actions .btn:disabled{opacity:.45;cursor:not-allowed}

.product-footer{position:sticky;bottom:0;background:rgba(246,245,242,.94);backdrop-filter:blur(10px);border-top:1px solid var(--line);display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:12px 0 0;margin-top:-60px;z-index:5}
.product-footer .btn{justify-content:center;padding:13px 16px}
.product-footer.single{grid-template-columns:1fr}
.product-empty-note{font-size:11.5px;color:var(--muted);line-height:1.5;margin-top:8px}

/* ---------- Owner produk list ---------- */
.produk-page{display:block}
.produk-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;flex-wrap:wrap}
.produk-toolbar-meta{font-size:12px;color:var(--muted)}
.produk-toolbar-actions{display:flex;gap:9px;flex-wrap:wrap}
.produk-layout{display:flex;gap:24px;align-items:flex-start}
.produk-main{flex:1;min-width:0;width:100%}
.produk-table-card{overflow:hidden}
.table-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch}
.produk-cell-name{display:flex;align-items:center;gap:10px;min-width:0}
.produk-thumb{width:38px;height:38px;border-radius:9px;background:#f2f2f2;display:flex;align-items:center;justify-content:center;flex:none;overflow:hidden;position:relative}
.produk-thumb .ms{font-size:18px;color:#c8c8c8}
.produk-thumb img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.produk-name-wrap{display:flex;flex-direction:column;align-items:flex-start;gap:4px;min-width:0}
.produk-name{font-weight:700;color:#333;line-height:1.3;word-break:break-word}
.produk-edit-btn{padding:6px 11px;font-size:12px}
.produk-salin-modal{position:fixed;inset:0;z-index:9000;display:flex;align-items:center;justify-content:center;padding:16px}
.produk-salin-modal[hidden]{display:none!important}
.produk-salin-modal-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.4)}
.produk-salin{position:relative;z-index:1;width:min(340px,100%);padding:18px 18px 16px;border-color:var(--orange);box-shadow:0 16px 40px rgba(0,0,0,.18);max-height:min(90vh,560px);overflow:auto}
.produk-salin-close{position:absolute;top:10px;right:10px;width:32px;height:32px;border:0;border-radius:50%;background:#f3f1ee;color:#666;cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0}
.produk-salin-close .ms{font-size:18px}
.produk-salin-close:hover{background:#ebe8e4;color:#333}
.produk-salin-head{display:flex;align-items:center;gap:8px;padding-right:28px}
.produk-salin-head .ms{color:var(--orange)}
.produk-salin-head b{font-size:14px}
.produk-salin-desc{font-size:11px;color:var(--muted);margin:8px 0 12px;line-height:1.45}
.produk-salin-label{font-size:11px;font-weight:700;color:var(--muted);margin-bottom:8px}
.produk-salin-item{display:flex;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid #f5f5f5;cursor:pointer}
.produk-salin-item span{flex:1;font-size:12.5px;font-weight:600}
.produk-salin-opt{display:flex;align-items:center;gap:8px;margin-top:12px;font-size:11.5px;color:#666;cursor:pointer}
.produk-salin-btn{width:100%;justify-content:center;margin-top:14px}

/* Variant builder (owner/kasir product form) */
.variant-builder{display:grid;gap:12px}
.variant-group-row{display:grid;gap:8px;padding:14px;border:1px solid var(--line);border-radius:12px;background:#fafafa}
.variant-group-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.variant-group-num{font-size:13px;font-weight:800;color:var(--ink)}
.variant-field-label,.variant-opts-label{font-size:11.5px;font-weight:700;color:#666;margin-top:2px}
.variant-group-row .product-input{text-align:left;border:1px solid var(--line);padding:10px 11px;background:#fff}
.variant-group-row .variant-remove{padding:6px 12px;font-size:12px}
.variant-opts{display:grid;gap:8px}
.variant-opt-row{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:center}
.variant-opt-remove{width:36px;height:36px;border:1px solid var(--line);border-radius:9px;background:#fff;color:#C0392B;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;padding:0}
.variant-opt-remove .ms{font-size:18px}
.variant-opt-remove:hover{background:#FFF5F3;border-color:#F5C4BC}
.variant-add-opt{justify-self:start;padding:7px 12px;font-size:12px;margin-top:2px}
.variant-builder-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}

/* ---------- Laporan filter ---------- */
.laporan-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px;flex-wrap:wrap}
.laporan-filter{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap;min-width:0;flex:1}
.laporan-field{display:flex;flex-direction:column;gap:4px;min-width:0}
.laporan-field label{font-size:12px;color:var(--muted);font-weight:600}
.laporan-field input[type="date"]{border:1px solid var(--line);border-radius:8px;padding:7px 10px;font-size:12.5px;font-family:inherit;background:#fff;max-width:100%}
.laporan-filter-btn{padding:8px 16px;flex:none}
.laporan-print-btn{padding:8px 16px;flex:none}

/* ---------- Auth ---------- */
.auth-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:20px;
  background:linear-gradient(135deg,var(--orange),var(--orange-2))}
.auth-card{background:#fff;border-radius:22px;width:100%;max-width:400px;padding:32px 30px;box-shadow:0 24px 64px rgba(0,0,0,.2)}
.auth-card .brand{justify-content:center;font-size:22px;padding-bottom:6px}
.auth-card h2{margin:6px 0 2px;font-size:20px;font-weight:800;text-align:center}
.auth-card p.sub{margin:0 0 22px;text-align:center;color:var(--muted);font-size:13px}
.field{margin-bottom:14px}
.field label{display:block;font-size:12px;font-weight:700;margin-bottom:6px;color:#444}
.field input{width:100%;border:1px solid #e2e2e2;border-radius:10px;padding:12px 14px;font-size:14px;font-family:inherit;outline:none}
.field input:focus{border-color:var(--orange)}
.auth-card .btn-primary{width:100%;justify-content:center;padding:13px;font-size:14px}
.demo{margin-top:18px;border-top:1px solid #f0f0f0;padding-top:14px;font-size:11px;color:var(--muted);line-height:1.7}
.demo b{color:#444}

/* ---------- Mobile menu (drawer) ---------- */
.nav-toggle{display:none;align-items:center;justify-content:center;width:40px;height:40px;flex:none;
  border:1px solid var(--line);background:#fff;border-radius:10px;color:var(--ink);cursor:pointer}
.nav-toggle .ms{font-size:22px}
.nav-backdrop{display:none;position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:55}
.chat-back{display:none}

/* ---------- Responsive ---------- */
@media(max-width:860px){
  .content{padding:16px;overflow-x:hidden}
  .topbar{padding:12px 16px;gap:10px}
  .topbar h1{font-size:16px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .nav-toggle{display:inline-flex}

  /* Sidebar becomes a slide-in drawer */
  .sidebar{position:fixed;top:0;left:0;bottom:0;z-index:60;width:250px;max-width:82vw;
    transform:translateX(-100%);transition:transform .25s ease;box-shadow:0 0 40px rgba(0,0,0,.35)}
  .shell.nav-open .sidebar{transform:none}
  .shell.nav-open .nav-backdrop{display:block}

  /* Panel grids: stack on tablet/phone (override inline columns) */
  .content .grid{grid-template-columns:1fr !important}
  .grid-2,
  .grid-2-wide,
  .grid-3{grid-template-columns:1fr !important}
  .content .grid.grid-kpi,
  .grid-kpi{grid-template-columns:1fr 1fr !important}
  .kpi .val{font-size:20px}

  /* Wide tables scroll horizontally instead of overflowing */
  .table{display:block;overflow-x:auto;white-space:nowrap;-webkit-overflow-scrolling:touch}

  /* Chat: satu kolom — tampilkan daftar ATAU thread, tidak keduanya */
  .chat-grid{grid-template-columns:1fr !important}
  .chat-grid.has-active .chat-list{display:none}
  .chat-grid:not(.has-active) .chat-thread{display:none}
  .chat-back{display:inline-flex;align-items:center}
  .chat-thread{min-height:calc(100vh - 150px)}
  .chat-msgs{max-height:none !important;flex:1}
  .product-form-shell{max-width:100%;margin-bottom:18px;width:100%}
  .product-form{padding-bottom:92px}
  .product-tip{padding:11px 12px;font-size:12px}
  .product-section.pad{padding:14px}
  .product-row{grid-template-columns:1fr;gap:7px;padding:14px}
  .product-row-label{font-size:13px}
  .product-row-label .ms{font-size:18px}
  .product-input,.product-select,.product-textarea{text-align:left;border:1px solid var(--line);padding:10px 11px;font-size:16px}
  .product-counter{text-align:left}
  .product-control.inline,.product-multi-grid{grid-template-columns:1fr 1fr}
  .product-photo-grid{align-items:flex-start}
  .product-photo-thumb,.product-photo-box{width:88px;height:88px}
  .product-photo-note{max-width:none;flex:1 1 100%}
  .product-video-box,.product-video-preview{width:88px;height:88px}
  .product-video-note{max-width:none;flex:1 1 100%}
  .product-video-play .ms{font-size:30px}
  .wholesale-row{grid-template-columns:1fr 1fr auto}
  .product-switch-line{align-items:flex-start}
  .product-muted-action{flex-direction:column;align-items:flex-start;gap:4px}
  .product-footer{position:fixed;left:0;right:0;bottom:0;padding:10px 16px calc(10px + env(safe-area-inset-bottom));margin:0;background:rgba(246,245,242,.97)}

  /* Produk list */
  .produk-layout{flex-direction:column;gap:14px}
  .produk-salin{width:min(340px,100%)}
  .produk-toolbar{align-items:stretch}
  .produk-toolbar-actions{width:100%}
  .produk-toolbar-actions .btn{flex:1;justify-content:center;min-width:0;padding:10px 12px;font-size:12.5px}
  .col-hide-md{display:none}
  .produk-table-card .table{display:table;width:100%;white-space:normal;font-size:12px}
  .produk-table-card .table thead th,
  .produk-table-card .table tbody td{padding:10px 10px;white-space:normal}
  .produk-thumb{width:34px;height:34px}

  /* Laporan: filter tanggal full-width di HP */
  .laporan-toolbar{flex-direction:column;align-items:stretch}
  .laporan-filter{width:100%;display:grid;grid-template-columns:1fr 1fr;gap:10px;align-items:end}
  .laporan-filter-btn{grid-column:1 / -1;width:100%;justify-content:center;padding:11px 16px}
  .laporan-field input[type="date"]{width:100%;padding:10px 11px;font-size:16px}
  .laporan-print-btn{width:100%;justify-content:center}
}

@media(max-width:520px){
  /* Condense the user block in the topbar on small phones */
  .topbar .side-foot > div{display:none}
  .content .grid.grid-kpi,
  .grid-kpi{grid-template-columns:1fr !important}
  .kpi{padding:14px 15px}
  .kpi .val{font-size:22px}
  .dash-row .btn{width:100%;justify-content:center}

  .col-hide-sm{display:none}
  .produk-edit-btn .edit-label{display:none}
  .produk-edit-btn{padding:6px 8px}
  .product-multi-grid{grid-template-columns:1fr}
  .produk-toolbar-actions{flex-direction:column}
  .produk-toolbar-actions .btn{width:100%}
}
