:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --ink: #182026;
  --muted: #63717a;
  --line: #dbe2e6;
  --accent: #17706f;
  --accent-strong: #105655;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

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

.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  padding: 22px;
  width: min(100%, 360px);
}

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

.login-panel span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  min-height: 38px;
  padding: 0 10px;
}

select {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  min-height: 38px;
  padding: 0 10px;
}

input:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(23, 112, 111, 0.18);
}

select:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(23, 112, 111, 0.18);
}

.form-error {
  color: #a33030;
  font-size: 13px;
}

.form-note {
  color: var(--accent-strong);
  font-size: 13px;
}

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

.sidebar {
  background: #111820;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  padding: 20px;
  position: sticky;
  top: 0;
}

.brand-mark {
  align-items: center;
  display: flex;
  gap: 12px;
}

.mark {
  align-items: center;
  background: #f6c94c;
  border-radius: 8px;
  color: #111820;
  display: flex;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.brand-mark small,
.user-panel small,
.user-panel span {
  color: #b8c2cf;
  display: block;
}

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

.nav-item {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #d7dde5;
  min-height: 42px;
  padding: 0 12px;
  text-align: left;
}

.nav-item.active,
.nav-item:hover {
  background: #22303d;
  color: #ffffff;
}

.user-panel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  display: grid;
  gap: 7px;
  margin-top: auto;
  padding: 12px;
}

.user-panel strong {
  color: #ffffff;
}

.sidebar-secondary-button {
  background: #ffffff;
  border-color: #ffffff;
  color: #17212b;
  min-height: 32px;
  padding: 0 10px;
}

.sidebar-secondary-button:hover {
  background: #e8edf2;
  border-color: #e8edf2;
}

.sidebar-password-form {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  gap: 8px;
  padding-top: 10px;
}

.sidebar-password-form label {
  display: grid;
  gap: 4px;
}

.sidebar-password-form input {
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  color: #0d1821;
  min-height: 34px;
  padding: 0 8px;
  width: 100%;
}

.sidebar-password-form .form-error,
.sidebar-password-form .form-note {
  border-radius: 6px;
  font-size: 12px;
  margin: 0;
  padding: 7px;
}

.sidebar-password-form .form-note {
  background: rgba(55, 164, 92, 0.14);
  color: #b8f3cc;
}

.workspace {
  min-width: 0;
  padding: 28px 32px 40px;
}

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.15;
}

h2 {
  font-size: 17px;
  line-height: 1.2;
}

p {
  color: var(--muted);
  margin-top: 5px;
}

button {
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  min-height: 38px;
  padding: 0 14px;
}

