/* ==========================================================================
   NTech Computers — page-level components
   Search, product detail, cart, checkout, manage, forms.
   ========================================================================== */

/* ---------------------------- Mobile nav strip --------------------------- */
.mobile-nav {
  display: none;
  gap: 18px;
  padding: 10px 16px;
  overflow-x: auto;
  border-top: 1px solid var(--line-2);
  background: #fff;
  scrollbar-width: none;
}
.mobile-nav::-webkit-scrollbar { display: none; }
.mobile-nav a {
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  padding: 4px 0;
}
.mobile-nav a:hover { color: var(--blue-600); }
@media (max-width: 991px) { .mobile-nav { display: flex; } }

/* ------------------------------ Search page ------------------------------ */
.search-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  padding: 30px 0 20px;
}

.filter-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.filter-card h2 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.filter-list li { border-bottom: 1px solid var(--line-2); }
.filter-list li:last-child { border-bottom: 0; }

.filter-link {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 0;
  border: 0;
  background: none;
  font-size: 13px;
  color: var(--ink-2);
  text-align: left;
  transition: .15s ease;
}
.filter-link span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.filter-link i { color: var(--muted-2); font-size: 14px; }
.filter-link:hover { color: var(--blue-600); }
.filter-link.is-active { color: var(--blue-600); font-weight: 600; }
.filter-link.is-active i { color: var(--blue-500); }
.filter-count {
  font-size: 11px;
  color: var(--muted-2);
  background: var(--canvas-2);
  padding: 1px 7px;
  border-radius: var(--radius-pill);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 0;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
}
.check-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue-500);
  cursor: pointer;
}

.price-inputs { display: flex; align-items: center; gap: 8px; }
.price-inputs input {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: #fbfcfe;
}
.price-inputs input:focus {
  outline: none;
  border-color: var(--blue-200);
  box-shadow: 0 0 0 3px var(--blue-50);
  background: #fff;
}
.price-inputs span { color: var(--muted-2); }
.filter-apply { width: 100%; margin-top: 12px; }

.search-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line-2);
}
.search-toolbar h1 { font-size: 22px; font-weight: 800; }
.result-count { font-size: 13px; color: var(--muted); margin-top: 3px; }

.toolbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.select-wrap { position: relative; }
.select-wrap select {
  appearance: none;
  height: 40px;
  padding: 0 38px 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
}
.select-wrap select:focus { outline: none; border-color: var(--blue-200); box-shadow: 0 0 0 3px var(--blue-50); }
.select-wrap i {
  position: absolute;
  right: 13px; top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 11px;
  color: var(--muted-2);
}

