/* تنسيق base؛ ترتيب الاستيراد في index.css يحافظ على أولوية القواعد. */
/**
 * تنسيقات الموقع. غيّر الألوان العامة من :root، ثم عدّل القسم المطلوب حسب عناوين الملف.
 */
@font-face {
  font-family: 'Alraseef UI';
  src: url('/fonts/ibm-plex-arabic-400.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range:
    U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08FF, U+200C-200E, U+2010-2011,
    U+204F, U+FB50-FDFF, U+FE70-FEFC;
}
@font-face {
  font-family: 'Alraseef UI';
  src: url('/fonts/ibm-plex-latin-400.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Alraseef UI';
  src: url('/fonts/ibm-plex-arabic-700.woff2') format('woff2');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  unicode-range:
    U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08FF, U+200C-200E, U+2010-2011,
    U+204F, U+FB50-FDFF, U+FE70-FEFC;
}
@font-face {
  font-family: 'Alraseef UI';
  src: url('/fonts/ibm-plex-latin-700.woff2') format('woff2');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Alraseef Mono';
  src: url('/fonts/ibm-plex-mono-500.woff2') format('woff2');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.wh-auth-card {
  width: min(100%, 440px);
}
.wh-auth-form {
  display: grid;
  gap: 14px;
  margin: 20px 0 12px;
  text-align: start;
}
.wh-auth-form label,
.wh-auth-field,
.wh-auth-sheet > label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.wh-auth-form input,
.wh-auth-form select,
.wh-auth-field input,
.wh-auth-sheet > label input {
  min-height: 44px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--field-line);
  color: var(--ink);
  background: var(--control);
  font: inherit;
}
.wh-auth-card input[name='pin'] {
  min-height: 60px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-align: center;
  direction: ltr;
}
.wh-auth-form input:focus,
.wh-auth-field input:focus,
.wh-auth-sheet input:focus {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}
.wh-auth-hint {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 12px 0;
}
.wh-login-identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-muted);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.wh-login-identity span {
  min-width: 0;
}
.wh-link-button {
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
  flex: none;
}
.wh-pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 8px auto 16px;
  max-width: 360px;
  direction: ltr;
}
.wh-pin-keypad button {
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--control);
  color: var(--ink);
  font: 700 30px/1 var(--font-ui);
  cursor: pointer;
  touch-action: manipulation;
}
.wh-pin-keypad button:active {
  background: var(--selected);
}
.wh-pin-keypad button:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}
.wh-auth-remember {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-weight: 400 !important;
}
.wh-auth-remember input,
.wh-auth-checks input {
  width: 18px !important;
  min-height: 18px !important;
  accent-color: var(--copper);
}
#wh-auth-error {
  color: var(--clay);
  font-weight: 700;
  font-size: 14px;
  margin-top: 10px;
}
.wh-auth-sheet {
  max-height: min(90vh, 780px);
  overflow: auto;
}
.wh-auth-sheet h3 {
  font-size: 18px;
  margin: 20px 0 8px;
}
.wh-auth-sheet .wh-btn {
  margin: 7px 0;
}
.wh-auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--surface-muted);
  font-size: 14px;
}
.wh-auth-row span {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}
.wh-auth-row .wh-btn {
  width: auto;
  max-width: 40%;
  flex: none;
  padding-inline: 14px;
  white-space: normal;
}
.wh-auth-row small {
  display: block;
  color: var(--ink-soft);
  line-height: 1.5;
}
.wh-auth-checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.wh-auth-checks label {
  display: flex !important;
  align-items: center;
  gap: 6px;
  font-weight: 400 !important;
}
.wh-join-duration {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.wh-join-duration label {
  min-width: 0;
}
.wh-staff-sheet .wh-settings-group {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin: 16px 0;
}
.wh-staff-sheet .wh-settings-group h3:first-child {
  margin-top: 0;
}
.wh-staff-sheet details {
  margin: 20px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.wh-staff-sheet summary {
  cursor: pointer;
  font-weight: 700;
}
.wh-link-share {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}
.wh-link-share input {
  width: 100%;
  min-width: 0;
}
.wh-auth-branch {
  border: 1px solid var(--surface-muted);
  border-radius: 12px;
  padding: 12px;
  margin: 10px 0;
}
.wh-auth-branch legend {
  font-weight: 700;
  padding: 0 6px;
}
.wh-staff-list {
  max-height: 270px;
  overflow: auto;
}
@media (max-width: 600px) {
  .wh-auth-row {
    align-items: start;
  }
  .wh-auth-row .wh-btn {
    flex: none;
  }
}

/* Keep pinch zoom and scrolling, without double-tap zoom, including sheets. */
html,
body {
  touch-action: manipulation;
}

/* iOS zooms small focused controls. Cover touch tablets too, not just narrow phones.
   Important overrides compact/inline field sizes; no viewport zoom restriction. */
@media (any-pointer: coarse) {
  #wh-root input,
  #wh-root select,
  #wh-root textarea,
  #wh-root [contenteditable='true'] {
    font-size: max(16px, 1rem) !important;
    touch-action: manipulation;
  }
}

:root {
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.22, 0.8, 0.28, 1);
  --font-ui: 'Alraseef UI', sans-serif;
  --font-number: 'Alraseef Mono', monospace;
}

#wh-root {
  font-family: var(--font-ui);
  font-size: 16px;
  font-synthesis: none;
  font-variant-numeric: lining-nums tabular-nums;
  touch-action: manipulation;
  background-color: var(--page-bg);
  color: var(--ink);
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  position: relative;
  isolation: isolate;
  transition:
    background-color 0.24s ease,
    color 0.24s ease;
}
#wh-root[dir='rtl'] {
  direction: rtl;
}
#wh-root[dir='ltr'] {
  direction: ltr;
}
#wh-root button,
#wh-root input,
#wh-root select,
#wh-root textarea,
#wh-print-area {
  font-family: var(--font-ui);
  font-synthesis: none;
}

#wh-root[data-theme='dark'] .wh-role-tab.active {
  color: var(--ink);
}
#wh-root[data-theme='dark'] .wh-top {
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.34);
}
#wh-root[data-theme='dark'] .wh-pcard,
#wh-root[data-theme='dark'] .wh-list-item,
#wh-root[data-theme='dark'] .wh-cart-row,
#wh-root[data-theme='dark'] .wh-sheet,
#wh-root[data-theme='dark'] .wh-access-card {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}
#wh-root[data-theme='dark'] .wh-access-title {
  color: var(--ink);
}
#wh-root[data-theme='dark'] .wh-sheet {
  background: var(--sheet);
  color: var(--ink);
}
#wh-root[data-theme='dark'] .wh-input,
#wh-root[data-theme='dark'] .wh-select,
#wh-root[data-theme='dark'] .wh-textarea,
#wh-root[data-theme='dark'] .wh-search,
#wh-root[data-theme='dark'] .wh-pin-key,
#wh-root[data-theme='dark'] .wh-icon-btn,
#wh-root[data-theme='dark'] .wh-btn-ghost {
  background: var(--control);
  color: var(--ink);
}
#wh-root[data-theme='dark'] .wh-select option {
  background: var(--control);
  color: var(--ink);
}
#wh-root[data-theme='dark'] input::placeholder,
#wh-root[data-theme='dark'] textarea::placeholder {
  color: var(--ink-soft);
  opacity: 0.88;
}
#wh-root[data-theme='dark'] input:-webkit-autofill,
#wh-root[data-theme='dark'] input:-webkit-autofill:hover,
#wh-root[data-theme='dark'] input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 1000px var(--control) inset;
  caret-color: var(--ink);
}

/* تنسيق header؛ ترتيب الاستيراد في index.css يحافظ على أولوية القواعد. */
/* ---------- Top bar ---------- */
.wh-top {
  background: var(--espresso);
  color: var(--on-dark);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}
.wh-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.wh-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 30%,
    var(--copper-light),
    var(--copper) 60%,
    #7a4420 100%
  );
  flex-shrink: 0;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.15);
}
.wh-brand-text {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.2px;
}
.wh-brand-sub {
  font-size: 10px;
  color: #c9b69b;
  font-weight: 500;
}

.wh-top-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wh-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--on-dark);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition:
    transform 0.18s var(--ease-out),
    background-color 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}
.wh-pill.active {
  background: var(--copper);
  border-color: var(--copper);
}
.wh-theme-toggle {
  min-width: 42px;
  justify-content: center;
}
.wh-theme-label {
  line-height: 1;
}
.wh-pill:active {
  transform: scale(0.94);
}

/* تنسيق layout؛ ترتيب الاستيراد في index.css يحافظ على أولوية القواعد. */
/* ---------- Layout ---------- */
.wh-department-selector {
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  margin: 12px 0;
}
.wh-department-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 46px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.wh-department-option.active {
  color: var(--heading);
  background: var(--parchment-2);
  border-color: var(--copper);
}
.wh-department-option:disabled {
  cursor: wait;
  opacity: 0.65;
}
.wh-department-loading {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background: var(--card);
  color: var(--heading);
  font: inherit;
  font-weight: 800;
  cursor: wait;
}
.wh-mobile-department {
  padding: 0 14px;
  max-width: 720px;
  margin: 0 auto;
}
.wh-app-nav-mobile > .wh-department-selector {
  display: none;
}
@media (min-width: 1280px) {
  .wh-mobile-department {
    display: none;
  }
}
.wh-body {
  padding: 14px;
  padding-bottom: 90px;
  max-width: 720px;
  margin: 0 auto;
}

.wh-role-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  background: var(--parchment-2);
  padding: 4px;
  border-radius: 14px;
}
.wh-role-tab {
  flex: 1;
  text-align: center;
  padding: 9px 6px;
  border-radius: 11px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  color: var(--ink-soft);
  font-family: inherit;
  border: none;
  background: transparent;
  transition:
    transform 0.2s var(--ease-out),
    color 0.22s ease,
    background-color 0.22s ease,
    box-shadow 0.22s ease;
}
.wh-role-tab.active {
  background: var(--card);
  color: var(--heading);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.wh-role-tab:active {
  transform: scale(0.97);
}
.wh-role-tabs.docked {
  max-width: 340px;
  margin-inline-start: auto;
  margin-inline-end: 0;
}
.wh-role-tabs.docked.entering {
  animation: wh-role-dock 0.22s cubic-bezier(0.2, 0.85, 0.25, 1);
}
@keyframes wh-role-dock {
  from {
    transform: translateX(-38%) scale(1.04);
    opacity: 0.35;
  }
  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

.wh-access-gate {
  min-height: calc(100vh - 72px);
  display: grid;
  place-items: center;
  padding: 28px 16px 80px;
}
.wh-access-card {
  width: min(520px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px 22px;
  text-align: center;
  box-shadow: 0 18px 55px rgba(43, 27, 18, 0.13);
  position: relative;
}
.wh-access-back {
  position: absolute;
  inset-block-start: 18px;
  inset-inline-start: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--access-choice-bg);
  color: var(--access-choice-text);
  font: 700 14px/1 inherit;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}
.wh-access-back:hover {
  border-color: var(--copper);
  box-shadow: 0 5px 14px rgba(43, 27, 18, 0.09);
}
.wh-access-back:active {
  transform: scale(0.96);
}
.wh-access-back:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}
.wh-access-mark {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  margin: 0 auto 14px;
  background: radial-gradient(circle at 35% 30%, var(--copper-light), var(--copper) 62%, #7a4420);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.2);
}
.wh-access-title {
  font-size: 21px;
  font-weight: 800;
  color: var(--heading);
}
.wh-access-sub {
  margin: 5px 0 20px;
  color: var(--ink-soft);
  font-size: 14px;
}
.wh-access-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.wh-access-choice {
  min-height: 82px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: var(--access-choice-bg);
  color: var(--access-choice-text);
  -webkit-text-fill-color: var(--access-choice-text);
  font: 800 30px/1.25 inherit;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}
.wh-access-choice:hover {
  transform: translateY(-2px);
  border-color: var(--copper);
  box-shadow: 0 8px 20px rgba(43, 27, 18, 0.09);
}
.wh-access-choice:active {
  transform: scale(0.98);
}

.wh-h1 {
  font-size: 19px;
  font-weight: 800;
  color: var(--heading);
  margin-bottom: 3px;
}
.wh-sub {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 16px;
  line-height: 1.65;
}

/* تنسيق products؛ ترتيب الاستيراد في index.css يحافظ على أولوية القواعد. */
/* ---------- Search ---------- */
.wh-search {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--card);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 14px;
  transition:
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.22s var(--ease-out),
    background-color 0.22s ease;
}
.wh-search:focus {
  outline: none;
  border-color: var(--copper);
  box-shadow: 0 0 0 4px rgba(168, 93, 46, 0.12);
  transform: translateY(-1px);
}

/* ---------- Category chips ---------- */
.wh-chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 6px;
}
.wh-chip {
  flex-shrink: 0;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--card);
  border: 1.3px solid var(--line);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition:
    transform 0.18s var(--ease-out),
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.wh-chip.active {
  background: var(--espresso);
  color: var(--on-dark);
  border-color: var(--espresso);
}
.wh-chip:active {
  transform: scale(0.94);
}

