:root {
  color-scheme: dark;
  --bg: #090d12;
  --panel: #10161d;
  --panel-2: #151d26;
  --line: #26313d;
  --line-soft: #1c2630;
  --text: #edf2f7;
  --muted: #8fa0b2;
  --soft: #c8d2dc;
  --accent: #4ecdc4;
  --accent-2: #78a6ff;
  --danger: #ff6b6b;
  --warning: #f8c14a;
  --ok: #4fd177;
  --shadow: 0 18px 60px rgba(0, 0, 0, .35);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  min-height: 100%;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, rgba(78, 205, 196, .06), transparent 260px),
    var(--bg);
  color: var(--text);
  letter-spacing: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  border-right: 1px solid var(--line-soft);
  background: rgba(9, 13, 18, .88);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  margin-bottom: 34px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--accent);
  color: #071012;
  font-weight: 800;
}

.brand small,
.eyebrow,
.muted,
.orders-table small,
.shipment small {
  display: block;
  color: var(--muted);
}

.sidebar nav {
  display: grid;
  gap: 6px;
}

.sidebar nav a,
.mobile-nav a {
  color: var(--soft);
  border-radius: 8px;
}

.sidebar nav a {
  padding: 11px 12px;
}

.sidebar nav a.active,
.sidebar nav a:hover,
.mobile-nav a.active {
  background: var(--panel-2);
  color: var(--text);
}

.main {
  min-width: 0;
  padding: 26px;
  padding-bottom: 96px;
}

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

.topbar h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
}

.eyebrow {
  margin: 0 0 7px;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

.top-actions {
  display: flex;
  gap: 10px;
}

.button {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-2);
  font: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.button.primary {
  background: var(--accent);
  color: #071012;
  border-color: transparent;
  font-weight: 700;
}

.button.danger-button {
  border-color: rgba(255, 107, 107, .42);
  color: #ffd6d6;
  background: rgba(255, 107, 107, .1);
}

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

.app-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding: 20px 0 0;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
}

.build-info {
  color: var(--soft);
  font-variant-numeric: tabular-nums;
}

.build-info-button {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.build-info-button:hover {
  color: var(--text);
}

.changelog-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, .66);
}

.changelog-modal[hidden] {
  display: none;
}

.changelog-dialog {
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.changelog-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.icon-button {
  width: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-2);
  font: inherit;
  font-size: 1.1rem;
  cursor: pointer;
}

.changelog-body {
  overflow: auto;
  padding: 18px;
  display: grid;
  gap: 16px;
}

.changelog-entry {
  display: grid;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.changelog-entry:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.changelog-entry header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: baseline;
}

.changelog-entry h3 {
  margin: 0 0 8px;
}

.changelog-entry time {
  color: var(--muted);
  font-size: .9rem;
}

.changelog-entry ul {
  margin: 0;
  padding-left: 18px;
}

.changelog-entry li {
  color: var(--soft);
  margin: 6px 0;
}

.changelog-tag {
  display: inline-flex;
  width: fit-content;
  min-height: 26px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  font-size: .78rem;
}

.metric-grid,
.module-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric,
.panel,
.module,
.print-card,
.shipment {
  background: rgba(16, 22, 29, .92);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  min-height: 100px;
  padding: 15px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 12px;
  font-size: 25px;
  line-height: 1.1;
}

.metric.warning {
  border-color: rgba(248, 193, 74, .35);
}

.panel {
  padding: 18px;
  margin-bottom: 16px;
}

.panel.danger {
  border-color: rgba(255, 107, 107, .45);
}

.panel h2,
.module h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.panel p,
.module p {
  color: var(--muted);
  margin: 0;
}

.status-panel,
.section-head,
.order-layout {
  display: grid;
  gap: 16px;
}

.status-panel {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  align-items: start;
}

.status-list {
  display: grid;
  gap: 8px;
}

.status-list span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--soft);
}

.customer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.address-warning-panel {
  border-color: rgba(248, 193, 74, .55);
  background: linear-gradient(135deg, rgba(248, 193, 74, .12), rgba(16, 22, 29, .92) 42%);
}

