/* ============================================================
   Jyoti Purever — Design tokens
   ============================================================ */
:root {
  /* Brand */
  --purple:        #4b1f8f;
  --purple-dark:   #33146a;
  --purple-light:  #7b4bc9;
  --accent:        #2aa8e0;
  --accent-dark:   #1d84b6;
  --accent-light:  #5fd0f5;

  /* Tints */
  --purple-050:    #f4f1fb;
  --purple-100:    #ece4f7;
  --purple-150:    #e0d3f1;
  --accent-050:    #e9f6fd;
  --accent-100:    #d3ecfa;

  /* Surfaces */
  --bg:            #f5f3fa;
  --card:          #ffffff;
  --text:          #221f36;
  --text-soft:     #4a4663;
  --muted:         #7a7690;
  --border:        #e8e3f2;
  --border-strong: #d8d1ea;

  /* Status */
  --ok:            #16a34a;
  --ok-bg:         #e7f6ec;
  --warn:          #d97706;
  --warn-bg:       #fff2df;
  --danger:        #dc2626;
  --danger-bg:     #fde8e8;
  --info:          #1668a5;
  --info-bg:       #e8f3fb;

  /* Gradients */
  --grad-sidebar:  linear-gradient(180deg, #4b1f8f 0%, #3a1875 55%, #2c1059 100%);
  --grad-accent:   linear-gradient(135deg, #7b4bc9 0%, #4b1f8f 100%);

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* Shadow */
  --shadow-xs: 0 1px 2px rgba(51,20,106,.06);
  --shadow-sm: 0 2px 8px rgba(51,20,106,.07);
  --shadow:    0 8px 26px rgba(75,31,143,.10);
  --shadow-lg: 0 18px 48px rgba(51,20,106,.22);
  --ring:      0 0 0 3px rgba(42,168,224,.28);

  --sidebar-w: 244px;
  --topbar-h: 64px;
  --ease: cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Brand / logo
   ============================================================ */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.logo-img { height: 34px; width: auto; display: block; object-fit: contain; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--purple); color: #fff; border: none; border-radius: var(--r-md);
  padding: 12px 18px; font-size: 15px; font-weight: 600; cursor: pointer; width: 100%;
  transition: background .18s var(--ease), transform .12s var(--ease), box-shadow .18s var(--ease);
}
.btn:hover { background: var(--purple-dark); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; box-shadow: none; }
.btn.secondary { background: var(--purple-100); color: var(--purple); }
.btn.secondary:hover { background: var(--purple-150); }
.btn.small { width: auto; padding: 8px 14px; font-size: 13px; border-radius: var(--r-sm); }
.btn.ghost { background: transparent; color: var(--purple); border: 1px solid var(--border-strong); }
.btn.ghost:hover { background: var(--purple-050); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #b91c1c; }
.btn.accent { background: var(--accent); }
.btn.accent:hover { background: var(--accent-dark); }

.link { color: var(--accent-dark); cursor: pointer; text-decoration: none; font-weight: 600; font-size: 14px; }
.link:hover { text-decoration: underline; color: var(--accent); }

/* ============================================================
   Forms
   ============================================================ */
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 6px; color: var(--text-soft); }
input, textarea, select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border-strong);
  border-radius: var(--r-md); font-size: 15px; font-family: inherit; background: #fff; color: var(--text);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
textarea { min-height: 90px; resize: vertical; }

/* ============================================================
   Login (centered)
   ============================================================ */
.center-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(123,75,201,.16), transparent 60%),
    radial-gradient(1000px 500px at 110% 110%, rgba(42,168,224,.16), transparent 55%),
    var(--bg);
}
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 24px;
}
.login-card { width: 100%; max-width: 420px; padding: 32px 28px; animation: pop .35s var(--ease); }
.login-card .logo-row { display: flex; justify-content: center; margin-bottom: 6px; }
.login-card .logo-img { height: 56px; }
.login-card h1 { font-size: 21px; margin: 16px 0 4px; text-align: center; }
.login-card p.sub { color: var(--muted); text-align: center; margin: 0 0 22px; font-size: 14px; }