/* ---------- Product card (employee grid) ---------- */
.wh-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.wh-pcard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.22s var(--ease-out),
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    background-color 0.22s ease;
}
.wh-pcard:active {
  transform: scale(0.97);
}
.wh-pcard-disabled {
  opacity: 0.6;
  cursor: default;
}
.wh-pcard-disabled:active {
  transform: none;
}
.wh-favorite {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  flex: none;
}
.wh-pcard > .wh-favorite {
  position: absolute;
  inset-inline-start: 10px;
  top: 10px;
  z-index: 1;
}
.wh-pcard:has(> .wh-favorite) > .wh-pcat {
  min-height: 34px;
  padding-inline-start: 40px;
}
.wh-favorite.active {
  color: var(--copper);
  border-color: var(--copper);
}
.wh-favorite:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}
.wh-save-status {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
  max-width: 43vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wh-save-status[data-status='failed'],
.wh-save-status[data-status='offline'] {
  color: var(--clay);
}
.wh-save-status[data-status='conflict'] {
  color: var(--clay);
}
.wh-save-status[data-status='failed'] {
  cursor: pointer;
  text-decoration: underline;
}
.wh-toast[role='alert'] {
  background: var(--danger-bg);
  color: var(--danger);
}
.wh-pname-ar {
  font-weight: 700;
  font-size: 16px;
  color: var(--heading);
  line-height: 1.45;
}
.wh-pname-en {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 3px;
  line-height: 1.5;
}
.wh-pcat {
  font-size: 12px;
  color: var(--copper);
  font-weight: 700;
  margin-bottom: 6px;
}

/* roast gauge */
.wh-gauge {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  width: 30px;
  height: 30px;
}
.wh-gauge svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.wh-gauge-track {
  fill: none;
  stroke: var(--parchment-2);
  stroke-width: 4;
}
.wh-gauge-fill {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
}

.wh-stockline {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 8px;
  color: var(--ink-soft);
  background: var(--parchment-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 5px 9px;
  line-height: 1;
}
.wh-stockqty {
  font-family: var(--font-number);
  font-size: 18px;
  font-weight: 800;
  color: var(--heading);
}
.wh-stockunit {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}
.wh-badge-low {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  color: var(--danger);
  background: var(--danger-bg);
  padding: 4px 8px;
  border-radius: 7px;
  margin-top: 6px;
}
.wh-badge-low .wh-stockqty {
  color: #fff;
  font-size: 14px;
}
.wh-badge-unset {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--parchment-2);
  padding: 2px 7px;
  border-radius: 6px;
  margin-top: 6px;
}
.wh-order-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 13px;
  margin-bottom: 14px;
  color: var(--ink-soft);
  font-size: 12.5px;
}
.wh-order-current strong {
  color: var(--heading);
  font-size: 15px;
}

.wh-badge-added {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  color: var(--success);
  background: var(--success-bg);
  padding: 2px 7px;
  border-radius: 6px;
  margin-top: 6px;
}
.wh-pcard-in-cart {
  border-color: var(--sage);
  box-shadow: 0 0 0 1.5px var(--sage) inset;
}

.wh-cart-section {
  margin-top: 18px;
}
.wh-cart-title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink-soft);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.wh-cart-row {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition:
    transform 0.2s var(--ease-out),
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.wh-cart-row-main {
  flex: 1;
  min-width: 0;
}
.wh-cart-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--parchment);
  border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  max-width: 720px;
  margin: 0 auto;
  box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.08);
  animation: wh-cart-bar-in 0.18s var(--ease-out);
}
.wh-cart-dock {
  display: grid;
  gap: 8px;
}
.wh-cart-dock-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.wh-cart-dock-main {
  flex: 1;
  min-width: 0;
  margin-top: 0;
}
.wh-cart-dock-delete {
  flex: 0 0 auto;
  min-width: 82px;
  border: 1px solid rgba(186, 76, 60, 0.5);
  border-radius: 11px;
  background: color-mix(in srgb, var(--clay) 16%, var(--card));
  color: var(--heading);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.18s var(--ease-out),
    background 0.18s ease,
    border-color 0.18s ease;
}
.wh-cart-dock-delete:active {
  transform: scale(0.97);
}
.wh-cart-dock-spacer {
  height: 78px;
}
.wh-cart-dock-spacer.double {
  height: 136px;
}
@keyframes wh-cart-bar-in {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.wh-catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.wh-catalog-grid .wh-catalog-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin: 0;
  min-width: 0;
  padding: 14px;
}
.wh-catalog-card .wh-list-main {
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}
.wh-catalog-card .wh-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}
.wh-catalog-card .wh-list-actions button {
  margin-inline-start: 0 !important;
  min-width: 36px;
  min-height: 36px;
}
.wh-consumption-total {
  padding: 10px;
  margin: 8px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 14px;
}
.wh-consumption-total strong {
  color: var(--heading);
  font-size: 16px;
}
.wh-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-soft);
  font-size: 13px;
}

/* تنسيق dialogs؛ ترتيب الاستيراد في index.css يحافظ على أولوية القواعد. */
/* ---------- Sheet / modal ---------- */
.wh-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.wh-sheet {
  background: var(--sheet);
  color: var(--ink);
  width: 100%;
  max-width: 720px;
  border-radius: 22px 22px 0 0;
  max-height: 88vh;
  overflow-y: auto;
  padding: 18px 16px 22px;
  transform: translateY(0);
}
.wh-overlay.wh-entering {
  animation: wh-overlay-in 0.18s ease both;
}
.wh-overlay.wh-entering .wh-sheet {
  animation: wh-sheet-in 0.22s var(--ease-out) both;
}
.wh-overlay.wh-leaving {
  animation: wh-overlay-out 0.13s ease both;
  pointer-events: auto;
}
.wh-overlay.wh-leaving .wh-sheet {
  animation: wh-sheet-out 0.14s cubic-bezier(0.4, 0, 1, 1) both;
}
@keyframes wh-overlay-in {
  from {
    background: transparent;
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
  }
  to {
    background: var(--overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
}
@keyframes wh-overlay-out {
  from {
    background: var(--overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
  to {
    background: transparent;
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
  }
}
@keyframes wh-sheet-in {
  from {
    transform: translateY(105%);
    opacity: 0.65;
  }
  70% {
    opacity: 1;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes wh-sheet-out {
  to {
    transform: translateY(105%);
    opacity: 0.65;
  }
}
.wh-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--line);
  border-radius: 4px;
  margin: 0 auto 14px;
}
.wh-sheet-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--heading);
  margin-bottom: 2px;
}
.wh-sheet-sub {
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 16px;
}

.wh-field {
  margin-bottom: 12px;
}
.wh-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 5px;
  display: block;
}
.wh-input,
.wh-select,
.wh-textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1.4px solid var(--line);
  background: var(--control);
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s var(--ease-out);
}
.wh-input:focus,
.wh-select:focus,
.wh-textarea:focus {
  outline: none;
  border-color: var(--copper);
  box-shadow: 0 0 0 4px rgba(168, 93, 46, 0.12);
  transform: translateY(-1px);
}
.wh-textarea {
  resize: vertical;
  min-height: 60px;
}
.wh-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 560px) {
  .wh-mixed-order-grid {
    grid-template-columns: 1fr;
  }
}

.wh-stepper {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin: 6px 0 4px;
}
.wh-step-btn {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: none;
  background: var(--espresso);
  color: var(--on-dark);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.18s var(--ease-out),
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}
.wh-step-btn:active {
  transform: scale(0.9);
}
.wh-step-val {
  font-size: 26px;
  font-weight: 800;
  min-width: 70px;
  text-align: center;
  font-family: var(--font-number);
}
input[type='number'],
.wh-step-val,
.wh-stockqty {
  font-family: var(--font-number);
  font-variant-numeric: lining-nums tabular-nums;
}
.wh-latin-number {
  direction: ltr;
  unicode-bidi: isolate;
  font-family: var(--font-number) !important;
  font-variant-numeric: lining-nums tabular-nums;
}
input[type='number'] {
  direction: ltr;
  unicode-bidi: isolate;
}

.wh-btn {
  width: 100%;
  padding: 13px;
  border-radius: 14px;
  border: none;
  font-family: inherit;
  font-weight: 800;
  font-size: 14.5px;
  cursor: pointer;
  margin-top: 6px;
  transition:
    transform 0.18s var(--ease-out),
    box-shadow 0.22s ease,
    filter 0.22s ease,
    opacity 0.22s ease;
}
.wh-btn:active:not(:disabled) {
  transform: scale(0.975);
}
.wh-btn-primary {
  background: var(--copper);
  color: #fff;
}
.wh-btn-primary:disabled {
  background: var(--line);
  color: var(--ink-soft);
  cursor: not-allowed;
}
.wh-btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1.4px solid var(--line);
}
.wh-btn-danger {
  background: var(--clay);
  color: #fff;
}
.wh-btn-sage {
  background: var(--sage);
  color: #fff;
}

.wh-confirm {
  text-align: center;
  padding: 20px 10px;
}
.wh-confirm-mark {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--sage);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin: 0 auto 14px;
}

/* تنسيق tables؛ ترتيب الاستيراد في index.css يحافظ على أولوية القواعد. */
/* ---------- Admin table ---------- */
.wh-admin-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.wh-add-btn {
  background: var(--espresso);
  color: var(--on-dark);
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 800;
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition:
    transform 0.18s var(--ease-out),
    box-shadow 0.22s ease,
    filter 0.22s ease;
}
.wh-add-btn:active {
  transform: scale(0.96);
}
.wh-list-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition:
    transform 0.2s var(--ease-out),
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.wh-list-item.inactive {
  opacity: 0.5;
}
.wh-list-main {
  flex: 1;
  min-width: 0;
}
.wh-list-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.wh-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--parchment);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.18s var(--ease-out),
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.wh-icon-btn:active {
  transform: scale(0.88);
}

.wh-tabs2 {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
}
.wh-tab2 {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1.4px solid var(--line);
  background: var(--card);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
  transition:
    transform 0.18s var(--ease-out),
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.wh-tab2.active {
  background: var(--espresso);
  color: var(--on-dark);
  border-color: var(--espresso);
}
.wh-tab2:active {
  transform: scale(0.95);
}

.wh-audit-row {
  padding: 16px;
  margin-bottom: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 16px;
  overflow-wrap: anywhere;
}
.wh-audit-row .wh-audit-tag {
  font-size: 12px;
  padding: 5px 9px;
}
.wh-audit-time {
  padding: 6px 0 10px;
}
.wh-audit-detail {
  margin: 10px 0;
  line-height: 1.7;
}
.wh-audit-detail > span {
  font-size: 14px;
  color: var(--ink-soft);
}
.wh-audit-detail p {
  margin-top: 4px;
  font-size: 15px;
  white-space: pre-wrap;
}
.wh-stock-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.wh-stock-summary-pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.wh-stock-summary > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  padding: 10px;
  border-radius: 10px;
  background: var(--surface-muted);
  min-width: 0;
  overflow-wrap: anywhere;
}
.wh-stock-summary span {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.wh-stock-summary strong,
.wh-stock-summary .wh-stockqty {
  font-size: 16px;
  line-height: 1.5;
  color: var(--heading);
}
@media (max-width: 420px) {
  .wh-stock-summary:not(.wh-stock-summary-pair) {
    grid-template-columns: 1fr;
  }
}
.wh-audit-top {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  color: var(--heading);
}
.wh-audit-meta {
  color: var(--ink-soft);
  font-size: 12px;
  margin-top: 2px;
}
.wh-audit-tag {
  font-size: 12px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  color: #fff;
}
.wh-audit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin-top: 9px;
}
.wh-audit-undo-slot {
  min-width: 92px;
}
.wh-audit-undo {
  padding: 6px 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--control);
  color: var(--heading);
  font: 700 12px/1.2 inherit;
  cursor: pointer;
}
.wh-audit-undo:active {
  transform: scale(0.96);
}
.wh-audit-undone {
  display: inline-block;
  color: var(--sage);
  font-size: 12px;
  font-weight: 700;
}
.wh-audit-delete {
  padding: 6px 11px;
  border-radius: 9px;
  border: 1px solid color-mix(in srgb, var(--clay) 52%, var(--line));
  background: color-mix(in srgb, var(--clay) 10%, transparent);
  color: var(--clay);
  font: 700 11px/1.2 inherit;
  cursor: pointer;
  white-space: nowrap;
}
.wh-audit-delete:active {
  transform: scale(0.96);
}