.active-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: #fff;
  font-size: 12px;
  color: var(--ink-2);
  transition: .15s ease;
}
.filter-chip:hover { border-color: var(--blue-200); color: var(--blue-600); }
.filter-chip--clear { color: var(--red); border-color: #fbd5d5; background: #fff7f7; }

.search-form {
  position: relative;
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.search-form input {
  flex: 1;
  height: 46px;
  padding: 0 16px 0 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfcfe;
  font-size: 14px;
}
.search-form input:focus {
  outline: none;
  background: #fff;
  border-color: var(--blue-200);
  box-shadow: 0 0 0 4px var(--blue-50);
}
.search-form > i {
  position: absolute;
  left: 16px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  pointer-events: none;
}
.search-form .btn { height: 46px; }

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 30px;
}
.page-btn {
  min-width: 36px; height: 36px;
  padding: 0 10px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--ink-2);
  transition: .15s ease;
}
.page-btn:hover { border-color: var(--blue-300, #a8c4ff); color: var(--blue-600); }
.page-btn.is-active { background: var(--blue-500); border-color: var(--blue-500); color: #fff; font-weight: 600; }
.page-btn[disabled] { opacity: .4; cursor: not-allowed; }

/* ------------------------------ Product page ----------------------------- */
.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 44px;
  padding: 10px 0 20px;
  align-items: start;
}

.product-gallery { position: sticky; top: calc(var(--header-h) + 20px); }
.gallery-main {
  background: var(--canvas-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }

.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; }
.gallery-thumb {
  width: 74px; height: 74px;
  padding: 6px;
  background: var(--canvas-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: .15s ease;
  overflow: hidden;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumb:hover { border-color: var(--blue-200); }
.gallery-thumb.is-active { border-color: var(--blue-500); box-shadow: 0 0 0 3px var(--blue-50); }

.info-brand {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--blue-600);
  margin-bottom: 8px;
}
.info-title { font-size: clamp(23px, 3vw, 31px); font-weight: 800; line-height: 1.2; }

.info-rating {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
}
.stars { color: #f59e0b; font-size: 12px; display: inline-flex; gap: 2px; }
.sku { font-size: 12px; color: var(--muted-2); }

.info-price {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 20px 0 12px;
  flex-wrap: wrap;
}
.price--xl { font-size: 32px; }
.save-tag {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--green);
  background: var(--green-50);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.info-desc { color: var(--muted); font-size: 14.5px; max-width: 560px; }

.info-buy {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  flex-wrap: wrap;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  height: 46px;
}
.qty-control button {
  width: 40px; height: 100%;
  border: 0;
  background: #fff;
  color: var(--ink-2);
  font-size: 17px;
  transition: .15s ease;
}
.qty-control button:hover { background: var(--blue-50); color: var(--blue-600); }
.qty-control input {
  width: 48px;
  height: 100%;
  border: 0;
  border-inline: 1px solid var(--line);
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  -moz-appearance: textfield;
}
.qty-control input::-webkit-outer-spin-button,
.qty-control input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-control input:focus { outline: none; }

.info-assurance {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  padding: 16px 0;
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2);
  font-size: 12.5px;
  color: var(--ink-2);
}
.info-assurance span { display: inline-flex; align-items: center; gap: 7px; }
.info-assurance i { color: var(--blue-500); font-size: 15px; }

.info-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
  margin: 20px 0 0;
}
.info-facts div { display: flex; flex-direction: column; gap: 3px; }
.info-facts dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted-2); font-weight: 600; }
.info-facts dd { margin: 0; font-size: 13.5px; font-weight: 500; color: var(--ink-2); }

/* tabs */
.product-tabs {
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.tab-list {
  display: flex;
  gap: 4px;
  padding: 8px 10px 0;
  border-bottom: 1px solid var(--line);
  background: var(--canvas-2);
  overflow-x: auto;
}
.tab {
  padding: 11px 18px;
  border: 0;
  background: none;
  border-bottom: 2px solid transparent;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: .15s ease;
}
.tab:hover { color: var(--blue-600); }
.tab.is-active { color: var(--blue-600); border-bottom-color: var(--blue-500); background: #fff; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }

.tab-panel { display: none; padding: 24px; font-size: 14px; color: var(--ink-2); line-height: 1.7; }
.tab-panel.is-active { display: block; }

.bullet-list { margin-top: 14px; padding-left: 18px; list-style: disc; color: var(--muted); font-size: 13.5px; }
.bullet-list li { margin-bottom: 6px; }

.spec-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.spec-table th,
.spec-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line-2); }
.spec-table th { width: 42%; font-weight: 600; color: var(--muted); background: #fbfcfe; }
.spec-table tr:last-child th,
.spec-table tr:last-child td { border-bottom: 0; }

.review { padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.review:last-child { border-bottom: 0; }
.review-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; font-size: 13.5px; }
.review p { color: var(--muted); font-size: 13.5px; }

/* -------------------------------- Cart ----------------------------------- */
.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 28px;
  align-items: start;
  padding: 10px 0 20px;
}

