/* MeatFishDelivery — админка (светлая тема) */

:root {
  --bg: #f5f7f4;
  --surface: #ffffff;
  --surface-2: #f2f6f1;
  --surface-3: #e8efe7;
  --line: #e3e9e2;
  --line-strong: #c9d7cb;
  --text: #16221c;
  --text-dim: #4f6259;
  --text-mute: #7d9088;
  --primary: #e2552f;
  --primary-dark: #c8401d;
  --primary-soft: #ffe7de;
  --mint: #0f9e8e;
  --mint-soft: #dcf5f0;
  --amber: #f2b544;
  --amber-soft: #fff3d4;
  --danger: #d64545;
  --success: #1c9c6b;
  --radius: 18px;
  --radius-sm: 13px;
  --shadow: 0 20px 40px -28px rgba(22, 34, 28, 0.45);
  --shadow-soft: 0 1px 2px rgba(22, 34, 28, 0.04), 0 14px 28px -22px rgba(22, 34, 28, 0.34);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 500px at 105% -10%, rgba(155, 226, 205, 0.4), transparent 60%),
    radial-gradient(700px 420px at -10% 0%, rgba(255, 203, 176, 0.45), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

a {
  color: var(--mint);
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
}

/* ---------------------------- кнопки и поля ---------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: transform 0.15s, background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  color: #fff;
  background: linear-gradient(135deg, #f4663c, var(--primary) 55%, var(--primary-dark));
  box-shadow: 0 10px 20px -14px rgba(226, 85, 47, 0.95);
}

.btn--ghost {
  color: var(--text);
  background: #fff;
  border-color: var(--line-strong);
}

.btn--ghost:hover {
  background: var(--surface-2);
}

.btn--danger {
  color: var(--danger);
  background: #fff;
  border-color: #f0c5c5;
}

.btn--block {
  width: 100%;
}

.btn--sm {
  min-height: 36px;
  padding: 0 12px;
  font-size: 12.5px;
  border-radius: 10px;
}

.btn[disabled] {
  opacity: 0.55;
  pointer-events: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}

.field__input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 400;
  color: var(--text);
  background: #f8faf7;
  border: 1px solid var(--line);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.field__input:focus {
  background: #fff;
  border-color: rgba(15, 158, 142, 0.6);
  box-shadow: 0 0 0 3px rgba(15, 158, 142, 0.12);
}

textarea.field__input {
  resize: vertical;
  line-height: 1.45;
}

select.field__input {
  padding-right: 34px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%237d9088' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 11px 8px;
  -webkit-appearance: none;
  appearance: none;
}

select.field__input:focus {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%237d9088' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

select.field__input option {
  color: var(--text);
  background: #fff;
}

/* ---------------------------- вход ---------------------------- */

.login-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 16px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  padding: 28px 22px 22px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-align: center;
}

.login-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  object-fit: contain;
}

.login-card h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.login-sub {
  margin: 4px 0 20px;
  font-size: 12.5px;
  color: var(--text-mute);
}

.login-card .field {
  margin-bottom: 12px;
  text-align: left;
}

.login-error {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: #7d1d1d;
  background: #fde8e8;
  border: 1px solid #f3c7c7;
  text-align: left;
}

.back-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--text-dim);
}

.back-link:hover {
  color: var(--primary);
}

/* ---------------------------- каркас ---------------------------- */

.admin-app {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100vh;
  height: 100dvh;
  padding: 18px 14px;
  background: rgba(255, 255, 255, 0.72);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 14px;
  border-bottom: 1px solid var(--line);
}

.sidebar-brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.sidebar-brand strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.sidebar-brand small {
  font-size: 10.5px;
  color: var(--text-mute);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.side-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  text-align: left;
  transition: background 0.2s, color 0.2s;
}

.side-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

