/* PaletaWMS — arkusz stylów. Bez zależności zewnętrznych; font Inter (OFL) w public/fonts. */
@font-face { font-family: 'Inter Variable'; font-style: normal; font-display: swap; font-weight: 100 900; src: url('fonts/inter-latin-wght-normal.woff2') format('woff2-variations'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter Variable'; font-style: normal; font-display: swap; font-weight: 100 900; src: url('fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #f4f6f9; --surface: #ffffff; --surface-2: #f8fafc; --surface-3: #eef2f6; --border: #e5e9ef; --border-2: #d3dae3;
  --text: #0f172a; --text-2: #334155; --muted: #64748b;
  --primary: #2f6df6; --primary-h: #1f5ae0; --primary-50: #ecf2ff; --primary-100: #d9e5ff; --primary-ring: rgba(47, 109, 246, .28);
  --success: #15803d; --success-50: #e8f7ee; --warning: #b45309; --warning-50: #fff4e0; --danger: #dc2626; --danger-50: #feecec; --info: #2563eb;
  --free: #e3e9f1; --free-b: #c7d2df; --occupied: #3b7cf0; --blocked: #94a3b8; --misfit: #ef4444; --hl: #fbbf24;
  --radius: 14px; --radius-s: 10px; --radius-xs: 7px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 1px rgba(15, 23, 42, .03);
  --shadow-m: 0 4px 12px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-l: 0 24px 60px rgba(15, 23, 42, .22), 0 2px 8px rgba(15, 23, 42, .08);
  --sidebar-w: 252px; --bottombar-h: 62px;
  --font: 'Inter Variable', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'JetBrains Mono', SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0b0f17; --surface: #121826; --surface-2: #171f2e; --surface-3: #1f2838; --border: #243043; --border-2: #33415a;
  --text: #e7ecf4; --text-2: #c3ccda; --muted: #8b98ad;
  --primary: #5b93ff; --primary-h: #79a7ff; --primary-50: #16233d; --primary-100: #1d3159; --primary-ring: rgba(91, 147, 255, .35);
  --success: #34c272; --success-50: #0f2d1d; --warning: #f0a132; --warning-50: #35260c; --danger: #f06d6d; --danger-50: #3b1717; --info: #6aa5ff;
  --free: #222c3c; --free-b: #33415a; --occupied: #4b8bf5; --blocked: #4b5970; --misfit: #f05a5a; --hl: #fbbf24;
  --shadow: 0 1px 2px rgba(0, 0, 0, .45); --shadow-m: 0 6px 18px rgba(0, 0, 0, .45); --shadow-l: 0 24px 70px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-feature-settings: 'cv11', 'ss01', 'ss03'; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.015em; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; } h4 { font-size: 13.5px; color: var(--text-2); }
p { margin: 0 0 8px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .xs { font-size: 11.5px; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; } .center { text-align: center; } .right { text-align: right; }
.flex { display: flex; gap: 10px; align-items: center; } .wrap { flex-wrap: wrap; } .between { justify-content: space-between; } .grow { flex: 1; }
.col { display: flex; flex-direction: column; gap: 10px; }
.mt { margin-top: 12px; } .mb { margin-bottom: 12px; } .mt-l { margin-top: 20px; }
.hidden { display: none !important; }
.boot { padding: 40px; text-align: center; color: var(--muted); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--primary-100); }

/* ---------- Szkielet ładowania ---------- */
.skeleton { display: flex; flex-direction: column; gap: 14px; }
.skeleton .sk { border-radius: var(--radius-s); background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 37%, var(--surface-3) 63%); background-size: 400% 100%; animation: sk 1.3s ease-in-out infinite; }
.skeleton .sk-row { display: flex; gap: 14px; } .skeleton .sk-row .sk { flex: 1; }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------- Układ ---------- */
.app { min-height: 100%; }
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 10px; }
.brand .logo { width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(135deg, var(--primary), #6a4df5); display: grid; place-items: center; color: #fff; flex: none; box-shadow: 0 4px 12px var(--primary-ring); }
.brand .logo svg { width: 20px; height: 20px; }
.brand b { font-size: 15px; display: block; line-height: 1.15; letter-spacing: -.01em; } .brand span { font-size: 11.5px; color: var(--muted); display: block; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { padding: 6px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav .sect { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 14px 10px 5px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 11px; border-radius: 10px; color: var(--text-2); font-weight: 500; transition: background .12s, color .12s; }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a.active { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.nav a.active svg { opacity: 1; }
.nav a .cnt { margin-left: auto; font-size: 11px; background: var(--danger); color: #fff; border-radius: 10px; padding: 1px 7px; font-weight: 600; }
.sidebar .foot { margin-top: auto; padding: 12px 18px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.sidebar .foot kbd { margin-left: auto; }
kbd { font-family: var(--font); font-size: 11px; border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: var(--surface); color: var(--muted); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 24px; background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; min-height: 60px; }
.topbar h1 { font-size: 18px; }
.topbar .spacer { flex: 1; }
.user { display: flex; align-items: center; gap: 8px; }
.user .avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--primary-100), var(--primary-50)); color: var(--primary); display: grid; place-items: center; font-weight: 700; font-size: 12.5px; border: 1px solid var(--border); }
.user .who { line-height: 1.15; white-space: nowrap; margin-right: 4px; } .user .who b { display: block; font-size: 13px; } .user .who span { font-size: 11.5px; color: var(--muted); }
.content { padding: 22px 24px 48px; display: flex; flex-direction: column; gap: 16px; animation: fade-in .18s ease-out; }
@keyframes fade-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.hamb { display: none; }
#gsearch .input { padding-left: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2364748b'%3E%3Cpath d='M10 2a8 8 0 1 0 4.9 14.3l5.4 5.4 1.4-1.4-5.4-5.4A8 8 0 0 0 10 2zm0 2a6 6 0 1 1 0 12 6 6 0 0 1 0-12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: 15px; background-position: 10px center; }
#viewas-sel { max-width: 210px; }
.bottombar { display: none; }
.sidebar-overlay { display: none; }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(var(--sidebar-w), 86vw); z-index: 60; transform: translateX(-100%); transition: transform .22s cubic-bezier(.2, .8, .2, 1); box-shadow: var(--shadow-l); }
  .sidebar.open { transform: none; }
  .sidebar-overlay { display: block; position: fixed; inset: 0; background: rgba(2, 6, 23, .45); z-index: 55; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .sidebar-overlay.open { opacity: 1; pointer-events: auto; }
  .hamb { display: inline-flex; }
  .topbar { padding: 8px 14px; min-height: 54px; } .topbar h1 { font-size: 16px; }
  .content { padding: 14px 14px calc(var(--bottombar-h) + 24px); }
  .user .who { display: none; }
  #gsearch { display: none; }
  .bottombar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; height: var(--bottombar-h); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--border); z-index: 50; padding-bottom: env(safe-area-inset-bottom); }
  .bottombar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; color: var(--muted); font-weight: 500; }
  .bottombar a svg { width: 22px; height: 22px; } .bottombar a.active { color: var(--primary); } .bottombar a:hover { text-decoration: none; }
  .bottombar button { background: none; border: 0; font: inherit; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 500; }
  .bottombar button svg { width: 22px; height: 22px; }
}
.viewas { background: var(--warning-50); color: var(--warning); border-bottom: 1px solid var(--border); padding: 7px 24px; font-size: 13px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Karty, siatki ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card .card-h { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card .card-h h2, .card .card-h h3 { margin-right: auto; }
.card .card-b { padding: 16px 18px; }
.card .card-b.tight { padding: 0; }
.card .card-b.tight .table-wrap { border-radius: 0 0 var(--radius) var(--radius); }
.grid { display: grid; gap: 14px; }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.kpi { padding: 16px 18px; position: relative; overflow: hidden; }
.kpi .lbl { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi .val { font-size: 28px; font-weight: 700; letter-spacing: -.03em; margin-top: 4px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 6px; }
.kpi.warn .val { color: var(--warning); } .kpi.danger .val { color: var(--danger); } .kpi.ok .val { color: var(--success); }
.bar { height: 8px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--primary); border-radius: 6px; transition: width .4s ease; }
.bar.thin { height: 5px; }
.bar > i.warn { background: var(--warning); } .bar > i.danger { background: var(--danger); } .bar > i.ok { background: var(--success); }

/* ---------- Tabele ---------- */
.table-wrap { overflow: auto; max-width: 100%; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table td.mono { white-space: nowrap; }
.table th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: var(--surface-2); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.selected { background: var(--primary-50); }
.table tfoot td { font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--border); }
.table.compact th, .table.compact td { padding: 6px 10px; font-size: 12.5px; }
.table .actions { white-space: nowrap; text-align: right; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 20px; text-align: center; color: var(--muted); }
.empty-state svg { width: 36px; height: 36px; opacity: .45; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px 14px; font-size: 12.5px; color: var(--muted); }

/* ---------- Przyciski, formularze ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 13px; border-radius: var(--radius-s); border: 1px solid var(--border-2); background: var(--surface); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; line-height: 1.2; white-space: nowrap; transition: background .12s, border-color .12s, transform .06s, box-shadow .12s; }
.btn:hover { background: var(--surface-2); border-color: var(--border-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 1px 2px var(--primary-ring); }
.btn.primary:hover { background: var(--primary-h); border-color: var(--primary-h); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.xs { padding: 3px 8px; font-size: 11.5px; border-radius: 7px; }
.btn.lg { padding: 13px 18px; font-size: 15px; border-radius: 12px; }
.btn.icon { padding: 7px; }
.btn svg { width: 16px; height: 16px; }
.btn.lg svg { width: 20px; height: 20px; }
.input, select.input, textarea.input { width: 100%; padding: 8px 11px; border-radius: var(--radius-s); border: 1px solid var(--border-2); background: var(--surface); color: var(--text); font: inherit; transition: border-color .12s, box-shadow .12s; min-height: 38px; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.input.sm { padding: 5px 9px; font-size: 12.5px; min-height: 32px; border-radius: 8px; }
.input.lg { font-size: 17px; padding: 12px 14px; min-height: 50px; border-radius: 12px; }
.input.err { border-color: var(--danger); }
.input::placeholder { color: var(--muted); opacity: .8; }
textarea.input { min-height: 72px; resize: vertical; }
select.input { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2364748b'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 16px; padding-right: 28px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.field .hint { font-size: 11.5px; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 14px; }
.form-grid .span2 { grid-column: span 2; }
.form-grid .span3 { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid .span2 { grid-column: 1 / -1; } }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar .input { width: auto; min-width: 140px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; line-height: 1.5; }
.badge.ok { background: var(--success-50); color: var(--success); }
.badge.warn { background: var(--warning-50); color: var(--warning); }
.badge.danger { background: var(--danger-50); color: var(--danger); }
.badge.info { background: var(--primary-50); color: var(--primary); }
.badge.pz { background: var(--success-50); color: var(--success); } .badge.wz { background: var(--primary-50); color: var(--primary); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 10px; overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 11px 14px; font: inherit; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap; transition: color .12s; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.alert { padding: 11px 14px; border-radius: var(--radius-s); border: 1px solid var(--border); background: var(--surface-2); font-size: 13px; }
.alert.warn { background: var(--warning-50); border-color: transparent; color: var(--warning); }
.alert.danger { background: var(--danger-50); border-color: transparent; color: var(--danger); }
.alert.ok { background: var(--success-50); border-color: transparent; color: var(--success); }
.alert.info { background: var(--primary-50); border-color: transparent; color: var(--primary); }
.alert ul { margin: 6px 0 0 18px; padding: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 5px 14px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; }

/* ---------- Modal, drawer, toasty, paleta poleceń ---------- */
dialog.modal { border: 0; border-radius: 16px; padding: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-l); width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 32px); animation: modal-in .16s ease-out; }
dialog.modal.wide { width: min(1000px, calc(100vw - 24px)); }
dialog.modal.narrow { width: min(460px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(2, 6, 23, .5); backdrop-filter: blur(3px); }
@keyframes modal-in { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
.modal .m-h { display: flex; align-items: center; gap: 10px; padding: 15px 20px; border-bottom: 1px solid var(--border); }
.modal .m-h h2 { margin-right: auto; font-size: 16px; }
.modal .m-b { padding: 18px 20px; overflow: auto; max-height: calc(100vh - 200px); }
.modal .m-f { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 16px 16px; flex-wrap: wrap; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
@media (max-width: 960px) { .toasts { bottom: calc(var(--bottombar-h) + 12px); left: 12px; right: 12px; } }
.toast { background: var(--text); color: var(--bg); padding: 11px 14px 11px 16px; border-radius: 12px; box-shadow: var(--shadow-l); font-size: 13px; max-width: 420px; animation: toast-in .2s ease-out; border-left: 4px solid var(--muted); }
.toast.ok { border-left-color: var(--success); } .toast.err { border-left-color: var(--danger); } .toast.warn { border-left-color: var(--warning); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
dialog.cmdk { border: 0; border-radius: 16px; padding: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-l); width: min(640px, calc(100vw - 24px)); margin-top: 10vh; }
.cmdk .cmdk-in { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.cmdk .cmdk-in input { flex: 1; border: 0; background: none; font: inherit; font-size: 16px; color: var(--text); outline: none; }
.cmdk .cmdk-list { max-height: 50vh; overflow: auto; padding: 6px; }
.cmdk .cmdk-sect { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px 4px; font-weight: 600; }
.cmdk .cmdk-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.cmdk .cmdk-item svg { width: 16px; height: 16px; opacity: .7; flex: none; }
.cmdk .cmdk-item.active, .cmdk .cmdk-item:hover { background: var(--primary-50); color: var(--primary); }
.cmdk .cmdk-item .sub { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.cmdk .cmdk-foot { padding: 8px 14px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--muted); display: flex; gap: 14px; }

/* ---------- Logowanie / kreator ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(900px 500px at 15% -5%, var(--primary-50), transparent 60%), radial-gradient(700px 400px at 95% 100%, color-mix(in srgb, var(--primary-50) 70%, transparent), transparent 60%), var(--bg); }
.login { width: min(420px, 100%); }
.login .brand { padding: 0 0 16px; }
.login .demo { margin-top: 14px; font-size: 12.5px; }
.login .demo button { font: inherit; background: none; border: 0; color: var(--primary); cursor: pointer; padding: 2px 0; text-align: left; }

/* ---------- Mapa magazynu ---------- */
.zone-h { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.zone-h .bar { width: 160px; }
.racks { display: flex; flex-wrap: wrap; gap: 14px; }
.rack { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px 12px; box-shadow: var(--shadow); max-width: 100%; overflow-x: auto; }
.rack .rack-h { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; font-size: 12.5px; }
.rack .rack-h b { font-size: 13.5px; }
.rack .lv { display: flex; align-items: center; gap: 6px; margin: 3px 0; }
.rack .lv .lvl { width: 26px; font-size: 10.5px; color: var(--muted); text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.rack .lv .cells { display: flex; gap: 2px; align-items: flex-end; }
.rack .lv .sec { display: grid; gap: 2px; margin-right: 5px; }
.rack .lv .sec:last-child { margin-right: 0; }
.cell { width: 13px; height: 13px; border-radius: 3px; background: var(--free); border: 1px solid var(--free-b); cursor: pointer; position: relative; transition: transform .08s; }
.cell.occ { border-color: transparent; }
.cell.blocked { background: repeating-linear-gradient(45deg, var(--blocked) 0 2px, transparent 2px 4px); border-color: var(--blocked); }
.cell.misfit { outline: 2px solid var(--misfit); outline-offset: -1px; }
.cell.hl { outline: 3px solid var(--hl); outline-offset: 0; z-index: 2; }
.cell.dim { opacity: .18; }
.cell:hover { transform: scale(1.4); z-index: 3; box-shadow: 0 0 0 1px var(--text); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); align-items: center; }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; border: 1px solid var(--free-b); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-l); z-index: 50; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .22s cubic-bezier(.2, .8, .2, 1); }
.drawer.open { transform: none; }
.drawer .d-h { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.drawer .d-h h3 { margin-right: auto; }
.drawer .d-b { padding: 14px 16px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 12px; }

/* ---------- Terminal mobilny ---------- */
.terminal { max-width: 560px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 14px; }
.terminal .big { font-size: 30px; font-weight: 750; letter-spacing: -.03em; font-family: var(--mono); }
.terminal .actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.terminal .actions-grid .btn { padding: 14px 10px; font-size: 14px; flex-direction: column; gap: 6px; border-radius: 14px; }
.terminal .actions-grid .btn svg { width: 22px; height: 22px; }
.scanner { position: relative; border-radius: 14px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner .frame { position: absolute; inset: 18% 12%; border: 2px solid rgba(255, 255, 255, .85); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); }

/* ---------- Wykresy SVG ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--font); fill: var(--muted); font-size: 11px; }
.chart .grid line { stroke: var(--border); }
.chart .in { fill: var(--success); } .chart .out { fill: var(--primary); }

/* ---------- Dokument do druku ---------- */
.doc { background: var(--surface); padding: 30px 34px; max-width: 900px; margin: 0 auto; border: 1px solid var(--border); border-radius: var(--radius); width: 100%; }
.doc .doc-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; border-bottom: 2px solid var(--text); padding-bottom: 12px; margin-bottom: 14px; }
.doc .doc-title { text-align: right; } .doc .doc-title h1 { font-size: 24px; } .doc .doc-title .num { font-size: 18px; font-weight: 700; text-align: right; }
.doc .parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 10px 0 16px; }
.doc .parties h4 { text-transform: uppercase; font-size: 11px; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }
.doc table.table th { position: static; }
.doc .sign { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 24px; margin-top: 40px; }
.doc .sign div { border-top: 1px solid var(--text); padding-top: 6px; font-size: 12px; color: var(--muted); text-align: center; }
.doc .cancelled { position: relative; }
.doc .stamp { position: absolute; top: 90px; left: 50%; transform: translateX(-50%) rotate(-14deg); border: 4px solid var(--danger); color: var(--danger); font-size: 32px; font-weight: 800; padding: 6px 22px; opacity: .55; letter-spacing: .1em; border-radius: 8px; pointer-events: none; }
@media (max-width: 640px) { .doc { padding: 18px 16px; } .doc .parties { grid-template-columns: 1fr; } }

/* ---------- Etykiety palet ---------- */
.labels { display: grid; grid-template-columns: repeat(auto-fill, minmax(96mm, 1fr)); gap: 6mm; }
.label { border: 1px solid var(--border-2); border-radius: 6px; padding: 5mm 6mm; background: #fff; color: #000; width: 100%; break-inside: avoid; page-break-inside: avoid; display: flex; flex-direction: column; gap: 2mm; }
.label .l-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; }
.label .l-id { font-family: var(--mono); font-size: 22px; font-weight: 800; letter-spacing: .02em; }
.label .l-bc svg { width: 100%; height: 16mm; display: block; }
.label .l-place { font-family: var(--mono); font-size: 20px; font-weight: 800; }
.label .l-goods { font-size: 13px; font-weight: 600; line-height: 1.2; }
.label .l-meta { font-size: 11px; color: #333; display: flex; justify-content: space-between; gap: 6px; }

@media print {
  @page { margin: 10mm; }
  body { background: #fff; color: #000; font-size: 12px; }
  .sidebar, .sidebar-overlay, .topbar, .viewas, .toolbar, .no-print, .toasts, .drawer, .btn, .bottombar { display: none !important; }
  .shell { display: block; } .content { padding: 0; animation: none; }
  .doc { border: 0; box-shadow: none; padding: 0; max-width: none; }
  .card { border: 0; box-shadow: none; }
  .table th { background: #eee; color: #000; }
  a { color: inherit; }
  .labels { gap: 4mm; grid-template-columns: repeat(2, 1fr); }
  .label { border: 1px dashed #999; }
}

/* ---------- Dostępność: ograniczony ruch ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- Ikony: domyślny rozmiar (zerowa specyficzność — reguły komponentów mają pierwszeństwo) ---------- */
:where(svg[viewBox="0 0 24 24"][aria-hidden="true"]) { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.18em; }
.cmdk .cmdk-in > svg { width: 18px; height: 18px; opacity: .55; }
.viewas > svg { width: 16px; height: 16px; }
