:root {
  --ww-red: #e30813;
  --ww-red-dark: #b4060f;
  --ww-red-soft: #fde8e9;
  --ww-green: #007830;
  --ww-green-dark: #006030;
  --ww-green-soft: #e5f6ec;
  --ww-ink: #1b2433;
  --ww-heading: #222833;
  --ww-muted: #62718d;
  --ww-line: #e4e8ef;
  --ww-bg: #f4f6fa;
  --ww-white: #fff;
  --ww-shadow: 0 12px 40px rgba(27, 36, 51, 0.08);
  --ww-radius: 10px;
  --font-head: "Fira Sans", sans-serif;
  --font-body: "Nunito Sans", sans-serif;
  --header-h: 78px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow-x: hidden; }
body {
  font-family: var(--font-body);
  color: var(--ww-ink);
  background: var(--ww-bg);
  font-size: 16px;
  line-height: 1.5;
}

img { max-width: 100%; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--ww-red); }

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #fff;
  border-bottom: 1px solid var(--ww-line);
  box-shadow: 0 6px 24px rgba(27, 36, 51, 0.06);
}
.header-stripe {
  height: 6px;
  background: linear-gradient(90deg, var(--ww-red) 0 50%, var(--ww-green) 50% 100%);
}
.admin-banner {
  display: none;
  background: var(--ww-red);
  color: #fff;
  text-align: center;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.45rem 1rem;
}
.admin-banner:not([hidden]) { display: block; }
.badge-admin {
  background: var(--ww-red);
  color: #fff;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.22rem 0.55rem;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 0.7rem 1.4rem 0.75rem;
  max-width: 1440px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 210px;
  text-decoration: none;
  color: inherit;
}
.brand img { height: 42px; width: auto; display: block; }
.brand-text small {
  display: block;
  color: var(--ww-red);
  font-family: var(--font-head);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}
.brand-text strong {
  display: block;
  font-family: var(--font-head);
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  flex: 1;
  gap: 0.15rem;
  flex-wrap: wrap;
  align-items: center;
}
.nav button {
  background: none;
  border: 0;
  color: var(--ww-heading);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.55rem 0.8rem;
  border-radius: 6px;
  position: relative;
}
.nav button:hover { color: var(--ww-red); background: var(--ww-red-soft); }
.nav button.active { color: var(--ww-red); }
.nav button.active::after {
  content: "";
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  bottom: 0.15rem;
  height: 3px;
  background: var(--ww-red);
  border-radius: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.cart-btn {
  position: relative;
  background: var(--ww-red);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 0.55rem 0.9rem;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.cart-btn:hover { background: var(--ww-red-dark); }
.cart-count {
  position: absolute;
  top: -7px;
  right: -7px;
  background: var(--ww-green);
  color: #fff;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  font-size: 0.72rem;
  display: grid;
  place-items: center;
  padding: 0 5px;
}
.vs-mark {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--ww-muted);
  font-size: 0.72rem;
}
.vs-mark img { height: 22px; width: auto; }

.hero {
  position: relative;
  min-height: 250px;
  max-width: 100%;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(18, 16, 20, 0.78) 0%, rgba(18, 16, 20, 0.45) 55%, rgba(227, 8, 19, 0.28) 100%),
    url("../img/hero-wash.jpg") center/cover no-repeat;
  color: #fff;
}
.hero-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 2.4rem 1.4rem 2.6rem;
}
.hero .eyebrow {
  color: #ffd3d5;
  font-family: var(--font-head);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
}
.hero h1 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.65rem, 4vw, 2.7rem);
  line-height: 1.15;
  margin: 0.35rem 0 0.5rem;
  max-width: 100%;
}
.hero h1 em {
  font-style: normal;
  color: #fff;
  border-bottom: 4px solid var(--ww-red);
}
.hero p { margin: 0; max-width: 42ch; color: #e8ecf3; }
.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.2rem;
}
.pill {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(8px);
  border-radius: 8px;
  padding: 0.55rem 0.8rem;
  min-width: 160px;
}
.pill b {
  display: block;
  font-family: var(--font-head);
  color: var(--ww-red);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
.pill span { font-size: 0.88rem; }

.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.3rem 1.4rem 4rem;
  min-width: 0;
  width: 100%;
}
.view { display: none; }
.view.active { display: block; }

