:root {
  color-scheme: light;
  --bg: #f3f1ee;
  --surface: #ffffff;
  --surface-strong: #fff7ee;
  --text: #222222;
  --muted: #6e6a63;
  --line: #e7e0d7;
  --brand: #b4232a;
  --brand-dark: #87191f;
  --green: #1b8a4a;
  --amber: #d68117;
  --red: #c93232;
  --shadow: 0 16px 38px rgba(51, 36, 24, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(140deg, rgba(180, 35, 42, 0.08), transparent 35%),
    var(--bg);
  color: var(--text);
}

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

button {
  cursor: pointer;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(145deg, rgba(180, 35, 42, 0.12), transparent 42%),
    var(--bg);
}

.login-screen.hidden {
  display: none;
}

.login-panel {
  display: grid;
  gap: 18px;
  width: min(100%, 440px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-title {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.login-title p,
.login-title h1 {
  margin: 0;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.login-title p {
  color: var(--brand);
  font-size: 30px;
  font-weight: 900;
}

.login-title h1 {
  color: var(--text);
  font-size: 30px;
  font-weight: 900;
}

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

.login-panel input {
  min-height: 56px;
  padding: 13px 16px;
  font-size: 20px;
  font-weight: 800;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 58px;
}

.password-field button {
  position: absolute;
  right: 8px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  background: #f2eee8;
  color: var(--text);
  font-size: 19px;
}

.login-panel .primary-button {
  min-height: 58px;
  font-size: 20px;
}

.app-shell {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 18px clamp(14px, 3vw, 28px) 96px;
}

.topbar {
  display: grid;
  grid-template-columns: max-content max-content 1fr auto;
  align-items: end;
  gap: 24px;
  min-height: 118px;
}

.brand-home {
  display: grid;
  justify-items: center;
  gap: 6px;
  width: max-content;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  padding: 0;
  text-align: center;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
}

.brand-home img {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  object-fit: cover;
  mix-blend-mode: multiply;
  filter: contrast(1.04) brightness(1.03);
}

.brand-home:focus {
  outline: none;
}

.brand-home:focus-visible {
  outline: 2px solid rgba(180, 35, 42, 0.35);
  outline-offset: 4px;
}

.screen-heading {
  min-width: 0;
  padding-bottom: 0;
}

.eyebrow {
  margin: 0;
  color: var(--brand);
  font-size: 40px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}

h1 {
  margin: 0;
  font-size: 40px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  white-space: nowrap;
}

.icon-button {
  display: none;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 28px;
  box-shadow: 0 8px 18px rgba(40, 32, 24, 0.08);
}

.icon-button.visible {
  display: grid;
}

.user-strip,
.low-stock-banner,
.order-alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.user-strip span,
.low-stock-banner strong,
.order-alert-banner strong {
  display: block;
  font-weight: 800;
}

.user-strip small,
.low-stock-banner span,
.order-alert-banner span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.low-stock-list {
  display: grid;
  gap: 5px;
  margin-top: 6px;
}

.low-stock-list span {
  margin: 0;
  color: var(--brand-dark);
  font-weight: 800;
}

.logout-button {
  flex: 0 0 auto;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-dark);
  padding: 0 18px;
  font-weight: 900;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 15px 14px;
  min-height: 54px;
}

textarea {
  resize: none;
}

.low-stock-banner {
  background: #fff2df;
  border-color: #f1c27d;
}

.order-alert-banner {
  background: #fff6f7;
  border-color: rgba(180, 35, 42, 0.32);
}

.order-alert-banner strong {
  color: var(--brand-dark);
}

.low-stock-banner button,
.order-alert-banner button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  min-height: 48px;
  padding: 0 18px;
  font-weight: 800;
}

.hidden,
.screen {
  display: none;
}

.operation-form label.hidden {
  display: none;
}

button.hidden {
  display: none;
}

.product-card label.hidden {
  display: none;
}

.screen.active {
  display: block;
}

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

.action-card {
  position: relative;
  display: flex;
  min-height: 166px;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.action-card:active {
  transform: scale(0.98);
}

.action-card.has-alert {
  border-color: rgba(180, 35, 42, 0.42);
  box-shadow: 0 16px 38px rgba(180, 35, 42, 0.16);
}

.order-card-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  min-width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-style: normal;
  font-size: 16px;
  font-weight: 900;
}

.action-card span {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-strong);
  font-size: 29px;
}

.action-card strong {
  display: block;
  font-size: 24px;
  line-height: 1.08;
}

.action-card small {
  color: var(--muted);
  font-size: 15px;
}

.product-list,
.history-list {
  display: grid;
  gap: 12px;
}

.stock-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.category-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 18px;
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(40, 32, 24, 0.08);
  text-align: left;
}

.category-card b {
  color: var(--muted);
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}

.category-card small {
  margin-left: auto;
  border-radius: 999px;
  background: #f4eee9;
  color: var(--brand-dark);
  min-width: 38px;
  padding: 8px 11px;
  text-align: center;
  font-size: 18px;
  line-height: 1;
  font-weight: 900;
}

.category-card > span {
  font-size: 24px;
  font-weight: 900;
}

.category-card:active {
  transform: scale(0.99);
}

.category-card:focus {
  outline: none;
}

.category-card:focus-visible {
  outline: 2px solid rgba(180, 35, 42, 0.35);
  outline-offset: 3px;
}

.order-category-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(40, 32, 24, 0.08);
  overflow: hidden;
}

