:root {
  color-scheme: light;
  --bg: #f4f1eb;
  --surface: #ffffff;
  --surface-2: #f9faf8;
  --text: #202321;
  --muted: #6e746f;
  --line: #d9ddd6;
  --brand: #2f7d63;
  --brand-dark: #22634e;
  --accent: #c8573d;
  --amber: #c88a24;
  --blue: #3977b7;
  --danger: #b83c35;
  --shadow: 0 18px 45px rgba(33, 40, 34, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  backdrop-filter: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.header-search {
  display: flex;
  align-items: end;
  gap: 8px;
  min-width: 0;
}

.header-search label {
  display: block;
  width: 224px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.header-search input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
}

.header-search button {
  min-height: 38px;
  padding: 8px 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand strong {
  display: block;
  font-size: 20px;
  line-height: 1;
}

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

.navrail {
  position: sticky;
  top: 69px;
  z-index: 15;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 22px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.navrail a {
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: #3d423e;
  font-size: 14px;
  white-space: nowrap;
}

.navrail a.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.page {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 12px 16px 42px;
}

.page-wide {
  width: min(1800px, 100%);
}

.page-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
}

.page-title h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.05;
}

.dashboard-title h1 {
  font-size: 22px;
  text-transform: uppercase;
}

.dashboard-title .eyebrow {
  margin: 8px 0 0;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.primary,
.secondary,
.muted,
.danger-text {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 700;
}

.primary {
  background: var(--brand);
  color: #fff;
}

.primary:hover {
  background: var(--brand-dark);
}

.secondary {
  background: #eef1ed;
  color: var(--text);
}

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

.danger-text,
.details-text {
  display: inline-flex;
  align-items: center;
  height: 18px;
  min-height: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  padding: 0;
  background: transparent;
  line-height: 1.1;
  text-decoration: none;
}

.danger-text {
  color: var(--danger);
}

.details-text {
  color: #4f5552;
  font-weight: 800;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.create-order-button {
  min-height: 42px;
  border: 1px solid #555;
  border-radius: 8px;
  padding: 10px 14px;
  background: #c0c0c0;
  color: var(--text);
  font-weight: 700;
}

.full {
  width: 100%;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.dashboard-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-stats > .stat-card {
  min-width: 0;
}

@media (min-width: 1200px) {
  .dashboard-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr)) calc(25% - 222.5px);
  }

  .dashboard-stats .expand-all-label {
    overflow-wrap: normal;
    white-space: nowrap;
  }
}

.stat-card {
  display: block;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat-card.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.stat-card strong {
  display: block;
  font-size: 22px;
}

.stat-card span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.stat-card.active span {
  color: rgba(255, 255, 255, 0.86);
}

.expand-all-button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  overflow: hidden;
  border-color: var(--line);
  background: var(--surface);
  color: #000;
  font-weight: 800;
  text-align: right;
}

.expand-all-button .expand-all-label {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  max-width: 100%;
  min-width: 0;
  min-height: 24px;
  padding: 4px 0;
  color: #000;
  font-size: 15px;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.expand-all-button .expand-all-icon {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  justify-self: start;
  border-radius: 8px;
  background: #eef1ed;
  color: #22634e;
  font-size: 23px;
  font-weight: 800;
  line-height: 1;
}

@media (min-width: 561px) {
  .dashboard-stats .expand-all-icon {
    font-size: 23px;
  }
}

.board {
  display: grid;
  grid-template-columns: repeat(9, minmax(172px, 1fr));
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.board-column {
  min-width: 0;
  min-height: 520px;
  background: #fdfdfb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.board-column header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.board-column h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.15;
}

.board-column header b {
  color: var(--muted);
}

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

.stage-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.stage-panel summary {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
}

.stage-panel summary::-webkit-details-marker {
  display: none;
}

.stage-panel summary::before {
  content: "+";
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  grid-row: 1;
  grid-column: 1;
  align-self: center;
  background: #eef1ed;
  border-radius: 8px;
  color: var(--brand-dark);
  font-weight: 800;
}

.stage-panel[open] summary::before {
  content: "-";
}

.stage-name {
  min-width: 0;
  grid-column: 2;
  font-size: 16px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.stage-name small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.stage-panel[open] .stage-name small {
  color: var(--brand-dark);
}

.stage-count {
  display: none;
  grid-column: 3;
  min-width: 34px;
  padding: 5px 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.stage-orders {
  display: grid;
  gap: 1px;
  padding: 0 10px 10px;
  border-top: 1px solid var(--line);
}

.dashboard-order {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  width: 100%;
  min-width: 0;
  padding: 8px 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--amber);
  border-radius: 8px;
  box-shadow: 0 6px 14px rgba(35, 40, 35, 0.05);
}

.dashboard-order.progress {
  border-left-color: var(--blue);
}

.dashboard-order.progress .status-badge {
  background: #e8f0f8;
  color: #245887;
}

.dashboard-order.done {
  border-left-color: var(--brand);
}

.dashboard-order-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px 8px;
  min-width: 0;
}

.dashboard-order-title {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
}

.dashboard-order-title .order-number {
  flex: 0 0 auto;
  white-space: nowrap;
}

.dashboard-order-title .status-badge {
  flex: 0 0 auto;
  max-width: none;
}

.dashboard-order-main .order-number {
  grid-column: 1;
  color: #353936;
  font-size: 18px;
}

.dashboard-order-main p {
  grid-column: 1 / -1;
  margin: 0;
  color: #353936;
  overflow-wrap: anywhere;
}

.dashboard-order-main .dashboard-order-customer {
  grid-column: 1 / -1;
  color: #353936;
  overflow-wrap: anywhere;
}

.dashboard-order-info {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.dashboard-order-actions {
  display: flex;
  align-items: center;
  align-self: end;
  justify-content: flex-end;
  gap: 14px;
}

.order-card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
}

.purchase-request-button,
.purchase-request-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid #ad7419;
  border-radius: 8px;
  padding: 7px 10px;
  background: #fff4db;
  color: #76500f;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.purchase-request-button:hover {
  background: #fbe7bd;
}

.dashboard-order-actions .purchase-request-button {
  min-height: 30px;
  padding: 5px 10px;
}

.purchase-request-state {
  border-color: #9da79f;
  background: #eef1ed;
  color: #56605a;
  cursor: default;
}

.workshop-purchase-action {
  display: flex;
  justify-content: flex-end;
}

.purchase-request-dialog {
  width: min(560px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(20, 27, 22, 0.3);
}

.purchase-request-dialog::backdrop {
  background: rgba(24, 29, 25, 0.58);
}

.purchase-request-dialog-form {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.purchase-request-dialog-head h2 {
  margin: 0;
  font-size: 22px;
}

.purchase-request-dialog-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.purchase-request-dialog textarea {
  min-height: 140px;
}

.purchase-request-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dashboard-order .delete-form {
  align-self: center;
}

.column-orders,
.mobile-workshop-list {
  display: grid;
  gap: 8px;
  padding: 8px;
}

.workshop-order {
  display: grid;
  min-width: 0;
  gap: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--amber);
  border-radius: 8px;
  box-shadow: 0 6px 14px rgba(35, 40, 35, 0.05);
}

.workshop-order.progress {
  border-left-color: var(--blue);
}

.workshop-order.done {
  border-left-color: var(--brand);
}

.workshop-order-summary {
  min-width: 0;
  cursor: pointer;
  list-style: none;
}

.workshop-order-summary.dashboard-order {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr) auto 40px;
  grid-template-rows: auto minmax(34px, auto);
  align-items: start;
  gap: 4px 12px;
  padding: 9px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.workshop-order-summary .dashboard-order-main {
  grid-column: 1;
  grid-row: 1 / span 2;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  align-items: start;
  justify-content: start;
  max-width: 100%;
}

.workshop-order-summary .dashboard-order-info {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.workshop-order-summary .dashboard-order-customer {
  min-width: 0;
  word-break: break-word;
}

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

.workshop-order-summary .comment-block span,
.workshop-order-summary .workshop-comments span {
  color: #454a46;
  white-space: pre-wrap;
  word-break: break-word;
}

.workshop-order-summary .workshop-comments span {
  display: block;
  font-size: 14px;
}

.workshop-order-details {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 0 9px 9px;
}

.workshop-order[open] .workshop-order-summary {
  box-shadow: none;
}

.expand-control {
  display: inline-flex;
  grid-column: 3;
  grid-row: 2;
  align-items: center;
  justify-self: end;
  align-self: end;
  min-height: 34px;
  color: #353936;
  font-size: 14px;
  font-weight: 800;
  transform: translateX(9px);
}

.expand-label::before {
  content: "Раскрыть";
}

.workshop-order[open] .expand-label::before {
  content: "Свернуть";
}

.expand-button {
  display: inline-grid;
  grid-column: 4;
  grid-row: 2;
  width: 34px;
  height: 34px;
  place-items: center;
  justify-self: end;
  align-self: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9faf8;
}

.expand-button-icon {
  width: 10px;
  height: 10px;
  border-right: 2px solid #353936;
  border-bottom: 2px solid #353936;
  transform: translateY(-2px) rotate(45deg);
}

.workshop-order[open] .expand-button-icon {
  transform: translateY(2px) rotate(225deg);
}

.order-card {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  gap: 8px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--amber);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(35, 40, 35, 0.06);
}

.order-card.progress {
  border-left-color: var(--blue);
}

.order-card.done {
  border-left-color: var(--brand);
}

.order-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 8px;
}

.order-number {
  display: inline-block;
  max-width: 100%;
  font-size: 18px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.order-head p,
.comment-block p,
.workshop-comments p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.comment-block,
.workshop-comments {
  display: grid;
  gap: 5px;
  color: #454a46;
}

.comment-block strong,
.workshop-comments strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.workshop-comments b {
  font-style: italic;
  overflow-wrap: anywhere;
}

.comment-block p,
.workshop-comments p {
  color: #454a46;
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-block p {
  margin-top: -1px;
}

.workshop-comments p {
  font-size: 14px;
}

.status-badge {
  flex: 0 0 auto;
  max-width: 92px;
  padding: 6px 8px;
  border-radius: 8px;
  background: #f0eee7;
  color: #5c5548;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  white-space: normal;
}

.order-card.progress .status-badge {
  background: #e8f0f8;
  color: #245887;
}

.order-card.done .status-badge {
  background: #e4f1e8;
  color: #276448;
}

.order-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.order-meta span {
  padding: 4px 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.actions {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(180px, 1.2fr) minmax(120px, 1fr);
  align-items: end;
  gap: 8px;
  min-width: 0;
}

.action-button {
  min-height: 44px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  padding: 10px 14px;
  background: #EEF1ED;
  color: var(--brand-dark);
  font-weight: 800;
}

.action-button:hover {
  background: #dcece5;
}

.transfer-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.transfer-field span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.transfer-field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: var(--text);
  font-weight: 700;
}

.comment-form {
  display: grid;
  gap: 8px;
  padding-top: 4px;
}

.comment-form textarea {
  min-height: 70px;
}

.delete-form {
  display: flex;
  justify-content: flex-end;
}

.empty,
.empty-state {
  margin: 0;
  padding: 18px 12px;
  color: var(--muted);
  text-align: center;
}

.empty-state {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.form-shell,
.details-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.form-shell {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 14px;
}

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

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--text);
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 125, 99, 0.14);
}

textarea {
  resize: vertical;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-error {
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}

.counter {
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}

.details-grid {
  display: grid;
  grid-template-columns: minmax(0, 430px) 1fr;
  gap: 18px;
}

.details-panel {
  padding: 16px;
}

.details-panel h2 {
  margin: 0 0 14px;
}

.timeline {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
}

.timeline li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.timeline strong,
.timeline span {
  display: block;
}

.timeline span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

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

.login-panel {
  width: min(420px, 100%);
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-brand {
  margin-bottom: 24px;
}

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

.purchase-title {
  align-items: center;
}

.purchase-section {
  display: grid;
  gap: 10px;
}

.purchase-section h2 {
  margin: 6px 0 0;
  font-size: 18px;
}

.purchase-section h2 span {
  color: var(--muted);
}

.purchase-list {
  display: grid;
  gap: 10px;
}

.purchase-notification {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--amber);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 8px 20px rgba(35, 40, 35, 0.06);
}

.purchase-notification.ordered {
  border-left-color: var(--blue);
  background: #f7fbff;
}

.purchase-notification.done {
  border-left-color: #a5aca6;
  background: #ecefed;
  color: #68706a;
  box-shadow: none;
}

.purchase-notification.done .order-number,
.purchase-notification.done .comment-block,
.purchase-notification.done .comment-block p {
  color: #68706a;
}

.purchase-notification-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.purchase-notification-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.purchase-status-badge {
  padding: 6px 9px;
  border-radius: 8px;
  background: #fff0cf;
  color: #76500f;
  font-size: 14px;
  font-weight: 800;
}

.purchase-notification.ordered .purchase-status-badge {
  background: #e6f0fa;
  color: #245887;
}

.purchase-notification.done .purchase-status-badge {
  background: #d8ddda;
  color: #606862;
}

.purchase-no-comment {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.purchase-notification-actions,
.purchase-status-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.purchase-notification-actions {
  justify-content: flex-end;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.purchase-status-actions {
  margin-right: auto;
}

.purchase-status-button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 13px;
  font-weight: 800;
}

.purchase-status-button.ordered {
  border-color: var(--blue);
  background: #e6f0fa;
  color: #245887;
}

.purchase-status-button.done {
  border-color: var(--brand);
  background: #e4f1e8;
  color: #276448;
}

.purchase-archive {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.45);
}

.purchase-archive > summary {
  padding: 13px 15px;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.purchase-archive > .purchase-list {
  padding: 0 10px 10px;
}

@media (max-width: 900px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    padding: 5px 14px;
  }

  .brand small {
    display: none;
  }

  .navrail {
    top: 123px;
    padding: 9px 14px;
  }

  .workshop-view .navrail {
    top: 109px;
  }

  .topbar-actions,
  .header-search {
    width: 100%;
  }

  .header-search {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .header-search label {
    width: 100%;
  }

  .page {
    padding: 18px 12px 34px;
  }

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

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

  .dashboard-stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .stat-card {
    padding: 12px;
  }

  .stat-card strong {
    font-size: 24px;
  }

  .board {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .board-column {
    min-height: auto;
  }

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

  .workshop-order-summary.dashboard-order {
    grid-template-columns: minmax(0, 1fr) auto 40px;
    grid-template-rows: auto auto minmax(34px, auto);
  }

  .workshop-order-summary .dashboard-order-main {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .workshop-order-summary .dashboard-order-info {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .workshop-order-summary .expand-control {
    grid-column: 2;
    grid-row: 3;
  }

  .workshop-order-summary .expand-button {
    grid-column: 3;
    grid-row: 3;
  }

  .dashboard-order-actions,
  .dashboard-order .delete-form {
    justify-content: flex-start;
  }

  .dashboard-order-actions {
    align-items: center;
    flex-wrap: wrap;
  }

  .column-orders {
    padding: 10px;
  }

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

@media (max-width: 560px) {
  .topbar {
    gap: 10px;
  }

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

  .header-search {
    grid-template-columns: 1fr;
  }

  .workshop-view .header-search {
    display: none;
  }

  .workshop-view .navrail {
    top: 82px;
  }

  .header-search label {
    width: 100%;
  }

  .brand strong {
    font-size: 18px;
  }

  .muted {
    padding: 8px 4px;
  }

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

  .dashboard-title .create-order-button,
  .dashboard-stats .stat-card {
    min-height: 36px;
    padding: 7px 10px;
  }

  .dashboard-stats .stat-card strong {
    font-size: 20px;
  }

  .dashboard-stats .stat-card span,
  .dashboard-stats .expand-all-label {
    font-size: 12px;
  }

  .dashboard-stats .expand-all-button {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .dashboard-stats .expand-all-label {
    min-height: 20px;
    padding: 3px 6px;
  }

  .dashboard-stats .expand-all-icon {
    width: 20px;
    height: 20px;
    font-size: 18px;
  }

  .workshop-title {
    gap: 8px;
  }

  .order-head {
    gap: 8px;
  }

  .status-badge {
    width: fit-content;
  }

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

  .actions button,
  .transfer-field select {
    min-height: 52px;
    font-size: 16px;
  }

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

  .purchase-notification-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .purchase-status-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-right: 0;
  }

  .purchase-status-actions > :only-child {
    grid-column: 1 / -1;
  }

  .purchase-notification-actions .details-text,
  .purchase-notification-actions .delete-form {
    align-self: flex-start;
  }

  .purchase-request-dialog-form {
    padding: 16px;
  }

  .purchase-request-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