.cart-lines {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.cart-head,
.cart-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 130px 110px 44px;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
}
.cart-head {
  background: var(--canvas-2);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.cart-line { border-bottom: 1px solid var(--line-2); }
.cart-line:last-of-type { border-bottom: 0; }

.cart-product { display: flex; align-items: center; gap: 14px; min-width: 0; }
.cart-thumb {
  width: 68px; height: 68px;
  flex-shrink: 0;
  background: var(--canvas-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  padding: 5px;
}
.cart-thumb img { width: 100%; height: 100%; object-fit: contain; }
.cart-name { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.4; }
.cart-name:hover { color: var(--blue-600); }
.cart-brand { font-size: 11.5px; color: var(--muted-2); }

.cart-price { font-size: 13.5px; color: var(--muted); }
.cart-total { font-size: 14px; font-weight: 700; }

.cart-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  height: 36px;
  overflow: hidden;
  width: fit-content;
}
.cart-qty button { width: 30px; height: 100%; border: 0; background: #fff; color: var(--ink-2); }
.cart-qty button:hover { background: var(--blue-50); color: var(--blue-600); }
.cart-qty input {
  width: 40px; height: 100%;
  border: 0; border-inline: 1px solid var(--line);
  text-align: center; font-size: 13px; font-weight: 600;
  -moz-appearance: textfield;
}
.cart-qty input::-webkit-outer-spin-button,
.cart-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.cart-remove {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--muted);
  transition: .15s ease;
}
.cart-remove:hover { color: var(--red); border-color: #fbd5d5; background: #fff7f7; }

.cart-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-top: 1px solid var(--line-2);
  flex-wrap: wrap;
}

.cart-summary {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: #fff;
}
.cart-summary h2 { font-size: 16px; margin-bottom: 16px; }

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 13.5px;
  color: var(--muted);
  border-bottom: 1px dashed var(--line);
}
.summary-row strong { color: var(--ink); font-weight: 600; }

.summary-hint { font-size: 12px; color: var(--muted); padding: 10px 0 0; }
.summary-hint--good { color: var(--green); display: flex; align-items: center; gap: 6px; }

.summary-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  margin-top: 4px;
  font-size: 15px;
  font-weight: 600;
}
.summary-total strong { font-family: var(--font-head); font-size: 22px; font-weight: 800; }

.summary-assurance {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
  font-size: 11.5px;
  color: var(--muted);
}
.summary-assurance span { display: inline-flex; align-items: center; gap: 5px; }
.summary-assurance i { color: var(--green); }

/* ------------------------------ Checkout --------------------------------- */
.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 28px;
  align-items: start;
  padding: 10px 0 20px;
}

.checkout-form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  background: #fff;
}
.form-section-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-2);
  display: flex;
  align-items: center;
  gap: 9px;
}
.form-section-title i { color: var(--blue-500); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field--full { grid-column: 1 / -1; }

.form-field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.form-field label .req { color: var(--red); }

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfcfe;
  font-size: 13.5px;
  transition: .15s ease;
}
.form-field textarea { resize: vertical; min-height: 90px; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--blue-200);
  box-shadow: 0 0 0 4px var(--blue-50);
}
.form-field input.is-invalid,
.form-field select.is-invalid {
  border-color: #f5a3a3;
  background: #fffbdb;
}
.field-error { font-size: 11.5px; color: var(--red); }
.form-hint { font-size: 11.5px; color: var(--muted-2); }

.radio-row { display: flex; flex-direction: column; gap: 10px; }
.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: .15s ease;
}
.radio-card:hover { border-color: var(--blue-200); background: var(--blue-50); }
.radio-card input { margin-top: 3px; accent-color: var(--blue-500); }
.radio-card strong { display: block; font-size: 13.5px; }
.radio-card small { color: var(--muted); font-size: 12px; }

.checkout-summary {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: #fff;
}
.checkout-summary h2 { font-size: 16px; margin-bottom: 14px; }

.checkout-lines { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; max-height: 260px; overflow-y: auto; }
.checkout-lines li { display: flex; align-items: center; gap: 11px; }
.co-thumb {
  width: 46px; height: 46px;
  flex-shrink: 0;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--canvas-2);
  padding: 4px;
  overflow: hidden;
}
.co-thumb img { width: 100%; height: 100%; object-fit: contain; }
.co-name { flex: 1; font-size: 12.5px; font-weight: 500; line-height: 1.35; min-width: 0; }
.co-name small { display: block; color: var(--muted-2); font-size: 11px; }
.co-price { font-size: 12.5px; font-weight: 600; white-space: nowrap; }