button:hover {
  background: var(--accent-strong);
}

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

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.metric,
.panel,
.row {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric {
  padding: 14px;
}

.metric strong {
  display: block;
  font-size: 26px;
  line-height: 1;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.grid.orders-only {
  grid-template-columns: 1fr;
}

.dashboard-notifications-panel {
  grid-column: 1 / -1;
}

.panel {
  min-width: 0;
  overflow: hidden;
}

.panel-header {
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.order-list-header {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(120px, auto) 1fr;
}

.order-filters {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(150px, 1fr) minmax(120px, 150px) minmax(120px, 150px);
}

.order-filters label {
  display: grid;
  gap: 5px;
}

.order-filters span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.list-summary {
  color: var(--muted);
  font-size: 12px;
  padding: 10px 12px 0;
}

.list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.brand-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.brand-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 16px;
  text-align: left;
}

.brand-card:hover {
  background: #f8fbfb;
  border-color: var(--accent);
}

.brand-card strong {
  font-size: 20px;
}

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

.row {
  display: grid;
  gap: 5px;
  padding: 12px;
}

.row-button {
  color: inherit;
  text-align: left;
  width: 100%;
}

button.row-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  min-height: 0;
  padding: 12px;
}

button.row-button:hover {
  border-color: var(--accent);
  background: #f8fbfb;
}

.order-link {
  border-left-width: 5px;
}

.order-link.order-status-draft {
  background: #f4f6f8;
  border-color: #c8d0d7;
}

button.order-link.order-status-draft:hover {
  background: #eef2f5;
}

.order-link.order-status-in-progress {
  background: #eff8ff;
  border-color: #2e90fa;
}

button.order-link.order-status-in-progress:hover {
  background: #e1f0ff;
}

.order-link.order-status-in-progress .row-title {
  color: #175cd3;
}

.order-link.order-status-ready {
  background: #ecfdf3;
  border-color: #12b76a;
}

button.order-link.order-status-ready:hover {
  background: #dcfae6;
}

.order-link.order-status-ready .row-title {
  color: #067647;
}

.order-link.order-status-completed {
  background: #e7f4ec;
  border-color: #087443;
}

button.order-link.order-status-completed:hover {
  background: #d8eee2;
}

.order-link.order-status-completed .row-title {
  color: #075f3a;
}

.order-link.order-status-cancelled {
  background: #fff1f0;
  border-color: #f04438;
}

button.order-link.order-status-cancelled:hover {
  background: #ffe4e1;
}

.order-link.order-status-cancelled .row-title {
  color: #b42318;
}

.order-link.order-status-trash {
  background: #fff7f7;
  border-color: #d92d20;
}

button.order-link.order-status-trash:hover {
  background: #fff1f0;
}

.order-link.order-status-trash .row-title {
  color: #b42318;
}

.order-link:hover,
button.order-link:hover {
  filter: saturate(1.05);
}

.order-row {
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
}

.order-row.is-trash {
  background: #fff7f7;
}

.order-row-main {
  background: transparent;
  border: 0;
  color: inherit;
  display: grid;
  gap: 5px;
  min-height: 0;
  padding: 0;
  text-align: left;
}

.order-row-main:hover {
  background: transparent;
  color: inherit;
}

.order-row-actions {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.order-row-actions button {
  min-height: 34px;
  white-space: nowrap;
}

.notification-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.notification-row {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: 8px;
  color: inherit;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 0;
  padding: 12px;
  text-align: left;
}

.notification-open {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 42px;
  padding: 0;
  text-align: left;
  width: 100%;
}

.notification-row:hover,
.notification-open:hover {
  background: #f8fbfb;
}

.notification-row.is-read {
  opacity: 0.72;
}

.notification-row.is-unread {
  box-shadow: inset 0 0 0 1px rgba(20, 124, 118, 0.08);
}

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

.notification-actions button {
  min-height: 34px;
  white-space: nowrap;
}

.notification-delete {
  min-height: 34px;
  white-space: nowrap;
}

.notification-row.status-about-to-close {
  border-left-color: #d97706;
}

.notification-row.status-closed {
  border-left-color: #dc2626;
}

.notification-main,
.notification-context {
  display: grid;
  gap: 4px;
}

.notification-main span,
.notification-context small {
  color: var(--muted);
  font-size: 13px;
}

.notification-context {
  justify-items: end;
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
}

.row-title {
  font-weight: 700;
}

.row-meta {
  color: var(--muted);
  font-size: 13px;
}

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

.detail-panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  margin-top: 0;
  overflow: visible;
}

.brand-workspace {
  margin-bottom: 16px;
}

.brand-workspace-body {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr 1fr;
  padding: 14px;
}

.brand-order-context {
  background: #f8fbfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  grid-column: 1 / -1;
  padding: 10px;
}

.brand-order-context span {
  color: var(--muted);
  font-size: 12px;
}

.brand-tabs {
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  grid-column: 1 / -1;
}

.brand-tabs button {
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  color: var(--muted);
  min-height: 34px;
  padding: 0 10px;
}

.brand-tabs button:hover,
.brand-tabs button.selected {
  background: transparent;
  border-bottom-color: var(--accent);
  color: var(--ink);
}

.section-heading {
  align-items: end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.section-heading h2 {
  margin-top: 4px;
}

.section-heading span {
  color: var(--muted);
  font-size: 12px;
}

.back-button {
  background: transparent;
  border: 0;
  color: var(--accent);
  min-height: 28px;
  padding: 0;
}

.back-button:hover {
  background: transparent;
  color: var(--accent-strong);
}

.shop-context-line {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.brand-shop-list {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.shop-db-row {
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--line);
  border-radius: 8px;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 8px;
  min-height: 104px;
  padding: 14px;
  text-align: left;
}

.shop-db-row:hover,
.shop-db-row.selected {
  background: #f8fbfb;
  border-color: var(--accent);
}

.shop-db-row.selected {
  border-left-color: var(--accent);
}

.shop-db-row.archived {
  opacity: 0.68;
}

.shop-db-row span {
  color: var(--muted);
  font-size: 12px;
}

.workspace-search {
  display: grid;
  gap: 5px;
  margin-bottom: 8px;
}

.workspace-search span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.workspace-check {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  margin: -2px 0 8px;
}

.workspace-check input {
  min-height: 0;
}

.workspace-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  margin: 0 0 8px;
}

.import-card {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 320px) auto;
  margin: 0 0 12px;
  padding: 14px;
}

.import-card div:first-child {
  display: grid;
  gap: 6px;
}

.import-card strong,
.import-card label span {
  font-weight: 700;
}

.import-card span,
.import-card small {
  color: var(--muted);
  font-size: 12px;
}

.import-card label {
  display: grid;
  gap: 5px;
}

.import-card .form-error,
.import-card .form-note {
  grid-column: 1 / -1;
}

.brand-shop-form,
.brand-order-form,
.selected-shop-form {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(120px, 1fr) minmax(100px, 0.8fr) auto auto;
  margin-bottom: 8px;
}

.brand-shop-form label,
.brand-order-form label,
.selected-shop-form label {
  display: grid;
  gap: 5px;
}

.brand-shop-form span,
.brand-order-form span,
.selected-shop-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.brand-shop-form .form-error,
.brand-order-form .form-error,
.selected-shop-form .form-error {
  grid-column: 1 / -1;
}

.brand-order-filters {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(140px, 1fr) minmax(120px, 160px);
  margin-bottom: 8px;
}

.brand-order-filters label {
  display: grid;
  gap: 5px;
}

.brand-order-filters span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.shop-lightbox-section,
.brand-parameters-section,
.brand-audit-section {
  grid-column: 1 / -1;
}

.brand-visual-form,
.brand-visual-list {
  max-width: 620px;
}

.parameters-page {
  margin-bottom: 16px;
}

.parameters-body {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.parameters-body h3 {
  margin: 0 0 6px;
}

.muted-line {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 12px;
}

.parameter-grid {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.parameter-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 8px;
  min-height: 230px;
  min-width: 0;
  padding: 12px;
}

.parameter-card h3 {
  font-size: 13px;
}

.parameter-values {
  display: grid;
  gap: 6px;
}

.parameter-value {
  align-items: center;
  background: #eef3f4;
  border-radius: 6px;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr auto;
  min-width: 0;
  padding: 7px 8px;
}

.parameter-value span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.parameter-value button {
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--muted);
  min-height: 28px;
  padding: 0 8px;
}

.parameter-value-actions {
  display: flex;
  gap: 6px;
}

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

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

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

.backup-row strong,
.backup-row span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.backup-row span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.backup-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.button-link {
  align-items: center;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: #ffffff;
  display: inline-flex;
  min-height: 38px;
  padding: 0 14px;
  text-decoration: none;
}

.button-link:hover {
  background: var(--accent-strong);
}

.parameter-add-form {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: auto;
  min-width: 0;
}

.parameter-add-form input {
  min-width: 0;
}

.small-empty {
  font-size: 12px;
  padding: 8px 0;
}

.recycle-panel {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  padding-top: 14px;
}

.recycle-panel > label:not(.workspace-check) {
  display: grid;
  gap: 5px;
}

.recycle-panel > label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.recycle-list {
  background: #f8fbfb;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 2px;
  max-height: 210px;
  overflow: auto;
  padding: 8px;
}

.recycle-row {
  align-items: center;
  display: flex;
  gap: 8px;
  min-height: 32px;
}

.recycle-row span {
  color: var(--muted);
  font-size: 12px;
}

.recycle-row strong {
  color: var(--ink);
}

.danger-outline {
  background: #fff7f5;
  border: 1px solid #f6b6ad;
  color: #b42318;
}

.danger-outline:hover {
  background: #fff1f0;
}

.full-width {
  width: 100%;
}

.user-form {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(150px, 1fr) minmax(140px, 0.8fr) minmax(140px, 0.8fr) minmax(160px, 1fr) auto auto;
}

.user-form select[multiple] {
  min-height: 116px;
}

.user-form .form-error {
  grid-column: 1 / -1;
}

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

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

.user-row span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 3px;
}

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