.order-category-list summary {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 0 18px;
  cursor: pointer;
  list-style: none;
}

.order-category-list summary::-webkit-details-marker {
  display: none;
}

.order-category-list summary span {
  font-size: 24px;
  font-weight: 900;
}

.order-category-list summary small {
  border-radius: 999px;
  background: #f4eee9;
  color: var(--brand-dark);
  min-width: 38px;
  padding: 8px 11px;
  text-align: center;
  font-size: 18px;
  line-height: 1;
  font-weight: 900;
}

.order-category-list summary b {
  color: var(--muted);
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  transition: transform 0.16s ease;
}

.order-category-list[open] summary {
  border-bottom: 1px solid var(--line);
}

.order-category-list[open] summary b {
  transform: rotate(180deg);
}

.order-category-products {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: #fbf8f4;
}

.stock-list-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.editable-stock-row {
  grid-template-columns: minmax(0, 1.2fr) auto minmax(260px, 0.9fr);
}

.stock-list-main {
  min-width: 0;
}

.stock-list-row strong {
  display: block;
  font-size: 18px;
  line-height: 1.15;
}

.stock-list-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.stock-list-summary {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.stock-list-summary b {
  color: var(--brand-dark);
  font-size: 20px;
  line-height: 1.1;
  white-space: nowrap;
}

.stock-list-summary .status-pill {
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
}

.quick-product-search {
  position: relative;
  z-index: 25;
  display: grid;
  gap: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(40, 32, 24, 0.08);
}

.quick-product-search label {
  display: grid;
  gap: 7px;
}

.quick-product-search label > span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.quick-product-search .combo-field {
  display: grid;
  grid-template-columns: 1fr 54px;
  align-items: center;
  overflow: hidden;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf7f2;
}

.quick-product-search .combo-field:focus-within {
  border-color: rgba(180, 35, 42, 0.45);
  box-shadow: 0 0 0 3px rgba(180, 35, 42, 0.1);
}

.quick-product-search input {
  min-width: 0;
  min-height: 52px;
  border: 0;
  background: transparent;
  padding: 0 14px;
  color: var(--text);
  font: inherit;
  font-weight: 900;
}

.quick-product-search input:focus {
  outline: none;
}

.quick-product-search .combo-field button {
  width: 54px;
  height: 52px;
  border: 0;
  border-left: 1px solid var(--line);
  background: #f1eee8;
  color: var(--text);
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.quick-product-search .combo-field button[aria-expanded="true"] {
  color: var(--brand-dark);
}

.quick-product-results {
  position: absolute;
  top: calc(100% - 8px);
  left: 14px;
  right: 14px;
  z-index: 30;
  display: grid;
  gap: 8px;
  max-height: min(520px, 58vh);
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 36px rgba(40, 32, 24, 0.18);
}

.quick-product-results:empty {
  display: none;
}

.quick-product-results .empty-state {
  margin: 0;
}

.quick-order-row {
  grid-template-columns: 54px 1fr;
  align-items: center;
  padding: 10px;
  box-shadow: none;
}

.quick-order-row.selected {
  border-color: rgba(180, 35, 42, 0.42);
  background: #fff8f8;
}

.quick-order-row .product-photo {
  width: 54px;
  font-size: 26px;
}

.quick-order-row .product-info h2 {
  margin-bottom: 3px;
  font-size: 18px;
}

.quick-order-row .product-meta {
  font-size: 14px;
}

.quick-order-row .order-controls {
  grid-template-columns: 48px 1fr 48px;
  gap: 8px;
  margin-top: 8px;
}

.quick-order-row .stepper {
  width: 48px;
  height: 48px;
}

.quick-order-row .quantity-field {
  min-height: 48px;
}

.quick-order-row .quantity-field input {
  min-height: 46px;
  font-size: 20px;
}

.quick-order-row .quick-comment {
  margin-top: 8px;
}

.quick-order-row .quick-comment textarea {
  min-height: 54px;
  resize: none;
}

.product-card,
.history-card,
.order-item {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 22px rgba(40, 32, 24, 0.08);
}

.product-card {
  grid-template-columns: 76px 1fr;
  align-items: center;
}

.product-photo {
  width: 76px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(145deg, #ffe3d5, #f4b9a7);
  font-size: 35px;
}

.product-info {
  min-width: 0;
}

.product-info h2,
.history-card h2 {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.12;
}

.product-meta,
.history-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.order-read-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.order-read-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.order-read-row p {
  display: grid;
  gap: 3px;
}

.order-read-row strong {
  color: var(--text);
}

.order-read-row span {
  color: var(--muted);
  font-weight: 800;
}

.compact-button {
  min-height: 40px;
  padding: 0 10px;
  white-space: nowrap;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.stock-value {
  font-size: 24px;
  font-weight: 900;
}

.status-pill {
  border-radius: 999px;
  padding: 7px 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
}

.status-ok {
  background: var(--green);
}

.status-low {
  background: var(--amber);
}

.status-critical {
  background: var(--red);
}

.order-controls {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.stepper {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 8px;
  background: #f1eee8;
  color: var(--text);
  font-size: 28px;
  font-weight: 900;
}

.quantity-field {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  overflow: hidden;
  min-height: 56px;
  border-radius: 8px;
  background: #faf7f2;
  border: 1px solid var(--line);
}

.quantity-field input {
  min-width: 0;
  min-height: 54px;
  border: 0;
  background: transparent;
  padding: 0 8px 0 12px;
  text-align: center;
  font-size: 22px;
  font-weight: 900;
}

.quantity-field span {
  padding-right: 12px;
  color: var(--muted);
  font-weight: 900;
}

.operation-form,
.admin-form {
  display: grid;
  gap: 14px;
  max-width: 620px;
}

.admin-toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px;
  max-width: 620px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-toolbar label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

.admin-toolbar strong {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 8px;
  background: #f8f1ea;
  color: var(--brand-dark);
  white-space: nowrap;
}

.operation-form label,
.admin-form label,
.order-item-comment {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

.order-item-comment {
  margin-top: 12px;
}

.product-order-button {
  margin-top: 12px;
}

.stock-edit-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.stock-edit-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.stock-edit-row input {
  min-height: 46px;
  padding: 10px 12px;
  font-size: 16px;
  font-weight: 800;
}

.stock-edit-row .secondary-button {
  min-height: 46px;
}

.stock-edit-row.compact {
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 8px;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.stock-edit-row.compact .secondary-button {
  min-height: 44px;
  padding: 0 14px;
}

.admin-form {
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 22px rgba(40, 32, 24, 0.08);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.admin-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.primary-button {
  width: 100%;
  min-height: 60px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 12px 22px rgba(180, 35, 42, 0.23);
}

.primary-button:disabled {
  cursor: not-allowed;
  background: #c9c1b7;
  box-shadow: none;
}

.primary-button.danger {
  background: var(--red);
}

.secondary-button {
  min-height: 60px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-dark);
  padding: 0 18px;
  font-weight: 900;
}

.danger-outline {
  width: 100%;
  margin-bottom: 14px;
  border-color: #f2b5b5;
  color: var(--red);
}

.sticky-action {
  position: sticky;
  bottom: 18px;
  margin-top: 16px;
}

.history-card {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.history-card.new-order-card {
  border-color: rgba(180, 35, 42, 0.42);
  background: #fff8f8;
}

.admin-product {
  grid-template-columns: 74px minmax(0, 1fr) auto auto;
  align-items: center;
  min-height: 104px;
  padding: 14px;
}

.admin-product .product-photo {
  width: 74px;
  min-height: 74px;
}

.admin-product .product-info h2 {
  font-size: 21px;
  line-height: 1.15;
}

.admin-stock-summary {
  display: grid;
  justify-items: end;
  gap: 4px;
  min-width: 132px;
}

.admin-stock-summary strong {
  color: var(--text);
  font-size: 21px;
  line-height: 1.1;
}

.admin-stock-summary small {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.admin-stock-summary .status-pill {
  margin-top: 2px;
}

.admin-row-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  min-width: 118px;
}

.admin-row-actions button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-dark);
  padding: 0 12px;
  font-weight: 900;
}

.danger-lite,
.admin-row-actions .danger-lite {
  border-color: #f2b5b5;
  color: var(--red);
}

.history-card .badge {
  border-radius: 999px;
  padding: 8px 10px;
  background: #f2eee8;
  color: var(--brand-dark);
  font-weight: 900;
  white-space: nowrap;
}

.section-label {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 900;
}

.documents-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.documents-toolbar button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 0 14px;
  font-weight: 900;
}

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

.writeoff-request-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(180, 35, 42, 0.22);
  border-radius: 8px;
  border-color: rgba(180, 35, 42, 0.28);
  background: #fffdfb;
  box-shadow: 0 10px 22px rgba(40, 32, 24, 0.08);
}

.writeoff-request-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.writeoff-request-main h2 {
  margin: 0 0 4px;
  font-size: 22px;
  line-height: 1.12;
}

.writeoff-request-main p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.writeoff-request-main .badge {
  border-radius: 999px;
  padding: 9px 12px;
  background: #f2eee8;
  color: var(--brand-dark);
  font-weight: 900;
  white-space: nowrap;
}

.writeoff-request-main .badge.status-ok,
.writeoff-request-main .badge.status-critical {
  color: #fff;
}

.writeoff-request-details {
  display: grid;
  grid-template-columns: minmax(130px, auto) minmax(0, 1fr);
  gap: 8px;
}

.writeoff-request-details.single {
  grid-template-columns: 1fr;
}

.writeoff-request-details span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.writeoff-request-details small {
  color: var(--muted);
  font-weight: 800;
}

.writeoff-request-details strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1.15;
}

.writeoff-request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.writeoff-request-actions button {
  flex: 1 1 180px;
  min-height: 48px;
  border-radius: 8px;
  font-weight: 900;
}

.writeoff-request-actions .primary-inline {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
}

.writeoff-request-actions .danger-lite {
  border: 1px solid #f2b5b5;
  background: #fff;
  color: var(--red);
}

#writeoffRequestsList:not(.hidden) {
  margin-bottom: 18px;
}

.order-pick-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.order-pick-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.order-pick-row span {
  display: grid;
  gap: 3px;
}

.order-pick-row strong {
  color: var(--text);
  line-height: 1.15;
}

.order-pick-row small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.2;
}

.order-pick-row input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--text);
  font: inherit;
  font-weight: 900;
}

