/* ============ Tegar Jaya Motor Sparepart design system ============ */
:root {
  --brand: #e02d2d;
  --brand-dark: #b92020;
  --brand-soft: #fdecec;
  --ink: #16181d;
  --muted: #667085;
  --line: #e5e7eb;
  --bg: #f5f6f8;
  --card: #ffffff;
  --ok: #0f9960;
  --ok-soft: #e6f6ef;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, 0.18);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.brand-mark { display: grid; place-items: center; }
.brand-text span { color: var(--brand); }
.header-nav { display: flex; gap: 6px; align-items: center; }
.nav-link { padding: 8px 14px; border-radius: 10px; font-weight: 600; color: var(--muted); }
.nav-link:hover { background: var(--bg); color: var(--ink); }
.nav-link.active { color: var(--brand); background: var(--brand-soft); }

/* ---------- hero ---------- */
.hero {
  background: radial-gradient(1200px 500px at 85% -20%, rgba(224, 45, 45, 0.35), transparent 60%),
              linear-gradient(135deg, #191c23 0%, #23272f 55%, #2a1d1d 100%);
  color: #fff;
  padding: 56px 0 64px;
  margin-bottom: 28px;
}
.hero h1 { font-size: clamp(26px, 4vw, 40px); font-weight: 800; letter-spacing: -0.03em; margin: 0 0 10px; }
.hero h1 em { font-style: normal; color: #ff8f8f; }
.hero p { color: #c9ced9; max-width: 560px; margin: 0 0 24px; font-size: 16px; }
.hero-search { display: flex; gap: 10px; max-width: 640px; background: #fff; padding: 8px; border-radius: 14px; box-shadow: var(--shadow-lg); }
.hero-search input { flex: 1; border: 0; outline: 0; padding: 10px 14px; font-size: 15px; border-radius: 10px; color: var(--ink); background: transparent; }
.hero-stats { display: flex; gap: 28px; margin-top: 30px; flex-wrap: wrap; }
.hero-stat b { display: block; font-size: 22px; letter-spacing: -0.02em; }
.hero-stat span { color: #aab1bf; font-size: 13px; }

/* ---------- filter bar ---------- */
.filterbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 18px; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 13.5px;
  transition: all 0.15s;
}
.chip:hover { border-color: #cfd4dc; color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.filterbar .spacer { flex: 1; }
.select {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 8px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 600;
}

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 18px; padding-bottom: 48px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform 0.18s, box-shadow 0.18s;
  display: flex; flex-direction: column; position: relative;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-img { aspect-ratio: 4 / 3; background: #eceef1; position: relative; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-img .badge { position: absolute; top: 10px; left: 10px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-sold { background: #fee4e2; color: #b42318; }
.badge-brand { background: rgba(22, 24, 29, 0.78); color: #fff; backdrop-filter: blur(4px); }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-weight: 700; font-size: 15px; line-height: 1.35; letter-spacing: -0.01em; }
.card-specs { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.card-specs span { display: inline-flex; align-items: center; gap: 5px; }
.card-foot { margin-top: auto; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-top: 8px; }
.price { font-weight: 800; font-size: 17px; color: var(--brand); letter-spacing: -0.02em; }
.card-loc { color: var(--muted); font-size: 12px; font-weight: 500; }

/* ---------- skeleton & empty ---------- */
.skeleton { border-radius: var(--radius); background: linear-gradient(100deg, #eceef1 40%, #f6f7f8 50%, #eceef1 60%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border: 1px solid var(--line); }
.skeleton .sk-img { aspect-ratio: 4/3; }
.skeleton .sk-line { height: 13px; margin: 14px 16px; border-radius: 6px; }
.skeleton .sk-line.w60 { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty {
  grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: var(--muted);
  background: #fff; border: 1px dashed var(--line); border-radius: var(--radius);
}
.empty b { color: var(--ink); display: block; font-size: 17px; margin-bottom: 6px; }

/* ---------- detail ---------- */
.detail-wrap { display: grid; grid-template-columns: 1.6fr 1fr; gap: 22px; padding: 8px 0 48px; align-items: start; }
@media (max-width: 860px) { .detail-wrap { grid-template-columns: 1fr; } }
.crumb { color: var(--muted); font-size: 13px; margin: 18px 0 14px; font-weight: 500; }
.crumb a:hover { color: var(--brand); }
.gallery-main { aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden; background: #eceef1; border: 1px solid var(--line); position: relative; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.gallery-thumbs button { border: 2px solid transparent; border-radius: 10px; overflow: hidden; width: 92px; flex: 0 0 auto; padding: 0; background: #eceef1; }
.gallery-thumbs button.active { border-color: var(--brand); }
.gallery-thumbs img { aspect-ratio: 4/3; object-fit: cover; width: 100%; height: 100%; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-pad { padding: 20px; }
.price-panel { position: sticky; top: 78px; }
.price-big { font-size: 30px; font-weight: 800; color: var(--brand); letter-spacing: -0.03em; }
.price-note { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.spec-table td { padding: 9px 0; border-bottom: 1px dashed var(--line); }
.spec-table td:first-child { color: var(--muted); width: 42%; font-weight: 500; }
.spec-table td:last-child { font-weight: 700; }
.spec-table tr:last-child td { border-bottom: 0; }
.desc { white-space: pre-wrap; color: #344054; }
.wa-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  background: #16a34a; color: #fff; border: 0; border-radius: 12px;
  padding: 13px 18px; font-weight: 700; font-size: 15px; transition: background 0.15s;
}
.wa-btn:hover { background: #128a3e; }
.section-title { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; margin: 34px 0 14px; }

/* ---------- admin ---------- */
.admin-wrap { max-width: 1120px; margin: 0 auto; padding: 26px 20px 60px; }
.login-card { max-width: 400px; margin: 60px auto; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-head h2 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.tabs { display: flex; gap: 6px; background: #fff; border: 1px solid var(--line); padding: 5px; border-radius: 12px; width: max-content; }
.tab { border: 0; background: transparent; padding: 8px 16px; border-radius: 9px; font-weight: 700; color: var(--muted); }
.tab.active { background: var(--ink); color: #fff; }
.table-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid #f0f1f3; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: #fafbfc; }
.tbl .row-title { font-weight: 700; }
.tbl .row-sub { color: var(--muted); font-size: 12px; }
.thumb-sm { width: 62px; height: 46px; object-fit: cover; border-radius: 8px; background: #eceef1; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 9px 16px; font-weight: 700; font-size: 14px; transition: all 0.15s;
}
.btn:hover { background: #f6f7f8; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #2b2f38; }
.btn-danger { color: #b42318; border-color: #fecdca; background: #fff; }
.btn-danger:hover { background: #fef3f2; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 700; font-size: 13px; color: #344054; }
.field .hint { font-weight: 500; color: var(--muted); font-size: 12px; }
.input, .field input, .field select, .field textarea {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  background: #fff; color: var(--ink); outline: none; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .span2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.dropzone {
  border: 2px dashed #cfd4dc; border-radius: var(--radius); background: #fafbfc;
  padding: 26px 16px; text-align: center; color: var(--muted); cursor: pointer;
  transition: all 0.15s; font-weight: 600;
}
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.dropzone b { color: var(--ink); }
.dz-hint { font-size: 12px; margin-top: 6px; font-weight: 500; }
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; }
.thumb-item { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #eceef1; }
.thumb-item img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.thumb-item .badge { position: absolute; top: 6px; left: 6px; }
.thumb-actions { display: flex; border-top: 1px solid var(--line); background: #fff; }
.thumb-actions button { flex: 1; border: 0; background: transparent; padding: 7px 4px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.thumb-actions button:hover { color: var(--ink); background: #f6f7f8; }
.thumb-actions button.del { color: #b42318; border-left: 1px solid var(--line); }
.thumb-actions button.del:hover { background: #fef3f2; }

.storage-card { display: flex; gap: 14px; align-items: center; }
.storage-ico { width: 46px; height: 46px; border-radius: 12px; background: var(--brand-soft); display: grid; place-items: center; color: var(--brand); font-size: 20px; font-weight: 800; }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(16, 20, 28, 0.55); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 30px 14px;
  overflow-y: auto; backdrop-filter: blur(3px);
}
.modal {
  background: #fff; border-radius: 16px; width: 100%; max-width: 720px;
  box-shadow: var(--shadow-lg); animation: pop 0.18s ease;
}
.modal.narrow { max-width: 440px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; border-radius: 16px 16px 0 0; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-close { border: 0; background: transparent; font-size: 22px; color: var(--muted); line-height: 1; padding: 4px 8px; border-radius: 8px; }
.modal-close:hover { background: var(--bg); color: var(--ink); }
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: #fff; border-radius: 0 0 16px 16px; }
@keyframes pop { from { transform: translateY(8px) scale(0.98); opacity: 0; } }

/* ---------- toast ---------- */
.toast-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px;
  font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lg); animation: toastIn 0.2s ease;
  max-width: 90vw; text-align: center;
}
.toast.err { background: #b42318; }
.toast.ok { background: #0f9960; }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } }

/* ---------- footer ---------- */
.site-footer { background: #16181d; color: #9aa1af; padding: 34px 0; margin-top: 20px; font-size: 13.5px; }
.footer-inner { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.footer-inner b { color: #fff; display: block; margin-bottom: 4px; font-size: 14px; }

.view-root { min-height: calc(100vh - 62px - 130px); }
@media (max-width: 640px) {
  .hero { padding: 40px 0 48px; }
  .hero-stats { gap: 18px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .price { font-size: 15px; }
  .card-body { padding: 11px 12px 12px; }
  .card-title { font-size: 13.5px; }
}


/* Admin dashboard uses a standalone route and hides public-site navigation/footer. */
body.standalone-admin #siteHeader,
body.standalone-admin #siteFooter { display: none !important; }
body.standalone-admin .view-root { min-height: 100vh; padding-top: 24px; }
body.standalone-admin { background: var(--bg, #f7f8fa); }

/* Reference-inspired Tegar Jaya Motor sparepart storefront */
.topbar{background:#111318;color:#f7f7f8;font-size:11px}
.topbar-inner{min-height:26px;display:flex;align-items:center;justify-content:space-between;gap:16px}
.header-inner{height:68px;gap:22px}
.brand{min-width:225px;text-transform:uppercase;font-style:italic;font-size:21px;line-height:1.02}
.brand-mark svg{width:44px;height:44px}
.header-nav{flex:1;justify-content:flex-end;gap:2px}
.nav-link{border-radius:0;padding:22px 12px;font-size:13px;color:#202127;white-space:nowrap}
.nav-link.active{background:transparent;border-bottom:2px solid var(--brand);color:var(--brand)}
.admin-link{background:var(--brand);color:#fff;padding:11px 18px;border-radius:8px;font-size:13px;font-weight:800;white-space:nowrap}
.hero{position:relative;overflow:hidden;margin:0 0 18px;padding:24px 0 22px;min-height:310px;background:#101114 url('/images/sparepart-banner.jpg') no-repeat right center;background-size:auto 100%;}
.hero:before{content:"";position:absolute;inset:0;background:linear-gradient(90deg,rgba(12,13,16,.98) 0%,rgba(12,13,16,.92) 43%,rgba(12,13,16,.2) 100%)}
.hero .container{position:relative;z-index:1}
.hero-inner{display:flex;align-items:center;min-height:264px}
.hero-copy{width:min(100%,650px)}
.eyebrow{font-size:12px;letter-spacing:3px;font-weight:800;color:#ff333b;margin-bottom:4px}
.hero h1{font-size:clamp(30px,4.1vw,50px);line-height:1.03;margin:4px 0 8px;font-style:italic;text-transform:uppercase;max-width:700px}
.hero h1 em{color:#ed252d}
.hero p{font-size:15px;line-height:1.5;margin-bottom:12px;max-width:510px;color:#f1f1f3}
.hero-search{max-width:560px;border-radius:9px;padding:4px;gap:4px}
.hero-search input{padding:9px 14px;min-width:0}
.hero-search .btn{min-width:54px;padding:10px 16px}
.hero-benefits{display:flex;gap:24px;margin-top:16px;flex-wrap:wrap}
.hero-benefits span{display:flex;flex-direction:column;border-left:4px solid var(--brand);padding-left:10px;color:#fff;font-size:12px;line-height:1.35}
.hero-benefits small{color:#d4d4d8;font-size:11px;margin-top:2px}
.category-strip{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:10px;margin:18px 0 16px}
.category-tile{border:1px solid var(--line);background:#fff;border-radius:11px;padding:9px 6px 8px;min-width:0;text-align:center;overflow:hidden;cursor:pointer;color:inherit;font:inherit;transition:border-color .15s,box-shadow .15s}.category-tile.active{border-color:var(--brand);box-shadow:0 0 0 2px color-mix(in srgb,var(--brand) 14%,transparent)}
.category-tile img{width:100%;height:66px;object-fit:cover;object-position:75% center;border-radius:5px;margin-bottom:6px}
.category-tile b{display:block;font-size:11px;line-height:1.2;white-space:normal}
.catalog-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin:18px 0 8px}
.catalog-heading h2{font-size:23px;margin:0;font-weight:800;letter-spacing:-.03em}
.catalog-heading span{font-size:12px;color:var(--muted)}
#filterbar{margin-bottom:12px}
.grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;padding-bottom:48px}
.card{border-radius:10px}
.card-img{aspect-ratio:1.08/1;background:#fff;padding:8px}
.card-img img{object-fit:contain}
.card-body{padding:10px 12px 12px;gap:4px}
.card-title{font-size:13px;min-height:35px}
.card-specs{font-size:11px;gap:4px 8px}
.card-foot{display:block;padding-top:3px}
.price{font-size:16px;display:block}
.card .btn{display:block;width:100%;margin-top:5px;text-align:center}
.site-footer{background:#111318;color:#fff}
@media(max-width:900px){
 .topbar-inner span:nth-child(3),.topbar-inner span:nth-child(4){display:none}
 .brand{min-width:auto;font-size:18px}
 .header-inner{gap:8px}
 .header-nav{gap:0}
 .nav-link{padding:20px 7px;font-size:12px}
 .admin-link{padding:9px 10px;font-size:11px}
 .category-strip{grid-template-columns:repeat(4,minmax(0,1fr))}
 .grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:600px){
 .container{padding-left:16px;padding-right:16px}
 .topbar-inner{min-height:24px;font-size:10px;justify-content:center}
 .topbar-inner span:nth-child(2){display:none}
 .header-inner{height:70px;justify-content:space-between}
 .brand{font-size:17px;gap:7px;max-width:190px}
 .brand-mark svg{width:40px;height:40px}
 .header-nav{flex:0 0 auto}
 .header-nav .nav-link{display:none}
 .admin-link{font-size:0;padding:10px;width:42px;height:42px;display:grid;place-items:center}
 .admin-link:before{content:'☰';font-size:20px}
 .hero{padding:28px 0 25px;min-height:0;background-size:auto 100%;background-position:62% center}
 .hero:before{background:linear-gradient(90deg,rgba(12,13,16,.97),rgba(12,13,16,.86) 70%,rgba(12,13,16,.55))}
 .hero-inner{min-height:0}
 .hero-copy{width:100%}
 .eyebrow{font-size:9px;letter-spacing:1.8px}
 .hero h1{font-size:clamp(27px,7.6vw,36px);line-height:1.05;margin:8px 0}
 .hero p{font-size:13px;max-width:340px;margin-bottom:14px}
 .hero-search{width:100%;padding:4px;gap:3px}
 .hero-search input{font-size:13px;padding:10px 8px}
 .hero-search .btn{padding:9px 12px;font-size:13px}
 .hero-benefits{gap:12px;margin-top:18px}
 .hero-benefits span{font-size:10px;padding-left:7px;border-left-width:3px;flex:1;min-width:0}
 .hero-benefits small{font-size:9px}
 .category-strip{grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin:12px 0}
 .category-tile{padding:6px 4px;border-radius:9px}
 .category-tile img{height:55px;margin-bottom:4px}
 .category-tile b{font-size:10px}
 .catalog-heading{margin:18px 0 8px;align-items:flex-start;flex-direction:column;gap:0}
 .catalog-heading h2{font-size:20px}
 .catalog-heading span{font-size:11px}
 .grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
 .card-img{aspect-ratio:1/0.92;padding:5px}
 .card-body{padding:9px;gap:4px}
 .card-title{font-size:12px;min-height:32px}
 .card-specs{font-size:10px}
 .price{font-size:14px}
 .card .btn{font-size:11px;padding:8px 5px}
}
/* Admin operations: dashboard, POS, reports */
.admin-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:16px}.admin-stats small{color:var(--muted)}.admin-stats h2{margin:8px 0 0;font-size:clamp(20px,3vw,30px)}.admin-charts{display:grid;grid-template-columns:1.2fr 1fr;gap:16px;margin-bottom:16px}.bar-chart{display:flex;align-items:flex-end;gap:12px;min-height:210px;padding:16px 0 0}.bar-col{flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:8px}.bar-col b{font-size:10px;color:var(--muted);overflow-wrap:anywhere}.bar{width:min(34px,80%);background:var(--brand);border-radius:6px 6px 0 0}.bar-col small{font-size:11px}.pie-wrap{display:flex;gap:20px;align-items:center;flex-wrap:wrap;min-height:180px}.pie{width:150px;height:150px;flex-shrink:0;border-radius:50%}.legend{display:flex;align-items:center;gap:7px;font-size:13px;margin:8px 0}.legend i{width:10px;height:10px;border-radius:3px}.pos-layout{display:grid;grid-template-columns:1.1fr 1fr;gap:16px}.pos-layout label{display:block;font-size:13px;margin:12px 0 5px}.pos-layout input,.pos-layout select,.pos-layout textarea{width:100%;padding:10px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--text)}.pos-products{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px;max-height:520px;overflow:auto}.pos-product{border:1px solid var(--line);background:var(--surface);color:var(--text);padding:12px;border-radius:10px;text-align:left;display:flex;flex-direction:column;gap:5px}.pos-product small{color:var(--muted)}.cart-row{display:grid;grid-template-columns:1fr 65px auto;align-items:center;gap:8px;border-bottom:1px solid var(--line);padding:9px 0}.cart-row small{display:block;color:var(--muted)}.cart-row button{border:0;color:var(--brand);background:transparent}.ai-chat{padding:10px 0;max-height:350px;overflow:auto}.ai-chat p{padding:10px;background:var(--surface-2);border-radius:8px;overflow-wrap:anywhere}.admin-head{flex-wrap:wrap}.admin-head .tabs{flex-wrap:wrap;max-width:100%}.admin-head .tab{white-space:nowrap}
@media(max-width:760px){.admin-stats{grid-template-columns:1fr 1fr}.admin-charts,.pos-layout{grid-template-columns:1fr}.pie{width:120px;height:120px}.bar-chart{gap:5px}.bar-col b{font-size:9px}.admin-head>div{width:100%;flex-wrap:wrap}.admin-head .tabs{overflow-x:auto;flex-wrap:nowrap}.pos-products{grid-template-columns:1fr 1fr}}

/* ---------- admin workspace refresh ---------- */
body.standalone-admin{background:#f4f6f8;color:#17212b}
body.standalone-admin .view-root{padding-top:0}
.standalone-admin .admin-wrap{max-width:1380px;padding:28px clamp(14px,3vw,38px) 56px}
.standalone-admin .admin-head{align-items:flex-start;background:#fff;border:1px solid #e6eaf0;border-radius:18px;padding:18px 20px;box-shadow:0 8px 24px rgba(15,23,42,.045)}
.standalone-admin .admin-head h2{font-size:24px;font-weight:800;color:#17212b;padding-top:8px}
.standalone-admin .tabs{width:auto;max-width:100%;flex-wrap:wrap;background:#f5f7fa;border:0;border-radius:12px;padding:5px}
.standalone-admin .tab{padding:10px 13px;font-size:13px;border-radius:9px;transition:background .18s,color .18s}
.standalone-admin .tab.active{background:#17212b;color:white;box-shadow:0 2px 5px #17212b20}
.standalone-admin .panel{border-color:#e6eaf0;box-shadow:0 5px 20px rgba(15,23,42,.035);border-radius:16px}
.standalone-admin .panel-pad{padding:clamp(15px,2vw,22px)}
.standalone-admin .btn{cursor:pointer;transition:transform .15s,background .15s}
.standalone-admin .btn:active{transform:scale(.98)}
.standalone-admin .admin-stats .panel{background:linear-gradient(145deg,#fff,#fbfcfd)}
.standalone-admin .tbl th{background:#f6f8fa}
.standalone-admin .login-card{padding:28px}
.standalone-admin .login-card input{width:100%;box-sizing:border-box}
.wa-assistant{max-width:940px;margin:0 auto;overflow:hidden;display:flex;flex-direction:column;min-height:min(720px,calc(100vh - 190px));background:#e9e4dc!important;border:1px solid #dfe4e8!important}
.wa-chat-head{display:flex;align-items:center;gap:12px;padding:15px 18px;background:#f8fafb;border-bottom:1px solid #e1e6e9}
.wa-avatar{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:#176b5b;color:#fff;font-size:14px;font-weight:800;letter-spacing:.03em;flex-shrink:0}
.wa-head-copy{display:flex;flex-direction:column;gap:4px;min-width:0}
.wa-head-copy strong{font-size:15px;color:#17212b}
.wa-head-copy span{font-size:12px;color:#667781}
.wa-head-copy span i{display:inline-block;width:7px;height:7px;border-radius:50%;background:#22a06b;margin-right:5px}
.wa-head-tag{margin-left:auto;border:1px solid #d8e5df;color:#176b5b;background:#eef8f2;border-radius:7px;padding:5px 9px;font-size:11px;font-weight:800;letter-spacing:.06em}
.wa-chat-body{flex:1;min-height:300px;max-height:calc(100vh - 340px);overflow:auto;padding:22px clamp(12px,3vw,28px);background-color:#e9e4dc;background-image:radial-gradient(#d9d2c8 0.7px,transparent .7px);background-size:14px 14px;scroll-behavior:smooth}
.wa-date-chip{width:max-content;margin:0 auto 20px;padding:6px 12px;border-radius:8px;background:#f7f4ee;color:#64736d;font-size:11px;box-shadow:0 1px 1px #0000000d}
.wa-message-row{display:flex;width:100%;margin:9px 0}
.wa-message-row.user-row{justify-content:flex-end}
.wa-message-row.bot-row{justify-content:flex-start}
.wa-bubble{position:relative;max-width:min(78%,600px);padding:10px 12px 7px;border-radius:10px;font-size:14px;line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere;box-shadow:0 1px 1px #00000012;color:#17212b}
.wa-bubble:before{content:"";position:absolute;top:0;border:7px solid transparent}
.bot-bubble{background:#fff;border-top-left-radius:3px}
.bot-bubble:before{left:-7px;border-top-color:#fff;border-left:0}
.user-bubble{background:#d9fdd3;border-top-right-radius:3px}
.user-bubble:before{right:-7px;border-top-color:#d9fdd3;border-right:0}
.wa-time{font-size:10px;color:#75817e;text-align:right;margin:4px 0 0 16px;line-height:1.2}
.wa-typing{color:#687b73;font-style:italic}
.wa-suggestions{display:flex;gap:8px;flex-wrap:wrap;margin:18px 0 8px}
.wa-suggestions button{background:#fff;border:1px solid #d9e5df;color:#176b5b;border-radius:18px;padding:8px 12px;font-size:12px;font-weight:700;cursor:pointer}
.wa-suggestions button:hover{background:#f3fff7}
.wa-compose{display:flex;align-items:flex-end;gap:10px;padding:12px 14px;background:#f5f7f8;border-top:1px solid #e0e5e8}
.wa-compose textarea{flex:1;resize:none;min-height:44px;max-height:120px;padding:12px 15px;border:1px solid #dce2e5;border-radius:22px;background:#fff;color:#17212b;font:inherit;font-size:14px;line-height:1.4;outline:none}
.wa-compose textarea:focus{border-color:#8ab8a5;box-shadow:0 0 0 3px #176b5b12}
.wa-send{width:44px;height:44px;display:grid;place-items:center;flex-shrink:0;border:0;border-radius:50%;background:#176b5b;color:white;cursor:pointer}
.wa-send:hover{background:#115648}
.wa-send:disabled{opacity:.55;cursor:wait}
.wa-send svg{width:20px;height:20px}
.wa-disclaimer{margin:0;padding:0 14px 12px;background:#f5f7f8;text-align:center;font-size:11px;color:#75817e}
@media(max-width:760px){
 .standalone-admin .admin-wrap{padding:12px 10px 32px}
 .standalone-admin .admin-head{padding:14px;border-radius:14px;gap:12px}
 .standalone-admin .admin-head h2{font-size:20px;padding-top:0}
 .standalone-admin .admin-head>div{width:100%;align-items:stretch;gap:8px!important}
 .standalone-admin .admin-head .tabs{width:100%;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:thin;gap:4px}
 .standalone-admin .admin-head .tab{flex:0 0 auto;padding:9px 11px;font-size:12px}
 .standalone-admin #btnLogout{flex-shrink:0}
 .wa-assistant{min-height:calc(100dvh - 180px);border-radius:13px}
 .wa-chat-head{padding:12px}
 .wa-chat-body{padding:16px 10px;max-height:none;min-height:260px}
 .wa-bubble{max-width:88%;font-size:13.5px}
 .wa-compose{padding:9px;gap:8px}
 .wa-compose textarea{font-size:16px;padding:11px 14px}
 .wa-send{width:42px;height:42px}
 .wa-disclaimer{font-size:10px;padding:0 9px 10px}
 .wa-suggestions{gap:6px}
 .wa-suggestions button{font-size:11px;padding:7px 10px}
}

/* Category image management */
.category-image-admin{display:grid;gap:12px;margin-bottom:14px}.category-image-row{display:grid;grid-template-columns:100px minmax(0,1fr);gap:12px;align-items:center;padding:10px;border:1px solid var(--line);border-radius:10px}.category-image-row>img{width:100px;height:76px;object-fit:cover;border-radius:7px;background:#f3f4f6}.category-image-row .field{min-width:0}.category-image-row input[type="url"]{width:100%}@media(max-width:520px){.category-image-row{grid-template-columns:76px minmax(0,1fr);gap:9px}.category-image-row>img{width:76px;height:70px}}