.template-upload-form {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr) auto;
  margin-top: 10px;
}

.template-upload-form label,
.template-upload-form label span {
  display: grid;
  gap: 5px;
}

.template-summary {
  margin-top: 10px;
}

.template-row {
  align-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 10px;
}

.template-row span {
  color: var(--muted);
  display: block;
  font-size: 12px;
}

.template-download-link {
  color: var(--teal);
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  margin-top: 6px;
}

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

.audit-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  grid-template-columns: minmax(180px, 0.5fr) minmax(160px, 0.4fr) 1fr;
  padding: 10px;
}

.audit-row span,
.audit-row small {
  color: var(--muted);
  font-size: 12px;
}

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

.lightbox-form {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: 110px minmax(220px, 1.4fr) minmax(150px, 0.85fr) minmax(150px, 0.85fr) minmax(150px, 0.9fr) minmax(220px, 1.2fr);
  margin-bottom: 14px;
}

.lightbox-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.lightbox-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.lightbox-form .form-error {
  grid-column: 1 / -1;
}

.lightbox-form input,
.lightbox-form select {
  min-width: 0;
  width: 100%;
}

.lightbox-field-id {
  grid-column: span 1;
}

.lightbox-field-description {
  grid-column: span 3;
}

.lightbox-field-short,
.lightbox-field-type {
  grid-column: span 1;
}