/* ============================================================
   App shell (two column)
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--grad-sidebar); color: #fff;
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 40;
  box-shadow: 6px 0 30px rgba(51,20,106,.16);
  transition: transform .3s var(--ease);
}
.sidebar-brand {
  padding: 20px 20px 16px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.sidebar-brand .logo-badge {
  background: #fff; border-radius: var(--r-md); padding: 8px 12px; width: 100%;
  display: flex; justify-content: center;
}
.sidebar-brand .logo-img { height: 42px; }

.sidebar-nav { padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.nav-section { font-size: 11px; letter-spacing: .9px; text-transform: uppercase; color: rgba(255,255,255,.42); padding: 12px 12px 6px; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--r-md);
  color: rgba(255,255,255,.82); font-weight: 600; font-size: 14.5px;
  cursor: pointer; user-select: none; position: relative;
  border: none; background: transparent; text-align: left; width: 100%;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; opacity: .9; }
.nav-item span.nav-label { flex: 1; }
.nav-item:hover { background: rgba(255,255,255,.10); color: #fff; }
.nav-item.active { background: #fff; color: var(--purple); box-shadow: var(--shadow-sm); }
.nav-item.active svg { opacity: 1; color: var(--accent); }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px; border-radius: 0 4px 4px 0; background: var(--accent);
}
.nav-badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill);
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.nav-item.active .nav-badge { background: var(--purple); }

.sidebar-footer { padding: 14px 12px; border-top: 1px solid rgba(255,255,255,.12); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 8px 12px; }
.user-chip .avatar {
  width: 38px; height: 38px; border-radius: var(--r-pill); flex-shrink: 0;
  background: rgba(255,255,255,.18); color: #fff; font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center; text-transform: uppercase;
}
.user-chip .who { min-width: 0; }
.user-chip .who .name { font-weight: 700; font-size: 14px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .who .role { font-size: 12px; color: rgba(255,255,255,.6); }
.logout-btn { color: #fff; border-color: rgba(255,255,255,.28); }
.logout-btn:hover { background: rgba(255,255,255,.12); }

/* Main column */
.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h); background: rgba(255,255,255,.82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px; display: flex; align-items: center; gap: 14px;
  position: sticky; top: 0; z-index: 30;
}
.page-title { font-size: 20px; font-weight: 800; margin: 0; letter-spacing: -.3px; }
.topbar .topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.hamburger {
  display: none; width: 40px; height: 40px; border-radius: var(--r-md); border: 1px solid var(--border);
  background: #fff; cursor: pointer; align-items: center; justify-content: center; color: var(--purple);
  flex-shrink: 0;
}
.hamburger svg { width: 22px; height: 22px; }

.content { padding: 26px 24px 60px; max-width: 1180px; width: 100%; animation: fadein .3s var(--ease); }

/* Sidebar backdrop (mobile) */
.sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(30,20,55,.45); z-index: 35;
  opacity: 0; visibility: hidden; transition: opacity .25s var(--ease), visibility .25s var(--ease);
}
.sidebar-backdrop.show { opacity: 1; visibility: visible; }

/* ============================================================
   Messages / hints
   ============================================================ */
.msg { padding: 10px 14px; border-radius: var(--r-md); font-size: 14px; margin: 12px 0; display: none; }
.msg.show { display: block; }
.msg.error { background: var(--danger-bg); color: var(--danger); }
.msg.success { background: var(--ok-bg); color: var(--ok); }
.msg.info { background: var(--info-bg); color: var(--info); }
.demo-hint {
  background: linear-gradient(135deg, var(--accent-050), #fff); border: 1px dashed var(--accent);
  color: var(--accent-dark); padding: 11px 14px; border-radius: var(--r-md); font-size: 13px;
  margin-top: 12px; text-align: center; font-weight: 600;
}

/* ============================================================
   Stats
   ============================================================ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 16px; margin-bottom: 26px; }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 18px 20px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
  animation: rise .45s var(--ease) both;
}
.stat::after {
  content: ""; position: absolute; right: -18px; top: -18px; width: 68px; height: 68px;
  border-radius: 50%; background: var(--purple-050);
}
.stat:nth-child(2)::after { background: var(--accent-050); }
.stat:nth-child(3)::after { background: var(--purple-050); }
.stat:nth-child(4)::after { background: var(--accent-050); }
.stat:nth-child(2) { animation-delay: .05s; }
.stat:nth-child(3) { animation-delay: .1s; }
.stat:nth-child(4) { animation-delay: .15s; }
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 600; position: relative; }
.stat .value { font-size: 27px; font-weight: 800; margin-top: 8px; color: var(--purple); position: relative; letter-spacing: -.5px; }

/* ============================================================
   Tables
   ============================================================ */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: var(--purple-050); color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .13s var(--ease); }