.address-warning-content {
  margin: 12px 0 0;
  padding: 14px;
  border: 1px solid rgba(248, 193, 74, .28);
  border-radius: 8px;
  background: rgba(9, 13, 18, .52);
  color: var(--text);
  font: inherit;
  line-height: 1.45;
  white-space: pre-wrap;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.login-shell {
  width: min(520px, 100%);
}

.login-panel {
  display: grid;
  gap: 18px;
}

.login-panel h1 {
  margin: 0;
  font-size: clamp(34px, 9vw, 58px);
  line-height: 1;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 7px;
}

.login-form span,
.login-note {
  color: var(--muted);
}

.login-form input {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-2);
  font: inherit;
}

.login-alert {
  padding: 12px 14px;
  border: 1px solid rgba(78, 205, 196, .45);
  border-radius: 8px;
  background: rgba(78, 205, 196, .08);
}

.login-alert.danger {
  border-color: rgba(255, 107, 107, .55);
  background: rgba(255, 107, 107, .1);
}

.shipping-address-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.shipping-address-card {
  display: grid;
  gap: 7px;
  padding: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
}

.shipping-address-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.shipping-address-card span,
.shipping-address-card small {
  color: var(--muted);
}

.shipping-address-merge-form {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.shipping-address-merge-form .button,
.shipping-address-merge-form .select-control {
  width: 100%;
}

.section-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  margin-bottom: 14px;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 -4px;
  padding: 0 4px;
}

.orders-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px;
}

.orders-table th {
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.table-tools {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 10px;
}

.filter-bar {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}

.filter-bar label {
  display: grid;
  gap: 6px;
  min-width: 180px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.filter-bar .muted {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.table-filter {
  max-width: 340px;
}

.table-sort {
  width: 100%;
  min-height: 32px;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  text-transform: inherit;
  cursor: pointer;
}

th[data-sort-direction="asc"] .table-sort::after {
  content: " ▲";
}

th[data-sort-direction="desc"] .table-sort::after {
  content: " ▼";
}

.orders-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}

.orders-table tbody tr {
  cursor: pointer;
}

.orders-table tbody tr:hover {
  background: rgba(255, 255, 255, .025);
}

.status-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.status-chips span,
.pill,
.lock,
.count {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-chips.large span {
  min-height: 34px;
  padding: 0 12px;
}

.status-chips .ok {
  background: rgba(79, 209, 119, .14);
  color: var(--ok);
}

.status-chips .todo {
  background: rgba(248, 193, 74, .12);
  color: var(--warning);
}

.pill,
.lock,
.count {
  background: var(--panel-2);
  color: var(--soft);
}

.note-badge {
  display: block;
  max-width: 280px;
  padding: 9px 10px;
  border: 1px solid rgba(248, 193, 74, .38);
  border-radius: 8px;
  background: rgba(248, 193, 74, .11);
  color: #ffe3a1;
  font-size: 13px;
  line-height: 1.35;
}

.customer-note-panel {
  border-color: rgba(248, 193, 74, .45);
  background: linear-gradient(180deg, rgba(248, 193, 74, .08), rgba(16, 22, 29, .92));
}

.customer-note {
  color: var(--text) !important;
  font-size: 16px;
  line-height: 1.55;
}

.order-note-form,
.legacy-info-list,
.note-block {
  display: grid;
  gap: 10px;
}

.order-note-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}

.order-note-form .button {
  grid-column: 1 / -1;
  width: 100%;
}

.legacy-info-list,
.note-block {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(248, 193, 74, .28);
  border-radius: 8px;
  background: rgba(248, 193, 74, .08);
}

.legacy-info-list strong,
.note-block strong {
  color: var(--text);
}

.set-review-panel,
.success-panel {
  border-color: rgba(78, 205, 196, .38);
}

.workflow-panel {
  border-color: rgba(78, 205, 196, .24);
}

.workflow-actions,
.document-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.document-panel {
  border-color: rgba(248, 193, 74, .24);
}

.workflow-action,
.document-action {
  min-width: 0;
}

.workflow-action .button,
.document-action .button {
  width: 100%;
  min-height: 46px;
  text-align: center;
}

.workflow-action .button,
.workflow-action .button:disabled {
  cursor: pointer;
}

.document-actions {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.document-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.document-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
}

.document-card span {
  color: var(--muted);
  font-size: 13px;
}

.shipment-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 16px;
}

.shipment-form .button,
.shipment-form .check-control {
  width: 100%;
}

.item-form {
  display: grid;
  grid-template-columns: minmax(120px, .7fr) minmax(260px, 1.6fr) repeat(2, minmax(170px, 1fr)) minmax(90px, .45fr);
  gap: 12px;
  align-items: end;
  margin: 14px 0 16px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(21, 29, 38, .58);
}

.form-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.item-type-field {
  grid-column: span 1;
}

.item-title-field {
  grid-column: span 2;
}

.item-option-field {
  grid-column: span 1;
}

.item-qty-field,
.item-tax-field {
  grid-column: span 1;
}

.item-price-field {
  grid-column: span 1;
}

.item-form .button {
  width: 100%;
  align-self: end;
}

.panel-toggle-button {
  margin: 0 0 12px;
}

.panel-action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}

