:root {
  --ink: #15171a;
  --muted: #68717c;
  --line: #dfe5ea;
  --paper: #f6f8f9;
  --white: #ffffff;
  --orange: #f47b20;
  --teal: #0d9b8e;
  --blue: #285e9e;
  --green: #4f8f36;
  --danger: #c13c36;
  --shadow: 0 18px 50px rgba(22, 27, 32, .12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

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

button,
.button {
  border: 0;
  border-radius: 7px;
  background: var(--orange);
  color: #fff;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}

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

.ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 42px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  color: var(--ink);
}

.checkbox-label input {
  width: 18px;
  min-height: 18px;
  padding: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h3 {
  line-height: 1.2;
}

#view {
  min-width: 0;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 1.15fr) minmax(320px, 440px);
  align-items: center;
  gap: 34px;
  padding: 42px;
  background:
    linear-gradient(110deg, #ffffff 0%, #ffffff 55%, #edf3f6 55%, #edf3f6 100%);
}

.login-visual {
  min-height: 540px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 45% 38%, #fff 0%, #fff 45%, #e8eef1 100%);
  border: 1px solid #e7ecef;
  border-radius: 8px;
  overflow: hidden;
}

.login-visual img {
  width: min(760px, 95%);
  max-height: 500px;
  object-fit: contain;
  filter: drop-shadow(0 20px 28px rgba(10, 15, 18, .16));
}

.login-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 30px;
  box-shadow: var(--shadow);
}

.login-logo {
  width: 260px;
  max-width: 100%;
  margin-bottom: 18px;
}

.login-panel h1 {
  font-size: 28px;
  line-height: 1.1;
  margin-bottom: 24px;
}

#loginForm,
.stack {
  display: grid;
  gap: 14px;
}

.demo-logins {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.demo-logins button {
  background: #eef4f5;
  color: var(--ink);
  min-height: 50px;
  padding: 6px 8px;
  font-size: 13px;
  flex-direction: column;
  gap: 2px;
  line-height: 1.15;
}

.demo-logins button span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  width: 210px;
  max-width: 100%;
  padding: 8px;
}

nav {
  display: grid;
  gap: 6px;
  flex: 1;
  align-content: start;
}

nav button {
  background: transparent;
  color: var(--ink);
  justify-content: space-between;
  border-radius: 7px;
  min-height: 40px;
}

nav button.active {
  background: #fff1e8;
  color: #9b430d;
}

nav b {
  background: var(--teal);
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 12px;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 22px;
}

.topbar p {
  color: var(--muted);
  margin-bottom: 4px;
  font-size: 14px;
}

.topbar h2 {
  margin-bottom: 0;
  font-size: 28px;
}

.quick-search {
  width: min(360px, 42vw);
}

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

.report-stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.compact-stats {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin: 10px 0 0;
}

.compact-stats .stat {
  min-height: 86px;
  padding: 12px;
}

.compact-stats .stat strong {
  font-size: 22px;
}

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

.stat {
  padding: 18px;
  border-top: 4px solid var(--teal);
}

.stat:nth-child(2) {
  border-top-color: var(--orange);
}

.stat:nth-child(3) {
  border-top-color: var(--blue);
}

.stat:nth-child(4) {
  border-top-color: var(--green);
}

.stat small {
  color: var(--muted);
  display: block;
  margin-bottom: 10px;
}

.stat strong {
  font-size: 28px;
}

button.report-stat {
  display: block;
  width: 100%;
  min-height: 118px;
  padding: 18px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  justify-content: flex-start;
  align-items: flex-start;
}

button.report-stat small {
  color: var(--muted);
}

button.report-stat.active {
  background: #fbfefd;
  box-shadow: 0 0 0 3px rgba(13, 155, 142, .14);
}

button.report-stat:hover {
  border-color: #bac8cf;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

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

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

.between {
  justify-content: space-between;
}

.wrap {
  flex-wrap: wrap;
}

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

.empty {
  padding: 22px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
}

.empty.small {
  padding: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 11px 9px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.category-section,
.cart-category {
  display: grid;
  gap: 12px;
  margin: 18px 0 24px;
}

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

.category-title h3 {
  margin-bottom: 0;
}

.category-title span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafb;
  color: var(--muted);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

.category-manager {
  margin: 14px 0 18px;
}

.product {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-img {
  aspect-ratio: 16 / 9;
  background: #eef4f5;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

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

.product-body {
  padding: 15px;
  flex: 1;
}

.product-body small {
  color: var(--teal);
  font-weight: 800;
}

.product-body h3 {
  margin: 7px 0 4px;
}

.product footer {
  display: flex;
  gap: 8px;
  padding: 0 15px 15px;
}

.product footer:empty {
  display: none;
}

.price-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  font-size: 12px;
  margin-top: 10px;
}

.price-row span {
  background: #f3f6f7;
  border-radius: 6px;
  padding: 6px;
  text-align: center;
}

.price-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.rebate-chip {
  display: inline-flex;
  width: fit-content;
  margin: 8px 0 0;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef7f5;
  color: #0a6d64;
  font-size: 12px;
  font-weight: 800;
}

.price-tier-label {
  width: fit-content;
  margin: 7px 0 0;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.cart-totals {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.cart-totals span,
.rebate-panel strong {
  color: var(--teal);
}

.business-panel {
  margin-bottom: 18px;
}

.business-stat-grid {
  margin-bottom: 0;
}

.business-stat-grid .stat:nth-child(5) {
  border-top-color: var(--blue);
}

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.shortcut-product {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.shortcut-product button {
  grid-column: 1 / -1;
}

.shortcut-image {
  width: 78px;
  height: 64px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef4f5;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.shortcut-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.shortcut-body {
  min-width: 0;
}

.shortcut-body small,
.shortcut-body p,
.shortcut-meta span {
  color: var(--muted);
}

.shortcut-body h3,
.shortcut-body p {
  margin-bottom: 5px;
}

.shortcut-body h3 {
  font-size: 16px;
}

.shortcut-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.order-list,
.ticket-list {
  display: grid;
  gap: 14px;
}

.ticket-meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.ticket-meta span,
.service-summary {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafb;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.ticket-meta .sla-overdue {
  border-color: rgba(193, 60, 54, .35);
  background: #fff3f2;
  color: var(--danger);
}

.ticket-actions {
  margin-top: 12px;
}

.service-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, max-content)) 1fr;
  gap: 10px;
  align-items: center;
  margin: 12px 0;
}

.service-summary p {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
}

.history-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  margin: 12px 0 16px;
}

.history-filters button {
  white-space: nowrap;
}

.compact-order {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.compact-order h3,
.compact-order p {
  margin-bottom: 8px;
}

.compact-order-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compact-order-summary span {
  display: inline-flex;
  gap: 5px;
  align-items: baseline;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafb;
  color: var(--muted);
  font-size: 13px;
}

.compact-order-summary strong {
  color: var(--ink);
}

.order-approval {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.order-approval span,
.delivery-done {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafb;
  color: var(--muted);
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
}

.order-trail {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  background: #fbfcfd;
}

.order-trail h4 {
  margin: 0 0 4px;
}

.order-trail p {
  margin: 0;
  padding-left: 10px;
  border-left: 2px solid #d6ece9;
}

.order-trail span,
.order-trail small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.delivery-done a {
  margin-left: 8px;
  color: var(--blue);
}

.serials-panel {
  width: 100%;
  margin-top: 10px;
}

.serial-group {
  display: grid;
  gap: 10px;
  margin: 10px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.serial-group h4,
.delivered-serials h4 {
  margin: 0;
}

.serial-group h4 span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.serial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.table-scroll {
  overflow-x: auto;
}

.review-table {
  min-width: 1080px;
  table-layout: fixed;
}

.review-table th:first-child {
  width: 24%;
}

.review-table th:nth-child(2) {
  width: 7%;
}

.review-table th:nth-child(3) {
  width: 14%;
}

.review-table th:nth-child(4) {
  width: 11%;
}

.review-table th:nth-child(5) {
  width: 13%;
}

.review-table th:nth-child(6) {
  width: 13%;
}

.review-table th:nth-child(7),
.review-table th:nth-child(8) {
  width: 9%;
}

.review-table input,
.review-table select {
  min-height: 40px;
  padding: 8px 10px;
}

.review-table tr {
  transition: opacity .15s ease, background .15s ease;
}

.review-table tr.item-unavailable {
  background: #fff4f2;
  opacity: .72;
}

.review-product {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.review-product-image {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef4f5;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.review-product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.review-product small,
.order-product-preview small,
.order-product-preview span,
.current-product-image span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.link-button {
  min-height: 0;
  margin-top: 5px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  justify-content: flex-start;
}

.review-summary {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--orange);
  background: #f8fafb;
}

.review-summary-grid {
  justify-content: stretch;
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.review-summary-grid div {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.review-summary span {
  color: var(--muted);
  font-weight: 700;
}

.review-summary strong {
  min-width: 150px;
  color: var(--teal);
  font-size: 22px;
  text-align: right;
}

.order-product-preview,
.current-product-image {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  background: #f8fafb;
}

.order-product-preview img,
.current-product-image img {
  width: 96px;
  height: 72px;
  object-fit: contain;
  background: #fff;
}

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

.inline-form input {
  width: auto;
  max-width: 280px;
}

.badge {
  border-radius: 999px;
  padding: 5px 10px;
  background: #eef7f5;
  color: #0a6d64;
  font-size: 12px;
  font-weight: 800;
}

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

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

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 21, .45);
  display: grid;
  place-items: center;
  z-index: 20;
  padding: 20px;
}

.modal {
  width: min(760px, 96vw);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  position: relative;
}

.modal:has([data-review-order]) {
  width: min(1180px, 96vw);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding-right: 42px;
  margin-bottom: 14px;
}

.modal-head h3,
.modal-head p {
  margin-bottom: 6px;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  min-height: 34px;
  padding: 0;
  background: #f3f6f7;
  color: var(--ink);
}

.timeline {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.timeline p {
  border-left: 3px solid var(--orange);
  padding-left: 10px;
  margin-bottom: 0;
}

.timeline small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: var(--ink);
  color: #fff;
  border-radius: 7px;
  padding: 12px 14px;
  z-index: 30;
  box-shadow: var(--shadow);
}

.toast.bad {
  background: var(--danger);
}

code {
  background: #f3f6f7;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 5px;
}

@media (max-width: 980px) {
  .login-shell,
  .app,
  .split {
    grid-template-columns: 1fr;
  }

  .login-shell {
    padding: 18px;
    gap: 16px;
  }

  .login-visual {
    min-height: 220px;
  }

  .login-visual img {
    max-height: 210px;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .product-grid,
  .shortcut-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
  }

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

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

  .service-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  button,
  .button {
    min-height: 38px;
    padding: 8px 11px;
  }

  input,
  select,
  textarea {
    min-height: 38px;
    padding: 8px 10px;
  }

  textarea {
    min-height: 78px;
  }

  .login-shell {
    min-height: 100dvh;
    align-content: start;
    padding: 12px;
  }

  .login-visual {
    min-height: 150px;
  }

  .login-visual img {
    max-height: 150px;
  }

  .login-panel {
    padding: 18px;
  }

  .login-logo {
    width: 190px;
    margin-bottom: 12px;
  }

  .login-panel h1 {
    font-size: 23px;
    margin-bottom: 16px;
  }

  #loginForm,
  .stack {
    gap: 10px;
  }

  .app {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 12;
    padding: 8px 10px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
  }

  .brand {
    width: 104px;
    padding: 2px;
  }

  nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 2px 2px 5px;
    scrollbar-width: thin;
  }

  nav button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 7px 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  nav button b {
    margin-left: 6px;
  }

  #logoutBtn {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 13px;
  }

  .workspace {
    padding: 12px;
  }

  .topbar {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
  }

  .topbar p {
    margin-bottom: 2px;
    font-size: 12px;
  }

  .topbar h2 {
    font-size: 22px;
  }

  .quick-search {
    width: 100%;
  }

  .panel {
    padding: 12px;
  }

  .panel h3,
  .category-title h3 {
    font-size: 17px;
    margin-bottom: 8px;
  }

  .stat-grid,
  .compact-stats,
  .report-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
  }

  .stat,
  button.report-stat,
  .compact-stats .stat {
    min-height: 72px;
    padding: 10px;
  }

  .stat small {
    margin-bottom: 5px;
    font-size: 12px;
  }

  .stat strong,
  .compact-stats .stat strong {
    font-size: 20px;
  }

  .split,
  .order-list,
  .ticket-list,
  .category-section,
  .cart-category {
    gap: 10px;
    margin-bottom: 12px;
  }

  .compact-order {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .compact-order > button {
    width: 100%;
  }

  .compact-order-summary span,
  .order-approval span,
  .delivery-done,
  .ticket-meta span,
  .service-summary {
    padding: 6px 8px;
    font-size: 12px;
  }

  .ticket-meta {
    gap: 6px;
    margin: 8px 0;
  }

  .ticket-actions {
    gap: 7px;
    margin-top: 8px;
  }

  .ticket-actions button,
  .order-approval button,
  .row.wrap button {
    flex: 1 1 135px;
  }

  .product-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .product {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: stretch;
  }

  .product-img {
    aspect-ratio: auto;
    min-height: 100%;
  }

  .product-body {
    padding: 10px;
  }

  .product-body h3 {
    font-size: 16px;
    margin: 4px 0;
  }

  .product-body .muted {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .product footer {
    grid-column: 1 / -1;
    padding: 0 10px 10px;
  }

  .price-row {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .shortcut-product {
    grid-template-columns: 62px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 9px 0;
  }

  .shortcut-product button {
    grid-column: auto;
    white-space: nowrap;
  }

  .shortcut-image {
    width: 62px;
    height: 52px;
  }

  .shortcut-body h3 {
    font-size: 14px;
  }

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

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    font-size: 13px;
  }

  th,
  td {
    padding: 8px 7px;
  }

  .review-summary,
  .review-summary-grid {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: stretch;
    gap: 8px;
    padding: 10px;
  }

  .review-summary-grid div {
    justify-items: start;
  }

  .review-summary strong {
    min-width: 0;
    text-align: left;
    font-size: 20px;
  }

  .modal-backdrop {
    padding: 8px;
    align-items: start;
  }

  .modal {
    width: min(100%, 760px);
    max-height: calc(100dvh - 16px);
    padding: 14px;
  }

  .modal-head {
    display: grid;
    gap: 8px;
    padding-right: 38px;
  }
}

@media (max-width: 640px) {
  .stat-grid,
  .grid-form,
  .ticket-meta,
  .history-filters,
  .demo-logins {
    grid-template-columns: 1fr;
  }

  .row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .between {
    justify-content: space-between;
  }

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

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

  .inline-form {
    display: grid;
  }

  .inline-form input {
    width: 100%;
    max-width: none;
  }

  .order-product-preview,
  .current-product-image {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
    padding: 9px;
  }

  .order-product-preview img,
  .current-product-image img {
    width: 72px;
    height: 56px;
  }
}

@media (max-width: 420px) {
  .sidebar {
    grid-template-columns: 1fr auto;
  }

  .brand {
    width: 96px;
  }

  nav {
    grid-column: 1 / -1;
    order: 2;
  }

  .product {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .stat-grid,
  .compact-stats,
  .report-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .shortcut-product {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .shortcut-product button {
    grid-column: 1 / -1;
  }

  .shortcut-image {
    width: 54px;
    height: 48px;
  }
}