tbody tr:hover { background: var(--purple-050); }
tr.clickable { cursor: pointer; }
td.wrap, th.wrap { white-space: normal; min-width: 180px; }

/* ============================================================
   Badges
   ============================================================ */
.badge { display: inline-block; padding: 3px 11px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; }
.badge.green { background: var(--ok-bg); color: var(--ok); }
.badge.amber { background: var(--warn-bg); color: var(--warn); }
.badge.gray { background: #eee; color: #555; }

/* ============================================================
   Section heads / toolbars
   ============================================================ */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 14px; gap: 12px; flex-wrap: wrap; }
.section-head:first-child { margin-top: 0; }
.section-head h2 { margin: 0; font-size: 18px; font-weight: 700; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { width: 260px; }

/* Panel card (content panels) */
.panel { animation: fadein .25s var(--ease); }

/* ============================================================
   Tabs (legacy hook — visually hidden, sidebar drives nav)
   ============================================================ */
.tabs { display: none; }

/* ============================================================
   Modal
   ============================================================ */
.modal-bg {
  position: fixed; inset: 0; background: rgba(30,20,55,.5); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; z-index: 60; padding: 20px;
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .22s var(--ease), visibility .22s var(--ease);
}
.modal-bg.show { opacity: 1; visibility: visible; pointer-events: auto; }
.modal {
  background: #fff; border-radius: var(--r-lg); width: 100%; max-width: 560px; max-height: 88vh;
  overflow-y: auto; padding: 26px; box-shadow: var(--shadow-lg);
  transform: translateY(14px) scale(.98); opacity: .6; transition: transform .24s var(--ease), opacity .24s var(--ease);
}
.modal-bg.show .modal { transform: translateY(0) scale(1); opacity: 1; }
.modal h3 { margin-top: 0; font-size: 19px; }
.modal .row { display: flex; gap: 12px; }
.modal .row > div { flex: 1; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }

/* Customer detail modal — wider so the orders table has room */
#custDetailModal .modal { max-width: min(860px, 94vw); }
#custDetailModal td.wrap, #custDetailModal th.wrap { min-width: 300px; }

/* ============================================================
   Toasts
   ============================================================ */
.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; min-width: 220px; max-width: 340px;
  background: var(--text); color: #fff; padding: 12px 16px; border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 600;
  animation: toastin .3s var(--ease);
}
.toast.out { animation: toastout .3s var(--ease) forwards; }
.toast.success { background: linear-gradient(135deg, #1c9c4c, #16a34a); }
.toast.error { background: linear-gradient(135deg, #e0453f, #dc2626); }
.toast.info { background: var(--grad-accent); }
.toast .dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.9); flex-shrink: 0; }

/* ============================================================
   Utility
   ============================================================ */
.muted { color: var(--muted); }
.hidden { display: none !important; }
.spacer { height: 16px; }
.small-note { font-size: 13px; color: var(--muted); margin-top: 8px; }
.right-align { text-align: right; }

.placeholder-card { text-align: center; padding: 46px 24px; }
.placeholder-card .ph-icon {
  width: 62px; height: 62px; border-radius: var(--r-lg); margin: 0 auto 16px;
  background: var(--purple-050); display: flex; align-items: center; justify-content: center; color: var(--purple);
}
.placeholder-card .ph-icon svg { width: 30px; height: 30px; }
.placeholder-card h2 { margin: 0 0 6px; font-size: 19px; }
.placeholder-card p { color: var(--muted); margin: 0 auto; max-width: 420px; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 14px; margin-top: 6px; }
.info-item { background: var(--purple-050); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; }
.info-item .k { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.info-item .v { font-size: 16px; font-weight: 700; margin-top: 4px; color: var(--text); }

/* ============================================================
   Animations
   ============================================================ */
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastin { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastout { to { opacity: 0; transform: translateX(40px); } }

/* ============================================================
   Responsive — sidebar becomes a drawer < 768px
   ============================================================ */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); box-shadow: none; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
  .hamburger { display: inline-flex; }
  .content { padding: 20px 16px 48px; }
  .topbar { padding: 0 16px; }
  .toolbar input, .toolbar select { width: 100%; }
  .section-head { align-items: flex-start; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 12px; }
  .stat .value { font-size: 23px; }
  .modal .row { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ============================================================
   Logout button — animated brand pill
   ============================================================ */
#logoutBtn {
  position: relative !important;
  overflow: hidden !important;
  isolation: isolate;
  color: #fff !important;
  background: linear-gradient(120deg, #4b1f8f 0%, #6a2fb0 45%, #2aa8e0 100%) !important;
  border: none !important;
  border-radius: var(--r-pill) !important;
  padding: 11px 22px !important;
  font-weight: 500 !important;
  letter-spacing: .2px;
  box-shadow: 0 4px 14px rgba(75,31,143,.28) !important;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), filter .18s var(--ease) !important;
}
#logoutBtn::before {
  content: "";
  position: absolute;
  top: 0; left: -60%;
  width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent 0%, rgba(255,255,255,.45) 50%, transparent 100%);
  transform: skewX(-20deg);
  z-index: -1;
  transition: left .55s var(--ease);
}
#logoutBtn:hover {
  transform: translateY(-2px) !important;
  filter: brightness(1.06);
  box-shadow: 0 10px 24px rgba(42,168,224,.42), 0 4px 12px rgba(75,31,143,.32) !important;
}
#logoutBtn:hover::before { left: 115%; }
#logoutBtn:active {
  transform: translateY(0) !important;
  box-shadow: 0 3px 10px rgba(75,31,143,.30) !important;
}
#logoutBtn:focus-visible {
  outline: none !important;
  box-shadow: 0 4px 14px rgba(75,31,143,.28), var(--ring) !important;
}