/* تنسيق statistics؛ ترتيب الاستيراد في index.css يحافظ على أولوية القواعد. */
/* ---------- Consumption statistics ---------- */
.wh-stats-panel {
  display: grid;
  gap: 12px;
}
.wh-stats-filter {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  display: grid;
  gap: 12px;
}
.wh-stats-presets {
  display: flex;
  gap: 7px;
  overflow-x: auto;
}
.wh-stats-date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.wh-stats-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.wh-stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
}
.wh-stat-value {
  color: var(--heading);
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-number);
}
.wh-stat-label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  margin-top: 2px;
}
.wh-stats-product {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px;
}
.wh-stats-product-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.wh-stats-product-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--heading);
}
.wh-stats-product-cat {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
}
.wh-stats-product-total {
  text-align: end;
  color: var(--copper);
  font-size: 14px;
  font-weight: 800;
}
.wh-stats-average {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--parchment-2);
  color: var(--ink-soft);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
@media (max-width: 520px) {
  .wh-stats-summary {
    grid-template-columns: 1fr;
  }
  .wh-stats-date-grid {
    grid-template-columns: 1fr;
  }
}

.wh-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--espresso);
  color: var(--on-dark);
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  z-index: 200;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: wh-toast-in 0.2s var(--ease-out) both;
}
@keyframes wh-toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 18px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}
.wh-toast.wh-toast-leaving {
  animation: wh-toast-out 0.14s ease-in both;
  pointer-events: none;
}
@keyframes wh-toast-out {
  from {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(-50%, 10px) scale(0.96);
  }
}

/* تنسيق theme؛ ترتيب الاستيراد في index.css يحافظ على أولوية القواعد. */
/* ========================================================================== */
/* Operational palette: petrol, warm sand, independent semantic colors            */
/* ========================================================================== */
:root {
  --page-bg: #f4f4ee;
  --card: #ffffff;
  --surface-muted: #e0eeea;
  --line: #d2dfd9;
  --field-line: #778b84;
  --ink: #183431;
  --ink-soft: #526965;
  --heading: #183431;
  --primary: #0f625c;
  --primary-text: #ffffff;
  --primary-hover: #0b514c;
  --selected: #e0eeea;
  --copper: #8d6123;
  --copper-light: #8d6123;
  --copper-soft: #f9edd7;
  --success: #22643e;
  --success-bg: #e9f3ea;
  --warning: #795300;
  --warning-bg: #fff2ce;
  --danger: #a7342c;
  --danger-bg: #fceae6;
  --danger-fill: #a7342c;
  --danger-on-fill: #ffffff;
  --info: #265788;
  --info-bg: #e9f0f9;
  --overlay: rgba(16, 30, 29, 0.54);
  --espresso: var(--primary);
  --espresso-2: var(--primary-hover);
  --sage: var(--primary);
  --clay: var(--danger);
  --parchment: var(--page-bg);
  --parchment-2: var(--surface-muted);
  --sheet: var(--card);
  --control: var(--card);
  --control-hover: var(--selected);
  --access-choice-bg: var(--card);
  --access-choice-text: var(--ink);
  --on-dark: var(--primary-text);
  --surface-2: var(--surface-muted);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  --status-good-text: var(--success);
  --status-good-bg: var(--success-bg);
  --status-warn-text: var(--warning);
  --status-warn-bg: var(--warning-bg);
  --status-info-text: var(--info);
  --status-info-bg: var(--info-bg);
  --status-error-text: var(--danger);
}
#wh-root[data-theme='dark'] {
  --page-bg: #101e1d;
  --card: #1a2d2a;
  --surface-muted: #23463f;
  --line: #39534b;
  --field-line: #718d82;
  --ink: #eef6ef;
  --ink-soft: #a6bdb5;
  --heading: #eef6ef;
  --primary: #75cabc;
  --primary-text: #0b2925;
  --primary-hover: #93dace;
  --selected: #23463f;
  --copper: #e9bd75;
  --copper-light: #e9bd75;
  --copper-soft: #3e3323;
  --success: #a8d5b5;
  --success-bg: #243e2e;
  --warning: #f1cb79;
  --warning-bg: #443820;
  --danger: #f2b2a8;
  --danger-bg: #482b29;
  --danger-fill: #c24135;
  --danger-on-fill: #ffffff;
  --info: #abcbef;
  --info-bg: #25364b;
  --overlay: rgba(4, 8, 6, 0.76);
  color-scheme: dark;
  --espresso: var(--primary);
  --espresso-2: var(--primary-hover);
  --sage: var(--primary);
  --clay: var(--danger);
  --parchment: var(--page-bg);
  --parchment-2: var(--surface-muted);
  --sheet: var(--card);
  --control: var(--card);
  --control-hover: var(--selected);
  --access-choice-bg: var(--card);
  --access-choice-text: var(--ink);
  --on-dark: var(--primary-text);
  --surface-2: var(--surface-muted);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  --status-good-text: var(--success);
  --status-good-bg: var(--success-bg);
  --status-warn-text: var(--warning);
  --status-warn-bg: var(--warning-bg);
  --status-info-text: var(--info);
  --status-info-bg: var(--info-bg);
  --status-error-text: var(--danger);
}
body {
  background: var(--page-bg);
}
#wh-root {
  background: var(--page-bg);
  color: var(--ink);
  line-height: 1.6;
}
#wh-root button {
  min-height: 44px;
}
.wh-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}
.wh-top {
  height: 64px;
  padding: 8px 16px;
  background: var(--card);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 3px 12px rgba(20, 25, 23, 0.05);
}
.wh-brand-mark {
  width: 32px;
  height: 32px;
  background: var(--copper);
  box-shadow: none;
}
.wh-brand-text {
  font-size: 16px;
  color: var(--heading);
}
.wh-brand-sub {
  display: inline-flex;
  width: max-content;
  margin-top: 1px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--selected);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}
.wh-account-button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font: 700 14px/1 var(--font-ui);
  cursor: pointer;
}
.wh-login-language {
  display: flex;
  gap: 6px;
}
.wh-pill {
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border-color: var(--line);
  background: var(--surface-muted);
  color: var(--ink);
}
.wh-pill.active {
  background: var(--selected);
  color: var(--primary);
  border-color: var(--primary);
}
.wh-body {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 16px 96px;
}
.wh-section-content {
  min-width: 0;
}
.wh-app-nav-desktop {
  display: none;
}
.wh-app-nav-mobile {
  position: fixed;
  z-index: 70;
  inset-inline: 0;
  bottom: 0;
  height: calc(64px + env(safe-area-inset-bottom));
  padding: 6px 8px env(safe-area-inset-bottom);
  background: var(--card);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 18px rgba(20, 25, 23, 0.07);
}
.wh-app-nav-mobile .wh-nav-brand,
.wh-app-nav-mobile .wh-nav-settings {
  display: none;
}
.wh-nav-items {
  display: flex;
  height: 100%;
  gap: 4px;
}
.wh-nav-item,
.wh-nav-settings {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: 700 12px/1.2 var(--font-ui);
  cursor: pointer;
}
.wh-app-nav-mobile .wh-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 12px;
}
.wh-nav-item.active {
  background: var(--selected);
  color: var(--primary);
}
.wh-page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.wh-page-heading h1 {
  margin: 0;
  color: var(--heading);
  font-size: 24px;
  line-height: 1.35;
  font-weight: 700;
}
.wh-page-heading h1 span {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 26px;
  padding: 0 7px;
  border-radius: 9px;
  background: var(--surface-muted);
  color: var(--ink-soft);
  font: 700 14px/1 var(--font-number);
}
.wh-page-heading p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}
.wh-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 10px;
}
.wh-section-heading h2,
.wh-dashboard-panel h3 {
  margin: 0;
  color: var(--heading);
  font-size: 18px;
  font-weight: 700;
}
.wh-attention-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--warning) 24%, var(--line));
  border-radius: 16px;
  background: var(--warning-bg);
  color: var(--warning);
}
.wh-attention-card > div:first-child {
  display: grid;
  gap: 3px;
}
.wh-attention-card span {
  font-size: 14px;
  font-weight: 700;
}
.wh-attention-card strong {
  font-size: 16px;
}
.wh-attention-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.wh-attention-links button,
.wh-panel-link {
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  font: 700 14px/1.3 var(--font-ui);
  cursor: pointer;
}
.wh-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.wh-quick-grid button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--heading);
  font: 700 15px/1.4 var(--font-ui);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(20, 25, 23, 0.04);
}
.wh-quick-grid button:first-child {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}
.wh-dashboard-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.wh-stat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 104px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  text-align: start;
  box-shadow: 0 4px 14px rgba(20, 25, 23, 0.04);
}
button.wh-stat-card {
  cursor: pointer;
}
.wh-stat-value,
.wh-stat-card > strong {
  color: var(--heading);
  font: 700 28px/1.15 var(--font-number);
}
.wh-stat-label,
.wh-stat-card > span {
  color: var(--ink-soft);
  font-size: 14px;
}
.wh-dashboard-duo {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}
.wh-dashboard-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 4px 16px rgba(20, 25, 23, 0.035);
}
.wh-dashboard-panel .wh-section-heading {
  margin: 0 0 12px;
}
.wh-dashboard-row,
.wh-dashboard-order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.wh-dashboard-row:last-of-type,
.wh-dashboard-order-row:last-of-type {
  border-bottom: 0;
}
.wh-dashboard-row > div:first-child,
.wh-dashboard-order-row > div:first-child {
  display: grid;
  min-width: 0;
}
.wh-dashboard-row strong,
.wh-dashboard-order-row strong {
  color: var(--heading);
  font-size: 16px;
}
.wh-dashboard-row small,
.wh-dashboard-order-row small {
  color: var(--ink-soft);
  font-size: 14px;
}
.wh-dashboard-row time {
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-size: 12px;
  direction: ltr;
  unicode-bidi: isolate;
}
.wh-dashboard-order-row > button,
.wh-card-action {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--primary);
  border-radius: 10px;
  background: transparent;
  color: var(--primary);
  font: 700 14px/1 var(--font-ui);
  cursor: pointer;
}
.wh-panel-link {
  display: block;
  margin-top: 12px;
  color: var(--primary);
}
.wh-panel-note {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}
.wh-empty.compact {
  padding: 24px 8px;
}
.wh-status,
.wh-order-status {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}
.wh-status-good,
.wh-order-status-accepted,
.wh-order-status-received {
  color: var(--success);
  background: var(--success-bg);
}
.wh-status-near,
.wh-order-status-new,
.wh-order-status-waiting,
.wh-order-status-modified {
  color: var(--warning);
  background: var(--warning-bg);
}
.wh-status-empty,
.wh-status-insufficient,
.wh-status-low {
  color: var(--danger);
  background: var(--danger-bg);
}
.wh-order-status-receiving {
  color: var(--info);
  background: var(--info-bg);
}
.wh-status-unknown,
.wh-status-no-data,
.wh-order-status-cancelled {
  color: var(--ink-soft);
  background: var(--surface-muted);
}
.wh-search,
.wh-input,
.wh-select,
.wh-textarea {
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid var(--field-line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font-size: 16px;
}
.wh-search:focus,
.wh-input:focus,
.wh-select:focus,
.wh-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
  transform: none;
}
.wh-label {
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 14px;
}
.wh-btn,
.wh-add-btn {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 16px;
}
.wh-btn-primary,
.wh-add-btn,
.wh-btn-sage {
  background: var(--primary);
  color: var(--primary-text);
}
.wh-btn-primary:hover,
.wh-add-btn:hover,
.wh-btn-sage:hover {
  background: var(--primary-hover);
}
.wh-btn-ghost {
  border: 1px solid var(--field-line);
  background: var(--card);
  color: var(--ink);
}
.wh-btn-danger {
  background: var(--danger-fill);
  color: var(--danger-on-fill);
}
.wh-chips,
.wh-filter-row,
.wh-inline-options {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
}
.wh-filter-row {
  margin: 0 0 16px;
  padding-bottom: 4px;
}
.wh-chip {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink-soft);
  font-size: 14px;
}
.wh-chip.active {
  background: var(--selected);
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 42%, var(--line));
}
.wh-clear-filter {
  min-height: 40px;
  border: 0;
  background: transparent;
  color: var(--primary);
  text-decoration: underline;
  font: 700 14px/1 var(--font-ui);
  white-space: nowrap;
  cursor: pointer;
}
.wh-catalog-head {
  display: none;
}
.wh-catalog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.wh-catalog-grid .wh-catalog-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 16px;
  padding: 16px;
  border-radius: 16px;
}
.wh-catalog-card .wh-list-main {
  grid-column: 1;
}
.wh-catalog-card .wh-list-actions {
  grid-column: 2;
  grid-row: 1;
}
.wh-catalog-cell {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 14px;
}
.wh-catalog-cell::before {
  content: attr(data-label);
  color: var(--ink-soft);
}
.wh-catalog-qty {
  font: 700 16px/1.5 var(--font-number);
}
.wh-icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
}
.wh-order-filters {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}
.wh-heading-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.wh-heading-actions .wh-btn {
  width: auto;
  margin: 0;
}
.wh-more-actions {
  position: relative;
}
.wh-more-actions summary {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  cursor: pointer;
  list-style: none;
  font-size: 24px;
}
.wh-more-actions > div {
  position: absolute;
  z-index: 20;
  inset-inline-end: 0;
  top: 54px;
  width: 240px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 14px 34px rgba(20, 25, 23, 0.14);
}
.wh-more-actions button {
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: start;
  font: 600 14px/1.4 var(--font-ui);
  cursor: pointer;
}
.wh-more-actions button:hover {
  background: var(--surface-muted);
}
.wh-more-actions button.danger {
  color: var(--danger);
}
.wh-order-card {
  border-radius: 16px;
  padding: 16px;
}
.wh-order-card .wh-audit-tag {
  margin-inline-start: 6px;
}
.wh-more-page {
  max-width: 760px;
}
.wh-more-list {
  display: grid;
  gap: 8px;
}
.wh-more-list > button {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  text-align: start;
  font: 700 16px/1.3 var(--font-ui);
  cursor: pointer;
}
.wh-more-list b {
  color: var(--ink-soft);
  font-size: 24px;
}
.wh-account-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  padding: 14px;
  border-radius: 14px;
  background: var(--surface-muted);
}
.wh-account-summary > span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--selected);
  color: var(--primary);
}
.wh-account-summary > div {
  display: grid;
}
.wh-account-summary small {
  color: var(--ink-soft);
}
.wh-account-summary > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.wh-account-sheet .wh-settings-group {
  padding: 16px;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}