.lightbox-field-material {
  grid-column: 1 / span 2;
}

.lightbox-field-visual {
  grid-column: span 2;
}

.lightbox-field-dimension {
  grid-column: span 1;
}

.lightbox-form #saveLightboxButton {
  grid-column: span 1;
  min-height: 42px;
}

.lightbox-form #cancelLightboxEditButton {
  grid-column: 1 / span 1;
  justify-self: start;
  min-height: 42px;
  min-width: 110px;
}

.lightbox-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 80px minmax(180px, 1fr) minmax(160px, 0.8fr) minmax(160px, 0.7fr) auto auto auto;
  padding: 10px;
}

.lightbox-row span {
  color: var(--muted);
  font-size: 12px;
}

.lightbox-row.in-order {
  background: #f8fbfb;
  border-color: rgba(23, 112, 111, 0.38);
}

.in-order-label {
  color: var(--accent-strong) !important;
  font-weight: 700;
}

.danger-action {
  background: #a33030;
  border-color: #a33030;
}

.danger-action:hover {
  background: #842525;
}

.form-panel {
  margin-bottom: 16px;
}

.inline-form {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(180px, 260px) minmax(220px, 1fr) auto;
  align-items: end;
  padding: 14px;
}

.inline-form label {
  display: grid;
  gap: 6px;
}

.inline-form span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.compact-form {
  grid-template-columns: minmax(180px, 240px) minmax(220px, 1fr) minmax(180px, 240px) auto;
  padding: 0;
}

.edit-order-form {
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) minmax(160px, auto) auto;
  padding: 0;
}

.upload-form {
  grid-template-columns: minmax(220px, 280px) minmax(220px, 1fr) minmax(160px, auto) auto;
  padding: 0;
}

.text-form {
  grid-template-columns: minmax(150px, 190px) minmax(180px, 1fr) minmax(180px, 260px) 80px 80px auto auto;
  padding: 0;
}

.photo-toolstrip {
  align-items: center;
  background: #f8fbfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
}

.photo-toolstrip span {
  color: var(--muted);
  flex: 1 1 180px;
  font-size: 13px;
}

.photo-toolstrip .tool-hint {
  flex: 0 1 auto;
}

.photo-toolstrip button {
  min-height: 30px;
  padding: 0 10px;
}

.shop-photo-layouts {
  display: grid;
  gap: 12px;
}

.shop-photo-section {
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 10px;
  padding: 8px;
}

.shop-photo-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.shop-photo-header span {
  color: var(--muted);
  font-size: 12px;
}

.shop-photo-mosaic {
  aspect-ratio: auto;
  background: #f5f9fb;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 440px;
  overflow: hidden;
  position: relative;
}

.empty-mosaic {
  align-content: start;
  border-style: dashed;
  color: var(--muted);
  display: grid;
  gap: 8px;
  padding: 28px;
}

.empty-mosaic strong {
  color: var(--ink);
}

.shop-photo-tile {
  background: #eef3f4;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: block;
  cursor: move;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  position: absolute;
  text-align: left;
  touch-action: none;
  user-select: none;
}

.shop-photo-tile:hover {
  background: #eef3f4;
  border-color: var(--accent);
}

.shop-photo-tile img {
  display: block;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  width: 100%;
}

.shop-photo-tile.is-dragging {
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(16, 86, 85, 0.18);
  z-index: 4;
}

.shop-photo-tile.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(23, 112, 111, 0.2);
}

