:root {
  --bg: #f5f7f8;
  --ink: #1c2529;
  --muted: #66757c;
  --line: #dbe2e5;
  --panel: #fff;
  --accent: #157f72;
  --accent-dark: #0f5f55;
  --warn: #b46b00;
  --bad: #b42318;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, Segoe UI, Arial, sans-serif; }
a { color: var(--accent-dark); text-decoration: none; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 244px; background: #172124; color: #fff; padding: 22px; display: flex; flex-direction: column; gap: 24px; }
.brand { font-size: 20px; font-weight: 800; }
nav { display: grid; gap: 8px; }
nav a { color: #dce8e7; padding: 10px 12px; border-radius: 6px; }
nav a:hover { background: #243337; }
.user { margin-top: auto; display: grid; gap: 6px; color: #c7d4d7; font-size: 13px; }
.user a { color: #fff; }
.content { margin-left: 244px; padding: 28px; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; gap: 16px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: 30px; }
h2 { font-size: 18px; }
p { color: var(--muted); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.metrics div, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.metrics div { padding: 18px; display: grid; gap: 8px; }
.metrics span, .info-grid span { color: var(--muted); font-size: 13px; }
.metrics strong { font-size: 28px; }
.panel { padding: 18px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: #405056; font-size: 13px; background: #f9fbfb; }
.status { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #e8f4f2; color: var(--accent-dark); }
.status.draft { background: #fff4df; color: var(--warn); }
.status.cancelled { background: #ffe7e4; color: var(--bad); }
.button, button { border: 0; background: var(--accent); color: #fff; padding: 10px 14px; border-radius: 6px; font-weight: 700; cursor: pointer; }
.button.ghost, button.ghost { background: #e8f4f2; color: var(--accent-dark); }
.button.compact, button.compact { padding: 7px 10px; font-size: 13px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-grid, .info-grid { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
input, select { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 10px; background: #fff; color: var(--ink); }
.item-row { display: grid; grid-template-columns: minmax(260px, 1fr) 120px 120px; gap: 10px; margin-bottom: 10px; align-items: start; }
.product-picker { position: relative; }
.suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 32px rgba(23, 33, 36, .16);
}
.suggestion {
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  text-align: left;
  font-weight: 400;
}
.suggestion:hover { background: #eef7f5; }
.suggestion strong { font-size: 14px; }
.suggestion span, .suggestion.muted { color: var(--muted); font-size: 12px; }
.checks { display: grid; gap: 10px; margin: 8px 0 18px; }
.checks > span { color: var(--muted); font-size: 13px; }
.checks label { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.checks input { width: auto; }
.checks.compact { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.checks.compact > span { grid-column: 1 / -1; }
.user-form { margin-bottom: 6px; }
.object-list { display: grid; gap: 14px; }
.edit-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfc;
}
.edit-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.edit-card-head strong { font-size: 17px; }
.panel + .panel { margin-top: 18px; }
.filters { display: flex; gap: 10px; margin-bottom: 16px; }
.filters input { max-width: 420px; }
.filters-bar { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 14px; align-items: end; margin-bottom: 18px; }
.upload-form { display: grid; gap: 12px; max-width: 520px; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 16px; }
.import-report h3 { margin: 0 0 10px; font-size: 16px; }
.import-report table { min-width: 0; }
.login-page { min-height: 100vh; display: grid; place-items: center; background: #eef3f2; }
.login-card { width: min(420px, calc(100vw - 32px)); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 28px; display: grid; gap: 14px; }
.login-card h1 { font-size: 28px; }
.login-card small { color: var(--muted); }
.error { color: var(--bad); background: #ffe7e4; padding: 10px; border-radius: 6px; }
.success { color: var(--accent-dark); background: #e8f4f2; padding: 10px; border-radius: 6px; margin-bottom: 16px; font-weight: 700; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 72px 20px 24px;
  background: rgba(23, 33, 36, .42);
}
.modal-backdrop.open { display: flex; }
.modal-window {
  width: min(920px, calc(100vw - 40px));
  max-height: calc(100vh - 96px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 22px 70px rgba(23, 33, 36, .28);
  padding: 18px;
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.modal-head h2 { margin-bottom: 4px; font-size: 22px; }
.modal-close { background: transparent; color: var(--muted); padding: 2px 8px; font-size: 28px; line-height: 1; }
.modal-close:hover { color: var(--ink); background: #eef3f2; }
.compact-info { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
.compact-info div { display: grid; gap: 4px; }
.compact-info strong { font-size: 15px; }
.modal-comment { padding: 10px 12px; background: #f5f7f8; border-radius: 6px; }
.modal-table { min-width: 640px; }
.modal-actions { justify-content: flex-end; margin-top: 16px; }
@media (max-width: 860px) {
  .sidebar { position: static; width: auto; }
  .content { margin-left: 0; padding: 18px; }
  .metrics, .form-grid, .info-grid { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: 1fr; }
  .filters-bar { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .item-row { grid-template-columns: 1fr; }
  .modal-backdrop { align-items: stretch; padding: 16px; }
  .modal-window { width: 100%; max-height: calc(100vh - 32px); }
  .compact-info { grid-template-columns: 1fr; }
}