.wh-settings-page.wh-auth-sheet {
  max-height: none;
  overflow: visible;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}
.wh-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}
.wh-settings-page .wh-page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.wh-settings-page .wh-page-heading .wh-btn {
  width: auto;
  flex: none;
}
.wh-settings-page.wh-staff-sheet .wh-settings-group {
  background: var(--card);
}
@media (max-width: 760px) {
  .wh-settings-grid {
    grid-template-columns: 1fr;
  }
  .wh-settings-page.wh-auth-sheet {
    padding: 18px 12px 90px;
  }
  .wh-settings-page .wh-page-heading {
    align-items: start;
  }
}
.wh-account-sheet .wh-settings-group h3 {
  margin: 0 0 12px;
  font-size: 17px;
}
.wh-account-sheet .wh-settings-group .wh-auth-form {
  margin: 12px 0;
}
.wh-account-sheet .wh-settings-group > .wh-btn {
  width: 100%;
}
.wh-account-sheet .wh-settings-group strong {
  overflow-wrap: anywhere;
}
.wh-account-sheet .wh-settings-divider {
  border-top: 1px solid var(--line);
  margin: 20px 0;
}
.wh-account-sheet .wh-settings-footer {
  display: grid;
  gap: 8px;
  margin: 18px 0 4px;
}
.wh-account-sheet .wh-settings-footer .wh-btn {
  width: 100%;
}
.wh-account-sheet .wh-account-keys {
  margin-top: 8px;
}
.wh-account-sheet .wh-setting-row:last-child {
  border-bottom: 0;
}
.wh-setting-row {
  display: grid;
  gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.wh-setting-row > span {
  color: var(--ink-soft);
  font-size: 14px;
}
.wh-setting-row .wh-btn {
  margin: 0;
}
.wh-access-gate {
  min-height: calc(100dvh - 64px);
  padding: 24px 16px;
}
.wh-access-card {
  width: min(480px, 100%);
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(20, 25, 23, 0.08);
}
.wh-access-mark {
  width: 48px;
  height: 48px;
  background: var(--copper);
  box-shadow: none;
}
.wh-access-title {
  font-size: 24px;
}
.wh-access-sub {
  font-size: 16px;
}
.wh-access-choices {
  gap: 10px;
}
.wh-access-choice {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font-size: 18px;
}
.wh-location-choice {
  display: grid;
  gap: 2px;
}
.wh-location-choice small {
  color: var(--ink-soft);
  font-size: 14px;
}
.wh-overlay {
  align-items: flex-end;
}
.wh-sheet {
  max-width: 480px;
  max-height: 85dvh;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0;
  background: var(--card);
}
.wh-sheet:has(#f-nameAr) {
  max-width: 640px;
}
.wh-sheet-title,
.wh-sheet h2 {
  color: var(--heading);
  font-size: 20px;
  font-weight: 700;
}
.wh-sheet-sub {
  color: var(--ink-soft);
  font-size: 14px;
}
.wh-fullscreen-flow .wh-flow-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -20px -16px 14px;
  padding: calc(16px + env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.wh-fullscreen-flow .wh-flow-header h2 {
  margin: 0;
}
.wh-flow-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.wh-flow-nav {
  flex: none;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--heading);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.wh-stock-summary > div {
  background: var(--surface-muted);
}
.wh-workflow-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 14px 0 18px;
}
.wh-workflow-steps span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 6px;
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.wh-workflow-steps span.active {
  background: var(--selected);
  color: var(--primary);
}
.wh-period-options {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}
.wh-period-options button {
  display: grid;
  gap: 2px;
  min-height: 68px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  text-align: start;
  font: inherit;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}
.wh-weighted-presets {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.wh-period-options button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
@media (hover: hover) {
  .wh-period-options button:hover:not(:disabled) {
    border-color: var(--primary);
    background: var(--selected);
    box-shadow: 0 0 0 1px var(--primary);
  }
}
.wh-period-options button:active:not(:disabled) {
  transform: scale(0.98);
}
.wh-period-options button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  .wh-period-options button {
    transition: none;
  }
  .wh-period-options button:active:not(:disabled) {
    transform: none;
  }
}
.wh-period-options button.active {
  border-color: var(--primary);
  background: var(--selected);
  color: var(--primary);
}
.wh-period-options strong {
  font-size: 16px;
}
.wh-period-options small {
  color: var(--ink-soft);
  font-size: 14px;
}
.wh-period-range {
  display: grid;
  gap: 3px;
  margin: 12px 0;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-muted);
  color: var(--ink-soft);
}
.wh-period-range b {
  color: var(--heading);
  font-family: var(--font-number);
}
.wh-auto-order-list {
  display: grid;
  gap: 12px;
}
.wh-auto-order-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}
.wh-auto-order-card h3 {
  margin: 0 0 10px;
  color: var(--heading);
  font-size: 16px;
}
.wh-auto-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  color: var(--ink-soft);
  font-size: 14px;
}
.wh-auto-fact {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border-radius: 12px;
  background: var(--page-bg);
  overflow-wrap: anywhere;
}
.wh-auto-fact span {
  font-size: 12px;
  line-height: 1.65;
}
.wh-auto-fact strong {
  color: var(--ink);
  line-height: 1.6;
}
.wh-auto-key-facts .wh-auto-fact:first-child {
  background: var(--selected);
}
.wh-auto-key-facts strong {
  font-size: 18px;
}
.wh-auto-reserve-line {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 2px;
  color: var(--ink-soft);
  font-size: 13px;
}
.wh-auto-calculation {
  margin-top: 6px;
  border-top: 1px solid var(--line);
}
.wh-auto-calculation summary {
  padding: 12px 0;
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
}
.wh-auto-review-tools {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}
.wh-auto-review-tools .wh-auto-edit {
  margin: 0;
}
.wh-zero-stock-warning {
  padding: 14px;
  border: 1px solid var(--warning);
  border-radius: 14px;
  background: color-mix(in srgb, var(--warning) 9%, var(--card));
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.wh-zero-stock-warning summary {
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}
.wh-zero-stock-warning p {
  margin: 10px 0;
  color: var(--ink-soft);
  font-size: 13px;
}
.wh-zero-stock-warning ul {
  max-height: 220px;
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}
.wh-zero-stock-warning li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.wh-zero-stock-warning small {
  color: var(--ink-soft);
}
.wh-required-qty {
  display: grid;
  grid-template-columns: 1fr 120px auto;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  border-radius: 12px;
  background: var(--selected);
  color: var(--primary);
  font-weight: 700;
}
.wh-required-qty .wh-input {
  background: var(--card);
}
.wh-manual-note {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  color: var(--warning);
  font-size: 12px;
}
.wh-manual-note button {
  border: 0;
  background: transparent;
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
}
.wh-excluded {
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.wh-excluded summary {
  padding: 12px;
  background: var(--surface-muted);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}
.wh-excluded > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.wh-excluded span {
  color: var(--ink-soft);
}
.wh-review-dock {
  position: sticky;
  bottom: -20px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px -16px -10px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--card);
}
.wh-review-dock .wh-btn {
  flex: 1;
  margin: 0;
}
.wh-st-panel {
  max-width: 1100px;
  margin: 0 auto;
}
.wh-st-row {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}
.wh-progress {
  height: 5px;
  margin: -2px 0 14px;
  border-radius: 999px;
  background: var(--surface-muted);
  overflow: hidden;
}
.wh-progress i {
  display: block;
  height: 100%;
  background: var(--primary);
}
.wh-st-row-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.wh-st-row-actions button {
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font: 700 13px/1 var(--font-ui);
  cursor: pointer;
}
.wh-review-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.wh-review-summary > div {
  display: grid;
  gap: 2px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
  text-align: center;
}
.wh-review-summary b {
  color: var(--heading);
  font: 700 24px/1 var(--font-number);
}
.wh-review-summary span {
  color: var(--ink-soft);
  font-size: 13px;
}
.wh-st-warning {
  border-color: color-mix(in srgb, var(--warning) 32%, var(--line));
  background: var(--warning-bg);
  color: var(--warning);
}
.wh-toast {
  bottom: calc(82px + env(safe-area-inset-bottom));
  border-radius: 12px;
  background: var(--primary);
  color: var(--primary-text);
}

@media (max-width: 767px) {
  .wh-attention-card {
    align-items: flex-start;
    flex-direction: column;
  }
  .wh-access-choices {
    grid-template-columns: 1fr;
  }
  .wh-page-heading {
    align-items: stretch;
    flex-direction: column;
  }
  .wh-page-heading > .wh-add-btn {
    width: 100%;
    justify-content: center;
  }
  .wh-heading-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .wh-heading-actions .wh-add-btn,
  .wh-heading-actions .wh-btn {
    justify-content: center;
  }
  .wh-fullscreen-flow,
  .wh-overlay:has(.wh-st-review),
  .wh-overlay:has(#f-nameAr) {
    align-items: stretch;
  }
  .wh-fullscreen-flow .wh-sheet,
  .wh-overlay:has(.wh-st-review) .wh-sheet,
  .wh-overlay:has(#f-nameAr) .wh-sheet {
    max-width: none;
    max-height: none;
    min-height: 100dvh;
    border-radius: 0;
    padding-top: max(16px, env(safe-area-inset-top));
  }
  .wh-fullscreen-flow .wh-sheet {
    height: 100dvh;
    min-height: 0;
    max-height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .wh-required-qty {
    grid-template-columns: 1fr 92px auto;
  }
  .wh-stock-summary:not(.wh-stock-summary-pair) {
    grid-template-columns: 1fr;
  }
}
@media (min-width: 768px) {
  .wh-body {
    padding: 24px 24px 100px;
  }
  .wh-dashboard-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .wh-quick-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .wh-order-filters {
    grid-template-columns: minmax(280px, 1fr) auto;
    align-items: start;
  }
}
@media (min-width: 1280px) {
  .wh-top {
    margin-inline-start: 232px;
    padding-inline: 32px;
  }
  .wh-app-shell {
    min-height: calc(100vh - 64px);
    padding-inline-start: 232px;
  }
  .wh-app-main {
    width: 100%;
    min-width: 0;
  }
  .wh-body {
    padding: 32px;
  }
  .wh-app-nav-mobile {
    display: none;
  }
  .wh-app-nav-desktop {
    position: fixed;
    z-index: 80;
    inset-block: 0;
    inset-inline-start: 0;
    display: flex;
    width: 232px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 18px 12px;
    border-inline-end: 1px solid var(--line);
    background: var(--card);
    flex-direction: column;
  }
  .wh-nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 10px 16px;
    color: var(--heading);
  }
  .wh-app-nav-desktop .wh-nav-items {
    display: grid;
    align-content: start;
    height: auto;
    gap: 4px;
  }
  .wh-app-nav-desktop .wh-nav-item,
  .wh-nav-settings {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 46px;
    padding: 0 12px;
    border-radius: 12px;
    text-align: start;
    font-size: 14px;
  }
  .wh-nav-settings {
    margin-top: auto;
  }
  .wh-page-heading h1 {
    font-size: 28px;
  }

  .wh-dashboard-duo {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .wh-catalog-head {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr 1fr auto;
    gap: 12px;
    padding: 0 14px 8px;
    color: var(--ink-soft);
    font-size: 13px;
  }
  .wh-catalog-grid {
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
  }
  .wh-catalog-grid .wh-catalog-card {
    grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr 1fr auto;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 13px 14px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
  }
  .wh-catalog-grid .wh-catalog-card:last-child {
    border-bottom: 0;
  }
  .wh-catalog-card .wh-list-main,
  .wh-catalog-card .wh-list-actions,
  .wh-catalog-cell {
    grid-column: auto;
    grid-row: auto;
  }
  .wh-catalog-cell {
    display: block;
  }
  .wh-catalog-cell::before {
    display: none;
  }
  .wh-catalog-card .wh-list-actions {
    flex-wrap: nowrap;
  }
  .wh-overlay {
    align-items: center;
    padding: 24px;
  }
  .wh-sheet {
    border-radius: 18px;
    max-height: calc(100dvh - 48px);
  }
  .wh-fullscreen-flow .wh-sheet,
  .wh-overlay:has(.wh-st-review) .wh-sheet {
    max-width: 1040px;
  }
  .wh-toast {
    bottom: 24px;
  }
}
@media (min-width: 1440px) {
  .wh-body {
    padding-inline: 32px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #wh-root *,
  #wh-root *::before,
  #wh-root *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.wh-loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
  font-size: 13px;
}

/* تنسيق branches؛ ترتيب الاستيراد في index.css يحافظ على أولوية القواعد. */
/* Location landing and warehouse requests reuse the existing visual language. */
.wh-location-choice {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  min-height: 96px;
}
.wh-location-choice strong {
  font-size: 18px;
  color: var(--heading);
}
.wh-location-choice small {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 600;
}
.wh-access-choice-single {
  grid-column: 1/-1;
  max-width: 340px;
  width: 100%;
  justify-self: center;
}
.wh-location-switch {
  width: auto;
  padding-inline: 13px;
}
.wh-role-single {
  width: 100%;
  cursor: default;
}
.wh-warehouse-orders {
  display: grid;
  gap: 10px;
}
.wh-request-card {
  width: 100%;
  text-align: start;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 15px;
  font: inherit;
  cursor: pointer;
  transition:
    transform 0.16s var(--ease-out),
    border-color 0.16s,
    box-shadow 0.16s;
}
.wh-request-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--heading);
  font-size: 15px;
}
.wh-request-meta {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 12px;
}
.wh-request-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px;
  margin-bottom: 9px;
}
.wh-request-quantities {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}
.wh-request-quantities span {
  background: var(--surface-muted);
  border-radius: 10px;
  padding: 8px;
  font-size: 14px;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.wh-request-quantities strong {
  color: var(--heading);
  font-size: 12px;
}
.wh-order-waiting {
  margin: 8px 0;
  padding: 12px;
}
@media (hover: hover) {
  .wh-request-card:hover {
    transform: translateY(-2px);
    border-color: var(--copper);
    box-shadow: 0 10px 24px rgba(43, 27, 18, 0.09);
  }
}
@media (max-width: 520px) {
  .wh-location-choices {
    grid-template-columns: 1fr;
  }
  .wh-location-choice {
    min-height: 82px;
  }
  .wh-request-quantities {
    grid-template-columns: 1fr;
  }
  .wh-location-switch {
    max-width: 112px;
    white-space: normal;
    line-height: 1.1;
  }
}

/* تنسيق reports؛ ترتيب الاستيراد في index.css يحافظ على أولوية القواعد. */
/* ---------- Print / PDF ---------- */
#wh-print-area {
  display: none;
}
@media print {
  #wh-root {
    display: none !important;
  }
  #wh-print-area {
    display: block !important;
  }
}
.wh-print-doc {
  font-family: var(--font-ui);
  color: #2b1b12;
  padding: 6px;
}
.wh-print-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 3px solid #a85d2e;
  padding-bottom: 14px;
  margin-bottom: 18px;
}
.wh-print-brand {
  font-size: 21px;
  font-weight: 800;
}
.wh-print-brand-sub {
  font-size: 12px;
  color: #6b5b4e;
  margin-top: 2px;
}
.wh-print-meta {
  text-align: end;
  font-size: 12px;
  color: #3a2a20;
}
.wh-print-meta div {
  margin-bottom: 3px;
}
.wh-print-doc-title {
  font-size: 16px;
  font-weight: 800;
  margin: 4px 0 16px;
}
.wh-print-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 18px;
  font-size: 12.5px;
}
.wh-print-table th {
  background: #2b1b12;
  color: #f2e8d8;
  padding: 8px 10px;
  text-align: start;
  font-weight: 700;
}
.wh-print-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #dcccb2;
}
.wh-print-table tr:nth-child(even) td {
  background: #f8f3ea;
}
.wh-print-section-title {
  font-size: 13.5px;
  font-weight: 800;
  margin: 18px 0 8px;
  padding-inline-start: 9px;
  border-inline-start: 4px solid;
}
.wh-print-section-title.ok {
  border-color: #6e7b5c;
  color: #4d5941;
}
.wh-print-section-title.missing {
  border-color: #b23b2e;
  color: #8a2e24;
}
.wh-print-note-ok {
  text-align: center;
  padding: 14px;
  background: #eef1e9;
  border-radius: 8px;
  font-weight: 700;
  color: #4d5941;
  font-size: 13px;
}
.wh-print-footer {
  margin-top: 26px;
  font-size: 14px;
  color: #9c8a76;
  text-align: center;
}
.wh-pdf-frame {
  width: 100%;
  height: 55vh;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  margin-bottom: 12px;
}
.wh-kitchen-message {
  width: 100%;
  min-height: 280px;
  max-height: 48vh;
  resize: vertical;
  font-family: monospace;
  font-size: 14px;
  line-height: 1.7;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.wh-kitchen-text-sheet input[type='date'],
.wh-kitchen-text-sheet input[type='time'] {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  direction: ltr;
  unicode-bidi: isolate;
}
.wh-kitchen-text-sheet .wh-row2 {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.wh-kitchen-text-sheet .wh-field {
  min-width: 0;
}
/* نخفي طبقة المنتقي كاملة؛ لون النص وحده لا يخفي حقول iOS في الوضع الداكن. */
.wh-kitchen-date-control {
  position: relative;
  height: 46px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wh-kitchen-date-control input[type='date'] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
  font-size: 16px;
}
.wh-kitchen-date-control input::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.wh-kitchen-date-control:focus-within {
  border-color: var(--copper);
  box-shadow: 0 0 0 4px rgba(168, 93, 46, 0.12);
}
.wh-kitchen-date-control span {
  pointer-events: none;
  font-size: 14px;
  white-space: nowrap;
  color: var(--ink);
}
/* الإطار يخص الحاوية حتى لا يغيّره المظهر الأصلي لمنتقي الوقت في iOS. */
.wh-kitchen-time-control {
  height: 46px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.wh-kitchen-time-control:focus-within {
  border-color: var(--copper);
  box-shadow: 0 0 0 4px rgba(168, 93, 46, 0.12);
}
.wh-kitchen-time-control input[type='time'] {
  width: 100%;
  height: 100%;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: inherit;
  font: inherit;
}

/* تنسيق accounts؛ ترتيب الاستيراد في index.css يحافظ على أولوية القواعد. */
/* ---------- PIN pad ---------- */
.wh-pin-dots {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 18px 0 6px;
}
.wh-pin-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--copper) 48%, var(--line));
  background: color-mix(in srgb, var(--copper) 7%, transparent);
  transition:
    background 0.1s,
    border-color 0.1s,
    box-shadow 0.1s;
}
.wh-pin-dot.filled {
  background: var(--copper-light);
  border-color: var(--copper);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--copper) 18%, transparent),
    0 0 10px color-mix(in srgb, var(--copper) 32%, transparent);
}
#wh-root[data-theme='dark'] .wh-pin-dot {
  border-color: rgba(235, 195, 157, 0.62);
  background: rgba(235, 195, 157, 0.08);
}
#wh-root[data-theme='dark'] .wh-pin-dot.filled {
  background: #e69a65;
  border-color: #ffd0aa;
  box-shadow:
    0 0 0 3px rgba(230, 154, 101, 0.22),
    0 0 12px rgba(230, 154, 101, 0.38);
}
.wh-pin-dot.error {
  border-color: var(--clay);
  background: var(--clay);
  animation: wh-pin-blink 0.35s ease-in-out infinite;
}
@keyframes wh-pin-blink {
  0%,
  100% {
    opacity: 1;
    transform: translateX(0);
  }
  50% {
    opacity: 0.25;
    transform: translateX(-3px);
  }
}
.wh-pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 260px;
  margin: 18px auto 8px;
}
.wh-pin-key {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.4px solid var(--line);
  background: var(--card);
  font-size: 20px;
  font-weight: 700;
  color: var(--heading);
  cursor: pointer;
  font-family: inherit;
  transition:
    transform 0.16s var(--ease-out),
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}
.wh-pin-key:active {
  background: var(--control-hover);
  transform: scale(0.9);
}