/* ----------------------------- Order success ----------------------------- */
.order-success {
  max-width: 620px;
  margin: 30px auto 40px;
  text-align: center;
  padding: 40px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #f7faff 0%, #ffffff 60%);
}
.success-icon {
  width: 72px; height: 72px;
  margin: 0 auto 20px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--green-50);
  color: var(--green);
  font-size: 32px;
}
.order-success h1 { font-size: 26px; }
.success-lead { color: var(--muted); margin: 10px 0 24px; }
.success-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: left;
  margin-bottom: 24px;
}
.success-card div { display: flex; justify-content: space-between; font-size: 13.5px; }
.success-card span { color: var(--muted); }
.success-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ------------------------------- Content --------------------------------- */
.prose { max-width: 760px; font-size: 14.5px; line-height: 1.8; color: var(--ink-2); }
.prose h2 { font-size: 19px; margin: 30px 0 10px; }
.prose h3 { font-size: 15.5px; margin: 22px 0 8px; }
.prose p { margin-bottom: 12px; color: var(--muted); }
.prose ul { padding-left: 20px; list-style: disc; margin-bottom: 14px; color: var(--muted); }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--blue-600); }

.entity-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 24px 0; }
.entity-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: #fff;
}
.entity-card i { font-size: 22px; color: var(--blue-500); margin-bottom: 10px; display: block; }
.entity-card h3 { font-size: 14px; margin-bottom: 6px; }
.entity-card p { font-size: 12.5px; color: var(--muted); }