.eyebrow {
  color: var(--ww-red);
  font-family: var(--font-head);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  margin: 0 0 0.2rem;
}
h2.page-title {
  font-family: var(--font-head);
  font-size: 1.7rem;
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
}
.page-lead { color: var(--ww-muted); margin: 0 0 1.1rem; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin: 0.8rem 0 1rem;
}
.toolbar .grow { flex: 1; min-width: 180px; }

.search, .select, .input, textarea.input {
  width: 100%;
  border: 1px solid var(--ww-line);
  background: #fff;
  border-radius: 8px;
  padding: 0.58rem 0.75rem;
  color: var(--ww-ink);
  outline: none;
}
.search:focus, .select:focus, .input:focus, textarea.input:focus {
  border-color: var(--ww-red);
  box-shadow: 0 0 0 3px rgba(227, 8, 19, 0.12);
}
textarea.input { min-height: 88px; resize: vertical; }
label.lbl {
  display: block;
  font-size: 0.78rem;
  color: var(--ww-muted);
  font-weight: 700;
  margin: 0 0 0.25rem;
  font-family: var(--font-head);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.field { display: flex; flex-direction: column; gap: 0.15rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.75rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 6px;
  padding: 0.58rem 0.95rem;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  white-space: nowrap;
}
.btn-red { background: var(--ww-red); color: #fff; }
.btn-red:hover { background: var(--ww-red-dark); }
.btn-green { background: var(--ww-green); color: #fff; }
.btn-green:hover { background: var(--ww-green-dark); }
.btn-ghost {
  background: #fff;
  color: var(--ww-heading);
  border: 1px solid var(--ww-line);
}
.btn-ghost:hover { border-color: var(--ww-red); color: var(--ww-red); }
.btn-dark { background: var(--ww-ink); color: #fff; }
.btn-sm { padding: 0.35rem 0.6rem; font-size: 0.78rem; }
.btn-danger { background: var(--ww-red-soft); color: var(--ww-red); }
.icon-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1px solid var(--ww-line);
  background: #fff;
  display: grid; place-items: center;
  color: var(--ww-muted);
}
.icon-btn:hover { color: var(--ww-red); border-color: var(--ww-red); }

.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin: 1rem 0 1.2rem;
}
.kpi {
  background: #fff;
  border-radius: var(--ww-radius);
  padding: 1rem 1.1rem 1.05rem;
  box-shadow: var(--ww-shadow);
  border-top: 4px solid var(--ww-red);
  position: relative;
}
.kpi.green { border-top-color: var(--ww-green); }
.kpi.dark { border-top-color: var(--ww-ink); }
.kpi .k { color: var(--ww-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; font-family: var(--font-head); font-weight: 700; }
.kpi .v { font-family: var(--font-head); font-size: 1.7rem; font-weight: 800; letter-spacing: -0.03em; margin-top: 0.15rem; }
.kpi .s { color: var(--ww-muted); font-size: 0.82rem; }

.card {
  background: #fff;
  border-radius: var(--ww-radius);
  box-shadow: var(--ww-shadow);
  padding: 1rem 1.1rem;
  min-width: 0;
  max-width: 100%;
}
.card + .card { margin-top: 1rem; }
.card h3 {
  font-family: var(--font-head);
  margin: 0 0 0.7rem;
  font-size: 1.05rem;
}
.split {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
  min-width: 0;
}

.table-wrap {
  overflow: auto;
  border-radius: 8px;
  border: 1px solid var(--ww-line);
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
table.data {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  background: #fff;
}
table.data th {
  background: var(--ww-red);
  color: #fff;
  font-family: var(--font-head);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
  text-align: left;
  padding: 0.65rem 0.7rem;
  white-space: nowrap;
}
table.data.dark th { background: var(--ww-ink); }
table.data td {
  padding: 0.58rem 0.7rem;
  border-bottom: 1px solid var(--ww-line);
  vertical-align: middle;
  font-size: 0.92rem;
}
table.data tbody tr:hover { background: #fff7f7; }
table.data tbody tr.clickable { cursor: pointer; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .center { text-align: center; }
.sku {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  color: var(--ww-muted);
}
table.data td:first-child { white-space: nowrap; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-head);
}
.badge-red { background: var(--ww-red-soft); color: var(--ww-red); }
.badge-green { background: var(--ww-green-soft); color: var(--ww-green); }
.badge-muted { background: #eef1f6; color: var(--ww-muted); }
.badge-dark { background: var(--ww-ink); color: #fff; }
.cheap { color: var(--ww-green); font-weight: 800; background: var(--ww-green-soft); }
.stock-low { color: var(--ww-red); font-weight: 700; }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  border: 1px solid var(--ww-line);
  background: #fff;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.82rem;
  color: var(--ww-heading);
}
.chip.active { background: var(--ww-red); color: #fff; border-color: var(--ww-red); }

.empty {
  text-align: center;
  padding: 2.2rem 1rem;
  color: var(--ww-muted);
}
.empty strong { display: block; color: var(--ww-heading); font-family: var(--font-head); margin-bottom: 0.3rem; }

.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(18, 16, 20, 0.55);
  z-index: 60;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 1rem 2rem;
  overflow: auto;
}
.modal-back.open { display: flex; }
.modal {
  background: #fff;
  width: min(820px, 100%);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.25);
  overflow: hidden;
}
.modal.wide { width: min(1040px, 100%); }
.modal-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--ww-line);
  background: linear-gradient(90deg, #fff, #fff8f8);
}
.modal-h h3 { margin: 0; font-family: var(--font-head); }
.modal-b { padding: 1.1rem; }
.modal-f {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.85rem 1.1rem;
  border-top: 1px solid var(--ww-line);
  background: #fafbfc;
}

.price-rows { display: flex; flex-direction: column; gap: 0.45rem; }
.price-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.8fr 0.6fr auto;
  gap: 0.4rem;
  align-items: center;
}

.toast {
  position: fixed;
  bottom: 1.2rem;
  right: 1.2rem;
  background: var(--ww-ink);
  color: #fff;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  z-index: 80;
  display: none;
  box-shadow: var(--ww-shadow);
  max-width: 360px;
}
.toast.show { display: block; }
.toast.ok { background: var(--ww-green); }
.toast.err { background: var(--ww-red); }

.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}
.site-card {
  background: #fff;
  border-radius: 10px;
  padding: 0.9rem 1rem;
  box-shadow: var(--ww-shadow);
  border-left: 4px solid var(--ww-red);
}
.site-card h4 { margin: 0 0 0.2rem; font-family: var(--font-head); }
.site-card p { margin: 0; color: var(--ww-muted); font-size: 0.88rem; }

.sup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.85rem;
}
.sup-card {
  background: #fff;
  border-radius: 12px;
  padding: 1rem 1.05rem;
  box-shadow: var(--ww-shadow);
}
.sup-card header { display: flex; justify-content: space-between; gap: 0.5rem; align-items: flex-start; }
.sup-card h3 { margin: 0; font-family: var(--font-head); font-size: 1.05rem; }
.sup-card .meta { color: var(--ww-muted); font-size: 0.86rem; margin: 0.35rem 0 0.7rem; word-break: break-word; }
.sup-card p.sku { white-space: normal; }

.compare-legend { display: flex; gap: 1rem; color: var(--ww-muted); font-size: 0.85rem; margin-bottom: 0.6rem; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 0.3rem; vertical-align: -1px; }
.swatch.g { background: var(--ww-green-soft); border: 1px solid var(--ww-green); }

.order-summary {
  position: sticky;
  top: 92px;
}
.order-summary .line {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--ww-line);
}
.order-summary .total {
  display: flex;
  justify-content: space-between;
  margin-top: 0.6rem;
  background: var(--ww-red);
  color: #fff;
  padding: 0.7rem 0.8rem;
  border-radius: 8px;
  font-family: var(--font-head);
  font-weight: 700;
}
.qty {
  width: 72px;
  text-align: center;
}