.wh-view-enter {
  animation: wh-view-enter 0.16s var(--ease-out) both;
}
@keyframes wh-view-enter {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.997);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.wh-view-leave {
  animation: wh-view-leave 0.08s ease-in both;
  pointer-events: none;
}
@keyframes wh-view-leave {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-5px) scale(0.997);
  }
}
.wh-item-enter {
  animation: wh-item-enter 0.16s var(--ease-out) both;
  animation-delay: var(--wh-enter-delay, 0ms);
}
@keyframes wh-item-enter {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

[data-act]:focus-visible,
button:focus-visible,
.wh-chip:focus-visible,
.wh-tab2:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

@media (hover: hover) {
  .wh-pcard:hover,
  .wh-list-item:hover,
  .wh-cart-row:hover {
    transform: translateY(-2px);
    border-color: rgba(168, 93, 46, 0.58);
    box-shadow: 0 10px 24px rgba(43, 27, 18, 0.09);
  }
  .wh-btn:hover:not(:disabled),
  .wh-add-btn:hover {
    filter: brightness(1.06);
    box-shadow: 0 8px 18px rgba(43, 27, 18, 0.13);
  }
  .wh-icon-btn:hover,
  .wh-chip:hover,
  .wh-tab2:hover,
  .wh-pill:hover {
    transform: translateY(-1px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wh-cart-bar,
  .wh-toast,
  .wh-view-enter,
  .wh-view-leave,
  .wh-item-enter,
  .wh-overlay.wh-entering,
  .wh-overlay.wh-entering .wh-sheet,
  .wh-overlay.wh-leaving,
  .wh-overlay.wh-leaving .wh-sheet,
  .wh-role-tabs.docked.entering,
  .wh-access-card,
  .wh-pin-dot.error {
    animation: none !important;
  }
  .wh-pill,
  .wh-role-tab,
  .wh-access-choice,
  .wh-search,
  .wh-chip,
  .wh-pcard,
  .wh-cart-row,
  .wh-input,
  .wh-select,
  .wh-textarea,
  .wh-step-btn,
  .wh-btn,
  .wh-add-btn,
  .wh-list-item,
  .wh-icon-btn,
  .wh-tab2,
  .wh-pin-key {
    transition: none !important;
  }
}

@media (max-width: 520px) {
  .wh-theme-label {
    display: none;
  }
  .wh-cart-dock-delete {
    min-width: 50px;
  }
  .wh-cart-dock-delete span {
    display: none;
  }
}

/* تنسيق stocktake؛ ترتيب الاستيراد في index.css يحافظ على أولوية القواعد. */
/* Quick stocktake shares the existing theme. Only its changing content animates. */
.wh-st-panel {
  padding-block: 12px 90px;
}
.wh-st-panel p,
.wh-st-panel h3 {
  margin-block: 12px;
}
.wh-st-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-block: 12px;
}
.wh-st-meta,
.wh-st-quantities {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.wh-st-meta label,
.wh-st-quantities label {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: 14px;
  color: var(--ink-soft);
}
.wh-st-period {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
}
.wh-st-period input {
  max-width: 140px;
}
.wh-st-period small {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 400;
}
.wh-st-panel input {
  min-width: 0;
  width: 100%;
  font-size: 16px;
}
.wh-st-quantities input {
  font-family: var(--font-number) !important;
  font-size: 18px;
  text-align: center;
}
.wh-st-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-block: 16px;
  padding: 14px;
  background: var(--surface-muted);
  border-radius: 12px;
  color: var(--ink);
}
#st-save-status {
  font-size: 13px;
  color: var(--ink-soft);
}
.wh-st-rows {
  display: grid;
  gap: 12px;
  margin-block: 14px;
}
.wh-st-row {
  background: var(--card);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.wh-workflow-changed {
  border-color: var(--danger, #b42318) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger, #b42318) 22%, transparent);
}
.wh-workflow-reviewed {
  border-color: var(--sage) !important;
}
.wh-workflow-mark {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 800;
}
.wh-workflow-mark.is-changed {
  color: var(--danger, #b42318);
}
.wh-workflow-mark.is-reviewed {
  color: var(--sage);
}
.wh-workflow-alerts {
  position: fixed;
  z-index: 120;
  inset-block-start: 12px;
  inset-inline: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: 720px;
  max-height: 40vh;
  overflow-y: auto;
  margin-inline: auto;
  padding: 12px;
  border: 2px solid var(--danger, #b42318);
  border-radius: 14px;
  background: var(--page-bg);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  color: var(--ink);
}
.wh-workflow-alerts strong {
  flex-basis: 100%;
  color: var(--danger, #b42318);
  font-size: 13px;
}
.wh-workflow-alerts button {
  border: 1px solid var(--danger, #b42318);
  border-radius: 999px;
  padding: 7px 10px;
  background: transparent;
  color: var(--danger, #b42318);
  font: 700 13px var(--font-ui);
  cursor: pointer;
}
.wh-st-row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.wh-st-row-head strong {
  display: block;
  color: var(--heading);
}
.wh-st-row-head small,
.wh-st-history small {
  display: block;
  color: var(--ink-soft);
  margin-top: 4px;
}
.wh-st-row-head span {
  font-size: 14px;
  color: var(--ink-soft);
}
.wh-st-diff {
  margin-block: 10px;
  min-height: 24px;
  font-size: 14px;
  font-weight: 700;
}
.wh-st-warning {
  padding: 14px;
  margin-block: 12px;
  border: 1px solid var(--copper);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface-muted);
}
.wh-st-history {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  margin-block: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow-wrap: anywhere;
}
.wh-st-history > div {
  min-width: 0;
  flex: 1 1 0;
}
/* Override the shared full-width button: keep room for draft date and details. */
.wh-st-history > .wh-btn {
  width: auto;
  max-width: 100%;
  flex: 0 0 auto;
  margin-top: 0;
  min-height: 44px;
}
.wh-st-dock {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  max-width: 720px;
  margin-inline: auto;
  z-index: 40;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--page-bg);
  box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.08);
}
.wh-st-dock .wh-btn {
  flex: 1 1 auto;
  width: auto;
}
.wh-st-actions .wh-btn {
  width: auto;
  flex: 1 1 auto;
}
.wh-st-dock [data-act='st-review'],
.wh-sheet [data-act='st-confirm'] {
  background: var(--sage);
  color: var(--page-bg);
  border-color: var(--sage);
}
.wh-st-dock [data-act='st-discard'] {
  color: var(--clay);
}
.wh-st-panel button:disabled,
.wh-sheet button:disabled {
  opacity: 0.55;
  cursor: wait;
}
@media (max-width: 520px) {
  .wh-st-panel {
    padding-bottom: 140px;
  }
  .wh-st-meta {
    grid-template-columns: 1fr;
  }
  .wh-st-history {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .wh-st-history > .wh-btn {
    width: 100%;
    flex-basis: 100%;
  }
  .wh-st-dock .wh-btn {
    flex-basis: calc(50% - 8px);
    min-height: 44px;
    padding: 10px 6px;
    font-size: 13px;
  }
}

/* تنسيق dashboard؛ ترتيب الاستيراد في index.css يحافظ على أولوية القواعد. */
/* Consumption dashboard: inherit the existing inventory theme. */
#wh-root .wh-dashboard {
  display: grid;
  gap: 18px;
  font-size: 16px;
  min-width: 0;
}
#wh-root .wh-dashboard h2,
#wh-root .wh-dashboard h3 {
  margin: 0 0 12px;
  line-height: 1.6;
}
#wh-root .wh-dashboard-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
#wh-root .wh-dashboard-cards .wh-stat-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
#wh-root .wh-dashboard-cards .wh-stat-label {
  font-size: 14px;
}
#wh-root .wh-dashboard-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
#wh-root .wh-dashboard-tools .wh-btn {
  margin: 0;
  font-size: 14px;
  white-space: normal;
}
#wh-root .wh-dashboard-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  min-width: 0;
}
#wh-root .wh-dashboard-table {
  max-height: 420px;
  overflow: auto;
  max-width: 100%;
}
#wh-root .wh-dashboard-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
#wh-root .wh-dashboard-table th,
#wh-root .wh-dashboard-table td {
  padding: 12px 8px;
  text-align: start;
  border-bottom: 1px solid var(--line);
  min-width: 90px;
  line-height: 1.7;
}
#wh-root .wh-dashboard-row,
#wh-root .wh-dashboard-order {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
#wh-root .wh-dashboard-row time {
  flex-shrink: 0;
  color: var(--ink-soft);
  font-size: 12px;
}
#wh-root .wh-dashboard-order {
  width: 100%;
  background: transparent;
  color: inherit;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: start;
  font: inherit;
  cursor: pointer;
}
#wh-root .wh-coverage-text {
  font-size: 12px;
  color: var(--ink-soft);
  padding-inline-end: 30px;
  line-height: 1.7;
}
@media (max-width: 560px) {
  #wh-root .wh-dashboard-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #wh-root .wh-dashboard-panel {
    padding: 12px;
  }
  #wh-root .wh-dashboard-row,
  #wh-root .wh-dashboard-order {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}
