:root {
  color-scheme: light;
  --bg: #eef4f7;
  --surface: #ffffff;
  --sheet: #ffffff;
  --ink: #111318;
  --muted: #626b76;
  --line: #111318;
  --hairline: #d7dee4;
  --red: #ed001c;
  --blue: #0956a4;
  --cyan: #28aee4;
  --black: #050608;
  --button: #111318;
  --button-muted: #eef1f4;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(40, 174, 228, 0.12), transparent 32%),
    linear-gradient(315deg, rgba(237, 0, 28, 0.08), transparent 34%),
    var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1280px, calc(100% - 24px));
  margin: 0 auto;
  padding: 20px 0 32px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(17, 19, 24, 0.12);
}

.brand-lockup {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 14px;
}

.brand-badge {
  position: relative;
  width: 172px;
  height: 58px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 6px;
  background: var(--red);
  box-shadow: 0 10px 22px rgba(237, 0, 28, 0.2);
}

.brand-badge img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  padding: 8px 10px;
}

.brand-kicker {
  margin: 0 0 3px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.toolbar h1 {
  margin: 0;
  font-size: clamp(1.55rem, 2.6vw, 2.35rem);
  line-height: 1.03;
  letter-spacing: 0;
}

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

.button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--button);
  color: #fff;
  padding: 0 17px;
  font-weight: 900;
  letter-spacing: 0;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(17, 19, 24, 0.16);
}

.button:hover {
  background: #2a3038;
}

.button:nth-child(1) {
  background: var(--red);
}

.button:nth-child(1):hover {
  background: #b91916;
}

.button:nth-child(2) {
  background: var(--blue);
}

.button:nth-child(2):hover {
  background: #073f78;
}

.button:nth-child(3) {
  background: var(--cyan);
  color: var(--black);
}

.button:nth-child(3):hover {
  background: #1598cc;
}

.button:nth-child(4) {
  background: #27313c;
}

.button:nth-child(4):hover {
  background: #384654;
}

.button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(40, 174, 228, 0.36);
  outline-offset: 2px;
}

.button-muted {
  background: var(--button-muted);
  border-color: #cbd4dd;
  color: var(--ink);
  box-shadow: none;
}

.button-muted:hover {
  background: #dde5ec;
}

.sheet-wrap {
  overflow-x: auto;
  padding: 2px 0 10px;
}

.order-sheet {
  min-width: 1040px;
  overflow: hidden;
  background: var(--sheet);
  border: 1px solid #0d1014;
  border-radius: 6px;
  box-shadow: 0 22px 52px rgba(17, 19, 24, 0.16);
}

.sheet-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 64px;
  padding: 0 18px;
  background:
    linear-gradient(90deg, var(--red) 0 280px, #fff 280px 100%),
    #fff;
  border-bottom: 1px solid var(--line);
}

.sheet-logo {
  width: 210px;
  height: 46px;
  display: block;
  object-fit: contain;
}