.order-pick-row em {
  color: var(--muted);
  font-style: normal;
  font-weight: 900;
}

.order-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.order-status button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
  font-weight: 800;
}

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

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

.receipt-selected {
  margin: 10px 0 0;
  color: var(--green);
  font-weight: 900;
}

.receipt-save-button {
  grid-column: 1 / -1;
  min-height: 46px;
}

.receipt-save-button:disabled {
  color: var(--muted);
  background: #f1eee8;
  cursor: not-allowed;
}

.empty-state {
  padding: 26px 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  text-align: center;
}

.empty-state.compact {
  padding: 14px;
}

.order-cart-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(180, 35, 42, 0.26);
  border-radius: 8px;
  background: #fff8f8;
  box-shadow: 0 12px 26px rgba(40, 32, 24, 0.1);
}

.order-cart-panel.hidden {
  display: none;
}

.order-cart-panel strong {
  display: block;
  font-size: 22px;
  line-height: 1.1;
}

.order-cart-panel span {
  color: var(--muted);
  font-weight: 800;
}

#orderCartPanel {
  position: fixed;
  right: max(14px, calc((100vw - 980px) / 2 + 28px));
  bottom: 12px;
  z-index: 23;
  width: min(360px, calc(100% - 28px));
  max-height: 58vh;
  margin-top: 0;
  overflow: auto;
}