.wh-audit-tag.wh-status-good {
  color: var(--status-good-text) !important;
  background: var(--status-good-bg) !important;
}
.wh-audit-tag.wh-status-warn {
  color: var(--status-warn-text) !important;
  background: var(--status-warn-bg) !important;
}
.wh-audit-tag.wh-status-info {
  color: var(--status-info-text) !important;
  background: var(--status-info-bg) !important;
}
.wh-audit-tag.wh-status-neutral {
  color: var(--ink-soft) !important;
  background: var(--surface-2) !important;
}
.wh-impact-review {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.wh-impact-review div {
  display: grid;
  gap: 3px;
}
.wh-impact-review span {
  font-size: 12px;
  color: var(--ink-soft);
}
.wh-impact-review strong {
  font-variant-numeric: tabular-nums;
}
.wh-impact-review strong.danger {
  color: var(--status-error-text);
}
.wh-st-optional {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 0 12px;
  margin: 12px 0;
}
.wh-st-optional summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  font-weight: 700;
  cursor: pointer;
}
.wh-st-optional .wh-st-meta {
  padding-bottom: 12px;
}
@media (max-width: 560px) {
  .wh-impact-review {
    grid-template-columns: 1fr;
  }
  .wh-impact-review div {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}
.wh-product-menu {
  display: none;
  position: absolute;
  inset-block-start: 10px;
  inset-inline-end: 10px;
  z-index: 5;
}
.wh-product-menu summary {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 24px;
  list-style: none;
}
.wh-product-menu summary::-webkit-details-marker {
  display: none;
}
.wh-product-menu > div {
  position: absolute;
  inset-block-start: 46px;
  inset-inline-end: 0;
  display: grid;
  min-width: 190px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.wh-product-menu button {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: start;
}
.wh-product-menu button:hover {
  background: var(--selected);
}
.wh-product-menu button.danger {
  color: var(--status-error-text);
}
@media (max-width: 1279px) {
  .wh-catalog-card {
    position: relative;
    padding-inline-end: 58px;
  }
  .wh-catalog-card > .wh-list-actions {
    display: none;
  }
  .wh-product-menu {
    display: block;
  }
}
@media (max-width: 1279px) {
  .wh-cart-bar {
    bottom: calc(64px + env(safe-area-inset-bottom));
    z-index: 75;
    padding: 10px 12px;
    background: var(--card);
  }
  .wh-cart-dock-spacer {
    height: 84px;
  }
  .wh-cart-dock-spacer.double {
    height: 144px;
  }
}
.wh-workspace-head {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.wh-workspace-head .wh-h1 {
  margin: 0;
}
.wh-workspace-head > span {
  font-size: 12px;
  color: var(--ink-soft);
}
@media (max-width: 1279px) {
  .wh-app-shell:has(.wh-workspace) .wh-app-nav-mobile {
    display: none;
  }
  .wh-app-shell:has(.wh-workspace) .wh-main {
    padding-bottom: 24px;
  }
  .wh-workspace-head {
    position: sticky;
    top: 64px;
    z-index: 25;
    margin: -16px -16px 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--page-bg);
  }
}

.wh-stats-pending .wh-stats-summary,
.wh-stats-pending .wh-stats-product,
.wh-stats-pending .wh-empty {
  display: none;
}

/* تنسيق workflows؛ ترتيب الاستيراد في index.css يحافظ على أولوية القواعد. */
/* Long order workflows use a full page canvas with a persistent back control. */
.wh-overlay.wh-page-flow {
  inset: 0;
  display: block;
  padding: 0;
  background: var(--page-bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.wh-page-flow .wh-sheet {
  width: 100%;
  max-width: 1080px;
  height: 100dvh;
  min-height: 0;
  max-height: none;
  margin: 0 auto;
  padding: 20px clamp(16px, 4vw, 44px) calc(28px + env(safe-area-inset-bottom));
  border-radius: 0;
  overflow-y: auto;
  background: var(--page-bg);
  overscroll-behavior: contain;
}
.wh-page-flow .wh-flow-header {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  margin: -20px calc(-1 * clamp(16px, 4vw, 44px)) 18px;
  padding: calc(10px + env(safe-area-inset-top)) clamp(16px, 4vw, 44px) 10px;
  border-bottom: 1px solid var(--line);
  background: var(--page-bg);
}
.wh-page-flow .wh-flow-header h2 {
  margin: 0;
}
.wh-page-flow .wh-review-dock {
  bottom: -28px;
  margin-inline: calc(-1 * clamp(16px, 4vw, 44px));
  padding-inline: clamp(16px, 4vw, 44px);
  background: var(--page-bg);
}
.wh-partial-choice {
  display: grid;
  gap: 6px;
  width: 100%;
  margin: 8px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  text-align: start;
  font: inherit;
  cursor: pointer;
}
.wh-partial-choice small {
  color: var(--ink-soft);
}
.wh-partial-choice.active {
  border-color: var(--sage);
  background: var(--selected);
}
.wh-receipt-touched {
  margin: 8px 0;
  color: var(--sage);
  font-weight: 700;
  font-size: 13px;
}
.wh-receipt-touched[hidden] {
  display: none;
}
.wh-review-tabs {
  position: sticky;
  top: 68px;
  z-index: 19;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 14px;
  padding: 8px 0;
  background: var(--page-bg);
}
.wh-review-tabs button {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.wh-review-tabs button.active {
  border-color: var(--sage);
  background: var(--selected);
  color: var(--ink);
}
.wh-review-tabs span {
  min-width: 24px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--page-bg);
  font-size: 12px;
}
.wh-review-category {
  margin: 18px 2px 8px;
  color: var(--ink-soft);
  font-size: 13px;
}
.wh-review-item {
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.wh-review-item.is-unreviewed {
  border-inline-start: 5px solid var(--ink-soft);
}
.wh-review-item.is-reviewed {
  border-color: var(--sage);
  background: var(--selected);
  box-shadow: 0 4px 16px rgba(30, 100, 75, 0.12);
}
.wh-item-review-btn {
  margin-top: 10px;
}
.wh-partial-card {
  border-color: var(--sage);
  background: var(--selected);
}
.wh-reserve-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.wh-reserve-options button {
  min-height: 52px;
  text-align: center;
}
.wh-admin-toolbar:has([data-act='close-order-builder']) {
  position: sticky;
  top: 64px;
  z-index: 24;
  padding: 10px;
  margin: -10px -10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--page-bg);
}

/* Order review is a single scrolling page. Its header and action dock stay visible. */
#wh-root .wh-overlay.wh-page-flow {
  inset: 0;
  display: block;
  padding: 0;
  background: var(--page-bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#wh-root .wh-overlay.wh-page-flow .wh-sheet {
  position: relative;
  width: 100%;
  max-width: 1080px;
  height: 100dvh;
  min-height: 0;
  max-height: none;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 44px) calc(40px + env(safe-area-inset-bottom));
  border-radius: 0;
  overflow-y: auto;
  background: var(--page-bg);
  box-shadow: none;
  overscroll-behavior: contain;
}
#wh-root .wh-overlay.wh-page-flow .wh-flow-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 68px;
  margin: 0 calc(-1 * clamp(16px, 4vw, 44px)) 18px;
  padding: 12px clamp(16px, 4vw, 44px);
  background: var(--page-bg);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 14px color-mix(in srgb, #000 8%, transparent);
}
#wh-root .wh-overlay.wh-page-flow .wh-review-dock {
  position: sticky;
  bottom: 0;
  z-index: 19;
  margin: 16px calc(-1 * clamp(16px, 4vw, 44px)) 0;
  padding: 12px clamp(16px, 4vw, 44px) calc(12px + env(safe-area-inset-bottom));
  background: var(--page-bg);
}
.wh-excluded {
  padding: 16px;
  background: var(--card);
}
.wh-excluded h3 {
  margin: 0 0 12px;
}
.wh-excluded .wh-search {
  width: 100%;
  margin-bottom: 10px;
}
.wh-auto-add-list {
  max-height: 310px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.wh-auto-add-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}
.wh-auto-add-row:last-child {
  border-bottom: 0;
}
.wh-auto-add-row[hidden] {
  display: none;
}
@media (max-width: 600px) {
  #wh-root .wh-overlay.wh-page-flow .wh-flow-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  #wh-root .wh-overlay.wh-page-flow .wh-flow-header h2 {
    flex: 1 1 100%;
  }
  .wh-flow-actions {
    width: 100%;
    justify-content: flex-start;
  }
}
/* Keep four receipt facts compact on phones, while leaving other summaries alone. */
#wh-root .wh-receipt-facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
#wh-root .wh-receipt-facts > div {
  padding: 8px;
}
#wh-root .wh-receipt-facts span {
  font-size: 12px;
}
#wh-root .wh-receipt-facts strong {
  font-size: 14px;
}
.wh-order-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 24px;
}
.wh-order-actions .wh-btn {
  width: 100%;
  margin: 0;
  min-height: 48px;
}
.wh-partial-complete {
  cursor: default;
  opacity: 0.82;
}
@media (max-width: 600px) {
  .wh-order-actions {
    grid-template-columns: 1fr 1fr;
  }
  .wh-order-actions .wh-btn {
    font-size: 12px;
    padding: 8px 6px;
  }
}
.wh-st-date-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 8px 0;
}
.wh-st-date-range label {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.wh-st-date-range input {
  min-width: 0;
  width: 100%;
}
@media (max-width: 480px) {
  .wh-st-date-range {
    grid-template-columns: 1fr;
  }
}
.wh-auto-edit {
  margin: 10px 0 18px;
}

/* Employee directory */
.wh-staff-heading h2 {
  margin: 0;
  font-size: 21px;
}
.wh-staff-heading p {
  color: var(--ink-soft);
  font-size: 13px;
  margin: 6px 0 18px;
}
.wh-staff-links {
  margin: 20px 0 28px;
}
.wh-staff-links .wh-settings-group {
  margin: 0;
}
.wh-staff-links .wh-auth-row {
  min-width: 0;
}
.wh-staff-links .wh-auth-row span {
  min-width: 0;
}
.wh-staff-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
}
.wh-staff-filters > label {
  font-size: 12px;
  font-weight: 700;
  display: grid;
  gap: 6px;
  min-width: 0;
}
.wh-staff-filters > label input {
  min-width: 0;
  width: 100%;
}
.wh-staff-sheet .wh-staff-filter-menu {
  position: relative;
  margin: 0;
  padding: 0;
  border: 0;
  z-index: 5;
}
.wh-staff-filter-menu summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  list-style: none;
  white-space: nowrap;
}
.wh-staff-filter-menu summary::-webkit-details-marker {
  display: none;
}
.wh-staff-filter-menu summary::after {
  content: '⌄';
  font-size: 18px;
  line-height: 1;
}
.wh-staff-filter-menu[open] summary {
  border-color: var(--primary);
  color: var(--primary);
}
.wh-staff-filter-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: min(420px, calc(100vw - 24px));
  max-height: min(70vh, 560px);
  overflow: auto;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.16);
}
.wh-staff-filter-panel fieldset {
  min-width: 0;
  margin: 0;
  padding: 8px 0 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
}
.wh-staff-filter-panel legend {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px;
}
.wh-staff-filter-panel label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.wh-staff-filter-panel input[type='checkbox'],
.wh-staff-filter-panel input[type='radio'] {
  width: 18px;
  height: 18px;
  flex: none;
  accent-color: var(--primary);
}
.wh-staff-filter-panel .wh-btn {
  margin: 0;
}
.wh-staff-filter-menu #wh-staff-filter-count {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
}
.wh-staff-filter-menu #wh-staff-filter-count[hidden] {
  display: none;
}
.wh-staff-filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.wh-staff-filter-actions .wh-btn {
  width: 100%;
}
@media (max-width: 600px) {
  .wh-staff-sheet .wh-staff-filter-menu[open] {
    z-index: 100;
  }
  .wh-staff-filter-panel {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    width: auto;
    max-height: min(65vh, 520px);
  }
}
.wh-staff-directory .wh-staff-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-height: none;
  overflow: visible;
}
.wh-staff-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.wh-staff-card[hidden] {
  display: none;
}
.wh-staff-card-top {
  display: flex;
  gap: 10px;
  align-items: center;
}
.wh-staff-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--surface-muted);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 17px;
  flex: none;
  color: var(--ink);
}
.wh-staff-identity {
  min-width: 0;
  flex: 1;
}
.wh-staff-identity h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.wh-staff-role {
  font-size: 12px;
  color: var(--ink-soft);
}
.wh-staff-state {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 4px 8px;
  font-size: 12px;
  white-space: nowrap;
  flex: none;
}
.wh-staff-state.active {
  color: var(--sage);
  background: var(--surface-muted);
}
.wh-staff-state.disabled {
  color: var(--ink-soft);
  background: var(--surface-muted);
}
.wh-staff-phone {
  align-self: start;
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
}
.wh-staff-branches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wh-staff-branches span {
  font-size: 12px;
  border: 1px solid var(--line);
  padding: 4px 8px;
  border-radius: 7px;
  line-height: 1.5;
}
.wh-staff-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: auto;
}
.wh-staff-meta span {
  display: block;
  color: var(--ink-soft);
  font-size: 12px;
  margin-bottom: 4px;
}
.wh-staff-meta strong {
  font-size: 12px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.wh-staff-card .wh-staff-edit {
  margin: 0;
  min-height: 40px;
  font-size: 12px;
}
.wh-staff-owner {
  font-size: 12px;
  color: var(--ink-soft);
  padding: 10px;
  text-align: center;
}
.wh-receipt-touched[data-status='saving'] {
  color: var(--ink-soft);
}
.wh-receipt-touched[data-status='error'],
.wh-receipt-error {
  color: var(--danger, #b42318);
  font-size: 12px;
}
@media (max-width: 600px) {
  .wh-staff-directory .wh-staff-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .wh-staff-card {
    padding: 10px;
    gap: 9px;
  }
  .wh-staff-card-top {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px;
  }
  .wh-staff-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 13px;
  }
  .wh-staff-identity h3 {
    font-size: 13px;
  }
  .wh-staff-state {
    padding: 2px 6px;
    font-size: 10px;
  }
  .wh-staff-phone {
    font-size: 11px;
    overflow-wrap: anywhere;
  }
  .wh-staff-branches span {
    font-size: 10px;
    padding: 3px 5px;
  }
  .wh-staff-meta {
    grid-template-columns: 1fr;
    gap: 7px;
    padding-top: 8px;
  }
  .wh-staff-meta span,
  .wh-staff-meta strong {
    font-size: 11px;
  }
  .wh-staff-card .wh-staff-edit {
    font-size: 11px;
    padding: 6px;
  }
  .wh-staff-filters {
    gap: 8px;
  }
}

/* Shared accessible fields and compact login. */
.wh-auth-form input,
.wh-auth-form select,
.wh-auth-field input,
.wh-auth-sheet > label input {
  font-size: 16px;
}
.wh-keypad-toggle {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
}
.wh-keypad-toggle summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--primary);
  font-weight: 700;
}
.wh-auth-card .wh-access-mark {
  width: 36px;
  height: 36px;
  margin-bottom: 12px;
}
.wh-auth-card.wh-access-card {
  padding: 24px;
}
.wh-auth-card .wh-auth-form {
  margin-top: 14px;
  gap: 12px;
}
.wh-auth-card .wh-auth-hint {
  margin: 8px 0;
}
.wh-auth-card input[name='pin'] {
  min-height: 52px;
}
.wh-product-menu .wh-favorite {
  display: flex;
  width: 100%;
  gap: 8px;
  justify-content: flex-start;
  font: inherit;
}
[data-act][role='button'] {
  cursor: pointer;
}
.wh-card-open {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  margin-top: 12px;
  border: 1px solid var(--primary);
  border-radius: 10px;
  background: var(--selected);
  color: var(--primary);
  font: 700 14px/1.5 var(--font-ui);
  text-align: center;
}
.wh-cart-row .wh-card-open {
  width: auto;
  flex-shrink: 0;
  margin-top: 0;
}
.wh-theme-select {
  min-height: 44px;
  max-width: 65%;
  border: 1px solid var(--field-line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  padding: 8px 12px;
  font: inherit;
}
.wh-catalog-cell,
.wh-pname-ar,
.wh-list-main {
  min-width: 0;
  overflow-wrap: anywhere;
}
@media (min-width: 768px) and (max-width: 1279px) {
  .wh-catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .wh-catalog-grid .wh-catalog-card {
    min-width: 0;
  }
}
@media (max-width: 600px) {
  .wh-auth-card.wh-access-card {
    padding: 18px;
  }
  .wh-access-gate:has(.wh-auth-card) {
    padding: 18px 16px;
  }
  .wh-auth-card .wh-access-title {
    font-size: 24px;
  }
  .wh-auth-card .wh-access-mark {
    display: none;
  }
}
@media (max-width: 390px) {
  .wh-top {
    height: auto;
    min-height: 64px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .wh-brand {
    min-width: 0;
    flex: 1;
  }
  .wh-brand-text {
    font-size: 14px;
  }
  .wh-top-controls {
    flex-shrink: 0;
  }
  .wh-save-status {
    max-width: 110px;
    white-space: normal;
  }
  .wh-account-button {
    padding: 0 9px;
  }
  .wh-heading-actions button {
    width: 100%;
  }
}
.wh-chip,
.wh-icon-btn {
  min-height: 44px;
  min-width: 44px;
}
.wh-audit-tag {
  color: var(--ink);
  background: var(--surface-muted);
}
.wh-audit-tag[style*='--clay'] {
  color: var(--danger-on-fill);
  background: var(--danger-fill) !important;
}

/* Catalog adapts to its available space, including sidebar and browser zoom. */
.wh-section-content {
  container-type: inline-size;
}
.wh-catalog-head {
  display: none;
}
.wh-catalog-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 14px;
  border: 0;
  border-radius: 0;
  overflow: visible;
}
.wh-catalog-grid .wh-catalog-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  align-items: stretch;
}
.wh-catalog-card .wh-list-main {
  grid-column: 1;
  grid-row: auto;
  width: auto;
  padding-inline-end: 44px;
}
.wh-catalog-card .wh-list-actions {
  display: none;
}
.wh-catalog-card .wh-catalog-cell {
  grid-column: 1;
  grid-row: auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  overflow-wrap: anywhere;
  line-height: 1.6;
  font-size: 14px;
}
.wh-catalog-card .wh-catalog-cell::before {
  display: block;
  content: attr(data-label);
  flex-shrink: 0;
  color: var(--ink-soft);
  font-weight: 500;
}
.wh-catalog-card .wh-product-menu {
  display: block;
}
.wh-catalog-card .wh-pname-ar {
  font-size: 16px;
  line-height: 1.6;
}
.wh-catalog-card .wh-pname-en {
  font-size: 13px;
  line-height: 1.5;
}
.wh-catalog-card .wh-status {
  font-size: 13px;
  line-height: 1.5;
  white-space: normal;
}
.wh-catalog-grid .wh-catalog-card:last-child {
  border-bottom: 1px solid var(--line);
}
@container (min-width:1120px) {
  .wh-catalog-head,
  .wh-catalog-grid .wh-catalog-card {
    grid-template-columns:
      minmax(180px, 1.5fr) minmax(112px, 0.9fr) minmax(140px, 1.1fr) minmax(104px, 0.8fr)
      minmax(88px, 0.7fr) minmax(120px, 1fr) 244px;
    gap: 12px;
    padding-inline: 14px;
  }
  .wh-catalog-head {
    display: grid;
    margin-inline: 1px;
    padding-block: 10px;
    align-items: center;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--ink-soft);
  }
  .wh-catalog-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: visible;
  }
  .wh-catalog-grid .wh-catalog-card {
    padding-block: 16px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    align-items: center;
  }
  .wh-catalog-grid .wh-catalog-card:last-child {
    border-bottom: 0;
  }
  .wh-catalog-grid .wh-catalog-card.wh-item-enter {
    animation: none;
  }
  .wh-catalog-grid .wh-catalog-card:hover {
    transform: none;
    box-shadow: none;
  }
  .wh-catalog-card .wh-list-main,
  .wh-catalog-card .wh-catalog-cell,
  .wh-catalog-card .wh-list-actions {
    grid-column: auto;
    grid-row: auto;
    padding-inline-end: 0;
  }
  .wh-catalog-card .wh-catalog-cell {
    display: block;
  }
  .wh-catalog-card .wh-catalog-cell::before {
    display: none;
  }
  .wh-catalog-card .wh-list-actions {
    display: flex;
    flex-wrap: nowrap;
    width: 244px;
    gap: 6px;
    margin: 0;
    justify-content: flex-end;
  }
  .wh-catalog-card .wh-list-actions button {
    flex: 0 0 44px;
    width: 44px;
    min-height: 44px;
    margin: 0 !important;
  }
  .wh-catalog-card .wh-product-menu {
    display: none;
  }
}