.app-footer {
  background: var(--ww-ink);
  color: #c5ccd8;
  margin-top: auto;
}
.app-footer .stripe {
  height: 6px;
  background: linear-gradient(90deg, var(--ww-red) 0 50%, var(--ww-green) 50% 100%);
}
.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.4rem 1.4rem 1.6rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}
.app-footer strong { color: #fff; font-family: var(--font-head); }
.app-footer a { color: #fff; }
.vs-foot { display: flex; align-items: center; gap: 0.6rem; }
.vs-foot img { height: 28px; background: #fff; border-radius: 6px; padding: 3px 8px; }

.menu-toggle { display: none; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .split, .grid-4 { grid-template-columns: 1fr 1fr; }
  .price-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand menu"
      "actions actions"
      "nav nav";
    padding: 0.65rem 0.9rem 0.7rem;
    gap: 0.55rem 0.6rem;
    align-items: center;
  }
  .brand { grid-area: brand; min-width: 0; }
  .brand-text small { display: none; }
  .menu-toggle {
    grid-area: menu;
    display: inline-flex;
    min-width: 44px;
    padding: 0.45rem 0.75rem;
    background: var(--ww-ink);
    color: #fff;
    border: 0;
  }
  .header-actions {
    grid-area: actions;
    width: 100%;
    justify-content: space-between;
  }
  .nav {
    grid-area: nav;
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .nav.open { display: flex; }
  .kpis, .split, .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .hero-inner { padding: 1.5rem 1rem 1.7rem; }
  .hero h1 { max-width: 100%; font-size: 1.55rem; }
  .hero h1 .h-rest { display: block; }
  .hero p { max-width: 100%; }
  .vs-mark span { display: none; }
  .order-summary { position: static; }
  .page { padding: 1rem 0.9rem 3rem; }
  .who span:first-child { display: none; }
}

.who {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  font-size: 0.78rem;
  color: var(--ww-muted);
  line-height: 1.2;
}
.who span:first-child { color: var(--ww-heading); font-weight: 700; font-family: var(--font-head); }
#btnLogout {
  text-decoration: none;
  font-size: 1.2rem;
  width: 36px; height: 36px;
}

.part-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
}
.part-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--ww-shadow);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.part-card:hover { outline: 2px solid var(--ww-red); }
.part-photo {
  aspect-ratio: 1;
  background: #f3f5f8;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.part-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.part-photo.big { border-radius: 10px; max-height: 280px; }
.ph-fallback {
  color: var(--ww-muted);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.4rem;
}
.part-body { padding: 0.75rem 0.85rem 0.9rem; display: flex; flex-direction: column; gap: 0.2rem; flex: 1; }
.part-body h3 { margin: 0; font-family: var(--font-head); font-size: 0.98rem; line-height: 1.25; }
.part-body .meta { color: var(--ww-muted); font-size: 0.8rem; }
.part-body .price { font-family: var(--font-head); font-weight: 800; color: var(--ww-green); }
.part-actions { display: flex; gap: 0.35rem; margin-top: 0.45rem; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.8rem;
}
.photo-tile {
  margin: 0;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--ww-shadow);
}
.photo-tile img { width: 100%; height: 180px; object-fit: cover; display: block; }
.photo-tile figcaption { padding: 0.6rem 0.75rem 0.75rem; }
.photo-tile figcaption strong { display: block; font-family: var(--font-head); font-size: 0.9rem; }
.photo-tile figcaption span { color: var(--ww-muted); font-size: 0.78rem; }

