:root {
  color-scheme: light;
  --ink: #172e28;
  --muted: #52665e;
  --green: #126243;
  --deep: #163c34;
  --accent: #cee7ad;
  --line: #d8e2db;
  --paper: #f4f7f4;
  --white: #fff;
  font: 100%/1.45 "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body, h1, h2, h3, p, dl, dd { margin: 0; }
a { color: var(--green); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:not(:hover) { text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid #ce822c; outline-offset: 3px; }
.skip { position: absolute; top: -80px; left: 12px; z-index: 10; background: white; padding: 12px; }
.skip:focus { top: 12px; }
.layout { display: grid; grid-template-columns: 212px minmax(0,1fr); min-height: 100vh; }
aside {
  background: var(--deep); color: #eaf4ea; display: flex; flex-direction: column;
  padding: 32px 16px 22px; gap: 34px; height: 100vh; position: sticky; top: 0; min-width: 0;
}
aside a { color: inherit; }
.brand { display: flex; align-items: center; gap: 12px; line-height: 1.12; font-size: 1.22rem; font-weight: 620; letter-spacing: -.03em; }
aside .brand { padding: 0 5px; }
.brand:hover { text-decoration: none; }
.logo { flex: none; display: inline-grid; grid-template-columns: repeat(3,5px); align-items: end; justify-content: center; gap: 3px; width: 37px; height: 37px; padding-bottom: 10px; border-radius: 11px; background: var(--accent); }
.logo i { background: var(--deep); height: 7px; border-radius: 3px 3px 1px 1px; }
.logo i:nth-child(2) { height: 13px; }
.logo i:nth-child(3) { height: 19px; }
aside nav { display: grid; gap: 5px; }
aside nav a { padding: 11px 16px; border-radius: 7px; font-weight: 550; }
aside nav a:hover, aside nav a[aria-current] { background: #30564a; text-decoration: none; }
aside nav a[aria-current] { box-shadow: inset 3px 0 var(--accent); }
.user { margin-top: auto; padding: 14px 4px 0; border-top: 1px solid #4c675e; display: flex; align-items: center; justify-content: space-between; gap: 8px; overflow-wrap: anywhere; }
button, input, select { font: inherit; }
button { background: var(--green); border: 1px solid transparent; color: white; border-radius: 7px; padding: 9px 16px; font-size: .9375rem; font-weight: 600; min-height: 44px; cursor: pointer; }
button:hover { background: #0a5136; }
.aslink { padding: 4px; background: transparent; color: #d5e8d9; font-size: .875rem; }
.aslink:hover { text-decoration: underline; background: transparent; }
main { min-width: 0; }
.layout main { width: 100%; max-width: 1540px; margin: 0 auto; padding: 36px clamp(18px,3.7vw,62px) 48px; }
header, .sectionhead, .pair, .pager, .pager>div, .shop-tabs { display: flex; gap: 12px; align-items: center; }
header, .sectionhead, .pager, .pair { justify-content: space-between; }
header { margin-bottom: 20px; flex-wrap: wrap; }
h1 { font-size: clamp(2rem,3.5vw,3.25rem); line-height: 1.07; font-weight: 620; letter-spacing: -.05em; overflow-wrap: anywhere; }
h1.detail-title { font-size: clamp(1.65rem,2.7vw,2.65rem); }
h2, h3 { line-height: 1.25; letter-spacing: -.028em; font-weight: 630; }
h2 { font-size: 1.28rem; margin-bottom: 16px; }
h3 { font-size: 1.08rem; margin-bottom: 8px; }
.eyebrow, .muted, .quiet, small, .note { color: var(--muted); }
.eyebrow, .quiet, .period, .note, small { font-size: .875rem; }
.eyebrow { margin-bottom: 7px; }
.period { border: 1px solid var(--line); border-radius: 20px; padding: 7px 13px; color: var(--muted); }
.shop-tabs { flex-wrap: wrap; gap: 5px; margin: 0 0 20px; }
.shop-tabs a { display: inline-flex; align-items: center; min-height: 40px; padding: 7px 14px; border-radius: 20px; color: var(--muted); font-size: .92rem; font-weight: 550; }
.shop-tabs a:hover { background: #e8eee8; text-decoration: none; }
.shop-tabs a[aria-current] { background: var(--deep); color: white; }
.metrics { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-bottom: 16px; }
.metric, .panel, .filters { background: var(--white); border: 1px solid var(--line); border-radius: 13px; }
.metric { color: var(--ink); padding: 20px 22px; display: grid; gap: 4px; align-content: start; }
.metric span { font-weight: 580; }
.metric strong { font-size: clamp(2rem,3.6vw,3.15rem); font-weight: 560; letter-spacing: -.06em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.metric.primary { background: var(--accent); border-color: #bfd6a3; }
.metric.primary small { color: #3c523b; }
.metric:hover { border-color: #629376; text-decoration: none; }
.panel { min-width: 0; margin-bottom: 16px; padding: clamp(17px,2vw,28px); }
.panel > .muted { margin-bottom: 16px; }
.cols { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.dashboard-cols { grid-template-columns: minmax(0,1.15fr) minmax(0,1fr); }
.sectionhead { margin-bottom: 14px; flex-wrap: wrap; }
.sectionhead h2 { margin: 0; }
.sectionhead a { font-size: .92rem; font-weight: 550; }
.counter { font-size: .86rem; font-weight: 600; letter-spacing: normal; vertical-align: middle; color: var(--muted); background: #edf3ee; border-radius: 6px; padding: 3px 7px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.graph { margin-top: 22px; display: flex; gap: clamp(6px,1.4vw,20px); background: repeating-linear-gradient(to top,transparent 0 33px,#eff3ef 33px 34px) 0 0/100% calc(100% - 29px) no-repeat; }
.barcol { flex: 1; min-width: 0; text-align: center; color: var(--muted); font-size: .85rem; }
.bar-track { height: 140px; padding: 23px 3px 0; border-bottom: 1px solid var(--line); display: flex; align-items: end; margin-bottom: 7px; }
.bar { width: 100%; min-height: 1px; border-radius: 4px 4px 0 0; background: #8bb39d; position: relative; }
.barcol:last-child .bar { background: #216c4e; }
.bar b { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); color: var(--ink); font-weight: 600; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { color: var(--muted); font-size: .875rem; font-weight: 550; vertical-align: bottom; }
td { font-size: .957rem; overflow-wrap: anywhere; }
tbody tr:last-child > * { border-bottom: 0; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
.compact th,.compact td { padding: 8px 5px; }
.compact :not(:first-child), .numeric { text-align: right; font-variant-numeric: tabular-nums; }
.compact td a { display: inline-block; min-width: 2.3em; }
.selected-row { background: #f0f5ef; }
.lead { font-weight: 600; }
td small, .event small, .pair small { display: block; margin-top: 3px; font-weight: 400; }
.status { display: inline-block; padding: 3px 8px; border-radius: 5px; background: #eff2f0; color: #4d5d53; line-height: 1.35; font-size: .875rem; font-weight: 550; white-space: normal; }
.status[data-status="DELIVERY"], .status[data-status="SEND"] { background: #e7f0f6; color: #385770; }
.status[data-status="CREATED"], .status[data-status="NEW"] { background: #eef1fd; color: #485777; }
.status[data-status="FINISHED"], .status[data-status="READY_FOR_PICKUP"] { background: #e2f0e4; color: #315e3d; }
.status[data-status="REFUND"], .status[data-status="CANCELED"], .status[data-status="CANCELLED"] { background: #f9ece2; color: #7f4a2b; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 17px 20px; margin-bottom: 18px; }
.filters label, .auth label { min-width: 0; display: grid; gap: 5px; font-size: .9rem; font-weight: 600; }
.filters .search-field { flex: 1 1 235px; }
input, select { width: 100%; min-width: 0; min-height: 44px; border: 1px solid #aabbb0; border-radius: 6px; color: var(--ink); background: white; padding: 9px 11px; font-size: 1rem; font-weight: 400; }
select { appearance: none; background: linear-gradient(45deg, transparent 50%, #567160 50%) calc(100% - 16px) 52%/5px 5px no-repeat, linear-gradient(135deg, #567160 50%, transparent 50%) calc(100% - 11px) 52%/5px 5px no-repeat, white; padding-right: 32px; }
.reset, .back { font-size: .92rem; }
.reset { padding: 10px 3px; }
.back { display: inline-block; margin-bottom: 13px; text-decoration: underline; }
.filters details { align-self: end; }
.filters summary { color: var(--green); padding: 11px 2px; cursor: pointer; font-size: .92rem; }
.extra-fields { display: flex; flex-wrap: wrap; gap: 12px; }
.pager { padding-top: 17px; margin-top: 6px; border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); flex-wrap: wrap; }
.pager a { display: inline-block; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; }
.empty { background: #f5f8f5; border-radius: 8px; padding: 20px; margin: 6px 0; }
.empty p { color: var(--muted); margin-top: 4px; }
.pair { padding: 12px 0; border-bottom: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
.pair:last-child { border-bottom: 0; }
.pair strong { font-weight: 600; }
dl { display: grid; grid-template-columns: minmax(90px,auto) minmax(0,1fr); gap: 11px 20px; }
dt { color: var(--muted); }
dd { overflow-wrap: anywhere; }
.event { padding: 13px 0; border-top: 1px solid var(--line); }
.event time { color: var(--muted); font-size: .875rem; }
.event p { margin: 4px 0; }
.note { margin: 10px 0; }
.price-input { width: 9em; max-width: 100%; }
.price-actions { margin-top: 16px; }
.warn, .errorlist { color: #a23328; }
.connection-form { margin-top: 22px; }
.connection-form .filters { border: 0; background: #f3f7f3; margin: 14px 0 0; }
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth { width: min(100%,425px); border: 1px solid var(--line); background: white; border-radius: 16px; padding: 30px; }
.auth-brand { margin-bottom: 28px; font-size: 1.1rem; }
.auth h1 { font-size: 2.1rem; margin-bottom: 12px; }
.auth form { display: grid; gap: 14px; margin: 20px 0; }
.errorlist { padding-left: 18px; }
@media (max-width: 1120px) {
  .layout { grid-template-columns: 176px minmax(0,1fr); }
  .layout main { padding: 26px 22px 40px; }
  aside { padding-inline: 12px; }
  .metric { padding: 17px; }
  .compact th, .compact td { padding-inline: 3px; }
}
@media (max-width: 820px) {
  .layout { grid-template-columns: minmax(0,1fr); }
  aside { height: auto; position: static; padding: 10px 16px 6px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px 12px; align-items: center; }
  aside .brand { font-size: 1.06rem; padding: 0; }
  aside .logo { width: 31px; height: 31px; padding-bottom: 7px; border-radius: 8px; }
  aside nav { grid-column: 1/-1; grid-row: 2; display: flex; flex-wrap: wrap; gap: 2px; }
  aside nav a { padding: 9px 11px; font-size: .92rem; }
  aside nav a[aria-current] { box-shadow: inset 0 -2px var(--accent); }
  .user { grid-column: 2; grid-row: 1; border: none; padding: 0; margin: 0; font-size: .875rem; }
  .layout main { padding: 22px 16px 38px; }
}
@media (max-width: 680px) {
  .cols, .dashboard-cols { grid-template-columns: minmax(0,1fr); gap: 0; }
  .metrics { gap: 8px; }
  .metric { padding: 14px 12px; }
  .panel { padding: 16px; }
  .records, .records tbody { display: block; }
  .records thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .records tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .records tr:last-child { border: none; }
  .records td { padding: 0; border: none; text-align: left; }
  .records td.lead, .records td[colspan] { grid-column: 1/-1; }
  .records td[data-label]::before { content: attr(data-label); font-size: .84rem; color: var(--muted); display: block; margin-bottom: 2px; }
  .filters { padding: 13px; gap: 10px; }
  .filters > label, .extra-fields label { flex: 1 1 130px; }
  .filters .search-field { flex: 1 0 100%; }
  .filters details[open] { flex-basis: 100%; }
  .pager>div { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  aside { padding: 8px 10px 4px; }
  aside nav a { padding: 8px 7px; font-size: .875rem; }
  .user span { max-width: 75px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .layout main { padding: 19px 12px 32px; }
  .shop-tabs { gap: 2px; }
  .shop-tabs a { padding: 6px 9px; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric.primary { grid-column: 1/-1; grid-template-columns: 1fr auto; align-items: center; }
  .metric.primary strong { grid-column: 2; grid-row: 1/3; }
  .metric span, .metric small { font-size: .875rem; }
  .period { font-size: .875rem; }
  dl { grid-template-columns: minmax(90px,2fr) minmax(0,3fr); gap: 10px; }
  .auth { padding: 23px; }
}
@media (max-height: 500px) and (min-width: 821px) { aside { position: static; height: auto; } }
.filters.catalog-filters { display: grid; grid-template-columns: minmax(10rem, 1fr) minmax(8rem, .65fr) minmax(10rem, 1fr) minmax(10rem, 1fr); }
.catalog-filters label, .catalog-filters input, .catalog-filters select { min-width: 0; width: 100%; }
.catalog-filter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; grid-column: 1 / -1; }
.records .catalog-category a { color: var(--deep); font-weight: 500; }
.records .catalog-suppliers { overflow-wrap: anywhere; }
.supplier-choices { margin: .8rem 0; }
.supplier-choices summary { cursor: pointer; color: var(--deep); font-weight: 600; }
.supplier-choices summary + div { display: grid; gap: .5rem; margin: .7rem 0; max-height: 17rem; overflow: auto; }
.supplier-choices label { display: inline-flex; align-items: center; gap: .5rem; }
.supplier-choices input[type="checkbox"] { width: 1rem; height: 1rem; min-height: 0; }
@media (max-width: 1150px) { .filters.catalog-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 580px) { .filters.catalog-filters { grid-template-columns: minmax(0, 1fr); } }
.catalog-selection { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; border-bottom: 1px solid var(--line); padding: 0 0 14px; margin-bottom: 8px; }
.catalog-selection[hidden], .catalog-clear[hidden] { display: none; }
.catalog-selection [role="status"] { color: var(--muted); font-size: .9rem; }
.catalog-check { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; cursor: pointer; }
.catalog-check input { width: 1.1rem; height: 1.1rem; min-height: 0; margin: 0; accent-color: var(--green); }
.catalog-check-cell { width: 3.5rem; }
.catalog-mobile-label { display: none; }
.catalog-selection button:disabled { background: #e8eee9; color: #52665e; cursor: default; }
.catalog-secondary { background: white; color: var(--green); border-color: #aabbb0; }
.catalog-secondary:hover, .catalog-clear:hover { color: var(--deep); background: #edf4ec; }
.catalog-clear { background: transparent; color: var(--green); padding-inline: 6px; }
.catalog-feedback { background: #edf6e8; color: var(--deep); border-left: 3px solid var(--green); padding: 12px 16px; margin: 0 0 14px; }
.directory-create > div { display: flex; flex-wrap: wrap; gap: 8px; }
.directory-create input { flex: 1 1 12rem; width: auto; }
.directory-create label, .assignment-form fieldset > label { display: block; margin: 10px 0 5px; font-weight: 600; }
.directory-list { list-style: none; margin: 18px 0 0; padding: 0; }
.directory-list li { border-top: 1px solid var(--line); padding: 8px 0; overflow-wrap: anywhere; }
.assignment-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-bottom: 18px; }
.assignment-columns fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.assignment-columns legend { font-weight: 650; font-size: 1.12rem; }
.assignment-summary details { margin-top: 10px; }
.assignment-summary details summary { color: var(--green); cursor: pointer; }
@media (max-width: 680px) {
  .assignment-columns { grid-template-columns: 1fr; }
  .records .catalog-check-cell { width: auto; grid-column: 1/-1; }
  .catalog-mobile-label { display: inline; color: var(--muted); font-size: .875rem; }
}
