/* PROFULFILMENT WMS design system
   Source of truth for the operational interface. Loaded after legacy styles. */

:root {
  --navy: #07111f;
  --navy2: #0b1726;
  --navy3: #102136;
  --navy-h: #162b43;
  --blue: #007fa8;
  --blue2: #006c90;
  --blue3: #005b79;
  --blue-bg: #eaf7fb;
  --blue-glow: rgba(0, 127, 168, .12);
  --blue-glow2: rgba(0, 127, 168, .2);
  --cyan: #0ea5c6;
  --cyan-bg: #e7f8fc;
  --violet: #6554c0;
  --violet-bg: #f1effb;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --sf: #ffffff;
  --sf2: #f7f9fc;
  --border: #d6e2f0;
  --border2: #b9c9da;
  --text: #172b3a;
  --text2: #52677b;
  --text3: #6b7f92;
  --green: #067647;
  --green-bg: #ecfdf3;
  --red: #b42318;
  --red-bg: #fef3f2;
  --orange: #9a6700;
  --orange-bg: #fffaeb;
  --focus: #0ea5c6;
  --heading: "Inter", "Segoe UI", Arial, sans-serif;
  --body: "Inter", "Segoe UI", Arial, sans-serif;
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-xl: 8px;
  --r-pill: 999px;
  --ui-control-h: 40px;
  --ui-gap: 12px;
  --ui-pad: 16px;
  --ui-radius: 8px;
  --sh-xs: 0 1px 2px rgba(7, 17, 31, .05);
  --sh-sm: 0 2px 8px rgba(7, 17, 31, .06);
  --sh-md: 0 6px 18px rgba(7, 17, 31, .09);
  --sh-lg: 0 16px 36px rgba(7, 17, 31, .14);
  --sh-blue: 0 2px 8px rgba(0, 127, 168, .18);
  --sh-blue-lg: 0 6px 18px rgba(0, 127, 168, .2);
}

html {
  background: var(--bg);
}

body {
  min-width: 320px;
  background: var(--bg);
  background-image: none;
  color: var(--text);
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: 0;
}

body,
button,
input,
select,
textarea {
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

a,
button,
input,
select,
textarea,
[tabindex] {
  outline: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(14, 165, 198, .28);
  outline-offset: 2px;
}

::selection {
  background: rgba(14, 165, 198, .2);
}

/* Application shell */
.topbar {
  height: 64px;
  padding: 0 20px;
  background: var(--navy);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  box-shadow: none;
}

.topbar-logo {
  font-size: 17px;
  letter-spacing: 0;
}

.topbar-logo span {
  color: #63c8e2;
  text-shadow: none;
}

.topbar-logo small {
  margin-top: 3px;
  font-size: 12px;
  letter-spacing: 0;
  color: rgba(255, 255, 255, .54);
}

.topbar-right {
  gap: 10px;
}

.topbar-user {
  font-size: 13px;
  color: rgba(255, 255, 255, .78);
}

.role-badge {
  padding: 5px 9px;
  border: 1px solid rgba(99, 200, 226, .4);
  border-radius: 4px;
  background: rgba(99, 200, 226, .1);
  box-shadow: none;
  color: #a8e4f3;
  font-size: 11px;
  letter-spacing: 0;
}

.btn-logout {
  min-height: 36px;
  padding: 7px 11px;
  border-color: rgba(255, 255, 255, .2);
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, .78);
}

