:root {
  color-scheme: light;
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #261f27;
  background: #f7f5f2;
  --rail: #211820;
  --muted: #655a63;
  --line: #e7e0df;
  --field: #cfc3cb;
  --accent: #71354f;
  --accent-dark: #542139;
  --focus: #955471;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: grid; grid-template-columns: 216px minmax(0, 1fr); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.sr-only, .mobile-label {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
}
.skip-link { position: fixed; inset: 8px auto auto 8px; z-index: 3; transform: translateY(-150%); padding: 10px; color: white; background: var(--rail); }
.skip-link:focus { transform: none; }
.workspace-nav {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column;
  align-items: flex-start; gap: 26px; background: var(--rail); color: #faf3ee; padding: 28px 20px 18px;
}
.workspace-nav a:focus-visible { outline-color: #e6c390; }
.identity { display: inline-flex; align-items: center; min-height: 48px; margin-inline: 8px; }
.identity img { width: 98px; height: auto; display: block; }
.workspace-links { width: 100%; display: grid; gap: 3px; }
.workspace-links a, .site-link {
  display: flex; align-items: center; min-height: 42px; padding: 8px 12px;
  color: inherit; text-decoration: none; font-size: .9rem; font-weight: 650; border-radius: 8px;
}
.workspace-links a:hover, .site-link:hover { background: #ffffff16; }
.workspace-links a:focus, body:not(:has(#zamowienia:target)) .workspace-links a:first-child,
body:has(#zamowienia:target) .workspace-links a:last-child { background-color: #ffffff12; }
.site-link { gap: 8px; color: #e0c5ad; margin-top: auto; }
.site-short { display: none; }
main { width: min(1150px, calc(100% - 64px)); margin-inline: auto; padding-block: 37px 56px; min-width: 0; }
.page-heading, .page-meta, .actions, .orders-tools, .filters, .pagination { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.page-heading, .orders-tools { justify-content: space-between; }
.page-heading { border-bottom: 1px solid var(--line); padding-bottom: 20px; }
h1 { font-size: clamp(2rem, 4vw, 2.85rem); line-height: 1.12; font-weight: 760; letter-spacing: -.05em; margin: 0; }
h2 { margin: 0; font-size: 1.15rem; letter-spacing: -.02em; }
p { margin: 0; }
.page-meta { gap: 8px; }
.page-meta:has(:not([hidden])) { margin-top: 8px; }
#mode { color: var(--muted); font-size: .89rem; }
.tag { background: #ede4d5; color: #58432d; font-size: .79rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
#status { margin: 13px 0; font-size: .85rem; color: var(--muted); }
#status:empty { display: none; }
#status[data-error="true"] { color: #9e272f; }
button, input, select { font: inherit; }
button {
  min-height: 42px; padding: 8px 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--field); background: #fff; color: inherit; font-weight: 650; font-size: .9rem;
}
button:hover { background: #f4eeef; }
button:disabled { opacity: .65; cursor: wait; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: var(--accent-dark); }
.totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin: 17px 0; }
.totals > div, .orders-card, #login { border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.totals > div { padding: 14px 19px; min-width: 0; }
.totals dt { color: var(--muted); font-size: .86rem; font-weight: 640; }
.totals dd { margin: 5px 0 0; font-size: clamp(1.3rem, 3vw, 1.95rem); font-weight: 760; letter-spacing: -.045em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.totals > div:first-child { background: #eee4e9; border-color: #e7d6df; }
.totals > div:first-child dd { color: var(--accent-dark); }
.orders-card { overflow: hidden; scroll-margin-top: 16px; }
.orders-tools { padding: 17px 20px; }
.filters label { min-width: 0; }
.filters input, .filters select, #access-key {
  width: 100%; min-height: 42px; border: 1px solid var(--field); border-radius: 8px;
  padding: 8px 12px; color: inherit; background: #fdfbfc; font-size: .9rem;
}
.filters input::placeholder { color: var(--muted); }
.orders ul { list-style: none; margin: 0; padding: 0; }
.columns, .order {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.05fr) 4.5rem minmax(5.5rem, .6fr);
  gap: 16px; align-items: center; padding: 12px 20px;
}
.columns { background: #f4efef; color: #59474f; font-size: .82rem; font-weight: 710; }
.order { border-top: 1px solid var(--line); overflow-wrap: anywhere; min-height: 68px; font-size: .94rem; }
.order time, .order .detail { color: var(--muted); font-size: .87rem; }
.buyer { display: flex; align-items: center; gap: 11px; min-width: 0; }
.buyer-details { min-width: 0; }
.avatar { flex: 0 0 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: #f2e9e9; color: #6b3b50; font-size: .78rem; font-weight: 740; }
.amount, .columns span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
#empty { padding: 24px 20px; border-top: 1px solid var(--line); color: var(--muted); }
.pagination:has(button:not([hidden])) { padding: 12px 20px; border-top: 1px solid var(--line); }
#login { margin-top: 23px; max-width: 560px; padding: 20px; }
#login label { display: block; margin-bottom: 7px; font-weight: 650; }
#access-key { width: auto; flex: 1 1 185px; }
@media (max-width: 850px) {
  body { display: block; }
  .workspace-nav { position: static; height: auto; flex-direction: row; align-items: center; gap: 10px; padding: 6px 14px; flex-wrap: wrap; }
  .identity { margin-inline: 0 6px; }
  .identity img { width: 70px; }
  .workspace-links { display: flex; width: auto; gap: 1px; }
  .workspace-links a, .site-link { padding-inline: 8px; }
  .site-link { margin: 0 0 0 auto; }
  main { width: calc(100% - 28px); padding-top: 28px; }
}
@media (max-width: 620px) {
  .page-heading { gap: 16px; padding-bottom: 15px; }
  .totals { gap: 7px; }
  .totals > div { padding: 10px 9px; border-radius: 9px; }
  .totals dt { font-size: .75rem; }
  .totals dd { font-size: clamp(1rem, 5vw, 1.35rem); }
  .orders-tools { padding: 14px; }
  .filters { width: 100%; gap: 8px; }
  .filters label { flex: 1 1 135px; }
  .columns { display: none; }
  .order { grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, 1fr); padding: 14px; gap: 12px; }
  .buyer { grid-column: 1 / -1; }
  .mobile-label { display: block; position: static; width: auto; height: auto; clip-path: none; color: var(--muted); font-size: .76rem; }
}
@media (max-width: 405px) {
  .workspace-nav { column-gap: 6px; }
  .identity img { width: 61px; }
  .site-long { display: none; }
  .site-short { display: inline; }
  .site-link { font-size: .8rem; padding-inline: 4px; gap: 4px; }
  .workspace-links a { font-size: .82rem; padding-inline: 6px; }
  .filters label:first-child { flex: 1 1 105px; }
  .filters label:last-child { flex: 1.2 1 158px; }
  .filters select { padding-inline: 9px; }
}