.panel-action-row .panel-toggle-button {
  margin: 0;
}

.collapsible-panel {
  margin-bottom: 14px;
}

.collapsible-panel[hidden] {
  display: none;
}

.item-summary-row {
  outline: none;
}

.item-summary-row:hover,
.item-summary-row:focus-visible,
.item-summary-row.is-open {
  background: rgba(78, 205, 196, .055);
}

.item-summary-row:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(78, 205, 196, .48);
}

.item-summary-row td:first-child strong::after {
  content: "Bearbeiten";
  display: inline-flex;
  margin-left: 8px;
  padding: 3px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  vertical-align: middle;
}

.item-summary-row.is-open td:first-child strong::after {
  content: "Geöffnet";
  color: var(--accent);
  border-color: rgba(78, 205, 196, .32);
}

.item-edit-toggle {
  margin-bottom: 8px;
  width: 100%;
}

.item-edit-row td {
  padding-top: 0;
  background: rgba(78, 205, 196, .035);
}

.item-edit-row[hidden] {
  display: none;
}

.item-edit-form {
  display: grid;
  grid-template-columns: minmax(110px, .7fr) minmax(220px, 1.7fr) repeat(2, minmax(150px, 1fr)) repeat(4, minmax(92px, .65fr)) minmax(120px, .8fr);
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid rgba(78, 205, 196, .2);
  border-radius: 8px;
  background: rgba(21, 29, 38, .48);
}

.item-edit-form .button {
  width: 100%;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 14px;
}

.customer-edit-panel {
  border-color: rgba(78, 205, 196, .24);
}

.customer-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

.customer-form .button,
.customer-form .textarea-control {
  grid-column: 1 / -1;
}

.manual-order-form {
  display: grid;
  gap: 16px;
}

.form-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(21, 29, 38, .58);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.form-section h2 {
  margin-bottom: 0;
}

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

.selected-customer {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(78, 205, 196, .34);
  border-radius: 8px;
  background: rgba(78, 205, 196, .08);
}

.selected-customer span {
  color: var(--muted);
  font-size: 13px;
}

.customer-choice-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  padding-right: 2px;
}

.customer-choice {
  min-height: 72px;
  display: grid;
  gap: 5px;
  justify-items: start;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-2);
  font: inherit;
  text-align: left;
}

.customer-choice.active {
  border-color: rgba(78, 205, 196, .55);
  background: rgba(78, 205, 196, .1);
}

.customer-choice span {
  color: var(--muted);
  font-size: 13px;
}

.mail-panel {
  border-color: rgba(78, 205, 196, .24);
}

.mail-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.mail-card {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
}

.mail-card span {
  color: var(--muted);
  font-size: 13px;
}

.review-form {
  display: grid;
  gap: 14px;
}

.discount-code-form,
.discount-code-edit-form,
.discount-apply-form {
  display: grid;
  gap: 12px;
}