/* Shared record-aware calendar for orders, statistics and the displayed log. */
.wh-date-fields {
  align-items: start;
  gap: 12px;
}
.wh-date-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  text-align: start;
  cursor: pointer;
  font-size: 16px;
  color: var(--ink);
}
.wh-date-help {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 8px 0 16px;
}
.wh-date-calendar {
  grid-column: 1/-1;
  max-width: 420px;
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  border: 1px solid var(--field-line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
}
.wh-calendar-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.wh-calendar-nav strong {
  flex: 1;
  text-align: center;
  font-size: 15px;
}
.wh-calendar-nav button {
  width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  flex: 0 0 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font-size: 22px;
  cursor: pointer;
}
.wh-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
  text-align: center;
}
.wh-calendar-weekday {
  padding: 6px 0;
  font-size: 11px;
  color: var(--ink-soft);
}
.wh-calendar-grid button {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
}
.wh-calendar-grid button[aria-pressed='true'] {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-text);
  font-weight: 800;
}
.wh-calendar-grid button:disabled,
.wh-calendar-nav button:disabled,
.wh-date-trigger:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.wh-calendar-grid button:focus-visible,
.wh-calendar-nav button:focus-visible,
.wh-date-trigger:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}
@media (max-width: 380px) {
  .wh-date-calendar {
    padding: 6px;
  }
  .wh-calendar-grid {
    gap: 2px;
  }
  .wh-date-trigger {
    font-size: 14px;
  }
}