.btn-logout:hover {
  border-color: rgba(255, 255, 255, .45);
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.subnav {
  padding: 12px 10px 18px;
  background: var(--navy);
  border-bottom: 0;
  box-shadow: none;
}

.tab {
  min-height: 44px !important;
  margin: 0;
  padding: 0 12px !important;
  border: 0;
  border-radius: 6px;
  color: rgba(255, 255, 255, .7);
  font-size: 13px !important;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.tab:hover:not(.active) {
  background: rgba(255, 255, 255, .07);
  color: #fff;
}

.tab.active {
  background: #16314c;
  border: 0;
  color: #fff;
  text-shadow: none;
}

.tab.active::after {
  content: "";
  position: absolute;
  inset: 8px auto 8px 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: #63c8e2;
}

.sidebar-toggle,
.sidebar-customize {
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.sidebar-toggle-icon,
.sidebar-customize-icon {
  position: relative;
  background: transparent !important;
}

.sidebar-customize-icon::before {
  content: "";
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.51a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.51a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (min-width: 901px) {
  :root {
    --sidebar-open: 288px;
    --sidebar-closed: 76px;
  }

  #app-screen {
    padding-left: var(--sidebar-open) !important;
  }

  #app-screen:has(> #summary-bar[style*="display: none"]) {
    padding-right: 0 !important;
  }

  .topbar,
  .subnav {
    width: var(--sidebar-open) !important;
  }

  .subnav {
    top: 64px;
    bottom: 0;
    overflow-y: auto;
    scrollbar-width: thin;
  }

  body.sidebar-collapsed #app-screen {
    padding-left: var(--sidebar-closed) !important;
  }

  body.sidebar-collapsed .summary {
    left: var(--sidebar-closed) !important;
  }

  .tab {
    gap: 10px;
  }

  .tab.has-submenu .tab-menu {
    position: fixed;
    left: var(--submenu-left, calc(var(--sidebar-open) + 8px));
    top: var(--submenu-top, 72px);
    width: min(280px, calc(100vw - 24px));
    min-width: 240px;
    max-height: var(--submenu-max-height, calc(100vh - 24px));
    margin: 0;
    overflow-y: auto;
    box-shadow: var(--sh-lg);
  }

  .tab::before {
    content: "";
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    border-radius: 0;
    background: currentColor;
    -webkit-mask: var(--nav-icon) center / 19px 19px no-repeat;
    mask: var(--nav-icon) center / 19px 19px no-repeat;
    opacity: .88;
  }

  .tab[data-page="calc"] {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='16' height='20' x='4' y='2' rx='2'/%3E%3Cpath d='M8 6h8M8 10h.01M12 10h.01M16 10h.01M8 14h.01M12 14h.01M16 14v4M8 18h.01M12 18h.01'/%3E%3C/svg%3E");
  }

  .tab[data-page="counterparties"],
  .tab[data-page="team"] {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2M16 3.13a4 4 0 0 1 0 7.75M22 21v-2a4 4 0 0 0-3-3.87'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3C/svg%3E");
  }

  .tab[data-page="ideas"] {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 22h4M8.5 14.5A7 7 0 1 1 15.5 14.5C14.5 15.3 14 16.1 14 18h-4c0-1.9-.5-2.7-1.5-3.5z'/%3E%3C/svg%3E");
  }

  .tab[data-page="inventory"] {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21V8l9-5 9 5v13M7 21v-8h10v8M7 17h10'/%3E%3C/svg%3E");
  }

  .tab[data-page="logistics"] {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 17h4V5H2v12h3M14 8h4l4 4v5h-3M14 17h1'/%3E%3Ccircle cx='7.5' cy='17.5' r='2.5'/%3E%3Ccircle cx='17.5' cy='17.5' r='2.5'/%3E%3C/svg%3E");
  }

  .tab[data-page="finances"] {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 7V6a2 2 0 0 0-2-2H5a3 3 0 0 0 0 6h15v10H5a3 3 0 0 1-3-3V7M16 14h.01'/%3E%3C/svg%3E");
  }

  .tab[data-page="help"] {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M9.1 9a3 3 0 1 1 5.83 1c0 2-3 2-3 4M12 18h.01'/%3E%3C/svg%3E");
  }

  .tab[data-page="notifications"] {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 21a2 2 0 0 0 3.4 0M18 8a6 6 0 0 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9'/%3E%3C/svg%3E");
  }

  .tab[data-page="dashboard"] {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='7' height='9' x='3' y='3' rx='1'/%3E%3Crect width='7' height='5' x='14' y='3' rx='1'/%3E%3Crect width='7' height='9' x='14' y='12' rx='1'/%3E%3Crect width='7' height='5' x='3' y='16' rx='1'/%3E%3C/svg%3E");
  }

  .tab[data-page="admin"] {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.09a2 2 0 0 1-1-1.74v-.51a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
  }

  .tab::before,
  .tab:hover::before,
  .tab.active::before {
    background-color: currentColor;
  }

  .tab-menu {
    padding: 6px;
    border-radius: 6px;
    background: var(--navy3);
    box-shadow: var(--sh-lg);
  }

  .tab-menu button,
  .tab-menu a {
    min-height: 40px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
  }

  .global-search {
    width: min(420px, calc(100% - 48px));
    margin: 16px 24px 0 auto;
  }

  .global-search input {
    min-height: 40px;
    border-radius: 6px;
    box-shadow: none;
  }

  .global-search-results {
    border-radius: 6px;
    box-shadow: var(--sh-lg);
  }

  .open-tabs {
    max-width: none;
    padding: 14px 24px 0;
    gap: 6px;
  }

  .open-tab {
    min-height: 36px;
    padding: 0 8px 0 12px;
    border-radius: 6px;
    box-shadow: none;
    font-size: 12px;
    font-weight: 600;
  }

  .open-tab.active {
    border-color: var(--blue);
    background: var(--blue);
    box-shadow: none;
    color: #fff;
  }
}

/* Page structure and typography */
.main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 18px 24px 84px;
  animation: none;
}

