:root {
  --ink: #171717;
  --muted: #6b625c;
  --paper: #fbfaf8;
  --line: #e7dfd6;
  --brand: #111111;
  --accent: #0f766e;
  --warm: #c68a2f;
  --rose: #b4234b;
  --success: #15803d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Tahoma, Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 68px;
  padding: 10px clamp(14px, 3vw, 34px);
  background: rgba(251, 250, 248, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  overflow: hidden;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.brand-lockup img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 50%;
  background: white;
}

.menu-toggle-input,
.menu-toggle-button {
  display: none;
}

.nav-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  overflow: hidden;
}

.chip,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.button.danger {
  border-color: #fecaca;
  background: #fff5f5;
  color: #b91c1c;
}

.button:disabled,
.button[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

.shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 28px;
  align-items: center;
  min-height: calc(100vh - 76px);
  padding: 34px 0 22px;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(38px, 6vw, 74px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero p {
  max-width: 660px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.hero-panel {
  min-height: 420px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.hero-panel img {
  display: block;
  width: min(230px, 70%);
  margin: 10px auto 24px;
}

.status-list {
  display: grid;
  gap: 10px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.section {
  padding: 34px 0;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-title h2 {
  margin: 0;
  font-size: 28px;
}

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

.card {
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 18px;
}

.muted {
  color: var(--muted);
}

.price {
  color: var(--accent);
  font-weight: 800;
}

.workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  padding: 24px 0 42px;
}

.side-panel,
.work-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.side-panel {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 116px);
  overflow: auto;
  padding: 16px;
}

.work-panel {
  min-width: 0;
  overflow: hidden;
  padding: 18px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  min-height: 96px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

.scan-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 10px;
  margin-bottom: 16px;
}

.scan-row input {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.table-wrap {
  max-height: min(72vh, 760px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.data-table,
table {
  width: 100%;
  border-collapse: collapse;
}

.data-table {
  min-width: 900px;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: inherit;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.data-table tbody tr:hover {
  background: #fbfaf8;
}

.module-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.module-list li {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.linked-list a {
  display: block;
  font-weight: 800;
}

.badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #f1eee9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.text-link {
  color: var(--accent);
  font-weight: 800;
}

.page-head {
  padding: 44px 0 16px;
}

.page-head h1 {
  margin: 8px 0 10px;
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.1;
}

.page-head p {
  max-width: 680px;
  color: var(--muted);
  line-height: 1.8;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px) 120px;
  gap: 10px;
  margin-bottom: 18px;
}

.catalog-filter {
  grid-template-columns: minmax(220px, 1.4fr) minmax(150px, 0.8fr) repeat(4, minmax(120px, 0.7fr)) auto auto;
  align-items: stretch;
}

.filter-bar input,
.filter-bar select,
.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.form-grid textarea {
  min-height: 120px;
  padding-top: 12px;
  resize: vertical;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.product-card {
  display: grid;
  gap: 14px;
  align-content: start;
  min-height: 270px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.product-media {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  background: #f4f0eb;
  overflow: hidden;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-media span {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: #fff;
  color: var(--warm);
  font-size: 34px;
  font-weight: 800;
}

.product-info {
  display: grid;
  gap: 8px;
}

.product-tags,
.catalog-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.catalog-meta {
  margin: 0 0 16px;
  color: var(--muted);
  font-weight: 800;
}

.catalog-meta.bottom {
  justify-content: center;
  margin-top: 18px;
}

.stock-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.stock-pill.is-ready {
  background: #eaf7ef;
  color: #1d6b3b;
}

.stock-pill.is-empty {
  background: #fff0f0;
  color: #a52828;
}

/* Stock status badges for inventory list */
.stock-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.stock-badge.stock-badge-ok {
  background: #eaf7ef;
  color: #1d6b3b;
}

.stock-badge.stock-badge-low {
  background: #fff8e6;
  color: #92600a;
}

.stock-badge.stock-badge-out {
  background: #fff0f0;
  color: #a52828;
}

/* Status filter tabs on stocks page */
.stock-status-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.stock-tab {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.15s, border-color 0.15s;
}

.stock-tab.is-active,
.stock-tab:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.stock-tab.stock-tab-ok.is-active {
  background: #1d6b3b;
  border-color: #1d6b3b;
}

.stock-tab.stock-tab-low.is-active {
  background: #92600a;
  border-color: #92600a;
}

.stock-tab.stock-tab-out.is-active {
  background: #a52828;
  border-color: #a52828;
}

.stock-badge.stock-badge-none {
  background: #f1eee9;
  color: #6b625c;
}

.stock-tab.stock-tab-none.is-active {
  background: #6b625c;
  border-color: #6b625c;
}

/* Stock detail info bar */
.stock-info-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.stock-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 160px;
  padding: 14px 18px;
  border-left: 1px solid var(--line);
}

.stock-info-item:last-child {
  border-left: none;
}

.stock-info-item span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.stock-info-item strong,
.stock-info-item a {
  font-size: 15px;
  font-weight: 800;
}

[dir="rtl"] .stock-info-item {
  border-left: none;
  border-right: 1px solid var(--line);
}

[dir="rtl"] .stock-info-item:last-child {
  border-right: none;
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: 26px;
  align-items: center;
  padding: 36px 0 20px;
}

.product-hero-media {
  display: grid;
  place-items: center;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.product-hero-media img {
  width: min(320px, 78%);
  max-height: 360px;
  object-fit: contain;
}

.product-info h1 {
  margin: 10px 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.1;
}

.checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.order-summary {
  display: grid;
  gap: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid h2,
.form-grid .wide {
  grid-column: 1 / -1;
}

.form-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border-top: 1px solid var(--line);
}

.cart-chip {
  gap: 8px;
}

.cart-chip span {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
}

.product-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: center;
}

.product-actions form,
.cart-qty-form {
  margin: 0;
}

.product-actions .button,
.product-actions form .button {
  width: 100%;
}

.storefront-buy-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 12px;
  margin-top: 18px;
}

.storefront-buy-box label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.storefront-buy-box select,
.storefront-buy-box input,
.cart-qty-form input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.storefront-buy-box .button {
  grid-column: 1 / -1;
}

.cart-qty-form {
  display: grid;
  grid-template-columns: 90px auto;
  gap: 8px;
  align-items: center;
}

.storefront-mini-lines {
  display: grid;
  gap: 8px;
  margin: 10px 0 12px;
}

.storefront-mini-lines > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.storefront-mini-lines span {
  color: var(--muted);
  line-height: 1.6;
}

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

.info-card {
  min-height: 210px;
}

.panel-title {
  align-items: flex-start;
}

.panel-title h1 {
  margin: 8px 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.12;
}

.panel-title p {
  max-width: 680px;
  line-height: 1.8;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.compact-title {
  align-items: center;
  margin: 24px 0 8px;
}

.compact-title h2 {
  font-size: 22px;
}

.title-tools {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.table-count {
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.page-link,
.page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.page-link.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.page-link.is-disabled {
  pointer-events: none;
  opacity: 0.4;
}

.page-arrow {
  font-size: 22px;
  line-height: 1;
}

.page-ellipsis {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 4px;
}

.process-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 74px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.process-step span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.process-step strong {
  font-size: 14px;
  line-height: 1.5;
}

.empty-state {
  margin: 0;
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
}

.alert {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  background: #ecfdf5;
  color: #065f46;
  font-weight: 800;
}

.alert.danger {
  border-color: #fecaca;
  background: #fff5f5;
  color: #991b1b;
}

.alert ul {
  margin: 8px 0 0;
}

.table-actions,
.form-actions,
.toggle-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.inline-form {
  display: inline;
  margin: 0;
}

.inline-form button {
  font: inherit;
  cursor: pointer;
}

.toggle-line {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.toggle-line input {
  width: auto;
  min-height: auto;
}

.truncate-cell {
  display: inline-block;
  max-width: min(320px, 42vw);
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.state-pill.on {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.state-pill.off {
  border-color: #e5e7eb;
  background: #f9fafb;
  color: #6b7280;
}

.chart-table td:nth-child(2),
.chart-table td:nth-child(3) {
  font-weight: 800;
}

.account-name {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
}

.account-name.level-1 {
  color: var(--brand);
  font-size: 15px;
}

.account-name.level-2 {
  padding-inline-start: 18px;
  color: var(--accent);
}

.account-name.level-3 {
  padding-inline-start: 36px;
  color: var(--ink);
  font-weight: 700;
}

.account-level-1 {
  background: #f7f2eb;
}

.account-level-2 {
  background: #fbfaf8;
}

.module-section {
  margin: 18px 0 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.filter-section {
  margin-top: 16px;
}

.module-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.module-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.filter-fields {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  align-items: end;
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.module-fields label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.module-fields input,
.module-fields select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.related-cell {
  display: inline-block;
  max-width: 260px;
  color: var(--ink);
  font-weight: 800;
  white-space: normal;
}

.product-section-list {
  gap: 10px;
}

.product-section-link {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.product-section-link strong {
  font-size: 15px;
}

.product-section-link span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.product-section-link.is-active {
  border-color: var(--brand);
  background: #f7f2eb;
}

.product-aside-note {
  margin-top: 16px;
}

.product-highlight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 4px;
}

.product-highlight {
  min-height: 120px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.product-highlight strong {
  display: block;
  margin-bottom: 10px;
  font-size: 15px;
}

.product-highlight p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.color-swatch-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.color-swatch {
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 50%;
}

.product-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 14px;
  margin-bottom: 14px;
}

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

.detail-grid > div {
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.detail-grid span,
.detail-grid strong {
  display: block;
}

.detail-grid span {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
}

.detail-grid strong {
  line-height: 1.7;
}

.detail-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.tool-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-right-width: 4px;
  border-radius: 8px;
  background: #fff;
}

.tool-card button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.report-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.report-filter {
  margin-top: 12px;
}

.smart-metric {
  border-top-width: 4px;
}

.smart-advice-list {
  display: grid;
  gap: 10px;
}

.smart-advice-list p {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  color: var(--muted);
  line-height: 1.8;
}

.print-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px;
}

.print-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 14px;
}

.voucher-print {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.voucher-head,
.signature-grid,
.voucher-grid {
  display: grid;
  gap: 14px;
}

.voucher-head {
  grid-template-columns: 1fr auto;
  align-items: start;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.voucher-head h1 {
  margin: 8px 0 4px;
  font-size: 30px;
}

.voucher-number {
  min-width: 180px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
}

.voucher-number span,
.voucher-grid span,
.voucher-box span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.voucher-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 18px 0;
}

.voucher-grid > div,
.voucher-box {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.voucher-box {
  margin: 14px 0;
}

.signature-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 38px;
}

.signature-grid div {
  min-height: 80px;
  padding-top: 12px;
  border-top: 1px solid var(--ink);
  text-align: center;
  font-weight: 800;
}

@media print {
  .topbar,
  .print-actions {
    display: none;
  }

  body {
    background: #fff;
  }

  .print-page {
    max-width: none;
    padding: 0;
  }

  .voucher-print {
    border: 0;
  }
}

.policy-block {
  max-width: 840px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.policy-block h2 {
  margin: 0 0 14px;
  font-size: 26px;
}

.policy-block p {
  color: var(--muted);
  line-height: 1.9;
}

@media (max-width: 1180px) {
  .catalog-filter {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
    max-height: none;
  }

  .grid,
  .metric-grid,
  .product-grid,
  .process-grid,
  .product-highlight-grid,
  .detail-grid,
  .detail-metric-grid,
  .module-fields,
  .tool-grid,
  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-actions {
    justify-content: flex-start;
  }

  .title-tools {
    justify-content: flex-start;
  }

  .scan-row,
  .filter-bar,
  .checkout-grid,
  .product-detail {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .grid,
  .metric-grid,
  .product-grid,
  .process-grid,
  .module-fields,
  .tool-grid,
  .product-detail-grid,
  .voucher-grid,
  .signature-grid,
  .info-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 40px;
  }

  .product-actions,
  .storefront-buy-box,
  .cart-qty-form {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    max-height: none;
  }

  .data-table {
    min-width: 760px;
  }
}

/* Seller POS */
.pos-page {
  padding: 24px 0 48px;
}

.pos-page-header,
.pos-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.pos-page-header {
  margin-bottom: 18px;
  padding: 0 2px;
}

.pos-page-header > div:first-child,
.pos-section-heading > div:first-child {
  min-width: 0;
}

.pos-page-header h1,
.pos-section-heading h2 {
  margin: 8px 0 0;
  letter-spacing: 0;
}

.pos-page-header h1 {
  font-size: 42px;
  line-height: 1.1;
}

.pos-section-heading h2 {
  font-size: 26px;
  line-height: 1.2;
}

.pos-page .muted {
  line-height: 1.7;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
}

.pos-alert {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  line-height: 1.8;
}

.pos-alert strong {
  display: block;
}

.pos-alert ul {
  margin: 8px 0 0;
  padding-inline-start: 18px;
}

.pos-alert-error {
  border-color: #fecaca;
  background: #fff7f7;
  color: #991b1b;
}

.pos-alert-warning {
  border-color: #f5d49a;
  background: #fffaf0;
  color: #854d0e;
}

.pos-alert-success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.pos-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.pos-metrics > div {
  min-height: 102px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.04);
}

.pos-metrics span,
.pos-product-meta,
.pos-product-stock {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.pos-metrics strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
  line-height: 1.2;
}

.pos-workspace {
  display: grid;
  grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
  grid-template-areas: "checkout sale";
  gap: 18px;
  align-items: start;
}

.pos-sale-area {
  grid-area: sale;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  min-width: 0;
}

.pos-checkout-panel {
  grid-area: checkout;
}

.pos-scan-panel,
.pos-cart-panel,
.pos-checkout-panel,
.pos-recent {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.04);
}

.pos-scan-panel,
.pos-cart-panel,
.pos-checkout-panel {
  padding: 20px;
}

.pos-cart-panel {
  min-height: 460px;
}

.pos-checkout-panel {
  position: sticky;
  top: 94px;
}

.pos-checkout-panel .button,
.pos-scan-panel .button,
.pos-search-item,
.pos-remove-button,
.pos-mode-button {
  touch-action: manipulation;
}

.pos-scan-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 10px;
  margin-top: 16px;
}

.pos-scan-row input,
.pos-form-stack input,
.pos-form-stack select,
.pos-form-stack textarea,
.pos-line-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.pos-scan-row input,
.pos-form-stack input,
.pos-form-stack select {
  min-height: 56px;
  padding: 0 14px;
  font-size: 17px;
}

.pos-form-stack textarea {
  min-height: 92px;
  padding: 11px 12px;
  resize: vertical;
  font-size: 15px;
}

.pos-search-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.pos-search-results:empty {
  display: none;
}

.pos-search-item {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfcfc;
  color: var(--ink);
  text-align: right;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.pos-search-item:hover {
  border-color: var(--accent);
  background: #f4fbfa;
  transform: translateY(-1px);
}

.pos-search-item:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.pos-search-item span {
  color: var(--muted);
  font-size: 12px;
}

.pos-cart-table-wrap {
  margin-top: 16px;
  max-height: 62vh;
  overflow: auto;
}

.pos-cart-table {
  min-width: 940px;
}

.pos-cart-table th:nth-child(1) {
  min-width: 280px;
}

.pos-cart-table th:nth-child(2),
.pos-cart-table th:nth-child(3),
.pos-cart-table th:nth-child(4),
.pos-cart-table th:nth-child(5),
.pos-cart-table th:nth-child(6) {
  min-width: 120px;
}

.pos-product-name {
  display: block;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.pos-product-stock {
  margin-top: 4px;
  color: var(--success);
  font-weight: 700;
}

.pos-line-input {
  min-height: 50px;
  padding: 0 10px;
  font-size: 16px;
}

.pos-remove-button {
  display: inline-grid;
  width: 48px;
  height: 48px;
  padding: 0;
  place-items: center;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff7f7;
  color: #b91c1c;
  font: 700 28px/1 Arial, sans-serif;
  cursor: pointer;
}

.pos-empty-row td {
  height: 220px;
  color: var(--muted);
  text-align: center;
  vertical-align: middle;
  font-size: 18px;
}

.pos-form-stack {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.pos-form-stack label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.pos-inline-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pos-print-mode {
  display: grid;
  gap: 8px;
}

.pos-print-mode > span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.pos-print-mode-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pos-mode-button {
  min-height: 54px;
  font-size: 15px;
}

.pos-mode-button.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.pos-totals,
.sales-invoice-totals,
.sales-invoice-notes dl {
  margin: 18px 0 0;
}

.pos-totals {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
}

.pos-totals > div,
.sales-invoice-totals > div,
.sales-invoice-notes dl > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.pos-totals > div:last-child,
.sales-invoice-totals > div:last-child,
.sales-invoice-notes dl > div:last-child {
  border-bottom: 0;
}

.pos-totals dt,
.pos-totals dd,
.sales-invoice-totals dt,
.sales-invoice-totals dd,
.sales-invoice-notes dt,
.sales-invoice-notes dd {
  margin: 0;
}

.pos-totals dt,
.sales-invoice-totals dt,
.sales-invoice-notes dt {
  color: var(--muted);
}

.pos-totals dd {
  font-weight: 700;
}

.pos-grand-total {
  color: var(--accent);
  font-size: 22px;
  font-weight: 800;
}

.pos-submit-actions {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
  margin-top: 16px;
}

.pos-touch-button {
  min-height: 60px;
  font-size: 18px;
  font-weight: 700;
}

.pos-recent {
  margin-top: 18px;
  padding: 20px;
}

.pos-recent .table-wrap {
  margin-top: 16px;
}

.pos-small-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Sales invoice print */
.invoice-print-body {
  min-width: 320px;
  padding: 24px;
  background: #ece9e4;
}

.invoice-print-thermal {
  background: #f4f2ee;
}

.invoice-print-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  width: min(1040px, 100%);
  margin: 0 auto 12px;
}

.sales-invoice-document {
  position: relative;
  width: min(1040px, 100%);
  min-height: 1240px;
  margin: 0 auto;
  padding: 34px;
  overflow: hidden;
  border: 1px solid #d8d2cb;
  background: #fff;
  box-shadow: 0 16px 40px rgba(23, 23, 23, 0.08);
}

.sales-invoice-document-thermal {
  width: 80mm;
  min-height: 0;
  padding: 8mm 6mm;
  box-shadow: none;
}

.sales-invoice-document-thermal .invoice-draft-mark {
  font-size: 70px;
}

.sales-invoice-document-thermal .sales-invoice-header,
.sales-invoice-document-thermal .sales-invoice-summary,
.sales-invoice-document-thermal .sales-invoice-footer {
  display: block;
}

.sales-invoice-document-thermal .sales-invoice-brand,
.sales-invoice-document-thermal .sales-invoice-title {
  text-align: center;
  justify-content: center;
}

.sales-invoice-document-thermal .sales-invoice-brand {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.sales-invoice-document-thermal .sales-invoice-brand img {
  width: 52px;
  height: 52px;
}

.sales-invoice-document-thermal .sales-invoice-brand strong,
.sales-invoice-document-thermal .sales-invoice-title strong {
  font-size: 16px;
}

.sales-invoice-document-thermal .sales-invoice-meta {
  grid-template-columns: 1fr;
}

.sales-invoice-document-thermal .sales-invoice-table {
  min-width: 0;
  font-size: 11px;
}

.sales-invoice-document-thermal .sales-invoice-table th,
.sales-invoice-document-thermal .sales-invoice-table td {
  padding: 5px 3px;
  white-space: normal;
}

.sales-invoice-document-thermal .sales-invoice-notes {
  margin-bottom: 10px;
}

.sales-invoice-document-thermal .sales-invoice-notes dl,
.sales-invoice-document-thermal .sales-invoice-totals {
  max-width: none;
  width: 100%;
}

.sales-invoice-document-thermal .sales-invoice-footer {
  margin-top: 18px;
  text-align: center;
}

.invoice-draft-mark {
  position: absolute;
  top: 48%;
  left: 50%;
  color: rgba(180, 35, 75, 0.08);
  font-size: 130px;
  font-weight: 900;
  transform: translate(-50%, -50%) rotate(-25deg);
  pointer-events: none;
}

.sales-invoice-header,
.sales-invoice-brand,
.sales-invoice-footer,
.sales-invoice-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.sales-invoice-header {
  padding-bottom: 24px;
  border-bottom: 3px solid var(--ink);
}

.sales-invoice-brand img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.sales-invoice-brand div,
.sales-invoice-title {
  display: grid;
  gap: 5px;
}

.sales-invoice-brand strong {
  font-size: 24px;
}

.sales-invoice-brand span,
.sales-invoice-title span,
.sales-invoice-title small {
  color: var(--muted);
}

.sales-invoice-title {
  text-align: left;
}

.sales-invoice-title strong {
  font-size: 22px;
}

.sales-invoice-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 22px 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.sales-invoice-meta > div {
  min-height: 70px;
  padding: 12px;
  background: #fff;
}

.sales-invoice-meta span,
.sales-invoice-table small,
.sales-invoice-notes > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.sales-invoice-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
}

.sales-invoice-table {
  min-width: 850px;
}

.sales-invoice-table th {
  background: #f6f4f1;
}

.sales-invoice-table td strong,
.sales-invoice-table td small {
  display: block;
}

.sales-invoice-summary {
  align-items: flex-start;
  margin-top: 22px;
}

.sales-invoice-notes {
  flex: 1;
  min-width: 0;
}

.sales-invoice-notes p {
  min-height: 64px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  white-space: pre-line;
}

.sales-invoice-notes dl {
  max-width: 420px;
}

.sales-invoice-totals {
  width: min(360px, 100%);
}

.sales-invoice-grand {
  color: var(--accent);
  font-size: 18px;
  font-weight: 800;
}

.sales-invoice-footer {
  align-items: flex-end;
  margin-top: 80px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.sales-invoice-footer div {
  display: grid;
  gap: 4px;
}

.sales-invoice-footer span,
.sales-invoice-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1050px) {
  .pos-workspace {
    grid-template-columns: 1fr;
    grid-template-areas:
      "sale"
      "checkout";
  }

  .pos-checkout-panel {
    position: static;
  }

  .pos-search-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pos-cart-panel {
    min-height: 0;
  }
}

@media (max-width: 700px) {
  .pos-page-header,
  .pos-section-heading,
  .sales-invoice-header,
  .sales-invoice-summary,
  .sales-invoice-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .pos-metrics,
  .sales-invoice-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pos-scan-row,
  .pos-search-results,
  .pos-submit-actions {
    grid-template-columns: 1fr;
  }

  .quick-actions {
    width: 100%;
  }

  .quick-actions .button {
    flex: 1 1 140px;
  }

  .pos-page-header h1 {
    font-size: 34px;
  }

  .pos-section-heading h2 {
    font-size: 22px;
  }

  .pos-cart-table {
    min-width: 760px;
  }

  .sales-invoice-title {
    text-align: right;
  }
}

@media (max-width: 480px) {
  .pos-metrics,
  .pos-inline-fields,
  .pos-print-mode-buttons,
  .sales-invoice-meta {
    grid-template-columns: 1fr;
  }

  .pos-page-header h1 {
    font-size: 28px;
  }

  .pos-page {
    padding-top: 18px;
  }

  .pos-scan-panel,
  .pos-cart-panel,
  .pos-checkout-panel,
  .pos-recent {
    padding: 14px;
  }

  .pos-metrics > div {
    min-height: 88px;
    padding: 14px;
  }

  .pos-metrics strong {
    font-size: 24px;
  }

  .pos-scan-row input,
  .pos-form-stack input,
  .pos-form-stack select {
    min-height: 52px;
    font-size: 16px;
  }

  .invoice-print-body {
    padding: 8px;
  }

  .sales-invoice-document {
    padding: 18px;
  }
}

@media print {
  @page {
    size: A4;
    margin: 10mm;
  }

  @page thermal {
    size: 80mm auto;
    margin: 4mm;
  }

  .invoice-print-body {
    padding: 0;
    background: #fff;
  }

  .invoice-print-actions {
    display: none;
  }

  .sales-invoice-document {
    width: 100%;
    min-height: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .invoice-print-thermal .sales-invoice-document {
    width: 72mm;
    padding: 0;
  }

  .invoice-print-thermal .sales-invoice-document,
  .invoice-print-thermal * {
    page-break-inside: avoid;
  }

  .sales-invoice-table-wrap {
    overflow: visible;
  }

  .sales-invoice-table {
    min-width: 0;
    font-size: 10px;
  }

  .sales-invoice-table th,
  .sales-invoice-table td {
    padding: 7px 5px;
    white-space: normal;
  }

  .sales-invoice-footer {
    margin-top: 36px;
  }

  .invoice-print-thermal .sales-invoice-footer {
    margin-top: 18px;
  }
}

/* Admin dashboard */
.admin-top-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(100%, 1120px);
  overflow-x: auto;
  padding: 2px;
}

.admin-menu-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #26221f;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-menu-link.is-active,
.admin-menu-link:hover {
  border-color: #111;
  background: #111;
  color: #fff;
}

.admin-menu-primary {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}

.admin-menu-spacer {
  flex: 1 0 12px;
}

.admin-dashboard {
  padding-bottom: 48px;
}

.admin-hero-band {
  padding: 30px 0 22px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(198, 138, 47, 0.08)),
    #fff;
}

.admin-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px) auto;
  gap: 22px;
  align-items: end;
}

.admin-hero-copy h1 {
  margin: 8px 0 10px;
  font-size: 38px;
  line-height: 1.18;
}

.admin-hero-copy p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.admin-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.admin-hero-visual {
  align-self: stretch;
  min-height: 132px;
  overflow: hidden;
  border: 1px solid rgba(231, 223, 214, 0.9);
  border-radius: 8px;
  background: #fff;
}

.admin-hero-visual img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 132px;
  object-fit: cover;
  object-position: center;
}

.admin-date {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-weight: 800;
}

.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.admin-kpi,
.admin-report,
.admin-quick-link,
.admin-health-item,
.admin-flow-node {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-kpi {
  display: grid;
  gap: 8px;
  min-height: 116px;
  padding: 16px;
  border-top-width: 4px;
}

.admin-kpi span,
.admin-report span,
.admin-health-item span,
.admin-flow-node span {
  color: #443d37;
  font-weight: 800;
}

.admin-kpi strong {
  font-size: 30px;
  line-height: 1;
}

.admin-kpi small,
.admin-report small,
.admin-flow-node small,
.admin-side-title span,
.admin-quick-link span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.admin-dashboard-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.admin-side-menu {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 116px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-side-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.admin-side-title strong {
  font-size: 16px;
}

.admin-side-group {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #eee7df;
  border-radius: 8px;
  background: #fffdfa;
}

.admin-side-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 900;
}

.admin-side-link b {
  min-width: 38px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  text-align: center;
  font-size: 12px;
}

.admin-side-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-side-sub a {
  padding: 5px 8px;
  border-radius: 7px;
  background: #f3eee8;
  color: #5f544a;
  font-size: 12px;
  font-weight: 800;
}

.admin-dashboard-main {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.admin-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.admin-panel-head h2 {
  margin: 6px 0 0;
  font-size: 24px;
}

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

.admin-quick-link {
  display: grid;
  gap: 6px;
  min-height: 88px;
  padding: 14px;
}

.admin-quick-link strong {
  font-size: 16px;
}

.admin-report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-report {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 14px;
  border-right-width: 4px;
}

.admin-report strong {
  font-size: 22px;
  line-height: 1.2;
}

.admin-flow {
  display: flex;
  align-items: stretch;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 6px;
}

.admin-flow-node {
  display: grid;
  gap: 7px;
  flex: 0 0 160px;
  min-height: 120px;
  padding: 14px;
}

.admin-flow-node strong {
  font-size: 24px;
}

.admin-flow-connector {
  position: relative;
  flex: 0 0 38px;
  align-self: center;
  height: 18px;
}

.admin-flow-connector::before,
.admin-flow-connector::after {
  content: "";
  position: absolute;
  top: 50%;
  background: #cfc6bc;
}

.admin-flow-connector::before {
  right: 0;
  left: 6px;
  height: 2px;
  transform: translateY(-50%);
}

.admin-flow-connector::after {
  left: 2px;
  width: 10px;
  height: 10px;
  border-top: 2px solid #cfc6bc;
  border-left: 2px solid #cfc6bc;
  background: transparent;
  transform: translateY(-50%) rotate(-45deg);
}

.admin-health-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-health-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 74px;
  padding: 14px;
  border-right-width: 4px;
}

.admin-health-item strong {
  font-size: 24px;
}

.admin-tone-blue {
  border-color: #bfdbfe;
  border-top-color: #2563eb;
  border-right-color: #2563eb;
}

.admin-tone-teal {
  border-color: #99f6e4;
  border-top-color: #0f766e;
  border-right-color: #0f766e;
}

.admin-tone-green {
  border-color: #bbf7d0;
  border-top-color: #15803d;
  border-right-color: #15803d;
}

.admin-tone-amber {
  border-color: #fde68a;
  border-top-color: #b45309;
  border-right-color: #b45309;
}

.admin-tone-rose {
  border-color: #fecdd3;
  border-top-color: #be123c;
  border-right-color: #be123c;
}

.admin-tone-indigo {
  border-color: #c7d2fe;
  border-top-color: #4f46e5;
  border-right-color: #4f46e5;
}

.admin-tone-slate,
.admin-tone-black {
  border-color: #d6d3d1;
  border-top-color: #44403c;
  border-right-color: #44403c;
}

@media (max-width: 1120px) {
  .admin-kpi-grid,
  .admin-report-grid,
  .admin-health-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .admin-hero-grid,
  .admin-dashboard-layout {
    grid-template-columns: 1fr;
  }

  .admin-hero-actions {
    justify-content: flex-start;
  }

  .admin-side-menu {
    position: static;
    max-height: none;
  }

  .admin-hero-visual {
    max-width: 360px;
  }
}

@media (max-width: 560px) {
  .admin-hero-copy h1 {
    font-size: 30px;
  }

  .admin-kpi-grid,
  .admin-report-grid,
  .admin-quick-grid,
  .admin-health-list {
    grid-template-columns: 1fr;
  }

  .admin-panel-head,
  .admin-side-title,
  .admin-health-item {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Unified Mido Center interface */
.topbar {
  min-width: 0;
  box-shadow: 0 10px 26px rgba(23, 23, 23, 0.04);
}

.brand-lockup {
  flex: 0 0 auto;
}

.brand-lockup span {
  white-space: nowrap;
}

.nav-actions {
  flex: 1 1 auto;
  min-width: 0;
}

.mido-top-menu,
.admin-top-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.mido-top-menu::-webkit-scrollbar,
.admin-top-menu::-webkit-scrollbar {
  display: none;
}

.mido-menu-link,
.admin-menu-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #26221f;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.mido-menu-link.is-active,
.admin-menu-link.is-active,
.mido-menu-link:hover,
.admin-menu-link:hover {
  border-color: #111;
  background: #111;
  color: #fff;
}

.mido-menu-primary,
.admin-menu-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.mido-menu-spacer,
.admin-menu-spacer {
  flex: 1 0 12px;
}

.cart-chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  margin-inline-start: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 12px;
}

.workspace {
  width: min(1440px, calc(100% - 32px));
  align-items: start;
  padding-top: 22px;
}

.side-panel,
.work-panel,
.module-section,
.product-highlight,
.shopdash-metric,
.shopdash-module,
.shopdash-table,
.shopmodule-note,
.shopmodule-card,
.shopmodule-filter,
.shopmodule-table,
.product-card,
.form-grid {
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.045);
}

.side-panel {
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.045), rgba(198, 138, 47, 0.035)),
    #fff;
}

.side-panel h2 {
  margin: 10px 0 16px;
  font-size: 24px;
  line-height: 1.25;
}

.work-panel {
  padding: 20px;
}

.section-title.panel-title,
.shopdash-header,
.shopmodule-header,
.page-head {
  border-bottom: 1px solid var(--line);
}

.section-title.panel-title {
  align-items: flex-start;
  margin: -4px -2px 18px;
  padding: 4px 2px 18px;
}

.section-title.panel-title h1,
.shopdash-header h1,
.shopmodule-header h1,
.page-head h1 {
  letter-spacing: 0;
}

.section-title.panel-title h1 {
  margin: 8px 0 8px;
  font-size: 34px;
  line-height: 1.18;
}

.metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.metric,
.shopdash-metric,
.shopmodule-card {
  border-top: 4px solid var(--accent);
}

.metric:nth-child(2n),
.shopdash-metric:nth-child(2n),
.shopmodule-card:nth-child(2n) {
  border-top-color: var(--warm);
}

.metric:nth-child(3n),
.shopdash-metric:nth-child(3n),
.shopmodule-card:nth-child(3n) {
  border-top-color: var(--success);
}

.metric:nth-child(4n),
.shopdash-metric:nth-child(4n),
.shopmodule-card:nth-child(4n) {
  border-top-color: var(--rose);
}

.module-section,
.filter-section {
  margin: 18px 0;
  background: #fffdfb;
}

.module-toolbar {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.module-fields input,
.module-fields select,
.module-fields textarea,
.filter-bar input,
.filter-bar select,
.form-grid input,
.form-grid select,
.form-grid textarea,
.shopmodule-filter input,
.shopmodule-filter select {
  min-height: 46px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.module-fields input:focus,
.module-fields select:focus,
.module-fields textarea:focus,
.filter-bar input:focus,
.filter-bar select:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.shopmodule-filter input:focus,
.shopmodule-filter select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.product-section-link,
.module-list li,
.linked-list a {
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.product-section-link:hover,
.product-section-link.is-active,
.module-list li:hover {
  border-color: var(--accent);
  background: #f0fdfa;
}

.product-section-link.is-active {
  box-shadow: inset 4px 0 0 var(--accent);
}

[dir="rtl"] .product-section-link.is-active {
  box-shadow: inset -4px 0 0 var(--accent);
}

.product-highlight {
  background: #fffdf8;
}

.table-wrap {
  max-height: min(74vh, 820px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.035);
}

th {
  background: #fffdfb;
  color: #514842;
  font-weight: 900;
}

td {
  color: #221f1c;
}

.data-table tbody tr:nth-child(even),
.table-wrap table tbody tr:nth-child(even) {
  background: #fffdfb;
}

.data-table tbody tr:hover,
.table-wrap table tbody tr:hover {
  background: #f4fbf9;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.table-actions .button,
.inline-form .button {
  min-height: 34px;
  padding-inline: 10px;
  font-size: 12px;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f9fafb;
  color: #57534e;
  font-size: 12px;
  font-weight: 900;
}

.state-pill.on {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.state-pill.off {
  border-color: #fecaca;
  background: #fff5f5;
  color: #991b1b;
}

.alert {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  background: #f0fdfa;
  color: #115e59;
  font-weight: 800;
}

.alert.danger {
  border-color: #fecaca;
  background: #fff5f5;
  color: #991b1b;
}

.empty-state {
  margin: 0;
  padding: 18px;
  border: 1px dashed #d6d3d1;
  border-radius: 8px;
  background: #fffdfb;
  color: var(--muted);
  font-weight: 800;
}

.page-head {
  margin-top: 18px;
  padding: 34px 0 22px;
}

.filter-bar {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.04);
}

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

.product-card .product-info,
.product-card .product-actions {
  padding-inline: 14px;
}

.product-card .product-actions {
  padding-bottom: 14px;
}

.product-media {
  border-radius: 0;
}

.shopdash,
.shopmodule {
  padding-top: 26px !important;
}

.shopdash-header,
.shopmodule-header,
.shopdash-table-head,
.shopmodule-table-head,
.shopmodule-filter-head,
.shopmodule-note {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.shopdash-header,
.shopmodule-header {
  margin-bottom: 18px;
  padding-bottom: 18px;
}

.shopdash-header h1,
.shopmodule-header h1 {
  margin: 8px 0 10px;
  font-size: 40px;
  line-height: 1.1;
}

.shopdash-header p,
.shopmodule-header p,
.shopmodule-note p,
.shopdash-table-head p,
.shopmodule-table-head p {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.8;
}

.shopdash-actions,
.shopmodule-actions,
.shopmodule-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.shopdash-metrics,
.shopmodule-metrics,
.shopdash-grid,
.shopmodule-filter-grid,
.shopmodule-summary,
.shiftops,
.shiftops-current {
  display: grid;
  gap: 14px;
}

.shopdash-metrics,
.shopmodule-metrics,
.shopmodule-filter-grid,
.shiftops-current {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.shopdash-grid,
.shopmodule-summary,
.shiftops {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.shopdash-grid,
.shopdash-metrics,
.shopmodule-metrics,
.shopmodule-summary,
.shopmodule-filter,
.shopmodule-note,
.shiftops,
.shiftops-current,
.shiftops-movements {
  margin-bottom: 18px;
}

.shopdash-grid,
.shopmodule-metrics,
.shopdash-metrics,
.shopmodule-summary {
  align-items: stretch;
}

.shopdash-module,
.shopmodule-card,
.shopmodule-note,
.shopmodule-filter,
.shopmodule-table,
.shopdash-table {
  background: #fff;
}

.shopdash-module,
.shopmodule-card {
  border-top: 4px solid var(--accent);
}

.shopdash-module,
.shopdash-metric,
.shopdash-table,
.shopmodule-card,
.shopmodule-filter,
.shopmodule-table,
.shopmodule-note,
.shopmodule-summary article,
.shiftops-card,
.shiftops-current article,
.shiftops-movements {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.shopdash-module,
.shopdash-metric,
.shopmodule-card,
.shopmodule-summary article,
.shiftops-card,
.shiftops-current article {
  padding: 16px 18px;
}

.shopdash-table,
.shopmodule-table,
.shopmodule-filter,
.shopmodule-note,
.shiftops-movements {
  padding: 18px;
}

.shopdash-module strong,
.shopmodule-summary strong,
.shiftops-current strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.shopdash-module p,
.shopmodule-summary p,
.shiftops-card p,
.shiftops-movements-head p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.8;
}

.shopdash-metric span,
.shopmodule-card span,
.shiftops-current span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.shopdash-metric strong,
.shopmodule-card strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
}

.shopmodule-filter label,
.shiftops-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.shiftops-card {
  background: #fff;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.045);
}

.shiftops-card h3 {
  margin: 8px 0 14px;
  font-size: 22px;
}

.shiftops-grid {
  display: grid;
  gap: 10px;
}

.shiftops-grid input,
.shiftops-grid select,
.shiftops-grid textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.shiftops-grid textarea {
  min-height: 88px;
  padding: 10px 12px;
  resize: vertical;
}

.shiftops-movements-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.shiftops-movements-head h3 {
  margin: 8px 0 0;
  font-size: 24px;
}

.shiftops-balance {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: #f4fbfa;
  color: var(--accent);
  font-weight: 800;
}

.checkout-grid {
  align-items: start;
}

.form-grid {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.form-grid h2 {
  margin-top: 0;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wide {
  grid-column: 1 / -1;
}

@media (max-width: 980px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .nav-actions {
    justify-content: flex-start;
  }

  .mido-menu-spacer,
  .admin-menu-spacer {
    display: none;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 700px) {
  .workspace,
  .shell {
    width: min(100% - 20px, 1440px);
  }

  .work-panel,
  .side-panel,
  .admin-panel,
  .shopdash-table,
  .shopmodule-table,
  .shopmodule-filter {
    padding: 14px;
  }

  .section-title,
  .section-title.panel-title,
  .shopdash-header,
  .shopmodule-header,
  .shopmodule-note,
  .shopmodule-table-head,
  .shopdash-table-head,
  .shopmodule-filter-head,
  .shiftops-movements-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-title.panel-title h1,
  .shopdash-header h1,
  .shopmodule-header h1,
  .page-head h1 {
    font-size: 30px;
  }

  th,
  td {
    padding: 10px 9px;
  }

  .shopdash-grid,
  .shopdash-metrics,
  .shopmodule-metrics,
  .shopmodule-filter-grid,
  .shopmodule-summary,
  .shiftops,
  .shiftops-current {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 701px) and (max-width: 1120px) {
  .shopdash-metrics,
  .shopmodule-metrics,
  .shopmodule-filter-grid,
  .shiftops-current {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shopdash-grid,
  .shopmodule-summary,
  .shiftops {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Universal responsive header menu */
@media (min-width: 821px) {
  .topbar {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    overflow: hidden;
  }

  .nav-actions {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-end !important;
  }

  .mido-top-menu,
  .admin-top-menu {
    flex-direction: row !important;
    align-items: center !important;
  }

  .mido-menu-link,
  .admin-menu-link {
    width: auto !important;
  }
}

@media (max-width: 820px) {
  .topbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 64px;
    padding: 9px 12px;
    overflow: visible;
  }

  .brand-lockup {
    min-width: 0;
  }

  .brand-lockup img {
    width: 42px;
    height: 42px;
  }

  .brand-lockup span {
    overflow: hidden;
    max-width: 180px;
    text-overflow: ellipsis;
  }

  .menu-toggle-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #111;
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    user-select: none;
  }

  .menu-toggle-button span,
  .menu-toggle-button span::before,
  .menu-toggle-button span::after {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 99px;
    background: currentColor;
  }

  .menu-toggle-button span {
    position: relative;
  }

  .menu-toggle-button span::before,
  .menu-toggle-button span::after {
    content: "";
    position: absolute;
    left: 0;
  }

  .menu-toggle-button span::before {
    top: -6px;
  }

  .menu-toggle-button span::after {
    top: 6px;
  }

  .menu-toggle-input:checked + .brand-lockup + .menu-toggle-button span {
    background: transparent;
  }

  .menu-toggle-input:checked + .brand-lockup + .menu-toggle-button span::before {
    top: 0;
    transform: rotate(45deg);
  }

  .menu-toggle-input:checked + .brand-lockup + .menu-toggle-button span::after {
    top: 0;
    transform: rotate(-45deg);
  }

  .nav-actions {
    grid-column: 1 / -1;
    display: none !important;
    width: 100%;
    max-height: calc(100dvh - 76px);
    overflow: auto;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
  }

  .menu-toggle-input:checked ~ .nav-actions {
    display: block !important;
  }

  .mido-top-menu,
  .admin-top-menu {
    display: grid !important;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 8px;
    overflow: visible !important;
    padding: 0;
  }

  .mido-menu-link,
  .admin-menu-link,
  .nav-actions > .chip,
  .nav-actions > .button {
    width: 100% !important;
    min-height: 46px !important;
    justify-content: center;
    padding: 0 14px !important;
    font-size: 15px !important;
  }

  .mido-menu-spacer,
  .admin-menu-spacer {
    display: none !important;
  }
}

@media (max-width: 420px) {
  .brand-lockup span {
    max-width: 130px;
  }

  .menu-toggle-button strong {
    display: none;
  }

  .menu-toggle-button {
    width: 46px;
    padding: 0;
  }
}

/* Shop unified interface */
.shop-top-menu .mido-menu-link.is-active {
  border-color: var(--accent) !important;
  background: var(--accent) !important;
  color: #fff !important;
}

.shopdash,
.shopmodule,
.posv2 {
  padding: clamp(18px, 2.4vw, 34px) 0 52px !important;
}

.shopdash-header,
.shopmodule-header,
.posv2-header {
  position: relative;
  align-items: stretch !important;
  margin-bottom: 18px !important;
  padding: 22px !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(198, 138, 47, 0.07)), #fff !important;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.055) !important;
}

.shopdash-header > div:first-child,
.shopmodule-header > div:first-child,
.posv2-header-copy {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
}

.shopdash-header h1,
.shopmodule-header h1,
.posv2-header h1 {
  margin: 8px 0 !important;
  font-size: clamp(30px, 3.6vw, 48px) !important;
  line-height: 1.12 !important;
  letter-spacing: 0 !important;
}

.shopdash-header p,
.shopmodule-header p,
.posv2-header p {
  max-width: 860px !important;
  font-size: clamp(15px, 1.3vw, 18px) !important;
  line-height: 1.9 !important;
}

.shopdash-actions,
.shopmodule-actions,
.posv2-actions {
  align-self: center;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 9px !important;
  justify-content: flex-start !important;
}

.shopdash-actions .button,
.shopmodule-actions .button,
.posv2-actions .button {
  min-height: 46px !important;
  padding: 0 16px !important;
}

.shopdash-metrics,
.shopmodule-metrics,
.posv2-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 14px !important;
}

.shopdash-metric,
.shopmodule-card,
.posv2-metric {
  min-height: 112px !important;
  padding: 18px !important;
  border: 1px solid var(--line) !important;
  border-top: 4px solid var(--accent) !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.05) !important;
}

.shopdash-metric strong,
.shopmodule-card strong,
.posv2-metric strong {
  font-size: clamp(24px, 2.5vw, 32px) !important;
}

.shopdash-module,
.shopmodule-summary article,
.shopmodule-note,
.shopmodule-filter,
.shopmodule-table,
.shopdash-table,
.shiftops-card,
.shiftops-current article,
.shiftops-movements,
.posv2-card {
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.045) !important;
}

.shopdash-module,
.shopmodule-summary article,
.shiftops-card,
.shiftops-current article {
  padding: 18px !important;
}

.shopmodule-note,
.shopmodule-filter,
.shopmodule-table,
.shopdash-table,
.shiftops-movements {
  padding: 18px !important;
}

.shopdash-grid,
.shopmodule-summary,
.shiftops {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.shopmodule-filter-grid,
.shiftops-current {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)) !important;
}

.shopmodule-filter input,
.shopmodule-filter select,
.shiftops-grid input,
.shiftops-grid select,
.shiftops-grid textarea,
.posv2-search-input,
.posv2-field input,
.posv2-field select,
.posv2-field textarea,
.posv2-line-input {
  min-height: 50px !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: none !important;
  outline: none !important;
}

.shopmodule-filter input:focus,
.shopmodule-filter select:focus,
.shiftops-grid input:focus,
.shiftops-grid select:focus,
.shiftops-grid textarea:focus,
.posv2-search-input:focus,
.posv2-field input:focus,
.posv2-field select:focus,
.posv2-field textarea:focus,
.posv2-line-input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12) !important;
}

.shopdash .table-wrap,
.shopmodule .table-wrap,
.shiftops-movements .table-wrap,
.posv2-cart-wrap {
  max-width: 100% !important;
  overflow: auto !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: #fff !important;
}

.shopdash table,
.shopmodule table,
.shiftops-movements table {
  min-width: 820px !important;
}

.shopdash th,
.shopdash td,
.shopmodule th,
.shopmodule td,
.shiftops-movements th,
.shiftops-movements td,
.posv2-cart-table th,
.posv2-cart-table td {
  padding: 13px 12px !important;
  text-align: right !important;
  vertical-align: middle !important;
}

.shopdash th,
.shopmodule th,
.shiftops-movements th,
.posv2-cart-table th {
  background: #fffdfb !important;
  color: #514842 !important;
  font-weight: 900 !important;
}

.posv2-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 410px) !important;
  gap: 18px !important;
  align-items: start !important;
}

.posv2-main {
  display: grid !important;
  gap: 18px !important;
  min-width: 0 !important;
}

.posv2-side {
  position: sticky !important;
  top: 88px !important;
  width: auto !important;
  flex: initial !important;
  min-width: 0 !important;
}

.posv2-card-body {
  padding: 18px !important;
}

.posv2-card-head {
  align-items: flex-start !important;
  margin-bottom: 14px !important;
}

.posv2-scan-row {
  grid-template-columns: minmax(0, 1fr) 128px !important;
}

.posv2-results {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.posv2-result {
  border-radius: 8px !important;
  background: #fffdfb !important;
}

.posv2-cart-table {
  min-width: 900px !important;
}

.posv2-totals {
  border-radius: 8px !important;
  background: linear-gradient(180deg, #fffdfb, #f8faf9) !important;
}

.posv2-total-row.is-grand {
  padding-top: 14px !important;
  color: var(--accent) !important;
  font-size: 24px !important;
}

.posv2-submit {
  display: grid !important;
  grid-template-columns: 1fr 1.15fr !important;
  gap: 10px !important;
}

.posv2-submit .button,
.posv2-print-button {
  min-height: 58px !important;
}

@media (max-width: 1180px) {
  .shopdash-metrics,
  .shopmodule-metrics,
  .posv2-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .shopdash-grid,
  .shopmodule-summary,
  .shiftops {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .posv2-layout {
    grid-template-columns: 1fr !important;
  }

  .posv2-side {
    position: static !important;
    width: 100% !important;
  }
}

@media (max-width: 820px) {
  .shop-top-menu .mido-menu-link {
    justify-content: center !important;
  }

  .shopdash-header,
  .shopmodule-header,
  .posv2-header {
    padding: 18px !important;
  }

  .shopdash-actions,
  .shopmodule-actions,
  .posv2-actions {
    width: 100% !important;
  }

  .shopdash-actions .button,
  .shopmodule-actions .button,
  .posv2-actions .button {
    flex: 1 1 150px !important;
  }

  .posv2-results {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 700px) {
  .shopdash,
  .shopmodule,
  .posv2 {
    padding-top: 16px !important;
  }

  .shopdash-header,
  .shopmodule-header,
  .posv2-header,
  .shopmodule-note,
  .shopdash-table-head,
  .shopmodule-table-head,
  .shopmodule-filter-head,
  .shiftops-movements-head,
  .posv2-card-head {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .shopdash-metrics,
  .shopmodule-metrics,
  .posv2-metrics,
  .shopdash-grid,
  .shopmodule-summary,
  .shiftops,
  .shiftops-current,
  .shopmodule-filter-grid,
  .posv2-scan-row,
  .posv2-submit,
  .posv2-two-cols,
  .posv2-print-buttons {
    grid-template-columns: 1fr !important;
  }

  .shopdash-module,
  .shopmodule-summary article,
  .shopmodule-note,
  .shopmodule-filter,
  .shopmodule-table,
  .shopdash-table,
  .shiftops-card,
  .shiftops-current article,
  .shiftops-movements,
  .posv2-card-body {
    padding: 14px !important;
  }

  .posv2-cart-table {
    min-width: 760px !important;
  }

  .posv2-submit .button {
    width: 100% !important;
  }
}

@media (max-width: 440px) {
  .shopdash-header h1,
  .shopmodule-header h1,
  .posv2-header h1 {
    font-size: 28px !important;
  }

  .shopdash-actions .button,
  .shopmodule-actions .button,
  .posv2-actions .button {
    flex-basis: 100% !important;
  }

  .posv2-metric {
    min-height: 96px !important;
  }

  .posv2-cart-table {
    min-width: 680px !important;
  }

  .posv2-total-row.is-grand {
    font-size: 21px !important;
  }
}

/* ===== Auth / login page ===== */
.auth-shell{display:flex;justify-content:center;padding:40px 0 64px}
.auth-card{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);width:min(1040px,100%);overflow:hidden;border:1px solid var(--line);border-radius:18px;background:#fff;box-shadow:0 30px 70px rgba(15,23,42,.12)}
.auth-brand{position:relative;display:flex;align-items:center;padding:44px 36px;background:linear-gradient(150deg,#0b3d38 0%,#0f766e 58%,#12867c 100%);color:#f5fffd;overflow:hidden}
.auth-brand-inner{position:relative;z-index:1;display:grid;gap:14px}
.auth-brand-glow{position:absolute;inset:auto -80px -110px auto;width:320px;height:320px;border-radius:50%;background:radial-gradient(circle,rgba(198,138,47,.5),transparent 65%);filter:blur(6px)}
.auth-logo{width:84px;height:84px;object-fit:cover;border-radius:50%;background:#fff;border:3px solid rgba(255,255,255,.85);box-shadow:0 14px 30px rgba(0,0,0,.25)}
.auth-brand h1{margin:0;font-size:30px;letter-spacing:.4px}
.auth-tagline{margin:0;color:rgba(245,255,253,.85);line-height:1.8;font-size:14px}
.auth-features{display:grid;gap:10px;margin:10px 0 0;padding:0;list-style:none}
.auth-features li{position:relative;padding-inline-start:26px;font-size:13px;line-height:1.7;color:rgba(245,255,253,.92)}
.auth-features li::before{content:"";position:absolute;inset-inline-start:0;top:6px;width:14px;height:14px;border-radius:50%;background:rgba(198,138,47,.9);box-shadow:0 0 0 4px rgba(198,138,47,.25)}
.auth-form-side{display:flex;flex-direction:column;justify-content:center;gap:6px;padding:44px clamp(24px,5vw,56px)}
.auth-tabs{display:flex;gap:8px;margin-bottom:18px;padding:5px;border:1px solid var(--line);border-radius:12px;background:#f6f3ee}
.auth-tab{flex:1;display:inline-flex;align-items:center;justify-content:center;min-height:40px;border-radius:9px;font-size:13px;font-weight:900;color:var(--muted);transition:all .15s ease}
.auth-tab:hover{color:var(--ink)}
.auth-tab.is-active{background:#fff;color:var(--accent);box-shadow:0 6px 16px rgba(15,118,110,.14);border:1px solid rgba(15,118,110,.25)}
.auth-title{margin:0 0 4px;font-size:26px}
.auth-subtitle{margin:0 0 18px;color:var(--muted);font-size:13.5px;line-height:1.7}
.auth-alert{margin:0 0 14px;padding:11px 14px;border:1px solid #fecaca;border-radius:10px;background:#fff5f5;color:#b91c1c;font-size:13px;line-height:1.7}
.auth-alert.is-info{border-color:#bae6fd;background:#f0f9ff;color:#075985}
.auth-form{display:grid;gap:15px}
.auth-field{display:grid;gap:7px}
.auth-field>span{font-size:13px;font-weight:800;color:var(--ink)}
.auth-input{position:relative;display:flex;align-items:center}
.auth-input svg:first-child{position:absolute;inset-inline-start:13px;width:19px;height:19px;color:#9a8f86;pointer-events:none}
.auth-input input{width:100%;min-height:48px;padding:0 44px;border:1.5px solid var(--line);border-radius:11px;background:#fbfaf8;font:inherit;font-size:14.5px;color:var(--ink);transition:border-color .15s ease,box-shadow .15s ease,background .15s ease}
.auth-input input:focus{outline:none;border-color:var(--accent);background:#fff;box-shadow:0 0 0 4px rgba(15,118,110,.12)}
.auth-eye{position:absolute;inset-inline-end:8px;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border:0;border-radius:8px;background:transparent;color:#9a8f86;cursor:pointer}
.auth-eye:hover{background:#f1eee9;color:var(--accent)}
.auth-eye.is-on{color:var(--accent)}
.auth-eye svg{width:19px;height:19px}
.auth-row{display:flex;align-items:center;justify-content:space-between}
.auth-remember{display:inline-flex;align-items:center;gap:9px;font-size:13px;color:var(--muted);cursor:pointer}
.auth-remember input{width:17px;height:17px;accent-color:var(--accent)}
.auth-submit{display:inline-flex;align-items:center;justify-content:center;min-height:50px;border:0;border-radius:11px;background:linear-gradient(135deg,#0f766e,#0b5d56);color:#fff;font:inherit;font-size:15.5px;font-weight:900;letter-spacing:.3px;cursor:pointer;box-shadow:0 14px 28px rgba(15,118,110,.3);transition:transform .12s ease,box-shadow .12s ease}
.auth-submit:hover{transform:translateY(-1px);box-shadow:0 18px 34px rgba(15,118,110,.38)}
.auth-submit:active{transform:translateY(0)}
.auth-foot{margin:16px 0 0;text-align:center;font-size:13px}
@media (max-width:860px){
  .auth-card{grid-template-columns:1fr}
  .auth-brand{padding:30px 26px}
  .auth-brand-inner{gap:10px}
  .auth-logo{width:64px;height:64px}
  .auth-brand h1{font-size:24px}
  .auth-features{display:none}
  .auth-form-side{padding:28px 22px 34px}
}

/* ==============================================
 * MIDO-UI: Modal overlay & panel
 * ============================================== */
#mido-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(15,23,42,.52);
  display: none;
  align-items: flex-start;
  justify-content: flex-end;
  backdrop-filter: blur(4px);
}
#mido-modal-overlay.is-open { display: flex; }
body.modal-open { overflow: hidden; }

#mido-modal-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(560px, 100vw);
  height: 100vh;
  background: #fff;
  box-shadow: -18px 0 42px rgba(15,23,42,.18);
  animation: mido-slide-in .22s ease;
  overflow: hidden;
}
@keyframes mido-slide-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

#mido-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  flex-shrink: 0;
}
#mido-modal-title {
  font-size: 15px;
  font-weight: 900;
  color: var(--ink);
}
#mido-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  flex-shrink: 0;
}
#mido-modal-close:hover { background: #f8f8f8; }
#mido-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.mido-modal-loading {
  color: var(--muted);
  padding: 28px 0;
  text-align: center;
  font-weight: 800;
}

/* ==============================================
 * MIDO-UI: Flash message
 * ============================================== */
#mido-flash {
  position: fixed;
  bottom: 24px;
  inset-inline-start: 24px;
  z-index: 999;
  min-width: 260px;
  padding: 14px 18px;
  border-radius: 8px;
  background: #065f46;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(15,23,42,.22);
  transform: translateY(80px);
  opacity: 0;
  transition: transform .22s, opacity .22s;
  pointer-events: none;
}
#mido-flash.is-visible { transform: translateY(0); opacity: 1; }
#mido-flash.danger { background: #991b1b; }

/* ==============================================
 * MIDO-UI: File attachment widget
 * ============================================== */
.attach-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-height: 96px;
  padding: 18px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  background: #fafaf9;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.attach-zone:hover,
.attach-zone:focus,
.attach-zone.is-dragover {
  border-color: var(--accent);
  background: #f0fdfa;
  outline: none;
}
.attach-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
  text-align: center;
}
.attach-icon { font-size: 26px; }
.attach-preview img {
  max-width: 180px;
  max-height: 130px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--line);
}
.attach-filename { font-weight: 800; color: var(--ink); font-size: 13px; }
.attach-clear { margin-top: 4px; }
.attach-error {
  margin: 6px 0 0;
  font-size: 12px;
  color: #c0392b;
  font-weight: 600;
}

/* ==============================================
 * MIDO-UI: Live-search list area
 * ============================================== */
#list-area { transition: opacity .18s; }

.ls-loading {
  padding: .6rem 1rem;
  color: #6b7280;
  font-size: .92rem;
  text-align: center;
  direction: rtl;
}

.ls-error {
  padding: .5rem 1rem;
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: .375rem;
  font-size: .9rem;
  text-align: center;
  direction: rtl;
  margin-bottom: .5rem;
}

/* ==============================================
 * MIDO-UI: Modal form grid
 * ============================================== */
.modal-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.modal-form-grid .wide { grid-column: 1 / -1; }
.modal-form-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}
.modal-form-grid input,
.modal-form-grid select,
.modal-form-grid textarea {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  outline: none;
}
.modal-form-grid input:focus,
.modal-form-grid select:focus,
.modal-form-grid textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15,118,110,.12);
}
.modal-form-grid textarea {
  min-height: 88px;
  padding-top: 10px;
  resize: vertical;
}
.modal-form-actions {
  display: flex;
  gap: 8px;
  padding-top: 6px;
  grid-column: 1 / -1;
}

@media (max-width: 640px) {
  #mido-modal-panel { width: 100vw; }
  .modal-form-grid { grid-template-columns: 1fr; }
}

/* ── Barcode field ────────────────────────────────────────── */
.barcode-field-wrap { display: flex; flex-direction: column; gap: 10px; }
.barcode-input-row  { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.barcode-input-row .barcode-text-input {
  flex: 1; min-width: 180px; font-family: monospace; font-size: 15px;
  letter-spacing: 1px;
}
.barcode-preview {
  background: #fff; border: 1px solid #dde3e0; border-radius: 8px;
  padding: 12px 16px; display: inline-flex; flex-direction: column;
  align-items: center; gap: 4px; width: fit-content;
}
.barcode-preview svg { display: block; max-width: 100%; }

/* ── Payment status badges (purchase invoices) ───────────── */
.pay-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.pay-badge.badge-paid    { background: #dcfce7; color: #166534; }
.pay-badge.badge-partial { background: #ffedd5; color: #9a3412; }
.pay-badge.badge-unpaid  { background: #fee2e2; color: #991b1b; }
.pay-badge.badge-overdue { background: #fecaca; color: #7f1d1d; border: 1px solid #f87171; }
.pay-badge.badge-draft   { background: #f1f5f9; color: #475569; }

/* Overdue row highlight */
tr.row-overdue > td { background: #fff5f5; }

/* ── Payment-status quick-filter tabs ───────────────────── */
.payment-status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.payment-status-tab {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.payment-status-tab:hover,
.payment-status-tab.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ── Vendor summary bar ─────────────────────────────────── */
.vendor-summary-bar { margin-bottom: 18px; }
.metric.metric-alert { border-color: #fca5a5; background: #fff5f5; }
.metric.metric-alert strong { color: var(--rose); }

/* ============================================================
 * STOREFRONT REDESIGN — professional bilingual e-commerce UI
 * ============================================================ */

/* ── Site footer ─────────────────────────────────────────── */
.sf-footer {
  margin-top: 52px;
  padding: 48px 0 0;
  background: var(--brand);
  color: #e7dfd6;
}
.sf-footer a { color: #c9c0b8; }
.sf-footer a:hover { color: #fff; }
.sf-footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr));
  gap: 32px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sf-footer-brand { display: grid; gap: 12px; }
.sf-footer-brand img {
  width: 56px; height: 56px;
  border-radius: 50%; object-fit: contain; background: #fff;
}
.sf-footer-brand strong { font-size: 22px; color: #fff; }
.sf-footer-brand p { margin: 0; font-size: 14px; line-height: 1.8; }
.sf-footer-col h4 {
  margin: 0 0 14px; font-size: 13px; font-weight: 900;
  text-transform: uppercase; letter-spacing: .05em; color: #fff;
}
.sf-footer-col ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.sf-footer-col li a { font-size: 14px; }
.sf-footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 18px 0;
  font-size: 13px; color: #7a6f62;
}
.sf-footer-payments { display: flex; flex-wrap: wrap; gap: 8px; }
.sf-payment-badge {
  display: inline-flex; align-items: center;
  min-height: 28px; padding: 0 10px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 6px; background: rgba(255,255,255,.07);
  font-size: 12px; font-weight: 700; color: #c9c0b8;
}

/* ── Trust strip ─────────────────────────────────────────── */
.sf-trust {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin: 28px 0;
}
.sf-trust-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 20px 14px; background: #fff; text-align: center;
}
.sf-trust-icon {
  font-size: 24px; line-height: 1;
}
.sf-trust-item strong { font-size: 14px; }
.sf-trust-item span { font-size: 12px; color: var(--muted); }

/* ── Product detail hero improvements ───────────────────── */
.sf-product-layout {
  display: grid;
  grid-template-columns: minmax(280px, .95fr) minmax(0, 1.05fr);
  gap: 32px;
  align-items: start;
  padding: 36px 0 28px;
}
.sf-product-image-wrap {
  position: sticky;
  top: 88px;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  max-height: 500px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.sf-product-image-wrap img {
  width: 100%; height: 100%; object-fit: contain;
  padding: 18px;
}
.sf-product-image-placeholder {
  display: grid;
  place-items: center;
  width: 100%; height: 100%;
  font-size: 80px; color: var(--warm);
  background: linear-gradient(135deg, #f4f0eb, #fbfaf8);
}
.sf-product-info {
  display: grid;
  gap: 18px;
}
.sf-product-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sf-product-name {
  margin: 4px 0 0; font-size: clamp(28px, 4vw, 48px);
  line-height: 1.1; letter-spacing: 0;
}
.sf-product-price-row {
  display: flex; align-items: baseline; gap: 10px;
}
.sf-product-price {
  font-size: 32px; font-weight: 900; color: var(--accent);
}
.sf-product-price-note {
  font-size: 13px; color: var(--muted);
}
.sf-buy-box {
  display: grid; gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.sf-buy-box label {
  display: grid; gap: 6px;
  font-size: 13px; font-weight: 800; color: var(--muted);
}
.sf-buy-box select,
.sf-buy-box input[type="number"] {
  width: 100%; min-height: 48px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); font: inherit;
  transition: border-color .15s;
}
.sf-buy-box select:focus,
.sf-buy-box input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15,118,110,.12);
}
.sf-buy-box .button {
  min-height: 52px; font-size: 16px; width: 100%;
  border-radius: 10px;
}
.sf-product-attrs {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.sf-product-attr {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px; background: #faf9f7;
}
.sf-product-attr span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.sf-product-attr strong { font-size: 14px; }

/* ── Catalog filter bar ─────────────────────────────────── */
.sf-filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px; background: #fff;
  margin-bottom: 20px;
  position: sticky; top: 68px; z-index: 10;
  backdrop-filter: blur(8px);
}
.sf-filter-bar input,
.sf-filter-bar select {
  min-height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #faf9f7; color: var(--ink);
  font: inherit; font-size: 13px;
  transition: border-color .15s;
}
.sf-filter-bar input:focus,
.sf-filter-bar select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(15,118,110,.1);
}
.sf-filter-bar .sf-search { flex: 1 1 220px; }
.sf-filter-bar .sf-cat  { flex: 0 0 160px; }
.sf-filter-bar .sf-price { flex: 0 0 110px; }
.sf-filter-bar .sf-sort  { flex: 0 0 150px; }
.sf-filter-bar .sf-stock { flex: 0 0 140px; }

/* ── Product grid ────────────────────────────────────────── */
.sf-product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.sf-product-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; overflow: hidden;
  transition: box-shadow .18s, transform .18s;
}
.sf-product-card:hover {
  box-shadow: 0 18px 48px rgba(15,23,42,.1);
  transform: translateY(-2px);
}
.sf-product-card.is-out { opacity: .72; }
.sf-card-media {
  display: grid; place-items: center;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #f4f0eb, #fbfaf8);
  overflow: hidden; position: relative;
}
.sf-card-media img { width: 100%; height: 100%; object-fit: cover; }
.sf-card-media-letter {
  font-size: 42px; font-weight: 900; color: var(--warm);
}
.sf-card-out-overlay {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(251,250,248,.7);
  font-size: 13px; font-weight: 800; color: var(--rose);
}
.sf-card-body { flex: 1; display: grid; gap: 6px; padding: 14px; }
.sf-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sf-card-name {
  font-size: 15px; font-weight: 800; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.sf-card-sku { font-size: 12px; color: var(--muted); }
.sf-card-price { font-size: 18px; font-weight: 900; color: var(--accent); margin-top: 4px; }
.sf-card-actions {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; padding: 0 14px 14px;
}
.sf-card-actions .button,
.sf-card-actions form { margin: 0; }
.sf-card-actions form .button { width: 100%; }

/* ── Cart page ───────────────────────────────────────────── */
.sf-cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
  padding-bottom: 52px;
}
.sf-cart-panel {
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; overflow: hidden;
}
.sf-cart-summary {
  position: sticky; top: 88px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; padding: 20px;
  display: grid; gap: 12px;
}
.sf-cart-summary h2 { margin: 0 0 6px; font-size: 20px; }
.sf-summary-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 10px 0; border-top: 1px solid var(--line);
}
.sf-summary-row.grand {
  font-size: 20px; font-weight: 900; color: var(--accent);
}
.sf-cart-empty {
  padding: 52px 24px; text-align: center;
}
.sf-cart-empty-icon { font-size: 56px; margin-bottom: 16px; }
.sf-cart-empty p { color: var(--muted); margin: 0 0 20px; font-size: 16px; }
.sf-cart-table { width: 100%; border-collapse: collapse; }
.sf-cart-table th, .sf-cart-table td {
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  text-align: inherit; vertical-align: middle;
}
.sf-cart-table th { font-size: 12px; color: var(--muted); font-weight: 900; background: #faf9f7; }
.sf-cart-table tbody tr:last-child td { border-bottom: 0; }
.sf-cart-item-media {
  display: inline-grid; place-items: center;
  width: 52px; height: 52px;
  border: 1px solid var(--line); border-radius: 6px;
  background: #f4f0eb; font-size: 20px; color: var(--warm);
  overflow: hidden; flex-shrink: 0;
}
.sf-cart-item-media img { width: 100%; height: 100%; object-fit: cover; }
.sf-cart-item-info { display: flex; align-items: center; gap: 12px; }
.sf-cart-item-name { font-weight: 800; font-size: 14px; }
.sf-cart-item-sku { font-size: 12px; color: var(--muted); }
.sf-qty-row { display: flex; align-items: center; gap: 6px; }
.sf-qty-row input[type="number"] {
  width: 56px; min-height: 36px; padding: 0 8px; text-align: center;
  border: 1px solid var(--line); border-radius: 6px;
  font: inherit; background: #fff;
}

/* ── Checkout page ────────────────────────────────────────── */
.sf-checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
  padding-bottom: 52px;
}
.sf-checkout-panel {
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; padding: 24px;
}
.sf-checkout-panel h2 {
  margin: 0 0 18px; font-size: 18px;
  display: flex; align-items: center; gap: 10px;
}
.sf-checkout-panel h2 .step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 13px; font-weight: 900;
  flex-shrink: 0;
}
.sf-fields-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px;
}
.sf-fields-grid label {
  display: grid; gap: 6px; font-size: 13px; font-weight: 800; color: var(--muted);
}
.sf-fields-grid label.span-2 { grid-column: 1 / -1; }
.sf-fields-grid input, .sf-fields-grid select, .sf-fields-grid textarea {
  min-height: 46px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); font: inherit;
  transition: border-color .15s;
}
.sf-fields-grid input:focus, .sf-fields-grid select:focus, .sf-fields-grid textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15,118,110,.1);
}
.sf-fields-grid textarea { min-height: 88px; padding-top: 10px; resize: vertical; }
.sf-checkout-side {
  position: sticky; top: 88px;
  display: grid; gap: 16px;
}
.sf-checkout-side-panel {
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; padding: 20px; display: grid; gap: 10px;
}
.sf-checkout-side-panel h3 { margin: 0 0 10px; font-size: 15px; }
.sf-option-row {
  display: flex; align-items: center; gap: 10px;
  min-height: 46px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #faf9f7; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.sf-option-row:has(input:checked) {
  border-color: var(--accent); background: #f0fdfa;
}
.sf-option-row input[type="radio"] { accent-color: var(--accent); }
.sf-checkout-items { display: grid; gap: 8px; }
.sf-checkout-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.sf-checkout-item:last-child { border-bottom: 0; }
.sf-checkout-item-info { flex: 1; min-width: 0; }
.sf-checkout-item-name { font-size: 13px; font-weight: 700; }
.sf-checkout-item-qty { font-size: 12px; color: var(--muted); }
.sf-checkout-item-price { font-weight: 800; white-space: nowrap; font-size: 13px; }
.sf-whatsapp-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px; border: 1px solid var(--line); border-radius: 8px;
  background: #faf9f7; cursor: pointer;
}
.sf-whatsapp-row input { margin-top: 3px; accent-color: #25d366; }
.sf-whatsapp-row span { font-size: 13px; color: var(--muted); line-height: 1.6; }
.sf-place-order-btn {
  width: 100%; min-height: 54px; font-size: 16px;
  background: var(--accent); color: #fff;
  border: none; border-radius: 10px; cursor: pointer;
  font-weight: 900; font-family: inherit;
  transition: background .15s;
}
.sf-place-order-btn:hover { background: #0a5e57; }
.sf-secure-note {
  display: flex; align-items: center; gap: 6px; justify-content: center;
  font-size: 12px; color: var(--muted);
}

/* ── Order success page ──────────────────────────────────── */
.sf-success-wrap {
  max-width: 720px; margin: 40px auto 60px;
  border: 1px solid var(--line); border-radius: 12px;
  background: #fff; overflow: hidden;
}
.sf-success-header {
  background: linear-gradient(135deg, rgba(15,118,110,.12), rgba(21,128,61,.08)), #fff;
  padding: 36px 32px 28px; text-align: center;
  border-bottom: 1px solid var(--line);
}
.sf-success-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 36px; margin-bottom: 14px;
}
.sf-success-header h1 { margin: 0 0 8px; font-size: 28px; }
.sf-success-header p { margin: 0; color: var(--muted); font-size: 15px; }
.sf-order-number {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px; padding: 8px 18px;
  border: 2px solid var(--accent); border-radius: 999px;
  font-weight: 900; font-size: 18px; color: var(--accent);
}
.sf-success-body { padding: 28px 32px; display: grid; gap: 20px; }
.sf-success-meta {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.sf-success-meta-item {
  padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #faf9f7;
}
.sf-success-meta-item span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.sf-success-meta-item strong { font-size: 15px; }
.sf-success-actions {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.sf-success-actions .button { flex: 1; min-width: 160px; justify-content: center; min-height: 48px; }

/* ── Track order timeline ────────────────────────────────── */
.sf-track-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px; align-items: start;
  padding-bottom: 52px;
}
.sf-track-panel {
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; padding: 24px;
}
.sf-track-form { display: grid; gap: 12px; margin-bottom: 24px; }
.sf-track-form-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sf-track-form-fields input {
  min-height: 46px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); font: inherit;
}
.sf-track-form-fields input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15,118,110,.1);
}
.sf-order-result {
  border-top: 1px solid var(--line); padding-top: 20px; display: grid; gap: 14px;
}
.sf-order-result-meta {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.sf-order-result-meta div {
  padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #faf9f7;
}
.sf-order-result-meta span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.sf-order-result-meta strong { font-size: 15px; }
.sf-timeline-panel {
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; padding: 20px;
}
.sf-timeline-panel h3 { margin: 0 0 18px; font-size: 16px; }
.sf-timeline { display: grid; gap: 0; position: relative; }
.sf-timeline-item {
  display: grid; grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px; padding-bottom: 22px; position: relative;
}
.sf-timeline-item:last-child { padding-bottom: 0; }
.sf-timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  inset-inline-start: 15px; top: 32px; bottom: 0;
  width: 2px; background: var(--line);
}
.sf-timeline-dot {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--line); background: #fff;
  display: grid; place-items: center; font-size: 13px;
  position: relative; z-index: 1; flex-shrink: 0;
}
.sf-timeline-dot.is-done {
  border-color: var(--accent); background: var(--accent); color: #fff;
}
.sf-timeline-body { padding-top: 6px; }
.sf-timeline-label { font-weight: 800; font-size: 14px; }
.sf-timeline-desc { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ── Info & branches ─────────────────────────────────────── */
.sf-branch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.sf-branch-card {
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; padding: 20px;
  display: grid; gap: 10px;
  transition: box-shadow .18s;
}
.sf-branch-card:hover { box-shadow: 0 12px 32px rgba(15,23,42,.08); }
.sf-branch-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 8px;
  background: #f0fdfa; color: var(--accent); font-size: 20px;
}
.sf-branch-name { font-size: 18px; font-weight: 900; }
.sf-branch-type { font-size: 12px; color: var(--muted); }
.sf-branch-info { display: grid; gap: 6px; }
.sf-branch-info-row {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; color: var(--muted);
}
.sf-branch-info-row strong { color: var(--ink); white-space: nowrap; }

.sf-info-content { max-width: 860px; }
.sf-info-card {
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; padding: 22px;
}
.sf-info-card + .sf-info-card { margin-top: 14px; }
.sf-info-card h3 { margin: 0 0 10px; font-size: 18px; }
.sf-info-card p { margin: 0; color: var(--muted); line-height: 1.9; }

.sf-contact-layout {
  display: grid; grid-template-columns: minmax(0,1fr) 300px;
  gap: 24px; align-items: start;
}
.sf-contact-panel {
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; padding: 24px;
}
.sf-contact-panel h2 { margin: 0 0 18px; font-size: 20px; }
.sf-contact-info { display: grid; gap: 12px; }
.sf-contact-info-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; border: 1px solid var(--line); border-radius: 8px;
  background: #faf9f7;
}
.sf-contact-info-row .ci-icon {
  font-size: 20px; width: 36px; text-align: center; flex-shrink: 0;
}
.sf-contact-info-label { font-size: 11px; color: var(--muted); }
.sf-contact-info-val { font-weight: 800; font-size: 14px; }

/* ── Nav improvements ─────────────────────────────────────── */
.sf-lang-toggle {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; background: #fff;
}
.sf-lang-toggle a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; min-height: 34px; padding: 0 10px;
  font-size: 12px; font-weight: 900; color: var(--muted);
  transition: background .12s, color .12s;
}
.sf-lang-toggle a.is-active { background: var(--brand); color: #fff; }

/* ── Page head improvements ───────────────────────────────── */
.sf-page-head {
  padding: 36px 0 24px; border-bottom: 1px solid var(--line); margin-bottom: 28px;
}
.sf-page-head h1 {
  margin: 8px 0 10px; font-size: clamp(30px, 4vw, 52px); line-height: 1.1;
}
.sf-page-head p { max-width: 700px; color: var(--muted); line-height: 1.8; margin: 0; }

/* ── Catalog count + pagination ─────────────────────────── */
.sf-catalog-meta {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 10px;
  margin-bottom: 16px; color: var(--muted); font-size: 14px; font-weight: 700;
}

/* ── Responsive adjustments ──────────────────────────────── */
@media (max-width: 1080px) {
  .sf-product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sf-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .sf-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sf-cart-layout, .sf-checkout-layout, .sf-track-layout, .sf-contact-layout { grid-template-columns: 1fr; }
  .sf-cart-summary, .sf-checkout-side, .sf-timeline-panel { position: static; }
  .sf-product-layout { grid-template-columns: 1fr; }
  .sf-product-image-wrap { position: static; max-height: 320px; }
  .sf-trust { grid-template-columns: repeat(2, 1fr); }
  .sf-branch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sf-success-meta { grid-template-columns: 1fr 1fr; }
  .sf-track-form-fields, .sf-order-result-meta { grid-template-columns: 1fr; }
}
@media (max-width: 580px) {
  .sf-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sf-card-actions { grid-template-columns: 1fr; }
  .sf-trust { grid-template-columns: repeat(2, 1fr); }
  .sf-footer-grid { grid-template-columns: 1fr; }
  .sf-branch-grid { grid-template-columns: 1fr; }
  .sf-success-meta { grid-template-columns: 1fr; }
  .sf-fields-grid { grid-template-columns: 1fr; }
  .sf-success-header { padding: 24px 20px 20px; }
  .sf-success-body { padding: 20px; }
}
@media (max-width: 420px) {
  .sf-product-grid { grid-template-columns: 1fr; }
  .sf-filter-bar { flex-direction: column; }
}