.sheet-title {
  color: var(--black);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.order-head {
  display: grid;
  grid-template-columns: minmax(220px, 0.95fr) minmax(0, 3.05fr);
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.field {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 68px;
  gap: 12px;
  padding: 10px 16px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.field + .field {
  border-left: 1px solid var(--line);
}

.field span {
  color: #323944;
  font-size: 0.78rem;
  letter-spacing: 0.11em;
  white-space: nowrap;
}

.field input {
  width: 100%;
  border: 0;
  border-bottom: 2px solid #d6dce2;
  background: transparent;
  color: var(--ink);
  padding: 8px 4px;
  font-weight: 900;
  text-transform: uppercase;
}

.field input::placeholder {
  color: #a5adb6;
}

.field input:focus {
  border-bottom-color: var(--red);
}

.order-grid {
  display: grid;
  grid-template-columns:
    minmax(185px, 1.15fr)
    minmax(108px, 0.48fr)
    minmax(350px, 2fr)
    minmax(108px, 0.48fr);
  background: #c7d0d8;
  gap: 1px;
}

.cell {
  min-height: 48px;
  display: flex;
  align-items: center;
  background: var(--sheet);
  padding: 7px 12px;
}

.cell.header {
  min-height: 50px;
  background: var(--black);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cell.header.qty-header {
  justify-content: center;
  background: var(--red);
  color: #fff;
}

.cell.product {
  position: relative;
  background: #fff;
  color: #121821;
  font-size: clamp(0.98rem, 1.45vw, 1.18rem);
  font-weight: 900;
  line-height: 1.12;
  text-transform: uppercase;
}

.cell.product::before {
  content: "";
  width: 4px;
  height: 26px;
  flex: 0 0 auto;
  margin-right: 10px;
  border-radius: 999px;
  background: var(--blue);
}

.cell.product[data-category="fresh"]::before {
  background: var(--cyan);
}

.cell.product[data-category="energy"]::before {
  background: var(--red);
}

.cell.product[data-category="vitalia"]::before {
  background: #7a838c;
}

.cell.qty {
  padding: 0;
  background: #f7fbff;
}

.cell.qty input {
  width: 100%;
  height: 100%;
  min-height: 48px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 6px 10px;
  font-size: 1.16rem;
  font-weight: 900;
  text-align: center;
}

.cell.qty input:focus {
  background: #eaf8fd;
}

.left-qty {
  box-shadow: inset -4px 0 0 rgba(17, 19, 24, 0.08);
}

.right-qty {
  box-shadow: inset 4px 0 0 rgba(237, 0, 28, 0.08);
}

.desktop-only,
.mobile-side {
  display: contents;
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 14px, 680px);
    padding-top: 10px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .brand-badge {
    width: 146px;
    height: 52px;
  }

  .brand-badge img {
    padding: 8px 9px;
  }

  .toolbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .button {
    width: 100%;
    padding: 0 12px;
  }

  .sheet-wrap {
    overflow: visible;
  }

  .order-sheet {
    min-width: 0;
    border-radius: 6px;
  }

  .sheet-brand {
    min-height: 54px;
    background: linear-gradient(90deg, var(--red) 0 62%, #fff 62% 100%);
    padding: 0 10px;
  }

  .sheet-logo {
    width: 138px;
    height: 38px;
  }

  .sheet-title {
    font-size: 0.74rem;
    letter-spacing: 0.1em;
  }

  .order-head {
    grid-template-columns: 1fr;
  }

  .field + .field {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .field {
    min-height: 62px;
    grid-template-columns: 82px 1fr;
    padding: 8px 10px;
  }

  .order-grid {
    display: block;
    background: #d5dde4;
  }

  .desktop-only {
    display: none;
  }

  .mobile-side {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px;
    min-height: 54px;
    border-bottom: 1px solid #c3ccd5;
  }

  .mobile-side + .mobile-side {
    border-top: 0;
  }

  .right-side {
    border-top: 3px solid var(--black);
  }

  .right-side ~ .right-side {
    border-top: 0;
  }

  .empty-side {
    display: none;
  }

  .cell {
    min-height: 54px;
    border: 0;
    grid-column: auto !important;
    grid-row: auto !important;
  }

  .cell.product {
    min-width: 0;
    font-size: 0.98rem;
    padding: 9px;
  }

  .cell.product::before {
    width: 4px;
    height: 24px;
    margin-right: 8px;
  }

  .cell.qty {
    border-left: 1px solid #c7d0d8;
  }

  .cell.qty input {
    min-height: 54px;
    font-size: 1rem;
  }
}

@media print {
  body {
    background: #fff;
  }

  .toolbar {
    display: none;
  }

  .app-shell {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .sheet-wrap {
    overflow: visible;
    padding: 0;
  }

  .order-sheet {
    min-width: 0;
    width: 100%;
    border-radius: 0;
    box-shadow: none;
    break-inside: avoid;
  }

  .sheet-brand {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .order-head {
    grid-template-columns: minmax(220px, 0.95fr) minmax(0, 3.05fr);
  }

  .order-grid {
    display: grid;
    grid-template-columns:
      minmax(150px, 1.15fr)
      minmax(80px, 0.48fr)
      minmax(250px, 2fr)
      minmax(80px, 0.48fr);
    gap: 1px;
  }

  .desktop-only {
    display: contents;
  }

  .mobile-row,
  .mobile-side {
    display: contents;
  }

  .cell {
    min-height: 35px;
    padding: 5px 8px;
  }

  .cell.product {
    font-size: 0.9rem;
  }

  .cell.product::before {
    width: 4px;
    height: 20px;
    margin-right: 7px;
  }

  .cell.qty input {
    min-height: 35px;
    font-size: 0.98rem;
  }

  @page {
    size: A4 portrait;
    margin: 8mm;
  }
}