/* ============================================================
   Wide form modal — "Add customer" (config-driven product form)
   ============================================================ */
.modal.wide { max-width: min(940px, 96vw); padding: 0; display: flex; flex-direction: column; }

.form-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 22px 26px 18px; border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--purple-050), #fff);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  position: sticky; top: 0; z-index: 2;
}
.form-head h3 { margin: 0; font-size: 19px; }

.icon-btn {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: var(--r-md);
  border: 1px solid var(--border-strong); background: #fff; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--purple-050); color: var(--purple); }

.form-grid { padding: 4px 26px 0; }

.form-section { padding: 20px 0; border-bottom: 1px dashed var(--border); }
.form-section:last-child { border-bottom: none; }
.form-section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.form-section-head h4 {
  margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .7px;
  text-transform: uppercase; color: var(--purple);
}
.step-dot {
  width: 24px; height: 24px; flex-shrink: 0; border-radius: var(--r-pill);
  background: var(--grad-accent); color: #fff; font-size: 12px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}

.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 16px; }
.field { min-width: 0; }
.field.span-2 { grid-column: span 2; }
.field label { margin-top: 0; }
.field textarea { min-height: 62px; }
.req { color: var(--danger); }

.field-error { color: var(--danger); font-size: 12px; font-weight: 600; margin-top: 5px; min-height: 0; }
input.invalid, select.invalid, textarea.invalid { border-color: var(--danger); }
input.invalid:focus, select.invalid:focus { box-shadow: 0 0 0 3px rgba(220,38,38,.18); }

.spec-empty { font-size: 13px; margin: 4px 0 0; }

.file-input {
  padding: 9px 12px; font-size: 13px; background: var(--purple-050);
  border-style: dashed; cursor: pointer;
}
.file-input::file-selector-button {
  margin-right: 12px; padding: 7px 13px; border: none; border-radius: var(--r-sm);
  background: var(--purple); color: #fff; font-weight: 600; font-size: 13px;
  cursor: pointer; font-family: inherit;
}
.file-input::file-selector-button:hover { background: var(--purple-dark); }

.sticky-actions {
  position: sticky; bottom: 0; margin-top: 0; padding: 16px 26px;
  background: #fff; border-top: 1px solid var(--border);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.modal.wide .msg { margin: 0 26px; }

/* ============================================================
   Product cards
   ============================================================ */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.product-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 16px 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.product-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--grad-accent);
}
.product-card.clickable { cursor: pointer; }
.product-card.clickable:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.pc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.pc-head strong { font-size: 15px; color: var(--purple); }
.pc-meta { font-size: 13px; color: var(--muted); }
.pc-foot { margin-top: 10px; font-size: 12px; color: var(--muted); }

/* ============================================================
   Product detail (customer view)
   ============================================================ */
.pd-back { margin-bottom: 14px; gap: 6px; }
.pd-back svg { width: 15px; height: 15px; }