.shop-photo-name {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 4px;
  bottom: 6px;
  color: var(--ink);
  font-size: 11px;
  left: 6px;
  max-width: calc(100% - 12px);
  overflow: hidden;
  padding: 2px 5px;
  pointer-events: none;
  position: absolute;
  text-overflow: ellipsis;
  white-space: nowrap;
  z-index: 3;
}

.shop-photo-text {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(17, 24, 32, 0.2);
  border-radius: 4px;
  cursor: move;
  font-weight: 700;
  line-height: 1.1;
  max-width: 120px;
  padding: 2px 4px;
  position: absolute;
  transform: translate(-50%, -50%);
  user-select: none;
  word-break: break-word;
  z-index: 4;
}

.shop-photo-text.is-dragging {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(23, 112, 111, 0.18);
  z-index: 30;
}

.tile-resize-handle {
  background: #ffffff;
  border: 2px solid var(--accent);
  border-radius: 999px;
  bottom: 6px;
  box-shadow: 0 2px 8px rgba(16, 86, 85, 0.35);
  cursor: nwse-resize;
  height: 28px;
  position: absolute;
  right: 6px;
  width: 28px;
  z-index: 20;
}

.tile-resize-handle::after {
  border-bottom: 3px solid var(--accent);
  border-right: 3px solid var(--accent);
  bottom: 7px;
  content: "";
  height: 8px;
  position: absolute;
  right: 7px;
  width: 8px;
}

.detail-header {
  align-items: center;
  border-bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 14px;
}

.detail-header > div:first-child {
  display: grid;
  gap: 6px;
}

.detail-header .back-button {
  justify-self: start;
}

.detail-header h2 {
  font-size: 30px;
  line-height: 1.1;
  margin: 0;
}

.detail-header p {
  color: var(--muted);
  display: grid;
  gap: 4px;
  margin: 0;
}

.detail-header p strong {
  color: var(--accent-strong);
  font-size: 12px;
  text-transform: uppercase;
}

.detail-header p span {
  font-size: 13px;
}

.detail-body {
  display: grid;
  gap: 12px 14px;
  grid-template-columns: 220px minmax(0, 1fr) 240px;
  padding: 0;
}

.shop-strip {
  display: grid;
  gap: 8px;
  grid-column: 1;
  grid-row: 1 / span 10;
  align-content: start;
  max-height: calc(100vh - 175px);
  overflow-y: auto;
  padding: 2px 10px 2px 2px;
  position: sticky;
  top: 12px;
}

.detail-body > :not(.shop-strip):not(.available-shop-rail) {
  grid-column: 2;
}

.available-shop-rail {
  align-content: start;
  display: grid;
  gap: 8px;
  grid-column: 3;
  grid-row: 1 / span 10;
  max-height: calc(100vh - 175px);
  overflow-y: auto;
  padding: 2px 2px 2px 10px;
  position: sticky;
  top: 12px;
}

.available-shop-search {
  display: grid;
  gap: 4px;
}

.available-shop-search span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.available-shop-card {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: grab;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 62px;
  padding: 9px 10px;
  transition: border-color 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.available-shop-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(17, 24, 39, 0.08);
}

.available-shop-card.dragging {
  opacity: 0.55;
}

.available-shop-card strong,
.available-shop-card span {
  display: block;
}

.available-shop-card strong {
  font-size: 13px;
  line-height: 1.2;
}

.available-shop-card span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.available-shop-card button {
  min-height: 30px;
  padding: 0 10px;
}

.shop-strip.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: 4px;
}

.available-shop-rail.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: 4px;
}

.order-workspace-context {
  background: transparent;
  border: 0;
  border-radius: 0;
  display: grid;
  gap: 4px;
  min-height: 42px;
  padding: 0 0 6px;
}

.order-workspace-context strong {
  font-size: 16px;
}

.order-workspace-context span {
  color: var(--muted);
  font-size: 12px;
}

.order-tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.text-tool-actions {
  align-items: center;
  background: #f8fbfb;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
}

.text-tool-actions::before {
  content: "Text Fields";
  font-weight: 700;
  margin-right: 2px;
}

.text-tool-actions span {
  color: var(--muted);
  font-size: 12px;
}

.order-shop-actions {
  align-items: end;
  background: transparent;
  border: 0;
  border-radius: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: -48px;
  padding: 0;
}

.order-shop-actions label {
  display: grid;
  gap: 4px;
}