/* --------------------------------- 404 ----------------------------------- */
.error-page { text-align: center; padding: 80px 20px; }
.error-code {
  font-family: var(--font-head);
  font-size: clamp(72px, 16vw, 140px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.05em;
  background: linear-gradient(135deg, var(--blue-500), #8fb4ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.error-page h1 { font-size: 24px; margin: 8px 0 10px; }
.error-page p { color: var(--muted); max-width: 440px; margin: 0 auto 24px; }

/* -------------------------------- Manage --------------------------------- */
.manage-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }

.manage-side {
  background: #0b1220;
  color: #c6d0e0;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.manage-side .brand { margin-bottom: 26px; }
.manage-side .brand-name { color: #fff; font-size: 17px; }
.manage-side .brand-tag { color: #7f8ca6; }

.manage-nav { display: flex; flex-direction: column; gap: 2px; }
.manage-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: #a7b3c8;
  transition: .15s ease;
}
.manage-nav a i { font-size: 15px; }
.manage-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.manage-nav a.is-active { background: var(--blue-500); color: #fff; font-weight: 600; }
.manage-nav-label {
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #67748c;
  padding: 18px 12px 8px;
  font-weight: 700;
}
.manage-side-foot { margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .08); }
.manage-side-foot a { font-size: 12.5px; color: #8b98b0; display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.manage-side-foot a:hover { color: #fff; }

.manage-main { background: var(--canvas-2); padding: 26px 30px 60px; min-width: 0; }
.manage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.manage-top h1 { font-size: 22px; font-weight: 800; }
.manage-top p { font-size: 13px; color: var(--muted); margin-top: 3px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.stat-card .stat-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.stat-card .stat-value { font-family: var(--font-head); font-size: 26px; font-weight: 800; margin-top: 6px; }
.stat-card .stat-note { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }
.stat-card--warn { border-color: #fde3b8; background: #fffdf7; }
.stat-card--danger { border-color: #fbd5d5; background: #fffafa; }

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-2);
  flex-wrap: wrap;
}
.panel-head h2 { font-size: 15px; }
.panel-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.panel-tools input[type="search"] {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: #fbfcfe;
  min-width: 200px;
}
.panel-tools input[type="search"]:focus { outline: none; background: #fff; border-color: var(--blue-200); }
.panel-tools select {
  height: 38px;
  padding: 0 30px 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: #fff;
  appearance: none;
}

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead th {
  text-align: left;
  padding: 11px 14px;
  background: #fbfcfe;
  border-bottom: 1px solid var(--line);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.data-table tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfcff; }

.row-product { display: flex; align-items: center; gap: 11px; min-width: 0; }
.row-thumb {
  width: 42px; height: 42px;
  flex-shrink: 0;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--canvas-2);
  padding: 3px;
  overflow: hidden;
}
.row-thumb img { width: 100%; height: 100%; object-fit: contain; }
.row-name { font-weight: 600; font-size: 13px; line-height: 1.35; }
.row-sku { font-size: 11px; color: var(--muted-2); }

.cell-actions { display: flex; gap: 6px; justify-content: flex-end; }
.icon-action {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  transition: .15s ease;
}
.icon-action:hover { color: var(--blue-600); border-color: var(--blue-200); background: var(--blue-50); }
.icon-action--danger:hover { color: var(--red); border-color: #fbd5d5; background: #fff7f7; }

.qty-inline { display: flex; align-items: center; gap: 6px; }
.qty-inline input {
  width: 58px;
  height: 32px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 13px;
  text-align: center;
  font-weight: 600;
}
.qty-inline input:focus { outline: none; border-color: var(--blue-200); box-shadow: 0 0 0 3px var(--blue-50); }
.qty-step {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}
.qty-step:hover { color: var(--blue-600); border-color: var(--blue-200); }

.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}
.status-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-dot--in { color: var(--green); }
.status-dot--low { color: var(--amber); }
.status-dot--out { color: var(--red); }
.status-dot--draft { color: var(--muted-2); }

/* modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  background: rgba(16, 24, 40, .55);
  backdrop-filter: blur(3px);
}
.modal.is-open { display: flex; }
.modal-card {
  width: 100%;
  max-width: 720px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: modal-in .2s ease;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-2);
}
.modal-head h2 { font-size: 17px; }
.modal-close {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}
.modal-close:hover { color: var(--red); border-color: #fbd5d5; }
.modal-body { padding: 22px; max-height: 70vh; overflow-y: auto; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 22px;
  border-top: 1px solid var(--line-2);
  background: #fbfcfe;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.spec-rows { display: flex; flex-direction: column; gap: 8px; }
.spec-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; align-items: center; }
.spec-row input {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: #fbfcfe;
}
.spec-row input:focus { outline: none; background: #fff; border-color: var(--blue-200); }
.spec-remove {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
}
.spec-remove:hover { color: var(--red); border-color: #fbd5d5; }

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 13.5px;
  cursor: pointer;
}
.switch {
  position: relative;
  width: 40px; height: 22px;
  border-radius: var(--radius-pill);
  background: #d8dfe9;
  transition: .18s ease;
  flex-shrink: 0;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: .18s ease;
}
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row input:checked + .switch { background: var(--blue-500); }
.switch-row input:checked + .switch::after { transform: translateX(18px); }

.image-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.image-preview-item {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--canvas-2);
  padding: 5px;
  overflow: hidden;
}
.image-preview-item img { width: 100%; height: 100%; object-fit: contain; }
.image-preview-item button {
  position: absolute;
  top: 3px; right: 3px;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(16, 24, 40, .72);
  color: #fff;
  font-size: 11px;
}

.banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  background: #fff;
}
.banner i { font-size: 16px; margin-top: 1px; }
.banner--info { background: var(--blue-50); border-color: var(--blue-100); color: var(--blue-700); }
.banner--warn { background: var(--amber-50); border-color: #fde3b8; color: #8a5a00; }

.muted { color: var(--muted); font-size: 13.5px; }

/* ------------------------------ Responsive ------------------------------- */
@media (max-width: 1180px) {
  .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 991px) {
  .search-layout { grid-template-columns: 1fr; }
  .search-filters { order: 2; }
  .product-detail { grid-template-columns: 1fr; gap: 28px; }
  .product-gallery { position: static; }
  .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
  .cart-summary, .checkout-summary { position: static; }
  .manage-shell { grid-template-columns: 1fr; }
  .manage-side { position: static; height: auto; }
  .manage-main { padding: 20px 16px 50px; }
  .entity-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .cart-head { display: none; }
  .cart-line {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      'product total'
      'qty price';
    gap: 10px 12px;
    padding: 14px;
  }
  .cart-product { grid-area: product; }
  .cart-price { grid-area: price; text-align: right; }
  .cart-qty { grid-area: qty; }
  .cart-total { grid-area: total; text-align: right; }
  .cart-remove { position: absolute; right: 10px; top: 10px; }
  .cart-line { position: relative; }
  .form-grid { grid-template-columns: 1fr; }
  .info-facts { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .data-table { font-size: 12px; }
  .data-table thead { display: none; }
  .data-table tbody tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-2);
  }
  .data-table tbody td { border: 0; padding: 0; }
  .data-table tbody td[data-label="Quantity"] { grid-column: 1; }
  .data-table tbody td.cell-actions { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
}

@media (max-width: 640px) {
  .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .section-head { gap: 12px; }
  .checkout-form { padding: 18px; }
  .cart-summary { padding: 18px; }
}