.side-link.is-active {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.side-link em {
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
  color: #fff;
  background: var(--primary);
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.sidebar-bottom a,
.sidebar-bottom button {
  padding: 8px 6px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  text-align: left;
}

.sidebar-bottom a:hover,
.sidebar-bottom button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.admin-main {
  min-width: 0;
  padding: 22px clamp(14px, 3vw, 34px) 40px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-header h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.admin-header p {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--text-mute);
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--line);
}

.avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 12px;
  color: #fff;
  background: linear-gradient(135deg, #f4663c, var(--primary-dark));
}

.tab-pane {
  display: none;
}

.tab-pane.is-active {
  display: block;
  animation: admin-fade 0.25s ease both;
}

@keyframes admin-fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
/* ---------------------------- панели и таблицы ---------------------------- */

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.stat-card {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.stat-card small {
  display: block;
  margin-bottom: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-mute);
}

.stat-card strong {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.stat-card--accent strong {
  color: var(--primary-dark);
}

.stat-card--mint strong {
  color: var(--mint);
}

.panel {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.panel + .panel {
  margin-top: 14px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.panel-head h2 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.panel-tools {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.panel-tools input[type="search"],
.panel-tools select {
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  outline: none;
}

.panel-tools select {
  padding: 0 32px 0 12px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%237d9088' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 11px 8px;
  transition: border-color 0.2s, box-shadow 0.2s, color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.panel-tools select:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.panel-tools select option {
  color: var(--text);
  background: #fff;
}

.panel-tools input[type="search"] {
  width: 210px;
}

.panel-tools input:focus,
.panel-tools select:focus {
  border-color: rgba(15, 158, 142, 0.55);
  box-shadow: 0 0 0 3px rgba(15, 158, 142, 0.12);
}

.table-wrap {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.data th,
table.data td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

table.data th {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-mute);
  background: var(--surface-2);
  white-space: nowrap;
}

table.data tbody tr:hover {
  background: #fbfdfa;
}

table.data td.num {
  font-weight: 700;
  white-space: nowrap;
}

table.data td.actions {
  text-align: right;
  white-space: nowrap;
}

.row-actions {
  display: inline-flex;
  gap: 6px;
  justify-content: flex-end;
}

.product-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
}

.product-thumb {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 10px;
  font-size: 20px;
  background: linear-gradient(150deg, var(--g1, #ffe4d7), var(--g2, #ffb79e));
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-cell small {
  display: block;
  font-size: 10.5px;
  color: var(--text-mute);
}

.empty {
  padding: 28px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-mute);
}

.stock-out {
  color: var(--danger);
  font-weight: 800;
}

.stock-low {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8a5a00;
  background: var(--amber-soft);
}

.stock-delta {
  font-weight: 800;
  white-space: nowrap;
}

.stock-delta--in {
  color: var(--success);
}

.stock-delta--out {
  color: var(--danger);
}

.loading {
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-mute);
}

/* ---------------------------- заказы ---------------------------- */

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.order-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.7fr) minmax(150px, 1fr) minmax(180px, 1.2fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--line);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.order-row:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.order-number {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.order-number small,
.order-client small,
.order-total small {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-mute);
}

.order-client {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-items {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-dim);
  min-width: 0;
}

.order-total {
  font-size: 14.5px;
  font-weight: 800;
  white-space: nowrap;
  text-align: right;
}

.order-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status.new {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.status.confirmed {
  color: #a8761a;
  background: var(--amber-soft);
}

.status.delivering {
  color: var(--mint);
  background: var(--mint-soft);
}

.status.done {
  color: var(--success);
  background: #e2f6ec;
}

.status.canceled {
  color: var(--text-mute);
  background: var(--surface-3);
}
/* ---------------------------- график ---------------------------- */

.chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 180px;
  margin-bottom: 16px;
  padding: 12px 12px 0;
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(
      to top,
      transparent 0,
      transparent 34px,
      var(--line) 35px,
      transparent 36px
    ),
    #fff;
  border: 1px solid var(--line);
}

.chart-col {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 100%;
  flex: 1 1 0;
  min-width: 6px;
  max-width: 30px;
}

.chart-bar {
  flex: 1;
  min-height: 2px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, #6ed8c3, var(--mint));
}

.chart-bar--orders {
  background: linear-gradient(180deg, #ff9a71, var(--primary));
}

.chart-col span {
  position: absolute;
  left: 50%;
  bottom: -22px;
  transform: translateX(-50%);
  font-size: 9px;
  white-space: nowrap;
  color: var(--text-mute);
}

.chart-empty {
  margin: auto;
  font-size: 12.5px;
  color: var(--text-mute);
}

/* ------------------- создание заказа за клиента ------------------- */

.order-builder {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.order-builder__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.order-builder__head small {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-mute);
}

.order-builder__add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px auto;
  gap: 8px;
  align-items: center;
}

.order-builder__add .field__input,
.draft-qty {
  min-height: 40px;
}

.draft-qty {
  width: 90px;
  min-height: 38px;
  padding: 0 8px;
  text-align: center;
}

.order-builder table.data td small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-mute);
}

.draft-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--line);
}

.draft-summary__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--text-dim);
}