#orderCartPanel .primary-button {
  min-height: 54px;
}

.cart-actions {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
}

.cart-actions button {
  min-width: 0;
  min-height: 56px;
  padding: 0 12px;
  line-height: 1.1;
  white-space: normal;
}

.cart-actions .danger-outline {
  margin-bottom: 0;
  font-size: 15px;
}

.cart-actions .primary-button {
  font-size: 17px;
}

.order-cart-list {
  display: grid;
  gap: 8px;
  max-height: 210px;
  overflow: auto;
}

.receipt-meta-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.receipt-meta-form label {
  display: grid;
  gap: 5px;
}

.receipt-meta-form label span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.receipt-meta-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  font-weight: 850;
}

.receipt-barcode-field {
  grid-column: 1;
}

.receipt-meta-form .secondary-button {
  align-self: end;
  min-height: 42px;
}

.receipt-manual-fields {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(110px, 0.35fr) minmax(90px, 0.25fr) auto;
  gap: 10px;
  align-items: end;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.receipt-manual-fields .secondary-button {
  white-space: nowrap;
}

.scanner-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 16, 14, 0.78);
}

.scanner-box {
  display: grid;
  gap: 12px;
  width: min(100%, 520px);
  padding: 12px;
  border-radius: 8px;
  background: var(--surface);
}

