/* =========================================================
   Procurement System — global stylesheet (fully responsive)
   ========================================================= */
:root {
  --bg: #f2f4f8;
  --card: #ffffff;
  --ink: #1c2330;
  --muted: #6b7280;
  --line: #e3e7ee;
  --brand: #2456d6;
  --brand-dark: #1c44ad;
  --green: #16a34a;
  --gray-chip: #9aa3b2;
  --danger: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 4px 14px rgba(16, 24, 40, .06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Segoe UI", Arial, "Helvetica Neue", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.3; }

/* ---------- generic ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 16px; }
.page-title { font-size: 20px; margin: 6px 0 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 16px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; }
.right { margin-left: auto; }
.center { text-align: center; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  border: 1px solid transparent; border-radius: 8px; padding: 8px 16px;
  background: var(--brand); color: #fff; font-weight: 600; transition: .15s;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: #f6f8fb; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #b91c1c; }
.btn.green { background: var(--green); }
.btn.green:hover { background: #15803d; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; font-weight: 500; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { border: 0; background: transparent; font-size: 16px; padding: 4px 6px; border-radius: 6px; color: var(--muted); }
.icon-btn:hover { background: #f0f2f6; color: var(--ink); text-decoration: none; }
.link-btn { background: none; border: 0; color: var(--brand); padding: 2px 4px; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--danger); }

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-weight: 600; font-size: 13px; }
.field label .req { color: var(--danger); margin-left: 2px; }
.field input, .field select, .field textarea, .inline-input {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus, .inline-input:focus {
  outline: 2px solid rgba(36, 86, 214, .25); border-color: var(--brand);
}
.field input[readonly], .inline-input[readonly] { background: #f4f6f9; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; background: #fff; min-width: 640px; }
table.tbl th, table.tbl td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: middle; white-space: nowrap; }
table.tbl th { background: #f7f9fc; font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
table.tbl td.wrap, table.tbl th.wrap { white-space: normal; }
table.tbl tr.clickable { cursor: pointer; }
table.tbl tr.clickable:hover { background: #f6f9ff; }

/* ---------- toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar .inline-input, .toolbar select { width: auto; min-width: 140px; }
.search-box { position: relative; }
.search-box input { padding-left: 30px; }
.search-box::before { content: "🔍"; position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font-size: 13px; opacity: .6; }

/* ---------- product cards / tab module ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
@media (max-width: 480px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
.p-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: .15s; display: flex; flex-direction: column; }
.p-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-media { aspect-ratio: 1/1; width: 100%; background: #eef1f6; position: relative; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.ph-img { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.95); font-weight: 700; font-size: 22px; letter-spacing: .05em; text-shadow: 0 1px 2px rgba(0,0,0,.15); }
.p-card .card-body { padding: 10px 12px 12px; }
.p-card .card-name { font-weight: 600; font-size: 13.5px; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-card .card-price { color: var(--brand-dark); font-weight: 700; }
.p-card .card-actions { display: flex; gap: 8px; padding: 0 12px 12px; }
.p-card .card-actions .btn { flex: 1; }
.more-wrap { text-align: center; margin-top: 18px; }

/* ---------- capsules ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-start; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 6px 16px; font-size: 13px; color: var(--ink); transition: .15s; white-space: nowrap;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.chip .x { margin-left: 6px; color: inherit; opacity: .7; }
.chip .x:hover { opacity: 1; }
.cat-filter { margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; }

/* ---------- toggle switch ---------- */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #cdd4e0; border-radius: 999px; transition: .2s; }
.switch .slider::before { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* ---------- badges / status ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.green { background: #e7f7ec; color: var(--green); }
.badge.gray { background: #eef0f4; color: var(--muted); }
.badge.red { background: #fdeaea; color: var(--danger); }
.badge.blue { background: #e8effd; color: var(--brand-dark); }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 520px; max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,.25); animation: pop .18s ease; }
.modal.wide { max-width: 760px; }
@keyframes pop { from { transform: scale(.96); opacity: .5; } to { transform: scale(1); opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.confirm-msg { font-size: 14.5px; }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: #111827; color: #fff; padding: 10px 20px; border-radius: 999px;
  font-size: 13.5px; z-index: 2000; box-shadow: 0 6px 20px rgba(0,0,0,.25); animation: pop .18s ease;
}
#toast.err { background: var(--danger); }

/* ---------- fixed bottom bar ---------- */
.fixed-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 500;
  background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(16,24,40,.07);
}
.fixed-bar .inner { max-width: 1200px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.fixed-bar .stat { font-size: 14px; }
.fixed-bar .stat b { color: var(--brand-dark); }
body.has-fixedbar { padding-bottom: 76px; }

/* =========================================================
   FRONT storefront
   ========================================================= */
.front-nav {
  position: sticky; top: 0; z-index: 600; background: #222222; border-bottom: 1px solid #141414;
}
.front-nav .inner { max-width: 1200px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 14px; min-height: 56px; flex-wrap: nowrap; }
.front-nav .brand { font-weight: 800; font-size: 17px; letter-spacing: .04em; color: #fff; flex-shrink: 0; white-space: nowrap; }
.front-nav .brand:hover { text-decoration: none; }
.front-nav .nav-links { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; min-width: 0; }
.front-nav .nav-links a { padding: 8px 10px; border-radius: 8px; color: #fff; font-weight: 500; }
.front-nav .nav-links a:hover { background: rgba(255,255,255,.12); text-decoration: none; color: #fff; }
.front-nav .nav-links a.active { color: #fff; font-weight: 700; background: rgba(255,255,255,.18); }
.front-nav .nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.front-nav .nav-right.compact { display: none; }
.front-nav .icon-btn { color: #fff; display: inline-flex; align-items: center; }
.front-nav .icon-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
/* minimal search: plain input + inline search icon, no extra borders */
.front-nav .search-box.mini { display: flex; align-items: center; background: rgba(255,255,255,.12); border-radius: 999px; height: 34px; padding: 0 12px; }
.front-nav .search-box.mini::before { content: none; }
.front-nav .search-box.mini input { background: transparent; border: 0; padding: 0; height: 100%; color: #fff; width: 150px; outline: none; box-shadow: none; }
.front-nav .search-box.mini input::placeholder { color: rgba(255,255,255,.6); }
.front-nav .search-box.mini input:focus { outline: none; box-shadow: none; border: 0; }
.front-nav .search-box.mini .s-ico { display: flex; align-items: center; color: rgba(255,255,255,.85); margin-left: 4px; }
@media (max-width: 640px) { .front-nav .search-box.mini input { width: 100px; } }
.cart-badge { position: relative; }
.cart-badge .n {
  position: absolute; top: -4px; right: -6px; background: var(--danger); color: #fff;
  border-radius: 999px; font-size: 10.5px; min-width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; padding: 0 4px; font-weight: 700;
}

/* product detail */
.detail-wrap { display: grid; grid-template-columns: minmax(280px, 460px) 1fr; gap: 26px; }
@media (max-width: 780px) { .detail-wrap { grid-template-columns: 1fr; } }
.gallery .main-img { aspect-ratio: 1/1; border-radius: var(--radius); overflow: hidden; background: #eef1f6; position: relative; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.gallery .main-img img { width: 100%; height: 100%; object-fit: cover; }
.gallery .g-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9);
  box-shadow: 0 2px 8px rgba(0,0,0,.18); font-size: 16px; font-weight: 700; color: var(--ink);
  opacity: 0; transition: opacity .25s; pointer-events: none; /* hidden until image hover */
}
.gallery .main-img:hover .g-nav { opacity: 1; pointer-events: auto; }
.g-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.g-thumb {
  width: 56px; height: 56px; border-radius: 8px; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; opacity: .7; padding: 0; background: #eef1f6;
}
.g-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-thumb:hover { opacity: 1; }
.g-thumb.active { border-color: var(--brand); opacity: 1; }
.gallery .g-nav.prev { left: 10px; }
.gallery .g-nav.next { right: 10px; }
.detail-price { font-size: 24px; color: var(--danger); font-weight: 800; margin: 10px 0; }
.detail-price small { font-size: 13px; color: var(--muted); font-weight: 500; }
.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.qty-stepper button { width: 32px; height: 32px; border: 0; background: #f4f6f9; font-size: 16px; font-weight: 700; }
.qty-stepper button:hover { background: #e8ecf3; }
.qty-stepper .qv { min-width: 44px; text-align: center; font-weight: 600; }
.qty-stepper .qty-input {
  width: 92px; height: 32px; border: 0; text-align: center; font-weight: 600; font-size: 15px;
  background: #fff; padding: 0 6px; color: var(--ink);
}
.qty-stepper .qty-input:focus { outline: none; background: #f7faff; }
.detail-actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }

/* cart / grouped forms */
.group-form { margin-bottom: 16px; }
.group-form .g-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.group-form .g-head img, .group-form .g-head .ph-img.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex: none; }
.group-form .g-head .ph-img.thumb { font-size: 13px; }
.group-form .g-head .t { font-weight: 700; flex: 1; }
.g-line { display: flex; align-items: center; gap: 12px; padding: 10px 14px; flex-wrap: wrap; border-bottom: 1px dashed var(--line); }
.g-line:last-child { border-bottom: 0; }
.g-line .spec { flex: 1; min-width: 120px; }
.g-line .price { font-weight: 600; color: var(--brand-dark); min-width: 80px; }

.summary-box { display: flex; gap: 26px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.summary-box .s-item { font-size: 14px; }
.summary-box b { color: var(--brand-dark); }

/* profile split layout */
.profile-head { display: flex; align-items: center; gap: 16px; padding: 18px; }
.avatar-wrap { position: relative; width: 72px; height: 72px; flex: none; }
.avatar-wrap img, .avatar-fallback { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.avatar-fallback { background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; }
.split { display: grid; grid-template-columns: 180px 1fr; gap: 0; border-top: 1px solid var(--line); }
@media (max-width: 700px) { .split { grid-template-columns: 1fr; } }
.split .split-title { padding: 16px; font-weight: 700; border-right: 1px solid var(--line); background: #f9fafc; border-bottom: 1px solid var(--line); }
@media (max-width: 700px) { .split .split-title { border-right: 0; border-bottom: 0; padding-bottom: 0; background: none; } }
.split .split-body { padding: 16px; border-bottom: 1px solid var(--line); min-width: 0; }
.split .split-body:last-child { border-bottom: 0; }
.order-mini { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 12px; background: #fff; }
.order-mini .om-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 6px; }
.order-mini .om-row:last-child { margin-bottom: 0; }
.om-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.om-item img, .om-item .ph-img.thumb { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; font-size: 10px; }
.om-row .meta { display: inline-flex; align-items: center; gap: 5px; }
.om-row .meta svg { flex: 0 0 auto; opacity: .75; }

/* account page tabs (P8) */
.acct-card { overflow: hidden; }
.acct-tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--line); background: #f9fafc; }
.acct-tab {
  appearance: none; border: 0; background: none; padding: 13px 18px; font-size: 14px;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; font-weight: 500;
  white-space: nowrap;
}
.acct-tab:hover { color: var(--ink); }
.acct-tab.active { color: var(--ink); font-weight: 700; border-bottom-color: #222; background: #fff; }
.acct-pane { padding: 16px; min-width: 0; }
.acct-pane[hidden] { display: none; }
@media (max-width: 700px) {
  .acct-tab { padding: 11px 12px; font-size: 13px; flex: 1 1 auto; text-align: center; }
}

/* order detail header with back button (P8) */
.od-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }

.addr-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: #fff; }
.addr-row.default { border-color: var(--green); background: #f4fbf6; }

/* auth pages */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(135deg, #e8eefc, #f5f7fb 60%, #eef7f0); }
.auth-card { width: 100%; max-width: 400px; padding: 30px 28px; }
.auth-card h1 { font-size: 22px; margin-bottom: 4px; }
.auth-card .sub { color: var(--muted); margin-bottom: 20px; }
.auth-card .switch-link { text-align: center; margin-top: 16px; }

/* =========================================================
   ADMIN back office
   ========================================================= */
.admin-nav { position: sticky; top: 0; z-index: 600; background: #222222; }
.admin-nav .inner { max-width: 1200px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; }
.admin-nav .brand { color: #fff; font-weight: 800; padding: 0 18px 0 0; height: 52px; display: flex; align-items: center; letter-spacing: .05em; }
.admin-nav .nav-item { position: relative; }
.admin-nav .nav-item > a { color: #fff; padding: 0 18px; height: 52px; display: flex; align-items: center; gap: 5px; font-weight: 600; }
.admin-nav .nav-item > a:hover, .admin-nav .nav-item > a.active { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.admin-nav .caret { font-size: 10px; opacity: .8; color: #fff; }
.admin-nav .admin-user { margin-left: auto; display: flex; align-items: center; gap: 8px; padding-left: 18px; color: #fff; font-weight: 600; white-space: nowrap; }
.admin-nav .admin-user .u-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.admin-nav .admin-user .link-btn { color: #fff; font-weight: 600; }
.admin-nav .drop {
  display: none; position: absolute; top: 100%; left: 0; min-width: 200px;
  background: #fff; border-radius: 0 0 10px 10px; box-shadow: 0 12px 30px rgba(10,20,50,.18);
  padding: 8px; flex-direction: column; gap: 6px; /* secondary nav spacing */
}
.admin-nav .nav-item:hover .drop, .admin-nav .nav-item.open .drop { display: flex; }
.admin-nav .drop a { padding: 9px 12px; border-radius: 8px; color: var(--ink); font-weight: 500; }
.admin-nav .drop a:hover { background: #eef3fd; text-decoration: none; }
.admin-nav .drop a.active { background: #e8effd; color: var(--brand-dark); font-weight: 700; }

.section-banner { display: flex; align-items: center; gap: 12px; margin: 18px 0 16px; flex-wrap: wrap; }
.section-banner .b-icon {
  width: 44px; height: 44px; border-radius: 12px; background: #e8effd; color: var(--brand-dark);
  display: flex; align-items: center; justify-content: center; font-size: 22px; flex: none;
}
.section-banner h2 { font-size: 19px; }
.section-banner .banner-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 700px) { .section-banner .banner-actions { margin-left: 0; width: 100%; justify-content: flex-start; } }

/* progress module */
.progress-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.prog-chip {
  color: #fff; font-weight: 700; padding: 10px 26px; border-radius: 10px; font-size: 15px;
  letter-spacing: .02em; border: 0; min-width: 130px; text-align: center;
}
.prog-chip.green { background: var(--green); }
.prog-chip.gray { background: var(--gray-chip); }
button.prog-chip.gray { cursor: pointer; }
button.prog-chip.gray:hover { background: #7f8896; }
.prog-arrow { font-size: 20px; color: var(--muted); font-weight: 700; }

/* info module */
.info-table { width: 100%; border-collapse: collapse; }
.info-table td { padding: 9px 6px; border-bottom: 1px dashed var(--line); vertical-align: top; }
.info-table tr:last-child td { border-bottom: 0; }
.info-table td.k { width: 190px; color: var(--muted); font-weight: 600; font-size: 13px; }
@media (max-width: 560px) { .info-table td.k { width: 130px; } }
.info-table td.v { font-weight: 500; word-break: break-word; }

/* product info section — one unified table, full width aligned with sibling sections */
.pi-form { overflow-x: auto; }
table.pi-table { width: 100%; border-collapse: collapse; background: #fff; min-width: 720px; }
table.pi-table th, table.pi-table td { border: 1px solid var(--line); padding: 9px 10px; text-align: center; vertical-align: middle; }
table.pi-table th { background: #f7f9fc; font-size: 12.5px; color: var(--muted); }
table.pi-table td img, table.pi-table td .ph-img.thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; margin: 0 auto; font-size: 11px; }
table.pi-table tfoot td { background: #f7f9fc; }
.pi-stats { text-align: right; font-size: 14px; display: flex; gap: 22px; justify-content: flex-end; flex-wrap: wrap; }
.pi-stats b { color: var(--brand-dark); }

/* logistics */
.ship-icon { font-size: 22px; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto; }
.ship-icon.sea { background: #e3f2fd; }
.ship-icon.air { background: #e8f5e9; }
.ship-icon.express { background: #fff3e0; }
td .inline-input { min-width: 90px; }

/* misc */
.empty-note { color: var(--muted); text-align: center; padding: 28px 10px; }
.thumb-strip { display: flex; gap: 10px; flex-wrap: wrap; }
.thumb-strip .thumb { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #eef1f6; }
.thumb-strip .thumb img, .thumb-strip .thumb .ph-img { width: 100%; height: 100%; object-fit: cover; font-size: 12px; }
.thumb-strip .thumb .del {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; border: 0; font-size: 11px; line-height: 1;
}
.thumb-strip .thumb .mv {
  position: absolute; top: 50%; transform: translateY(-50%); width: 20px; height: 26px; border: 0;
  background: rgba(0,0,0,.5); color: #fff; font-size: 14px; line-height: 1; padding: 0; cursor: pointer;
}
.thumb-strip .thumb .mv.l { left: 0; border-radius: 0 6px 6px 0; }
.thumb-strip .thumb .mv.r { right: 0; border-radius: 6px 0 0 6px; }
.thumb-strip .thumb .mv:hover:not(:disabled) { background: rgba(0,0,0,.72); }
.thumb-strip .thumb .mv:disabled { opacity: .28; cursor: not-allowed; }
.thumb-strip .thumb .ord {
  position: absolute; left: 3px; bottom: 3px; background: rgba(0,0,0,.55); color: #fff;
  font-size: 10.5px; min-width: 15px; height: 15px; border-radius: 999px; display: flex;
  align-items: center; justify-content: center; padding: 0 4px; font-weight: 700;
}

/* category rows: left content grows, switch + delete sit in one aligned right column */
.cat-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cat-row.sub { padding: 11px 0 11px 26px; border-top: 1px dashed var(--line); }
.cat-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; min-width: 0; }
.cat-name { font-weight: 700; min-width: 100px; display: inline-block; }
.cat-name.sub { font-weight: 600; }
.cat-switch {
  display: flex; align-items: center; gap: 8px; justify-content: flex-start;
  min-width: 128px; padding: 4px 12px; border-left: 1px solid var(--line);
}
.cat-switch .small { color: var(--muted); white-space: nowrap; }
.cat-actions {
  display: flex; align-items: center; gap: 6px; justify-content: flex-end;
  min-width: 168px; padding: 4px 0 4px 12px; border-left: 1px solid var(--line);
}
.cat-actions .btn { margin: 0; }
@media (max-width: 560px) {
  .cat-switch { min-width: 106px; padding: 4px 8px; }
  .cat-actions { min-width: 150px; padding-left: 8px; gap: 6px; }
}

/* product detail images (storefront): one image per row, no gaps, full panel width */
.detail-panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.detail-gallery { display: flex; flex-direction: column; gap: 0; }
.detail-gallery img { width: 100%; display: block; border: 0; border-radius: 0; background: #eef1f6; }

/* admin: live storefront top-nav preview on the categories page */
.nav-preview { display: flex; align-items: center; gap: 12px; background: #222222; border-radius: 10px; padding: 10px 14px; flex-wrap: wrap; }
.np-brand { color: #fff; font-weight: 800; font-size: 14px; letter-spacing: .04em; }
.np-links { display: flex; gap: 6px; flex-wrap: wrap; }
.np-item { color: #e6e9ef; background: rgba(255,255,255,.14); border-radius: 999px; padding: 4px 12px; font-size: 12.5px; }
.upload-hint { border: 1px dashed var(--line); border-radius: 10px; padding: 10px 14px; color: var(--muted); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; background: #fff; }
.upload-hint:hover { border-color: var(--brand); color: var(--brand); }

.picker-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; cursor: pointer; border-bottom: 1px solid var(--line); }
.picker-row:hover { background: #f2f6ff; }
.picker-row img, .picker-row .ph-img.thumb { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; font-size: 11px; flex: none; }
.picker-row .t { flex: 1; min-width: 0; }
.picker-row .t .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-row .pr { font-weight: 700; color: var(--brand-dark); }

.spec-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.spec-table th, .spec-table td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; }
.spec-table th { font-size: 12.5px; color: var(--muted); }

.callout { background: #fff8e6; border: 1px solid #f2dcab; color: #8a6410; border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }

@media (max-width: 640px) {
  .container { padding: 12px; }
  .admin-nav .brand { padding-right: 10px; }
  .admin-nav .nav-item > a { padding: 0 12px; font-size: 13px; }
  .toolbar .inline-input, .toolbar select { min-width: 110px; flex: 1; }
}

/* narrow screens: the back-office bar scrolls inside itself instead of
   widening the page (the user menu sits at the end of the same row) */
@media (max-width: 700px) {
  .admin-nav .inner { overflow-x: auto; -ms-overflow-style: none; scrollbar-width: none; }
  .admin-nav .inner::-webkit-scrollbar { display: none; }
  .admin-nav .admin-user { padding-left: 10px; }
}

/* --- order detail: Product Information head row (title + Edit/Save/Cancel) --- */
.pi-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; flex-wrap: wrap; }
.pi-actions { display: flex; gap: 8px; }
.pi-actions .btn { white-space: nowrap; }
table.pi-table td input.inline-input { min-width: 70px; width: 100%; text-align: center; }