.draft-summary__row strong {
  color: var(--text);
  font-weight: 800;
}

.draft-summary__row--mint strong {
  color: var(--mint);
}

.draft-summary__row--total {
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.draft-summary__note {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-mute);
}

.draft-summary__error {
  color: var(--danger);
}

.order-source {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  color: #7a4b00;
  background: var(--amber-soft);
}

/* ---------------------------- модалки ---------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(12, 26, 20, 0.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: admin-fade 0.2s ease both;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 100;
  width: min(620px, calc(100vw - 28px));
  max-height: min(90vh, 900px);
  max-height: min(90dvh, 900px);
  overflow: auto;
  border-radius: 22px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 30px 70px -30px rgba(12, 26, 20, 0.6);
  transform: translate(-50%, -50%);
  animation: modal-in 0.22s ease both;
}

.modal--wide {
  width: min(760px, calc(100vw - 28px));
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.modal__head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.modal__head h2 {
  font-size: 17px;
  font-weight: 800;
}

.modal__close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-dim);
  background: var(--surface-2);
}

.modal__close:hover {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.modal__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field--wide {
  grid-column: 1 / -1;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 6px;
}

.upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.upload-preview {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 12px;
  font-size: 28px;
  background: var(--surface-3);
  color: var(--text-mute);
}

.upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.order-details {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.detail-grid div span {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-mute);
}

.detail-grid div strong {
  font-size: 13px;
  font-weight: 700;
}

.order-lines {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.order-lines td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
}

.order-lines td:last-child {
  text-align: right;
  white-space: nowrap;
  font-weight: 700;
}

.order-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  font-weight: 800;
}

.status-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}

/* ---------------------------- тосты ---------------------------- */

.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  max-width: 340px;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  background: #16221c;
  box-shadow: 0 14px 30px -14px rgba(12, 26, 20, 0.7);
  animation: toast-in 0.22s ease both;
}

.toast--error {
  background: var(--danger);
}

.toast--success {
  background: var(--success);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------------------------- адаптив ---------------------------- */

@media (max-width: 1000px) {
  .order-row {
    grid-template-columns: minmax(120px, 0.8fr) minmax(140px, 1fr) auto;
  }

  .order-items {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .order-actions {
    grid-column: 3;
    grid-row: 1;
  }
}

@media (max-width: 760px) {
  .admin-app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    gap: 12px;
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .side-nav {
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .side-link {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 10px;
    font-size: 12.5px;
  }

  .sidebar-bottom {
    flex-direction: row;
    gap: 12px;
    padding-top: 8px;
  }

  .admin-main {
    padding: 16px 12px 32px;
  }

  .admin-header h1 {
    font-size: 22px;
  }

  .stat-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel {
    padding: 12px;
  }

  .panel-tools input[type="search"] {
    width: 100%;
  }

  .order-row {
    grid-template-columns: 1fr auto;
    gap: 8px 10px;
  }

  .order-client {
    grid-column: 1;
    grid-row: 2;
  }

  .order-total {
    grid-column: 2;
    grid-row: 1;
  }

  .order-actions {
    grid-column: 1 / -1;
    grid-row: 4;
    justify-content: flex-start;
  }

  .form-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .order-builder__add {
    grid-template-columns: 1fr;
  }

  .chart {
    height: 150px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}