.wh-source-order {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 8px 0;
  border-inline-start: 3px solid var(--heading);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}
.wh-source-order strong {
  font-size: 14px;
  min-width: 0;
}
.wh-source-order .wh-btn {
  width: auto;
  margin: 0;
}

.wh-st-stock-comparison {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.wh-st-previous {
  padding-inline-start: 10px;
  border-inline-start: 2px solid var(--copper);
}
.wh-st-previous[hidden] {
  display: none;
}

/* Keep the favorite action, coverage label and gauge in separate cells. */
.wh-pcard-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: start;
  gap: 8px;
  min-width: 0;
  margin-bottom: 10px;
}
.wh-pcard-head > .wh-favorite {
  position: static;
  grid-column: 1;
  grid-row: 1;
}
#wh-root .wh-pcard-head > .wh-coverage-text {
  grid-column: 1/-1;
  grid-row: 2;
  min-width: 0;
  padding: 0;
  text-align: start;
  overflow-wrap: normal;
}
.wh-toast[data-kind='success'] {
  background: #17633c;
  color: #fff;
}
.wh-operation-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-family: inherit;
}
.wh-operation-card {
  width: min(100%, 460px);
  max-height: 85dvh;
  overflow: auto;
  box-sizing: border-box;
  background: var(--card, #fff);
  color: var(--ink, #172520);
  border: 2px solid #b42318;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 70px #0005;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.wh-operation-card h2 {
  font-size: 24px;
  margin: 10px 0;
  color: #b42318;
}
.wh-operation-symbol {
  font-size: 28px;
  font-weight: 800;
  color: #b42318;
}
.wh-operation-card button {
  width: 100%;
  margin-top: 16px;
  min-height: 48px;
  background: #174c43;
  color: #fff;
}
.wh-operation-card button:focus-visible {
  outline: 3px solid #bb861c;
  outline-offset: 3px;
}
.wh-operation-details {
  white-space: pre-line;
  border-block-start: 1px solid #8885;
  padding-top: 12px;
}
.wh-operation-pending {
  position: fixed;
  z-index: 9000;
  inset-inline: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  max-width: 460px;
  margin-inline: auto;
  background: var(--card, #fff);
  color: var(--ink, #172520);
  border: 2px solid #9c6513;
  border-radius: 16px;
  padding: 14px 18px;
  box-shadow: 0 8px 30px #0003;
  pointer-events: none;
  line-height: 1.6;
}
.wh-operation-pending strong {
  color: #9c6513;
}
.wh-operation-pending p {
  margin: 4px 0;
  font-size: 14px;
}
.wh-pcard-head > .wh-gauge {
  position: static;
  grid-column: 2;
  grid-row: 1;
}
.wh-pcard > .wh-pcat {
  padding-inline: 0;
  min-height: 0;
}
/* Mixed-language names follow their text direction without moving the column. */
.wh-pname-ar,
.wh-pname-en {
  text-align: match-parent;
  unicode-bidi: plaintext;
  overflow-wrap: anywhere;
}
.wh-settings-group,
.wh-settings-grid > div,
.wh-page-heading > div {
  min-width: 0;
}
.wh-setting-row {
  flex-wrap: wrap;
  gap: 12px;
}
.wh-setting-row > select {
  min-width: 0;
  max-width: 100%;
}
#wh-root[dir='ltr'] .wh-auth-form,
#wh-root[dir='ltr'] .wh-settings-group {
  text-align: left;
}
#wh-root[dir='ltr'] .wh-catalog-cell::before {
  flex-shrink: 1;
  min-width: 0;
}
@media (max-width: 600px) {
  .wh-catalog-card .wh-catalog-cell::before {
    max-width: 46%;
  }
  .wh-settings-page .wh-page-heading {
    flex-wrap: wrap;
  }
  .wh-page-heading h1 {
    overflow-wrap: anywhere;
  }
  .wh-flow-header h2 {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}
#wh-app-update {
  position: fixed;
  z-index: 8500;
  inset-inline: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  max-width: 520px;
  margin-inline: auto;
  box-sizing: border-box;
  padding: 12px 16px;
  border: 1px solid var(--primary, #174c43);
  border-radius: 14px;
  background: var(--card, #fff);
  color: var(--ink, #172520);
  box-shadow: 0 8px 30px #0003;
  text-align: center;
  line-height: 1.6;
  pointer-events: none;
}
.wh-updates-button {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.wh-updates-button:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}
.wh-updates-count {
  position: absolute;
  inset-block-start: -6px;
  inset-inline-end: -6px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 3px;
  box-sizing: border-box;
  border-radius: 999px;
  background: var(--danger-fill);
  color: var(--danger-on-fill);
  font: 700 11px/1 var(--font-ui);
  box-shadow: 0 0 0 2px var(--card);
}
.wh-feature-updates-sheet {
  max-width: 520px;
}
.wh-feature-updates-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 22px;
}
.wh-feature-update {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-muted);
}
.wh-feature-update time {
  display: block;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}
.wh-feature-update h3 {
  margin: 5px 0 6px;
  color: var(--heading);
  font-size: 17px;
}
.wh-feature-update p {
  margin: 0;
  line-height: 1.65;
}
.wh-admin-message-form {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}
.wh-admin-message-form h3,
.wh-admin-messages h3 {
  margin: 0 0 12px;
  font-size: 17px;
}
.wh-admin-message-form textarea {
  width: 100%;
  min-height: 100px;
  resize: vertical;
  font: inherit;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
}
.wh-admin-messages {
  margin-top: 22px;
}
.wh-admin-message {
  border-color: var(--primary);
}
@media (max-width: 600px) {
  .wh-account-button span {
    display: none;
  }
  .wh-top-controls {
    gap: 6px;
  }
  .wh-save-status {
    max-width: 100px;
  }
}

.wh-dish-stock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.wh-dish-stock-row small {
  display: block;
  color: var(--ink-soft);
  margin-top: 4px;
}
.wh-dish-stock-row .wh-stepper {
  margin: 0;
  gap: 10px;
}
.wh-dish-stock-row output {
  min-width: 28px;
  text-align: center;
  font-weight: 800;
}

.wh-dish-entry-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.wh-dish-entry-stepper .wh-step-btn {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
}
.wh-dish-entry-stepper .wh-input {
  flex: 1;
  min-width: 0;
  text-align: center;
  height: 44px;
  margin: 0;
}
.wh-products-primary-actions {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 0;
  background: var(--bg, var(--surface));
}
.wh-products-add {
  width: auto;
  min-width: 160px;
  margin: 0 0 8px;
}
@media (max-width: 600px) {
  .wh-dish-entry-grid {
    grid-template-columns: 1fr;
  }
  .wh-products-add {
    width: 100%;
  }
}

/* التنسيقات مقسمة حسب الشاشة؛ غيّر الألوان العامة في ملف theme. */
.wh-legacy-surface {
  display: contents;
}