.page-title {
  margin-bottom: 4px;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
}

.page-sub {
  max-width: 960px;
  margin-bottom: 16px;
  color: var(--text2);
  font-size: 13px;
  line-height: 1.45;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  letter-spacing: 0;
}

.card-title,
.dash-title,
.history-toolbar-title,
.msec-title {
  color: var(--text2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.card-title {
  margin-bottom: 12px;
  padding-bottom: 10px;
}

.mini-note,
.muted-small {
  color: var(--text3);
  font-size: 12px;
  line-height: 1.4;
}

/* Surfaces: deliberate, restrained and flat */
.card,
.dash-card,
.list-card,
.cp-kpi,
.cp-detail-header,
.template-admin-card,
.role-box,
.users-kpi,
.user-card,
.process-overview,
.process-matrix,
.process-work-details,
.pick-batch-card,
.timesheet-card {
  border-color: var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: none;
}

.card {
  margin-bottom: 14px;
  padding: 16px;
}

.card:hover,
.dash-card:hover,
.user-card:hover,
.kpi-card:hover {
  box-shadow: none;
  transform: none;
}

.card .card,
.card .dash-card,
.card .list-card,
.modal-content .card {
  border-radius: 6px;
  box-shadow: none;
}

.filter-bar,
.admin-toolbar,
.history-toolbar,
.template-bar {
  gap: 10px;
  padding: 10px 12px;
  border-color: var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: none;
}

.dash-grid,
.users-grid,
.cp-kpi-row {
  gap: 12px;
}

/* KPI summaries */
.kpi-strip {
  gap: 10px;
  margin-bottom: 14px;
}

.kpi-card,
.kpi-card:nth-child(n) {
  min-height: 82px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  background: var(--surface) !important;
  box-shadow: none;
  color: var(--text);
}

.kpi-card:nth-child(2) {
  border-left-color: var(--green);
}

.kpi-card:nth-child(3) {
  border-left-color: var(--orange);
}

.kpi-card:nth-child(4) {
  border-left-color: #6554c0;
}

.kpi-lbl {
  color: var(--text2);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.kpi-val {
  margin-top: 5px;
  color: var(--text);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.15;
  text-shadow: none;
}

/* Inputs and filters */
.field {
  margin-bottom: 12px;
}

.field label,
.cc-field label,
.cc-status label,
.calc-field label,
.mfield > label,
.assignment-scan-entry > label > span {
  margin-bottom: 5px;
  color: var(--text2) !important;
  font-size: 12px !important;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
}

.fi,
.multi-check-btn,
.history-status-select,
.inv-select,
.num-in,
.global-search input {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--border2);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 14px !important;
  line-height: 1.3;
}

textarea.fi {
  min-height: 88px;
  resize: vertical;
}

.fi:hover,
.multi-check-btn:hover,
.history-status-select:hover,
.inv-select:hover,
.num-in:hover {
  border-color: #8da6bb;
}

.fi:focus,
.multi-check-btn.open,
.history-status-select:focus,
.inv-select:focus,
.num-in:focus {
  border-color: var(--focus);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(14, 165, 198, .16);
}

.check-line,
.check-card,
.multi-check-option {
  font-size: 13px;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--blue);
}

/* Buttons */
.btn-add,
.btn-save,
.btn-primary,
.btn-sec,
.btn-word,
.hc-btn,
.quick-btn,
.tpl-btn,
.cc-status-btn,
.save-settings-btn,
.btn-generate,
.btn-inline-danger {
  min-height: 36px;
  height: auto;
  padding: 7px 12px;
  border-radius: 6px;
  box-shadow: none;
  font-size: 13px !important;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.25;
  text-transform: none;
  transition: background-color .15s, border-color .15s, color .15s;
}

.btn-add,
.btn-save,
.btn-primary,
.save-settings-btn {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
}

.btn-add:hover,
.btn-save:hover,
.btn-primary:hover,
.save-settings-btn:hover {
  border-color: var(--blue2);
  background: var(--blue2);
  box-shadow: none;
  filter: none;
  transform: none;
}

.btn-sec,
.btn-word,
.hc-btn,
.quick-btn,
.tpl-btn,
.cc-status-btn,
.btn-generate {
  border: 1px solid var(--border2);
  background: #fff;
  color: var(--text2);
}

.btn-sec:hover,
.btn-word:hover,
.hc-btn:hover,
.quick-btn:hover,
.tpl-btn:hover,
.cc-status-btn:hover,
.btn-generate:hover {
  border-color: var(--blue);
  background: var(--blue-bg);
  color: var(--blue2);
  box-shadow: none;
  filter: none;
  transform: none;
}

.btn-danger,
.btn-inline-danger,
.hc-del {
  border-color: #f0b4af !important;
  background: #fff !important;
  box-shadow: none !important;
  color: var(--red) !important;
}

.btn-danger:hover,
.btn-inline-danger:hover,
.hc-del:hover {
  border-color: var(--red) !important;
  background: var(--red-bg) !important;
}

.btn-ok {
  border-color: var(--green) !important;
  background: var(--green) !important;
  box-shadow: none !important;
  color: #fff !important;
}

.btn-add::after,
.btn-save::after,
.btn-primary::after,
.save-settings-btn::after {
  display: none;
}

button:disabled,
.disabled {
  cursor: not-allowed;
  opacity: .52;
}

/* Tables */
.card:has(> table),
.card:has(.adm-table),
.card:has(.dash-table),
.card:has(.svc-table) {
  overflow-x: auto;
}

.adm-table,
.dash-table,
.svc-table,
.timesheet-grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

.adm-table th,
.dash-table th,
.svc-table th,
.timesheet-grid th {
  height: 40px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  color: var(--text2);
  font-size: 12px !important;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.25;
  text-align: left;
  text-transform: none;
  white-space: nowrap;
}

.adm-table td,
.dash-table td,
.svc-table td,
.timesheet-grid td {
  height: 46px;
  padding: 9px 11px;
  border-bottom: 1px solid #e4ebf3;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  vertical-align: middle;
}

.adm-table tbody tr:nth-child(even) td,
.dash-table tbody tr:nth-child(even) td,
.svc-table tbody tr:nth-child(even) td {
  background: #fbfcfe;
}

.adm-table tbody tr:hover td,
.dash-table tbody tr:hover td,
.svc-table tbody tr:hover td {
  background: var(--blue-bg);
}

.adm-table .r,
.dash-table .r,
.svc-table .r,
.adm-table td[data-type="number"],
.dash-table td[data-type="number"],
.svc-table td[data-type="number"] {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.adm-table .c,
.dash-table .c,
.svc-table .c {
  text-align: center;
}

.adm-table .fi,
.dash-table .fi,
.svc-table .fi {
  min-height: 36px;
  padding: 6px 8px;
}

/* Sections, tabs and status feedback */
.section {
  margin-bottom: 14px;
  border-color: var(--border);
  border-radius: 8px;
  box-shadow: none;
}

.section:hover {
  box-shadow: none;
}

.section-head {
  min-height: 44px;
  height: auto;
  padding: 10px 13px;
  border-radius: 7px 7px 0 0;
  background: #edf3f8;
  color: var(--text);
}

.section-head::before {
  display: none;
}

.section-head:hover {
  background: #e5eef6;
  filter: none;
}

.section-name,
.section-total,
.section-chevron {
  color: var(--text);
  text-shadow: none;
}

.section-icon {
  display: none;
}

.section-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.section-total {
  font-size: 13px;
}

.admin-tabs,
.entity-tabs {
  gap: 4px;
  padding: 4px;
  border-color: var(--border);
  border-radius: 8px;
  background: #edf3f8;
}

.admin-tab,
.admin-tabs .hc-btn,
.entity-tabs .hc-btn {
  min-height: 36px;
  height: auto;
  padding: 7px 10px;
  border-radius: 5px;
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
}

.admin-tab.active,
.admin-tabs .hc-btn.active,
.entity-tabs .hc-btn.active {
  border-color: var(--border2);
  background: #fff;
  box-shadow: var(--sh-xs);
  color: var(--blue2);
}

.status-pill,
.status-badge,
.late-tag-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid var(--border2);
  border-radius: 4px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

.status-pill::before,
.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-new,
.status-work,
.status-sent {
  border-color: #b9d7e5;
  background: #eef8fc;
  color: #16627d;
}

.status-pending_approval,
.status-needs_clarification,
.status-thinking,
.status-approval,
.status-warn,
.status-wait {
  border-color: #e8cc83;
  background: var(--orange-bg);
  color: var(--orange);
}

.status-accepted,
.status-approved,
.status-done,
.status-success {
  border-color: #91d6b5;
  background: var(--green-bg);
  color: var(--green);
}

.status-rejected,
.status-error,
.status-danger {
  border-color: #f0b4af;
  background: var(--red-bg);
  color: var(--red);
}

/* Modals and side panels */
.modal {
  padding: 24px;
  background: rgba(7, 17, 31, .58);
  backdrop-filter: none;
}

.modal-content {
  width: min(720px, 100%);
  max-width: 720px;
  max-height: calc(100vh - 48px);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--sh-lg);
}

.mhd {
  min-height: 56px;
  margin: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.mhd-title {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.mhd-icon {
  width: 32px;
  height: 32px;
  border: 1px solid #b9d7e5;
  border-radius: 6px;
  background: var(--blue-bg);
  box-shadow: none;
  color: var(--blue2);
  font-size: 0;
}

.mhd-icon::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

/* Lucide-style monochrome action icons. */
[data-ui-icon] {
  --ui-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8v8M8 12h8'/%3E%3C/svg%3E");
}

button[data-ui-icon],
a[data-ui-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

button[data-ui-icon]::before,
a[data-ui-icon]::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  background: currentColor;
  -webkit-mask: var(--ui-icon) center / contain no-repeat;
  mask: var(--ui-icon) center / contain no-repeat;
}

[data-ui-icon="copy"] {
  --ui-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='14' height='14' x='8' y='8' rx='2'/%3E%3Cpath d='M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2'/%3E%3C/svg%3E");
}

[data-ui-icon="invoice"],
[data-ui-icon="card"] {
  --ui-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5z'/%3E%3Cpolyline points='14 2 14 8 20 8'/%3E%3Cpath d='M8 13h8M8 17h6'/%3E%3C/svg%3E");
}

[data-ui-icon="trash"] {
  --ui-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6M10 11v5M14 11v5'/%3E%3C/svg%3E");
}

[data-ui-icon="print"] {
  --ui-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9V2h12v7M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2M6 14h12v8H6z'/%3E%3C/svg%3E");
}

[data-ui-icon="table"] {
  --ui-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='18' x='3' y='3' rx='2'/%3E%3Cpath d='M3 9h18M3 15h18M9 3v18M15 3v18'/%3E%3C/svg%3E");
}

[data-ui-icon="refresh"] {
  --ui-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 11a8.1 8.1 0 0 0-15.5-2M4 4v5h5M4 13a8.1 8.1 0 0 0 15.5 2M20 20v-5h-5'/%3E%3C/svg%3E");
}

[data-ui-icon="edit"] {
  --ui-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9M16.5 3.5a2.1 2.1 0 0 1 3 3L8 18l-4 1 1-4z'/%3E%3C/svg%3E");
}

[data-ui-icon="calculator"] {
  --ui-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='16' height='20' x='4' y='2' rx='2'/%3E%3Cpath d='M8 6h8M8 10h.01M12 10h.01M16 10h.01M8 14h.01M12 14h.01M16 14v4M8 18h.01M12 18h.01'/%3E%3C/svg%3E");
}

[data-ui-icon="deals"] {
  --ui-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='20' height='14' x='2' y='7' rx='2'/%3E%3Cpath d='M8 7V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M2 12h20M10 12v2h4v-2'/%3E%3C/svg%3E");
}

[data-ui-icon="download"] {
  --ui-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3'/%3E%3C/svg%3E");
}

button[onclick^="startCameraScan"] {
  width: 40px;
  min-width: 40px;
  padding: 0;
  font-size: 0 !important;
}

button[onclick^="startCameraScan"]::before {
  content: "";
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 4l1.5 2H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l1.5-2z'/%3E%3Ccircle cx='12' cy='13' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.5 4l1.5 2H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l1.5-2z'/%3E%3Ccircle cx='12' cy='13' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
}

.mhd-close {
  width: 36px;
  height: 36px;
  border-radius: 6px;
}

.mbody {
  max-height: calc(100vh - 106px);
  padding: 16px;
}

.msec,
.user-form-section {
  border-radius: 6px;
}

.mfooter,
.user-modal-footer {
  gap: 8px;
  padding-top: 12px;
}

.mfooter .btn-save,
.mfooter .hc-btn {
  min-height: 40px;
  height: auto;
}

/* Operational workflows */
.process-route,
.process-overview,
.process-matrix,
.process-work-details,
.assignment-scanner,
.assignment-discrepancy,
.assignment-scan-queue {
  border-color: var(--border);
  border-radius: 6px;
}

.process-stage {
  min-height: 68px;
  padding: 11px;
  background: var(--sf2);
}

.process-stage b {
  font-size: 13px;
}

.process-stage small {
  font-size: 12px;
}

.process-stage-number {
  width: 26px;
  height: 26px;
  flex-basis: 26px;
  font-size: 12px;
}

.process-stage.done .process-stage-number {
  border-color: var(--green);
  background: var(--green);
}

.process-stage.current .process-stage-number {
  border-color: var(--blue);
  background: var(--blue);
}

.process-matrix-row {
  min-height: 44px;
  padding: 8px 10px;
  font-size: 13px;
}

.process-matrix-row.head {
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.my-task-row,
.operation-assignment-row,
.batch-service-row,
.batch-line-card {
  border-radius: 6px;
}

.pick-card-open {
  margin-left: auto;
}

.stock-shortage-badge {
  border: 1px solid #e9b75f;
  background: #fff4dd;
  color: #8a4b08;
}

.stock-shortage-panel {
  overflow: hidden;
  border: 1px solid #e9b75f;
  border-radius: 6px;
  background: #fffbf2;
}

.stock-shortage-panel .section-head {
  gap: 12px;
  padding: 12px;
  background: #fff4dd;
  color: #49300f;
}

.stock-shortage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.stock-shortage-table-wrap {
  overflow-x: auto;
}

.stock-shortage-table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
}

.stock-shortage-table th,
.stock-shortage-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #ead9b9;
  text-align: left;
  font-size: 12px;
}

.stock-shortage-table th {
  background: #fffaf0;
  color: #765023;
}

.stock-shortage-delivery {
  padding: 9px 12px;
  background: #f1fbf5;
  color: #167446;
}

@media (max-width: 900px) {
  .stock-shortage-panel .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .stock-shortage-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

.assignment-scan-input {
  min-height: 48px;
  font-size: 17px !important;
}

/* Calculator summary */
.summary {
  border-top: 1px solid rgba(255, 255, 255, .12);
  background: var(--navy);
  box-shadow: none;
}

.summary .s-lbl {
  color: rgba(255, 255, 255, .62);
  font-size: 11px;
  letter-spacing: 0;
}

.summary .s-val {
  color: #fff;
}

.summary .s-val.accent,
.summary .s-green {
  color: #82d8ed;
}

/* Modules that inject their styles at runtime need a stronger system contract. */
.main .wh-col,
.main .wh-order,
.main .wh-panel,
.main .wh-import-wrap,
.main .wh-photo-list img,
.main .wh-order-tabs button,
.main .public-link-box,
.main .lg-tabs,
.main .lg-col,
.main .lg-card,
.main .lg-endpoint,
.main .lg-stop,
.main .lg-driver-action,
.main .lg-svc-line,
.main .lg-warning {
  border-radius: 8px;
  box-shadow: none;
}

.main .wh-col,
.main .lg-col {
  border-color: var(--border);
  background: #eef3f8;
}

.main .wh-order,
.main .lg-card,
.main .lg-endpoint,
.main .lg-stop {
  border-color: var(--border);
  background: #fff;
}

.main .wh-col-title,
.main .lg-card-head {
  color: var(--text2);
  font-size: 13px;
}

.main .wh-tag,
.main .origin-badge,
.main .lg-status {
  min-height: 24px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.main .wh-order-tabs button,
.main .lg-tabs button {
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 5px;
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
}

.main .lg-tabs {
  padding: 4px;
  border-color: var(--border);
  background: #edf3f8;
}

.main .lg-tabs button.active {
  color: var(--blue2);
  box-shadow: var(--sh-xs);
}

.main .lg-line-head label {
  color: var(--text2);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.main .wh-compact-table td,
.main .wh-compact-table th {
  min-height: 44px;
  padding: 8px 10px;
  font-size: 13px;
}

/* Responsive behavior */
@media (max-width: 900px) {
  #app-screen {
    padding-left: 0 !important;
  }

  .topbar {
    height: 56px;
    padding: 0 12px;
  }

  .topbar-logo {
    font-size: 15px;
  }

  .topbar-logo small,
  .topbar-user,
  .role-badge {
    display: none;
  }

  .subnav {
    top: 56px;
    width: 100% !important;
    gap: 4px;
    padding: 6px 10px;
    align-items: center;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: thin;
  }

  .sidebar-toggle {
    display: none !important;
  }

  .sidebar-customize {
    width: 40px !important;
    min-width: 40px;
    min-height: 40px;
    flex: 0 0 40px;
    margin: 0;
    padding: 0 !important;
    justify-content: center;
  }

  .sidebar-customize-text {
    display: none;
  }

  .tab {
    position: relative;
    width: auto !important;
    min-height: 40px !important;
    flex: 0 0 auto;
    padding: 0 10px !important;
  }

  .tab-main-link {
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: inherit;
    text-decoration: none;
  }

  .tab-menu {
    display: none !important;
    position: fixed;
    z-index: 500;
    top: 103px;
    left: 10px;
    right: 10px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 6px;
    background: var(--navy3);
    box-shadow: var(--sh-lg);
  }

  .tab.has-submenu.submenu-open .tab-menu {
    display: grid !important;
    gap: 3px;
  }

  .tab-menu a,
  .tab-menu button {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: rgba(255, 255, 255, .82);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
  }

  .tab-menu a:hover,
  .tab-menu button:hover {
    background: rgba(255, 255, 255, .09);
    color: #fff;
  }

  .global-search {
    width: auto;
    margin: 10px;
  }

  .open-tabs {
    display: flex;
    gap: 6px;
    padding: 0 10px 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .open-tabs:empty {
    display: none;
  }

  .open-tab {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    padding: 0 8px 0 11px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--text2);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
  }

  .open-tab.active {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
  }

  .open-tab-close {
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: inherit;
  }

  .main {
    padding: 12px 10px 72px;
  }

  .main .row-actions {
    flex-wrap: wrap;
  }

  .page-title {
    font-size: 18px;
  }

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

  .modal {
    padding: 10px;
  }

  .modal-content {
    max-height: calc(100vh - 20px);
    border-radius: 8px;
  }

  .fi,
  .multi-check-btn,
  .history-status-select,
  .inv-select,
  .num-in,
  .btn-add,
  .btn-save,
  .btn-primary,
  .btn-sec,
  .btn-word,
  .hc-btn,
  .quick-btn,
  .tpl-btn,
  .cc-status-btn,
  .save-settings-btn,
  .btn-generate {
    min-height: 44px;
  }

  .adm-table td,
  .dash-table td,
  .svc-table td {
    height: 52px;
  }
}

@media (max-width: 560px) {
  .topbar-logo small {
    display: none;
  }

  .btn-logout {
    min-height: 40px;
    padding: 6px 9px;
  }

  .card {
    padding: 12px;
  }

  .kpi-strip {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    min-height: 72px;
  }

  .filter-bar,
  .history-toolbar,
  .admin-toolbar,
  .template-bar {
    align-items: stretch;
  }

  .row-actions,
  .mfooter,
  .user-modal-footer {
    align-items: stretch;
  }

  .row-actions > button,
  .row-actions > a,
  .mfooter > button,
  .user-modal-footer > button {
    flex: 1 1 auto;
  }

  .main .row-actions > button,
  .main .row-actions > a,
  .main .row-actions > select,
  .main .row-actions > .field {
    width: 100%;
    flex: 1 1 100%;
  }

  .main .wh-board,
  .main .lg-board {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .main .wh-col,
  .main .lg-col {
    min-height: 132px;
  }

  .main .wh-empty {
    padding: 22px 12px;
  }

  .modal {
    padding: 0;
  }

  .modal-content {
    max-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .mbody {
    max-height: calc(100vh - 56px);
  }
}

.scanner-mode-switch {
  display: inline-flex;
  gap: 4px;
  margin: 0 0 12px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--sf2);
}

.scanner-mode-switch button {
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text2);
  font: 600 12px/1.2 var(--body);
  cursor: pointer;
}

.scanner-mode-switch button.active {
  border-color: var(--blue3);
  background: var(--surface);
  color: var(--blue3);
  box-shadow: var(--sh-xs);
}

.quick-inventory-card {
  max-width: 1040px;
  padding: 16px;
  border-radius: 8px;
}

.quick-inventory-active {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid var(--border2);
  border-left: 5px solid var(--orange);
  border-radius: 6px;
  background: var(--sf2);
}

.quick-inventory-active.ready {
  border-color: rgba(0, 166, 109, .45);
  border-left-color: var(--green);
  background: rgba(0, 214, 143, .08);
}

.quick-inventory-active span,
.quick-inventory-active small {
  color: var(--text3);
  font-size: 11px;
}

.quick-inventory-active strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font: 700 18px/1.2 var(--heading);
}

.quick-inventory-scan-form > label {
  display: block;
  margin-bottom: 6px;
  color: var(--text2);
  font-size: 12px;
  font-weight: 700;
}

.quick-inventory-scan-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 8px;
}

.quick-inventory-scan-row .fi,
.quick-inventory-scan-row button {
  min-height: 48px;
}

.quick-inventory-scan-row .fi {
  border-width: 2px;
  font-size: 16px;
}

.quick-inventory-message {
  min-height: 38px;
  margin: 10px 0;
  padding: 9px 12px;
}

.quick-inventory-shelves {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  padding-bottom: 4px;
  overflow-x: auto;
}

.quick-inventory-shelf {
  display: grid;
  flex: 0 0 auto;
  min-width: 150px;
  min-height: 52px;
  padding: 7px 10px;
  border: 1px solid var(--border2);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text2);
  text-align: left;
  cursor: pointer;
}

.quick-inventory-shelf.active {
  border-color: var(--blue2);
  box-shadow: inset 3px 0 0 var(--blue2);
}

.quick-inventory-shelf span {
  color: var(--text3);
  font-size: 10px;
}

.quick-inventory-table-wrap {
  max-height: 420px;
  margin-top: 12px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.quick-inventory-table {
  margin: 0;
}

.quick-inventory-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.quick-inventory-positive {
  color: var(--orange);
  font-weight: 700;
}

.quick-inventory-negative {
  color: var(--red);
  font-weight: 700;
}

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

@media (max-width: 720px) {
  .scanner-mode-switch,
  .scanner-mode-switch button {
    width: 100%;
  }

  .quick-inventory-active {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .quick-inventory-scan-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .quick-inventory-scan-row .btn-save {
    grid-column: 1 / -1;
  }

  .quick-inventory-actions > button {
    flex: 1 1 100%;
  }
}

/* Motion is optional and never required to understand state. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