.scanner-box video {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  background: #111;
  object-fit: cover;
}

.receipt-cart-panel {
  position: fixed;
  left: 50%;
  bottom: 12px;
  z-index: 24;
  width: min(calc(100% - 28px), 924px);
  grid-template-columns: minmax(0, 1fr) minmax(190px, 280px);
  align-items: center;
  gap: 12px;
  margin-top: 0;
  padding: 12px;
  overflow: visible;
  transform: translateX(-50%);
}

.receipt-cart-panel .primary-button {
  min-height: 56px;
}

.receipt-cart-panel .order-cart-list {
  display: none;
}

.receipt-cart-panel > div:first-child {
  min-width: 0;
}

.order-cart-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.order-cart-row strong {
  color: var(--brand-dark);
  font-size: 16px;
  white-space: nowrap;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 40;
  width: min(calc(100% - 32px), 460px);
  transform: translate(-50%, 90px);
  border-radius: 8px;
  background: #222;
  color: #fff;
  padding: 14px 16px;
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
  text-align: center;
  font-weight: 800;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 620px) {
  .app-shell {
    padding-top: 12px;
  }

  .topbar {
    grid-template-columns: max-content 1fr auto;
    align-items: end;
    gap: 10px;
    min-height: 0;
  }

  .brand-home {
    width: max-content;
    min-width: 0;
    justify-items: start;
  }

  .brand-home img {
    width: 78px;
    height: 78px;
  }

  .eyebrow {
    font-size: 28px;
  }

  h1 {
    display: none;
  }

  .user-strip,
  .low-stock-banner,
  .order-alert-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .logout-button {
    width: 100%;
  }

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

  .action-card {
    min-height: 132px;
  }

  .admin-toolbar {
    grid-template-columns: 1fr;
  }

  .admin-toolbar strong {
    justify-content: flex-start;
  }

  .product-card {
    grid-template-columns: 68px 1fr;
  }

  .quick-order-row {
    grid-template-columns: 50px 1fr;
    padding: 9px;
  }

  .quick-order-row .product-photo {
    width: 50px;
  }

  .stock-toolbar {
    justify-content: stretch;
  }

  .stock-toolbar .secondary-button {
    width: 100%;
  }

  .stock-edit-row {
    grid-template-columns: 1fr;
  }

  .editable-stock-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .editable-stock-row .stock-list-summary {
    justify-items: start;
  }

  .stock-edit-row.compact {
    grid-template-columns: 1fr;
  }

  .admin-product {
    grid-template-columns: 68px 1fr;
  }

  .admin-product .product-photo {
    width: 68px;
    min-height: 68px;
  }

  .admin-stock-summary {
    grid-column: 2;
    justify-items: start;
    min-width: 0;
  }

  .admin-row-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
  }

  .product-photo {
    width: 68px;
  }

  .history-card {
    grid-template-columns: 1fr;
  }

  .writeoff-request-main,
  .writeoff-request-details,
  .writeoff-request-actions {
    grid-template-columns: 1fr;
  }

  .writeoff-request-main .badge {
    width: fit-content;
  }

  .receipt-meta-form {
    grid-template-columns: 1fr;
  }

  .receipt-manual-fields {
    grid-template-columns: 1fr;
  }

  .receipt-cart-panel {
    grid-template-columns: 1fr;
  }

  .category-card {
    min-height: 68px;
    padding: 0 14px;
  }

  .category-card > span {
    font-size: 21px;
  }

  .category-card small {
    font-size: 16px;
  }

  .order-category-list summary {
    min-height: 66px;
    padding: 0 14px;
  }

  .order-category-list summary span {
    font-size: 21px;
  }

  .order-category-list summary small {
    font-size: 16px;
  }

  .form-grid,
  .admin-actions {
    grid-template-columns: 1fr;
  }
}