.photo-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.55rem;
}
.thumb-card { margin: 0; }
.thumb-card img, .thumb-card .ph-fallback {
  width: 100%; height: 100px; object-fit: cover; border-radius: 8px; background: #eef1f6;
  display: grid; place-items: center;
}
.thumb-card figcaption { font-size: 0.75rem; color: var(--ww-muted); margin-top: 0.25rem; }

img.mini { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; display: block; }

.chips .chip { display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer; }
.chips .chip input { margin: 0; }

.section-title {
  font-family: var(--font-head);
  font-size: 1.15rem;
  margin: 1.6rem 0 0.7rem;
}
.staff-grid {
  display: grid;
  gap: 0.85rem;
}
.staff-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--ww-shadow);
  padding: 0.95rem 1.05rem 1.05rem;
}
.staff-card header {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
  margin-bottom: 0.7rem;
}
.staff-card h3 { margin: 0; font-family: var(--font-head); font-size: 1.05rem; }
.staff-card .meta { color: var(--ww-muted); font-size: 0.84rem; margin-top: 0.15rem; }
.staff-actions { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.assign-sites {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.site-toggle {
  border: 1px solid var(--ww-line);
  background: #fff;
  color: var(--ww-heading);
  border-radius: 999px;
  padding: 0.32rem 0.72rem;
  font-size: 0.82rem;
  font-family: var(--font-head);
  font-weight: 600;
}
.site-toggle:hover { border-color: var(--ww-red); color: var(--ww-red); }
.site-toggle.on {
  background: var(--ww-green);
  border-color: var(--ww-green);
  color: #fff;
}
.site-card .staff-line { margin-top: 0.45rem; font-size: 0.88rem; color: var(--ww-heading); }

body { display: flex; flex-direction: column; min-height: 100vh; }
main.page { flex: 1; }