.order-shop-actions span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.order-shop-rail-title {
  background: transparent;
  border: 0;
  border-radius: 0;
  display: grid;
  gap: 3px;
  padding: 0 0 4px;
}

.order-shop-rail-title span {
  color: var(--muted);
  font-size: 12px;
}

.order-shop-rail-title button {
  justify-self: start;
  margin-top: 4px;
  min-height: 30px;
  padding: 0 10px;
}

.shop-chip {
  background: #f4f6f8;
  border: 1px solid #c8d0d7;
  border-radius: 6px;
  display: grid;
  gap: 6px;
  grid-template-columns: 1fr;
  margin: 2px 0;
  min-height: 62px;
  padding: 9px 10px;
  transform-origin: left center;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.shop-chip[data-order-shop-id] {
  cursor: grab;
}

.shop-chip[data-order-shop-id]:hover {
  box-shadow: inset 0 0 0 1px currentColor;
}

.shop-chip.status-ready {
  background: #ecfdf3;
  border-color: #12b76a;
}

.shop-chip.status-ready strong,
.shop-chip.status-ready div::before {
  color: #067647;
}

.shop-chip.status-in-progress {
  background: #eff8ff;
  border-color: #2e90fa;
}

.shop-chip.status-in-progress strong,
.shop-chip.status-in-progress div::before {
  color: #175cd3;
}

.shop-chip.status-about-to-close {
  background: #fffaeb;
  border-color: #f79009;
}

.shop-chip.status-about-to-close strong,
.shop-chip.status-about-to-close div::before {
  color: #b54708;
}

.shop-chip.status-closed {
  background: #fff1f0;
  border-color: #f04438;
}

.shop-chip.status-closed strong,
.shop-chip.status-closed div::before {
  color: #b42318;
}

.shop-chip.selected {
  border-color: #7a35d8;
  box-shadow: 0 0 0 2px rgba(122, 53, 216, 0.28), 0 8px 16px rgba(85, 44, 148, 0.12);
  transform: scale(1.035);
  z-index: 2;
}

.shop-chip.dragging {
  opacity: 0.55;
}

.shop-chip.reorder-before {
  box-shadow: 0 -3px 0 var(--accent), 0 0 0 1px rgba(23, 112, 111, 0.16);
}

.shop-chip.reorder-after {
  box-shadow: 0 3px 0 var(--accent), 0 0 0 1px rgba(23, 112, 111, 0.16);
}

.shop-chip strong,
.shop-chip span {
  display: block;
}

.shop-chip strong {
  color: #35424c;
  font-size: 13px;
  line-height: 1.2;
}

.shop-chip span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.shop-chip span:first-child,
.shop-chip div::before {
  color: #57656f;
}

.shop-chip div::before {
  content: attr(data-status-label);
  display: block;
  font-size: 10px;
  font-weight: 700;
  margin-bottom: 3px;
  text-transform: capitalize;
}

.shop-chip button {
  display: none;
}

.table-action {
  min-height: 30px;
  padding: 0 10px;
}

.record-select {
  min-height: 32px;
  min-width: 140px;
}

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

table {
  border-collapse: collapse;
  min-width: 1460px;
  width: 100%;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

td {
  font-size: 13px;
}

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

  .sidebar {
    height: auto;
    position: static;
  }

  .workspace {
    padding: 18px 12px 32px;
  }

  .nav-list {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  }

  .topbar,
  .grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .order-list-header,
  .order-filters,
  .detail-body,
  .brand-workspace-body {
    grid-template-columns: 1fr;
  }

  .shop-strip,
  .available-shop-rail,
  .detail-body > :not(.shop-strip):not(.available-shop-rail) {
    grid-column: 1;
    grid-row: auto;
  }

  .shop-strip,
  .available-shop-rail {
    max-height: none;
    position: static;
  }

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

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

  .brand-shop-form,
  .brand-order-form,
  .brand-order-filters,
  .selected-shop-form,
  .import-card,
  .user-form,
  .lightbox-form {
    grid-template-columns: 1fr;
  }

  .lightbox-form > *,
  .lightbox-field-material,
  .lightbox-field-description,
  .lightbox-form #saveLightboxButton,
  .lightbox-form #cancelLightboxEditButton {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

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

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

  .parameter-grid,
  .parameter-add-form,
  .backup-row {
    grid-template-columns: 1fr;
  }

  .parameter-add-form button,
  .button-link {
    justify-self: stretch;
  }
}