.pd-card { padding: 0; overflow: hidden; }

/* Header: name + sub-line on the left, warranty pill on the right */
.pd-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 22px 24px; border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--purple-050), #fff);
}
.pd-heading { min-width: 0; }
.pd-heading h2 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -.3px; color: var(--purple); }
.pd-subline { margin-top: 5px; font-size: 13px; color: var(--muted); }
.pd-subline:empty { display: none; }

.warranty-pill {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  background: var(--purple-100); color: var(--purple);
  border: 1px solid var(--purple-150); border-radius: var(--r-pill);
  padding: 8px 15px; font-size: 13px; font-weight: 700;
}
.warranty-pill svg { width: 16px; height: 16px; color: var(--accent-dark); }

/* Body: spec card + drawing card, stacking on narrow screens */
.pd-body {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 20px; padding: 20px 24px;
}
.pd-body.single-col { grid-template-columns: minmax(0, 1fr); }
/* full width: keep label and value from drifting apart on wide screens */
.pd-body.single-col .kv-table { max-width: 760px; }
.pd-body.single-col .kv-table th { width: 38%; }

.pd-panel {
  background: #fff; border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 18px; box-shadow: var(--shadow-xs); min-width: 0;
}
.pd-panel-title {
  display: flex; align-items: center; gap: 9px; margin: 0 0 12px;
  font-size: 12px; font-weight: 800; letter-spacing: .7px;
  text-transform: uppercase; color: var(--purple);
}
.pd-panel-title::before {
  content: ""; width: 3px; height: 14px; border-radius: 2px; background: var(--grad-accent);
}
.pd-empty { font-size: 13px; margin: 0; }

/* Key/value spec tables */
.kv-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.kv-table th, .kv-table td {
  text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border);
  white-space: normal; word-break: break-word;
}
.kv-table th {
  width: 46%; background: transparent; color: var(--text-soft);
  font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: 0;
}
.kv-table td { font-weight: 600; color: var(--text); }
.kv-table tr:last-child th, .kv-table tr:last-child td { border-bottom: none; }
.kv-table tbody tr:hover { background: var(--purple-050); }

.spec-subhead {
  margin: 20px 0 8px; font-size: 11.5px; font-weight: 800; letter-spacing: .6px;
  text-transform: uppercase; color: var(--accent-dark);
  padding-top: 14px; border-top: 1px dashed var(--border-strong);
}

/* Tank drawing */
.tank-drawing { display: flex; justify-content: center; padding: 2px 0 6px; }
.tank-svg { width: 100%; max-width: 290px; height: auto; }
.tank-svg .shell { fill: var(--accent-050); stroke: var(--purple); stroke-width: 2; stroke-linejoin: round; }
.tank-svg .cap { fill: var(--purple-100); stroke: var(--purple); stroke-width: 2; }
.tank-svg .inner { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 5 4; }
.tank-svg .dim { stroke: var(--muted); stroke-width: 1.2; }
.tank-svg .dim-ext { stroke: var(--border-strong); stroke-width: 1; }
.tank-svg .dim-arrow { fill: var(--muted); }
.tank-svg .dim-label {
  fill: var(--text-soft); font-family: inherit; font-size: 11px; font-weight: 700;
}

/* Downloads */
.pd-downloads { padding: 4px 24px 24px; }
.doc-list { display: flex; flex-wrap: wrap; gap: 10px; }
.doc-btn { text-decoration: none; padding: 10px 16px; }
.doc-btn svg { width: 15px; height: 15px; flex-shrink: 0; }

@media (max-width: 900px) {
  .pd-body { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
  .pd-header { padding: 18px 16px; }
  .pd-heading h2 { font-size: 19px; }
  .pd-body { padding: 16px; gap: 16px; }
  .pd-downloads { padding: 0 16px 20px; }
  .pd-panel { padding: 14px; }
  .kv-table th, .kv-table td { padding: 8px 6px; }
  .doc-btn { flex: 1 1 auto; justify-content: flex-start; }
}

@media (max-width: 768px) {
  .field.span-2 { grid-column: span 1; }
  .field-grid { grid-template-columns: 1fr; }
  .form-grid { padding: 0 16px; }
  .form-head, .sticky-actions { padding-left: 16px; padding-right: 16px; }
  .modal.wide .msg { margin: 0 16px; }
}