.discount-code-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

.discount-code-form .discount-category-field,
.discount-code-form .button {
  grid-column: 1 / -1;
}

.discount-code-list {
  display: grid;
  gap: 12px;
}

.discount-code-card {
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-2);
}

.discount-code-card-head,
.discount-switches {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.discount-code-card-head span {
  display: block;
  color: var(--muted);
}

.category-check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.discount-apply-form {
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: end;
  margin-bottom: 12px;
}

.field-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.select-control {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
}

.text-control {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
}

.textarea-control {
  width: 100%;
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  padding: 12px;
  font: inherit;
  resize: vertical;
}

.check-control {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--soft);
}

.review-warning {
  padding: 11px 12px;
  border: 1px solid rgba(248, 193, 74, .4);
  border-radius: 8px;
  background: rgba(248, 193, 74, .1);
  color: #ffe3a1;
}

.subitem-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.subitem-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

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

.module {
  position: relative;
  padding: 17px;
}

.module span {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--warning);
  margin-bottom: 15px;
}

.module.ready span {
  background: var(--ok);
}

.order-layout {
  grid-template-columns: 1.35fr .9fr;
}

.address {
  white-space: pre-line;
  display: grid;
  gap: 4px;
}

.contact {
  margin-top: 12px !important;
}

.shipment-grid,
.print-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.shipment,
.print-card {
  padding: 14px;
}

.shipment span,
.print-card span {
  display: block;
  color: var(--soft);
  margin: 7px 0;
}

.empty {
  color: var(--muted);
  padding: 18px;
}

.mobile-nav {
  display: none;
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .module-grid,
  .shipment-form,
  .customer-form,
  .item-form,
  .discount-code-form,
  .customer-choice-list,
  .form-grid,
  .shipment-grid,
  .print-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .item-title-field,
  .item-form .button,
  .discount-code-form .button {
    grid-column: 1 / -1;
  }

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

  .item-edit-form .item-title-field,
  .item-edit-form .button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 840px) {
  body {
    background: var(--bg);
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 16px;
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
  }

  .topbar {
    align-items: flex-start;
  }

  .top-actions {
    display: none;
  }

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

  .metric {
    min-height: 88px;
  }

  .metric strong {
    font-size: 21px;
  }

  .status-panel,
  .section-head,
  .order-layout,
  .module-grid,
  .workflow-actions,
  .document-actions,
  .document-card,
  .shipment-form,
  .customer-form,
  .order-note-form,
  .item-form,
  .discount-code-form,
  .discount-apply-form,
  .search-form,
  .customer-choice-list,
  .form-grid,
  .shipment-grid,
  .print-grid {
    grid-template-columns: 1fr;
  }

  .form-field,
  .item-title-field,
  .item-form .button {
    grid-column: 1 / -1;
  }

  .item-edit-row td {
    padding: 8px 0 12px;
  }

  .item-edit-form {
    grid-template-columns: 1fr;
  }

  .item-edit-form .form-field,
  .item-edit-form .item-title-field,
  .item-edit-form .button {
    grid-column: 1 / -1;
  }

  .orders-table,
  .orders-table thead,
  .orders-table tbody,
  .orders-table tr,
  .orders-table td {
    display: block;
  }

  .orders-table {
    min-width: 0;
  }

  .table-tools {
    justify-content: stretch;
  }

  .table-filter {
    max-width: none;
  }

  .orders-table thead {
    display: none;
  }

  .orders-table tr {
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--panel-2);
  }

  .orders-table td {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 10px;
    padding: 7px 0;
    border: 0;
  }

  .orders-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    align-self: start;
  }

  .mobile-nav {
    position: fixed;
    z-index: 10;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(16, 22, 29, .94);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
  }

  .mobile-nav a {
    min-height: 44px;
    display: grid;
    place-items: center;
    color: var(--soft);
    font-size: 13px;
    font-weight: 700;
  }
}

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

  .panel {
    padding: 14px;
  }

  .orders-table td {
    grid-template-columns: 92px minmax(0, 1fr);
  }
}
