:root {
  --bg: #F6F1EA;
  --surface: #FFFDF9;
  --sunk: #EFE8DE;
  --hover: #F8F3EC;
  --line: #E6DCCF;
  --line-strong: #D3C6B5;
  --ink: #2A211B;
  --ink-2: #5F5248;
  --muted: #74675C;
  --accent: #B04A26;
  --accent-hover: #983D1C;
  --accent-ink: #FFF8F2;
  --accent-soft: #F6E3D9;
  --ok: #3F6B45;
  --ok-soft: #E2EDDF;
  --warn: #7A540C;
  --warn-soft: #F7EBCF;
  --bad: #A8261C;
  --bad-soft: #F8DED9;
  --stock-ready: #2C67B0;
  --stock-ready-soft: #E3EDF9;
  --stock-sewn: #C9620C;
  --stock-sewn-soft: #FCEBD9;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(60, 40, 20, .05), 0 3px 10px rgba(60, 40, 20, .05);
  --shadow-lift: 0 2px 4px rgba(60, 40, 20, .08), 0 16px 36px rgba(60, 40, 20, .16);
  --display: 'Bricolage Grotesque', 'Instrument Sans', sans-serif;
  --body: 'Instrument Sans', system-ui, sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --side-w: 248px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
::selection { background: var(--accent-soft); color: var(--ink); }
input, select, textarea, button { font: inherit; color: inherit; caret-color: var(--accent); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.02em; margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.text-bad { color: var(--bad); font-weight: 600; }
.text-ok { color: var(--ok); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 3px solid var(--bg); }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface); cursor: pointer; font-weight: 500; white-space: nowrap; text-decoration: none; color: var(--ink);
  transition: background .15s, border-color .15s, color .15s, transform .15s var(--ease);
}
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--sunk); }
.btn.danger { color: var(--bad); }
.btn.danger-fill { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ok-fill { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.sm { height: 32px; padding: 0 10px; font-size: 14px; }
.btn.icon-only { width: 38px; padding: 0; }
.btn.icon-only.sm { width: 32px; }
.btn.icon-only.xs { width: 26px; height: 26px; border-radius: 6px; }
.btn.block { width: 100%; justify-content: flex-start; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.input {
  height: 38px; padding: 0 11px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--surface); width: 100%; min-width: 0;
}
textarea.input { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.45; }
.input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.input.bare { border-color: transparent; background: transparent; height: 32px; padding: 0 4px; }
.input.color { padding: 4px; height: 38px; }
.xs-input { width: 76px; height: 32px; }
.input-icon { position: relative; display: block; }
.input-icon .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 36px; }
.input-icon.search { width: min(280px, 100%); }
.check { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; min-width: 0; }
.row.end { justify-content: flex-end; }
.row.top-align { align-items: flex-start; }
.grow { flex: 1; min-width: 0; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; }
.stack-form { display: grid; gap: 12px; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.filters .field { min-width: 150px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.chip-btn:hover { background: var(--hover); }
.chip-btn[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: #F6EFE7; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.chip .icon { width: 14px; height: 14px; }
.chip.bad { color: var(--bad); font-weight: 600; }
.chip.warn { color: var(--warn); font-weight: 600; }
.chip.ok { color: var(--ok); }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 12px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--sunk); color: var(--ink-2); }
.pill .icon { width: 14px; height: 14px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected='true'] { color: var(--ink); border-bottom-color: var(--accent); }
.tab-count { font-size: 12px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); display: grid; place-items: center; }
.seg { display: inline-flex; padding: 3px; background: var(--sunk); border-radius: 9px; }
.seg button { border: 0; background: none; height: 30px; padding: 0 10px; border-radius: 7px; display: inline-flex; gap: 6px; align-items: center; font-size: 14px; font-weight: 500; color: var(--ink-2); cursor: pointer; }
.seg button[aria-selected='true'] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.summary-line { font: 500 1rem/1.4 var(--display); color: var(--ink-2); }
.summary-line b { color: var(--ink); font-weight: 700; }
.summary-line.small-line { font: 400 14px/1.5 var(--body); color: var(--muted); }
.notice { display: flex; gap: 10px; padding: 12px 16px; border-radius: var(--radius); background: var(--warn-soft); color: #5E4108; font-size: 14px; align-items: flex-start; }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.empty { padding: 28px 18px; text-align: center; color: var(--muted); display: grid; gap: 6px; justify-items: center; }
.empty img { width: min(220px, 70%); margin-bottom: 6px; }
.empty b { color: var(--ink); font-weight: 600; }
.empty .btn { margin-top: 8px; }
.skeleton { height: 140px; border-radius: var(--radius); background: linear-gradient(90deg, var(--sunk), #F4EEE6, var(--sunk)); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; grid-template-columns: 1.15fr 1fr; }
.login-photo { background: #8B6F55 url('/img/login-hero.jpg') center/cover; position: relative; }
.login-photo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(30, 20, 12, .6)); }
.login-photo p { position: absolute; z-index: 1; left: 40px; bottom: 36px; right: 40px; color: #FBF4EC; font: 500 1.35rem/1.35 var(--display); max-width: 32ch; }
.login-panel { display: grid; place-items: center; padding: 32px 20px; }
.login-box { width: min(380px, 100%); display: grid; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font: 700 1.2rem var(--display); letter-spacing: -0.02em; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.demo-accounts { display: grid; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.demo-accounts button { display: flex; justify-content: space-between; text-align: left; padding: 8px 10px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-sm); cursor: pointer; }
.demo-accounts button:hover { border-color: var(--accent); }
.err { color: var(--bad); font-size: 14px; min-height: 1.2em; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; height: 100dvh; }
.side { padding: 14px 12px; display: flex; flex-direction: column; gap: 14px; border-right: 1px solid var(--line); background: var(--bg); overflow-y: auto; }
.company-switch { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid transparent; border-radius: var(--radius-sm); background: none; cursor: pointer; text-align: left; width: 100%; }
.company-switch:hover { background: var(--surface); border-color: var(--line); }
.co-mark { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; font: 700 1rem var(--display); flex: none; }
.co-mark.lg { width: 44px; height: 44px; font-size: 1.25rem; border-radius: 11px; }
.co-mark.xs { width: 18px; height: 18px; font-size: 11px; border-radius: 5px; display: inline-grid; vertical-align: -4px; }
.co-name { display: grid; line-height: 1.25; min-width: 0; flex: 1; }
.co-name b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-switch { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 3px; background: var(--sunk); border-radius: 10px; }
.panel-switch:empty { display: none; }
.panel-switch button { border: 0; background: none; border-radius: 8px; padding: 7px 4px 6px; display: grid; justify-items: center; gap: 2px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.panel-switch button:hover { color: var(--ink); }
.panel-switch button[aria-selected='true'] { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.nav { display: grid; gap: 1px; align-content: start; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; font-weight: 500; min-width: 0; }
.nav a span:not(.count):not(.dot-color) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav a:hover { background: var(--sunk); color: var(--ink); }
.nav a[aria-current='page'] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.nav a[aria-current='page'] .icon { color: var(--accent); }
.nav-group { display: flex; align-items: center; justify-content: space-between; padding: 14px 10px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.nav-add { border: 0; background: none; width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.nav-add:hover { background: var(--sunk); color: var(--ink); }
.nav-add .icon { width: 16px; height: 16px; }
.nav-empty { padding: 4px 10px; font-size: 13px; color: var(--muted); }
.dot-color { width: 10px; height: 10px; border-radius: 3px; flex: none; margin: 0 4px; display: inline-block; }
.dot-color.lg { width: 14px; height: 14px; border-radius: 4px; margin: 0 10px 0 0; vertical-align: 1px; }
.count { margin-left: auto; font-size: 12px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 6px 0; border-top: 1px solid var(--line); }
.me .who { line-height: 1.25; min-width: 0; flex: 1; }
.me .who b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 600; font-size: 12.5px; flex: none; }
.avatar.sm { width: 24px; height: 24px; font-size: 10.5px; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.avatars { display: flex; }
.avatars .avatar { border: 2px solid var(--surface); margin-left: -6px; }
.avatars .avatar:first-child { margin-left: 0; }
.main { min-width: 0; display: flex; flex-direction: column; overflow-y: auto; }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: 12px 28px; min-height: 64px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top h1 { font-size: 1.3rem; margin-right: auto; display: flex; align-items: center; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-tools { flex-wrap: nowrap; }
.top-tools select.input { width: auto; }
.page { padding: 22px 28px 56px; display: grid; gap: 20px; align-content: start; min-width: 0; }
.bell { position: relative; color: var(--ink-2); }
.bell .dot { position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; }
#msg-dot { background: var(--accent); }
.date-pill { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); font-weight: 500; cursor: pointer; white-space: nowrap; }
.date-pill input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.date-pill:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.tabbar { display: none; }

/* ---------- panels & tables ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2 { margin-right: auto; }
.panel-body { padding: 16px 18px; }
.panel-foot { padding: 0 18px 16px; }
.split { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.stack { display: grid; gap: 20px; align-content: start; min-width: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.kpi { display: grid; gap: 6px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .2s var(--ease); }
a.kpi:hover { border-color: var(--line-strong); box-shadow: var(--shadow-lift); }
.kpi > span { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi b { font: 700 1.9rem/1 var(--display); letter-spacing: -0.02em; }
.kpi b small { font: 500 .95rem var(--body); color: var(--muted); letter-spacing: 0; }
.kpi em { font-style: normal; font-size: 13px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--bg); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
td.c, th.c { text-align: center; }
th.w-check { width: 44px; }
tbody tr:hover td { background: var(--hover); }
tbody tr.selected td { background: #FBEFE8; }
tr.clickable { cursor: pointer; }
tr.inactive td { opacity: .5; }
tfoot td { font-weight: 600; background: var(--bg); border-top: 1px solid var(--line-strong); }
.big-sum { font: 700 1.2rem var(--display); }
.bar { height: 6px; border-radius: 6px; background: var(--sunk); overflow: hidden; min-width: 60px; flex: 1; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .5s var(--ease); }
.bar.ok > i { background: var(--ok); }
.bar.bad > i { background: var(--bad); }
.thumb { width: 52px; height: 52px; border-radius: 7px; object-fit: cover; background: var(--sunk); flex: none; }
.thumb.sm { width: 36px; height: 36px; border-radius: 6px; }
.thumbs { display: flex; }
.thumbs img { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; border: 2px solid var(--surface); margin-left: -6px; background: var(--sunk); }
.thumbs img:first-child { margin-left: 0; }

/* ---------- alarms ---------- */
.alarms { display: grid; }
.alarm { display: grid; grid-template-columns: 30px 1fr; gap: 2px 10px; padding: 11px 18px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
a.alarm:hover { background: var(--hover); }
.alarm:last-child { border-bottom: 0; }
.alarm .ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; grid-row: span 2; }
.alarm .ic .icon { width: 16px; height: 16px; }
.alarm b { font-weight: 600; }
.alarm p { color: var(--ink-2); font-size: 13.5px; grid-column: 2; }
.alarm.high .ic { background: var(--bad-soft); color: var(--bad); }
.alarm.mid .ic, .alarm.low .ic { background: var(--warn-soft); color: var(--warn); }
.alarm.ok .ic { background: var(--ok-soft); color: var(--ok); }
.alarms.scroll { max-height: 360px; overflow-y: auto; }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.sw.done { background: var(--accent); }
.sw.plan { background: #EAD9CC; }
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .g { stroke: var(--line); stroke-width: 1; }
.chart .ax { font: 500 11px var(--body); fill: var(--muted); font-variant-numeric: tabular-nums; }
.chart .ax.now { fill: var(--accent); font-weight: 700; }
.chart .plan { fill: #EAD9CC; }
.chart .done { fill: var(--accent); }
.chart .hit { fill: transparent; }
.chart .day:hover .hit { fill: rgba(176, 74, 38, .05); }
.chart .tip { position: absolute; pointer-events: none; background: var(--ink); color: #F6EFE7; font-size: 13px; padding: 5px 9px; border-radius: 6px; white-space: nowrap; box-shadow: var(--shadow-lift); }
.feed { list-style: none; margin: 0; padding: 4px 0; max-height: 360px; overflow-y: auto; }
.feed li { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 8px 18px; font-size: 14px; }
.feed li + li { border-top: 1px solid var(--line); }
.feed img { width: 34px; height: 34px; border-radius: 7px; object-fit: cover; }
.feed b { font-weight: 600; }

/* ---------- kanban (wspólny dla planu, rozdzielni, projektów) ---------- */
.kb { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; min-height: 200px; }
.kb-col { flex: 0 0 292px; background: var(--sunk); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100dvh - 170px); border: 1px solid transparent; transition: background .15s, border-color .15s; }
.kb-col.drop { background: var(--accent-soft); border-color: var(--accent); }
.kb-head { padding: 12px 12px 10px; display: grid; gap: 8px; }
.kb-head h2 { font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-head .row h2 { flex: 1; min-width: 0; }
.kb-cards { padding: 0 8px 8px; display: grid; gap: 8px; overflow-y: auto; min-height: 44px; align-content: start; }
.kb-card { background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 10px 11px; display: grid; gap: 7px; border: 1px solid transparent; transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .15s, opacity .15s; }
.kb-card[draggable='true'] { cursor: grab; }
.kb-card[draggable='true']:hover { box-shadow: var(--shadow-lift); }
.kb-card:active { cursor: grabbing; }
.kb-card.dragging { opacity: .4; transform: rotate(1.5deg); }
.kb-card.is-done { background: #F8FBF6; border-color: #D5E4D1; }
.kb-card h3 { font: 600 14.5px/1.35 var(--body); letter-spacing: 0; }
.kb-card .note { margin: 0; font-size: 13px; color: var(--ink-2); background: var(--bg); border-radius: 6px; padding: 6px 8px; }
.kb-empty { margin: 2px 4px 6px; font-size: 13px; color: var(--muted); padding: 14px 8px; text-align: center; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm); }
.kb-add { padding: 0 8px 8px; }
.kb-form { background: var(--surface); padding: 8px; border-radius: var(--radius-sm); display: grid; gap: 8px; box-shadow: var(--shadow); }
.lane-ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--surface); color: var(--accent); flex: none; }
.lane-ic.ok { width: 24px; height: 24px; background: var(--ok-soft); color: var(--ok); }
.lane-ic.ok .icon { width: 14px; height: 14px; }
.kb-col.lane-cart { background: #EFE3D6; flex-basis: 316px; }
.kb-col.lane-print { background: #E7ECE3; }
.kb-col.lane-print .lane-ic { color: var(--ok); }
.ocard.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.order-items { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; }
.order-items li { display: flex; gap: 8px; align-items: flex-start; line-height: 1.3; }
.order-items img { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; flex: none; background: var(--sunk); }
.order-items.compact { gap: 4px; }
.order-items.compact img { width: 26px; height: 26px; }
.orders-table td { vertical-align: top; }
.bulk-bar { position: sticky; bottom: 16px; z-index: 6; display: flex; gap: 10px; align-items: center; padding: 10px 12px 10px 18px; background: var(--ink); color: #F6EFE7; border-radius: var(--radius); box-shadow: var(--shadow-lift); flex-wrap: wrap; animation: rise .35s var(--ease); }
.bulk-bar .btn:not(.primary) { background: transparent; color: inherit; border-color: #5c4f45; }
.bulk-bar .btn:not(.primary):hover { background: #3a2f27; }
.bulk-bar select.input { width: auto; background: #3a2f27; border-color: #5c4f45; color: #F6EFE7; }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
.add-col { flex: 0 0 260px; height: 48px; border: 1.5px dashed var(--line-strong); background: transparent; color: var(--muted); font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--radius); }
.add-col:hover { color: var(--ink); border-color: var(--ink-2); background: var(--hover); }
.drop-marker { height: 4px; border-radius: 2px; background: var(--accent); margin: -2px 2px; }
.tcard .t-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-start; }
.tcard .t-meta:not(:has(> :not(.grow))) { display: none; }
.round-check { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; flex: none; padding: 0; color: transparent; transition: background .15s, border-color .15s, color .15s; margin-top: 1px; }
.round-check .icon { width: 12px; height: 12px; stroke-width: 2.5; }
.round-check:hover { border-color: var(--ok); color: var(--ok); }
.round-check.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.is-done .t-title, .tcard.is-done h3 { text-decoration: line-through; color: var(--muted); }
.prio { display: inline-grid; place-items: center; }
.prio .icon { width: 15px; height: 15px; }
.prio.p1 { color: var(--muted); }
.prio.p2 { color: var(--warn); }
.prio.p3 { color: var(--bad); }
.prio.p3 .icon { fill: currentColor; }

/* ---------- zadania (lista Asana) ---------- */
.quick-add { display: flex; gap: 8px; align-items: center; padding: 8px 8px 8px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.quick-add .input[name='title'] { flex: 1; border-color: transparent; }
.quick-add select.input { width: auto; max-width: 220px; }
.quick-add input[type='date'] { width: auto; }
.qa-ic { color: var(--muted); display: grid; place-items: center; }
.task-group { display: grid; gap: 8px; }
.task-group > h2 { font-size: .95rem; display: flex; gap: 8px; align-items: baseline; }
.task-group.overdue > h2 { color: var(--bad); }
.trows { display: grid; overflow: hidden; }
.trow { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); cursor: pointer; min-height: 48px; }
.trow:last-child { border-bottom: 0; }
.trow:hover { background: var(--hover); }
.t-title { flex: 1; min-width: 0; font-weight: 500; }
.t-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.trow.add-row { cursor: text; color: var(--muted); }
.trow.add-row .input { flex: 1; }
.proj-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); text-decoration: none; padding: 2px 8px 2px 6px; border-radius: 6px; background: color-mix(in srgb, var(--c) 12%, transparent); white-space: nowrap; justify-self: start; }
.proj-chip::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
a.proj-chip:hover { background: color-mix(in srgb, var(--c) 20%, transparent); }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.proj-card { display: grid; gap: 12px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; transition: box-shadow .2s var(--ease), transform .2s var(--ease); align-content: start; }
.proj-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.proj-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--c); color: #fff; display: grid; place-items: center; font: 700 1rem var(--display); flex: none; }

/* ---------- panel boczny (szczegóły zadania, osoba, alarmy) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(42, 33, 27, .25); z-index: 29; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.side-sheet { position: fixed; inset: 0 0 0 auto; width: min(540px, 100%); background: var(--surface); box-shadow: var(--shadow-lift); z-index: 30; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .35s var(--ease); }
.side-sheet.open { transform: none; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.sheet-body { padding: 18px 22px 32px; overflow-y: auto; display: grid; gap: 14px; align-content: start; }
.sheet-body > h3 { margin-top: 8px; display: flex; gap: 8px; align-items: baseline; }
.side-sheet .alarms { overflow-y: auto; }
.title-input { font: 700 1.4rem/1.25 var(--display); letter-spacing: -0.02em; border: 1px solid transparent; border-radius: 8px; padding: 4px 6px; margin: 0 -7px; resize: none; background: transparent; width: calc(100% + 14px); overflow: hidden; }
.title-input:hover { border-color: var(--line); }
.title-input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.fields { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; align-items: center; margin: 0; }
.fields dt { font-size: 13.5px; color: var(--muted); font-weight: 500; }
.fields dd { margin: 0; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.checklist li { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; }
.checklist li:hover { background: var(--hover); }
.checklist label { display: flex; align-items: center; gap: 10px; flex: 1; cursor: pointer; }
.checklist input:checked + span { text-decoration: line-through; color: var(--muted); }
.checklist li .btn { opacity: 0; }
.checklist li:hover .btn, .checklist li .btn:focus-visible { opacity: 1; }
.comments { display: grid; gap: 12px; }
.comment { display: grid; grid-template-columns: 24px 1fr; gap: 10px; }
.comment p { margin-top: 2px; }
.mini-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.mini-days > div { display: grid; gap: 4px; padding: 10px; background: var(--bg); border-radius: var(--radius-sm); }

/* ---------- dialog, menu, toasty ---------- */
dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(460px, calc(100% - 32px)); box-shadow: var(--shadow-lift); background: var(--surface); color: var(--ink); }
dialog.wide { width: min(620px, calc(100% - 32px)); }
dialog[open] { animation: pop-in .3s var(--ease); }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
dialog::backdrop { background: rgba(42, 33, 27, .35); }
dialog form { display: grid; gap: 14px; padding: 22px; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
legend { font-size: 13px; font-weight: 500; color: var(--ink-2); padding: 0; margin-bottom: 6px; width: 100%; }
.swatches label { cursor: pointer; }
.swatches input { position: absolute; opacity: 0; }
.swatches span { display: block; width: 30px; height: 30px; border-radius: 8px; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); }
.swatches input:checked + span { box-shadow: 0 0 0 2px var(--ink); }
.swatches input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.img-pick label { cursor: pointer; }
.img-pick input { position: absolute; opacity: 0; }
.img-pick img { width: 62px; height: 62px; object-fit: cover; border-radius: 8px; border: 2px solid transparent; display: block; }
.img-pick input:checked + img { border-color: var(--accent); }
.img-pick input:focus-visible + img { outline: 2px solid var(--accent); outline-offset: 2px; }
.co-pick label { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; }
.co-pick label:has(input:checked) { border-color: var(--accent); background: #FBEFE8; }
.popmenu { position: fixed; z-index: 60; min-width: 220px; max-width: 300px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lift); padding: 5px; display: grid; animation: pop-in .2s var(--ease); }
.popmenu button { display: flex; align-items: center; gap: 9px; border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.popmenu button:hover, .popmenu button:focus-visible { background: var(--sunk); outline: none; }
.popmenu button.danger { color: var(--bad); }
.popmenu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.pm-h { font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 10px 2px; }
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 70; width: min(440px, calc(100% - 32px)); }
.toast { background: var(--ink); color: #F6EFE7; padding: 11px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lift); animation: toast .4s var(--ease); display: flex; gap: 10px; align-items: center; }
.toast span { flex: 1; }
.toast a { color: #F3C7B3; font-weight: 600; white-space: nowrap; }
.toast.bad { background: var(--bad); }
@keyframes toast { from { opacity: 0; transform: translateY(10px); filter: blur(3px); } }

/* ---------- pracownik: mój dzień ---------- */
.day-hero { display: grid; gap: 10px; padding: 20px; }
.day-hero .big { font: 700 3rem/1 var(--display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.day-hero .big small { font-size: 1.2rem; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.day-hero .bar { height: 10px; flex: none; }
.msg-banner { display: flex; gap: 12px; padding: 14px 16px; background: var(--accent-soft); border-radius: var(--radius); color: #6E2E15; text-decoration: none; }
.task-list { display: grid; gap: 12px; }
.task { display: grid; grid-template-columns: 76px 1fr; gap: 12px 14px; padding: 14px; }
.task .thumb { width: 76px; height: 76px; }
.task .qty-count { font: 700 1.6rem/1 var(--display); margin-top: 6px; }
.task .qty-count small { font: 500 .95rem var(--body); color: var(--muted); }
.task .note.wide { grid-column: 1 / -1; background: var(--bg); padding: 8px 10px; border-radius: 8px; }
.task .actions { grid-column: 1 / -1; display: grid; grid-template-columns: 64px 1fr; gap: 10px; }
.task .plus { height: 60px; font: 700 1.15rem var(--display); border-radius: var(--radius); }
.task .minus { height: 60px; border-radius: var(--radius); }
.task.is-done .plus { background: var(--ok); border-color: var(--ok); }
.pop { animation: popk .45s var(--ease); }
@keyframes popk { 35% { transform: scale(1.03); } }

/* ---------- biblioteka / magazyn ---------- */
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.lib-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: grid; align-content: start; transition: border-color .15s, box-shadow .2s var(--ease), transform .2s var(--ease); }
.lib-item.as-button { padding: 0; text-align: left; cursor: pointer; }
.lib-item.as-button:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.lib-item.picked { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.lib-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--sunk); display: block; }
.lib-item .info { padding: 10px 12px 12px; display: grid; gap: 8px; }
.lib-item .info b { font-weight: 600; line-height: 1.3; }
.stepper { display: grid; grid-template-columns: 34px 1fr 34px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; height: 34px; }
.stepper button { border: 0; background: var(--bg); cursor: pointer; display: grid; place-items: center; }
.stepper button:hover { background: var(--sunk); }
.stepper input { border: 0; text-align: center; min-width: 0; background: var(--surface); font-variant-numeric: tabular-nums; }
.stepper input:focus { outline: none; background: var(--accent-soft); }

/* ---------- firmy ---------- */
.owner-hero { min-height: 150px; padding: 26px 28px; border-radius: var(--radius); background: var(--surface) url('/img/owner-hero.png') right center / auto 100% no-repeat; border: 1px solid var(--line); display: flex; align-items: center; }
.owner-hero > div { max-width: 56%; display: grid; gap: 6px; }
.owner-hero h2 { font-size: 1.5rem; }
.co-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.co-card { display: grid; gap: 16px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.co-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; }
.co-stats > div { padding: 12px; background: var(--bg); border-radius: var(--radius-sm); display: grid; gap: 4px; align-content: start; }
.co-stats dt { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.co-stats dd { margin: 0; font: 700 1.4rem/1.1 var(--display); }
.co-stats dd small { font: 500 .9rem var(--body); color: var(--muted); }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; align-items: start; }
table.access th.c { white-space: nowrap; }

/* ---------- wiadomości ---------- */
.chat { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.chat-list { display: grid; padding: 6px; max-height: calc(100dvh - 140px); overflow-y: auto; }
.chat-person { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; background: none; border-radius: var(--radius-sm); text-align: left; cursor: pointer; }
.chat-person > span.grow { display: grid; line-height: 1.25; }
.chat-person b { font-weight: 600; }
.chat-person:hover { background: var(--hover); }
.chat-person[aria-current='true'] { background: var(--accent-soft); }
.chat-main { display: flex; flex-direction: column; min-height: 420px; max-height: calc(100dvh - 140px); }
.chat-main .panel-head h2 { margin-right: auto; }
.thread { display: grid; gap: 10px; overflow-y: auto; padding: 16px 18px; align-content: start; flex: 1; }
.bubble { max-width: 78%; padding: 9px 13px; border-radius: 14px; background: var(--sunk); justify-self: start; }
.bubble.mine { justify-self: end; background: var(--accent); color: var(--accent-ink); }
.bubble small { display: block; opacity: .75; font-size: 12px; margin-top: 3px; }
.chat-send { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }

/* ---------- druk (lista dla krawcowej) ---------- */
#print-area { display: none; }
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff; font-size: 11pt; }
  #app, #toasts, .side-sheet, .scrim, .tabbar { display: none !important; }
  #print-area { display: block; color: #000; }
  .p-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #000; padding-bottom: 6px; margin-bottom: 10px; }
  .p-head h1 { font-size: 18pt; }
  .p-group { break-inside: avoid; margin-bottom: 12px; }
  .p-group h2 { font-size: 13pt; display: flex; justify-content: space-between; border-bottom: 1px solid #000; padding: 4px 0; }
  .p-group table th { background: none; color: #000; font-size: 9pt; }
  .p-group td, .p-group th { padding: 5px 6px; border-bottom: 1px solid #bbb; }
  .p-box { width: 14px; height: 14px; border: 1.5px solid #000; display: inline-block; }
  .p-foot { margin-top: 14px; font-size: 9pt; border-top: 1px solid #000; padding-top: 6px; display: flex; justify-content: space-between; }
}

/* ---------- responsywność ---------- */
@media (max-width: 1180px) { .split { grid-template-columns: 1fr; } .owner-hero { background-size: auto 60%; background-position: right bottom; } .owner-hero > div { max-width: 100%; } }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-photo { min-height: 200px; }
  .login-photo p { left: 16px; right: 16px; bottom: 16px; font-size: 1.05rem; }
  .shell { grid-template-columns: 1fr; height: auto; }
  .side { display: none; }
  .main { overflow: visible; }
  .top { padding: 10px 16px; min-height: 56px; flex-wrap: wrap; }
  .top h1 { font-size: 1.15rem; }
  .top-tools { order: 3; width: 100%; overflow-x: auto; }
  .page { padding: 16px 16px 96px; gap: 16px; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: grid; justify-items: center; gap: 2px; font-size: 11.5px; color: var(--muted); text-decoration: none; padding: 4px 0; font-weight: 500; }
  .tabbar a[aria-current='page'] { color: var(--accent); }
  .tabbar .icon { width: 22px; height: 22px; }
  th, td { padding: 9px 10px; }
  .kb-col { flex-basis: 84vw; max-height: none; }
  .bulk-bar { bottom: 76px; }
  .quick-add { flex-wrap: wrap; }
  .quick-add .input[name='title'] { flex-basis: 100%; }
  .trow { flex-wrap: wrap; }
  .t-meta { justify-content: flex-start; width: 100%; padding-left: 32px; }
  .chat { grid-template-columns: 1fr; }
  .chat-list { max-height: 180px; }
  .fields { grid-template-columns: 90px 1fr; }
  .co-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

[hidden] { display: none !important; }
.kb.dispatch .kb-col:not(.lane-cart) { flex-basis: 260px; }
.sheet-body { flex: 1; grid-auto-rows: max-content; }
.sheet-body textarea.input { min-height: 96px; }
.owner-hero { background-color: var(--bg); }
@media (max-width: 860px) { .quick-add .qa-ic { display: none; } .quick-add { padding: 8px; } }
.empty img { border-radius: 12px; }

/* ---------- v3: działy, etapy, tkaniny ---------- */
.dept-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
.dept-tag .icon { width: 14px; height: 14px; }
.task-group h2 .icon { width: 18px; height: 18px; vertical-align: -3px; color: var(--accent); }
.panel-head h2 .icon { width: 18px; height: 18px; vertical-align: -3px; color: var(--accent); }

.fab-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.fab-chip i { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); }
.fab-chip span { font-weight: 400; color: var(--muted); }
.fab-chip.lg { font-size: 15px; margin-top: 2px; }
.fab-chip.lg i { width: 16px; height: 16px; }

/* stan magazynu na zamówieniach: niebieskie = gotowe, pomarańczowe = uszyte */
.pill.st-gotowe { background: var(--stock-ready-soft); color: var(--stock-ready); }
.pill.st-uszyte { background: var(--stock-sewn-soft); color: var(--stock-sewn); }
.pill.st-czesc { background: var(--sunk); color: var(--ink-2); }
.kb-card.st-gotowe { border-color: var(--stock-ready); box-shadow: inset 4px 0 0 var(--stock-ready), var(--shadow); background: #F7FAFE; }
.kb-card.st-uszyte { border-color: var(--stock-sewn); box-shadow: inset 4px 0 0 var(--stock-sewn), var(--shadow); background: #FFF9F3; }
tbody tr.st-gotowe td { background: var(--stock-ready-soft); }
tbody tr.st-gotowe td:first-child { box-shadow: inset 4px 0 0 var(--stock-ready); }
tbody tr.st-uszyte td { background: var(--stock-sewn-soft); }
tbody tr.st-uszyte td:first-child { box-shadow: inset 4px 0 0 var(--stock-sewn); }
.legend .sw.st-gotowe { background: var(--stock-ready); }
.legend .sw.st-uszyte { background: var(--stock-sewn); }
.dot-st { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: 1px; }
.dot-st.st-gotowe { background: var(--stock-ready); }
.dot-st.st-uszyte { background: var(--stock-sewn); }
.stack-xs { display: grid; gap: 4px; justify-items: start; }

/* raport 7:00 i magazyn */
.kpis.sizes { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpis.stages { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kpi.dim b { color: var(--muted); }
tbody tr.gap td { background: #FDF4F2; }
tbody tr.muted-row td { color: var(--muted); }
tbody tr.muted-row .thumb { opacity: .6; }
.var-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 0; }
.stock-table td { vertical-align: top; }
.form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.field.inline { min-width: 240px; }
.order-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; max-height: 240px; overflow: auto; }
.order-list li { display: flex; align-items: center; gap: 8px; }
.form-grid.three { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.rates input { width: 92px; }
.rates th .icon { width: 15px; height: 15px; vertical-align: -2px; color: var(--muted); }

/* tkaniny */
.fab-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); align-items: start; }
.colors { width: 100%; }
.colors td, .colors th { padding: 6px 10px; }
.colors .input { height: 34px; }
.input.bare { border-color: transparent; background: transparent; }
.input.bare:hover, .input.bare:focus { border-color: var(--line-strong); background: var(--surface); }
.swatch-input { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.swatch-input::-webkit-color-swatch-wrapper { padding: 0; }
.swatch-input::-webkit-color-swatch { border: 1px solid rgba(0, 0, 0, .18); border-radius: 50%; }
.add-color td { border-top: 1px dashed var(--line); }
.input.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.add-color .input.num { padding: 0 8px; width: 100%; min-width: 48px; }
.size-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.size-sum > div { display: grid; gap: 3px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg); font-size: 13px; color: var(--ink-2); justify-items: start; }
.size-sum > div > b { font: 700 1rem var(--display); color: var(--ink); }
.size-sum > div.gap { background: #FDF4F2; }

/* ---------- v4: rozdzielnia — szybkie zaznaczanie, wysyłka ---------- */
.quick-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.quick { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; cursor: pointer; color: var(--ink); box-shadow: var(--shadow); transition: border-color .15s, background .15s; }
.quick .icon { width: 17px; height: 17px; }
.quick b { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: inline-grid; place-items: center; font-size: 12.5px; }
.quick:disabled { opacity: .45; cursor: default; box-shadow: none; }
.quick.q-sew .icon { color: var(--accent); }
.quick.q-sew b { background: var(--accent-soft); color: var(--accent); }
.quick.q-ship .icon { color: var(--stock-ready); }
.quick.q-ship b { background: var(--stock-ready-soft); color: var(--stock-ready); }
.quick.q-ship:not(:disabled):hover { border-color: var(--stock-ready); background: var(--stock-ready-soft); }
.quick.q-sewn .icon { color: var(--stock-sewn); }
.quick.q-sewn b { background: var(--stock-sewn-soft); color: var(--stock-sewn); }
.quick.q-sewn:not(:disabled):hover { border-color: var(--stock-sewn); background: var(--stock-sewn-soft); }
.quick.q-sew:not(:disabled):hover { border-color: var(--accent); background: var(--accent-soft); }
.item-st { display: inline-block; padding: 0 6px; border-radius: 6px; font-size: 12px; font-weight: 700; line-height: 18px; }
.item-st.st-gotowe { background: var(--stock-ready-soft); color: var(--stock-ready); }
.item-st.st-uszyte { background: var(--stock-sewn-soft); color: var(--stock-sewn); }
.kb-col.lane-ship { background: #EAF1FA; }
.kb-col.lane-ship .lane-ic { color: var(--stock-ready); }
.dept-filter { margin: -4px 0 2px; }
.ocard .small .icon { width: 13px; height: 13px; vertical-align: -2px; }

/* ---------- stolarnia / piankowanie: kafelki stanu ---------- */
.stock-tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stile { display: grid; gap: 8px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); border-top: 4px solid var(--ok); }
.stile.mid { border-top-color: #D29A2E; }
.stile.low { border-top-color: var(--bad); background: #FFF8F6; }
.stile h3 { font: 700 1.1rem var(--display); }
.stile .big { font: 700 2.4rem/1 var(--display); letter-spacing: -0.02em; }
.stile .big small { font: 500 1rem var(--body); color: var(--muted); }
.stile .row.small { justify-content: space-between; }
.stile .actions { display: grid; grid-template-columns: 56px 1fr; gap: 8px; margin-top: 4px; }
.stile .actions .btn { height: 52px; font-size: 15px; }
.stile.pop { animation: popk .45s var(--ease); }

/* ---------- zadania: kolory statusów ---------- */
.st-chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 600; white-space: nowrap;
  color: var(--s); background: color-mix(in srgb, var(--s) 12%, transparent); }
.st-chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--s); }
.st-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--s); margin-right: 8px; flex: none; }
.task-group h2 { display: flex; align-items: center; gap: 4px; }
.trows .trow[style*='--s'] { box-shadow: inset 3px 0 0 var(--s); }
.trow.late { background: #FDF4F2; }
.trow.late .t-title { color: var(--bad); }
.kb-col.st-col { border-top: 4px solid var(--s); }
.kb-col.st-col .kb-head .st-dot { background: var(--s); margin-right: 2px; }
.kb-col.st-col .tcard { box-shadow: inset 3px 0 0 var(--s), var(--shadow); }
.tcard.late { background: #FFF8F6; }
.task-tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.ttile { display: grid; gap: 2px; justify-items: start; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; text-align: left;
  border-left: 4px solid var(--s); transition: background .15s, border-color .15s; }
.ttile b { font: 700 1.6rem/1.1 var(--display); color: var(--s); }
.ttile span { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.ttile:hover { background: color-mix(in srgb, var(--s) 6%, var(--surface)); }
.ttile.on { background: color-mix(in srgb, var(--s) 12%, var(--surface)); border-color: var(--s); }
.ttile.zero b { color: var(--muted); }
.group-toggle { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; font: 600 .95rem var(--display); color: var(--ink-2); cursor: pointer; padding: 4px 0; }
.group-toggle .icon { width: 16px; height: 16px; }
.st-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.st-opt { height: 30px; padding: 0 11px; border-radius: 15px; border: 1px solid color-mix(in srgb, var(--s) 35%, transparent); background: var(--surface); color: var(--s); font-weight: 600; font-size: 13px; cursor: pointer; }
.st-opt:hover { background: color-mix(in srgb, var(--s) 8%, var(--surface)); }
.st-opt.on { background: var(--s); color: #fff; border-color: var(--s); }
.yday { display: grid; gap: 4px; padding: 14px 18px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid #EBC9B8; }
.yday-label { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--accent); }
.yday-label .icon { width: 16px; height: 16px; }
.yday b { font: 700 1.6rem/1.2 var(--display); letter-spacing: -0.01em; }
.yday b i { font-style: normal; color: var(--muted); font-weight: 400; margin: 0 4px; }
.yday.none { background: var(--surface); border-color: var(--line); }
.yday.none b { font-size: 1.1rem; color: var(--muted); }

/* ---------- v5: zamówienie ręczne, wysyłka ---------- */
.seg.kinds label { position: relative; }
.seg.kinds input { position: absolute; opacity: 0; pointer-events: none; }
.seg.kinds span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 7px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg.kinds span .icon { width: 16px; height: 16px; }
.seg.kinds input:checked + span { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.seg.kinds input:focus-visible + span { outline: 2px solid var(--accent); }
.mo-lines { display: grid; gap: 8px; margin-bottom: 6px; }
.mo-line { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(170px, 1.3fr) 80px 36px; gap: 8px; align-items: center; }
@media (max-width: 640px) { .mo-line { grid-template-columns: 1fr 70px 36px; } .mo-line select[name=v] { grid-column: 1 / -1; grid-row: 2; } }
.ship-table td { vertical-align: top; }
.ship-table .pill .icon { width: 13px; height: 13px; }

/* ---------- poprawki kafelków ---------- */
.tabs { overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.kpis { grid-auto-rows: 1fr; }
.kpi { align-content: start; min-width: 0; }
.kpi > span, .kpi em { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpis + .panel, .kpis + .notice, .stock-tiles + .split, .yday + .stock-tiles, .task-tiles + .task-group, .task-tiles + .summary-line { margin-top: 2px; }
.stock-tiles { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); align-items: stretch; }
.stile { grid-template-rows: auto auto auto auto 1fr; min-width: 0; }
.stile .actions { align-self: end; }
.stile .actions .btn.plus { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 10px; }
.task-tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-auto-rows: 1fr; }
.ttile { min-width: 0; align-content: start; }
.ttile span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.quick span { white-space: nowrap; }
@media (max-width: 700px) {
  .quick-bar { display: grid; grid-template-columns: 1fr; width: 100%; }
  .quick { justify-content: space-between; }
  .quick b { margin-left: auto; }
  .stock-tiles { grid-template-columns: 1fr 1fr; }
  .stile .big { font-size: 2rem; }
}
@media (max-width: 460px) { .stock-tiles { grid-template-columns: 1fr; } }
#tab-body, #ship-body, #dept-body { display: grid; gap: 16px; align-content: start; min-width: 0; }

/* ---------- tkaniny w mb ---------- */
.mat-segs { display: grid; gap: 16px; }
.mat-seg .panel-head { gap: 10px; }
.mat-sum { font: 700 1.15rem var(--display); letter-spacing: -0.01em; }
.mat-grid { display: grid; gap: 12px; padding: 16px; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
.mat-tile { display: grid; grid-template-rows: auto 1fr; padding: 0; text-align: left; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; cursor: pointer; transition: border-color .15s, box-shadow .2s var(--ease), transform .2s var(--ease); }
.mat-tile:hover { border-color: var(--line-strong); box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.mat-tile.low { border-color: #E9B8AF; background: #FFF8F6; }
.mat-tile.empty { border-color: var(--bad); background: #FFF3F0; }
.mat-band { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; height: 54px; padding: 8px 10px; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .08); }
.mat-band b { font: 700 .95rem var(--display); padding: 1px 7px; border-radius: 6px; background: rgba(255, 253, 249, .88); color: var(--ink); }
.mat-band .pill { height: 20px; font-size: 11.5px; }
.mat-body { display: grid; gap: 5px; padding: 10px 12px 12px; }
.mat-name { font-weight: 600; font-size: 14px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mat-m { font: 700 1.55rem/1.05 var(--display); letter-spacing: -0.02em; }
.mat-tile.low .mat-m, .mat-tile.empty .mat-m { color: var(--bad); }
.mat-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); vertical-align: -2px; margin-right: 4px; }
.mat-dot.lg { width: 30px; height: 30px; border-radius: 8px; margin: 0; }
.mat-dot.other { display: grid; place-items: center; background: var(--sunk); box-shadow: none; color: var(--ink-2); }
.mat-reqs { display: grid; }
.mat-req { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); }
.mat-req:first-child { border-top: 0; }
.mat-req.done { opacity: .62; }
.mat-req-main { min-width: 0; }
.mat-card { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; }
.mat-card .mat-band { height: 72px; border-radius: var(--radius-sm); }
.mat-pick { display: grid; gap: 6px; max-height: 300px; overflow: auto; }
.mat-pick-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.mat-pick-row:has(input[type=checkbox]:checked) { border-color: var(--accent); background: var(--accent-soft); }
.mat-pick-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.mat-qty { display: flex; align-items: center; gap: 4px; }
.mat-qty .input { width: 74px; text-align: right; }
.mat-other { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px 12px; margin: 0; }
.mat-other legend { padding: 0 6px; color: var(--ink-2); font-weight: 600; }
.mat-hist > summary { cursor: pointer; list-style: none; border-bottom: 0; }
.mat-hist[open] > summary { border-bottom: 1px solid var(--line); }
.mat-hist > summary::-webkit-details-marker { display: none; }
@media (max-width: 860px) {
  .mat-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); padding: 12px; gap: 10px; }
  .mat-req { grid-template-columns: auto minmax(0, 1fr) auto; padding: 12px; }
  .mat-req-act { grid-column: 1 / -1; justify-content: flex-end; }
  .mat-m { font-size: 1.3rem; }
}
.chips .chip-btn { display: inline-flex; align-items: center; gap: 6px; }
.chips .chip-btn .icon { width: 15px; height: 15px; }

/* ---------- komunikator ---------- */
.chat2 { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; height: calc(100dvh - 120px); min-height: 460px; }
.chat-side { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.chat-search { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--muted); }
.chat-search .input { flex: 1; }
.chat-scroll { overflow-y: auto; padding: 6px; display: grid; align-content: start; gap: 2px; }
.chat-group { display: block; padding: 12px 10px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.chat-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: var(--radius-sm); text-align: left; cursor: pointer; color: var(--ink); }
.chat-item:hover { background: var(--hover); }
.chat-item[aria-current="true"] { background: var(--accent-soft); }
.chat-item .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.ci-main { display: grid; min-width: 0; flex: 1; gap: 1px; }
.ci-top { display: flex; justify-content: space-between; gap: 8px; }
.ci-top b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-prev { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item.unread .ci-prev { color: var(--ink); font-weight: 600; }
.ch-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--sunk); color: var(--ink-2); flex: none; }
.chat-pane { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.chat-head h2 { font-size: 1.05rem; }
.chat-head .back { display: none; }
.thread2 { flex: 1; overflow-y: auto; padding: 14px 18px 8px; display: flex; flex-direction: column; gap: 2px; background: color-mix(in srgb, var(--bg) 55%, var(--surface)); }
.day-sep { display: flex; justify-content: center; margin: 14px 0 8px; }
.day-sep span { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--line); padding: 2px 10px; border-radius: 10px; }
.msg { position: relative; display: flex; align-items: flex-end; gap: 8px; margin-top: 8px; }
.msg.cont { margin-top: 2px; }
.msg.mine { flex-direction: row-reverse; }
.msg-gap { width: 24px; flex: none; }
.msg.mine .msg-gap { display: none; }
.msg-col { display: grid; justify-items: start; max-width: min(72%, 620px); min-width: 0; }
.msg.mine .msg-col { justify-items: end; }
.msg-who { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin: 0 0 2px 10px; }
.msg .bubble { max-width: 100%; padding: 7px 12px 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 1px rgba(60, 40, 20, .04); overflow-wrap: anywhere; color: var(--ink); }
.msg:not(.mine):not(.cont) .bubble { border-bottom-left-radius: 6px; }
.msg.mine .bubble { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.msg.mine:not(.cont) .bubble { border-bottom-right-radius: 6px; }
.msg.mine .bubble a { color: inherit; }
.msg.deleted .bubble { background: transparent; border-style: dashed; color: var(--muted); }
.msg.deleted .bubble i { display: inline-flex; gap: 4px; align-items: center; font-size: 13.5px; }
.msg-text { line-height: 1.45; }
.msg-time { display: block; text-align: right; font-size: 11px; opacity: .7; margin-top: 1px; }
.msg-img { display: block; margin: 2px -6px 4px; }
.msg-img img { display: block; max-width: min(320px, 100%); max-height: 320px; border-radius: 11px; object-fit: cover; }
.quote { display: grid; text-align: left; gap: 1px; width: 100%; margin: 2px 0 5px; padding: 5px 9px; border: 0; border-left: 3px solid currentColor; border-radius: 6px; background: rgba(0, 0, 0, .06); color: inherit; font-size: 13px; cursor: pointer; }
.quote span { opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.msg.mine .quote { background: rgba(255, 255, 255, .16); }
.reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: -4px; padding: 0 6px; position: relative; z-index: 1; }
.react { display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 7px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; cursor: pointer; box-shadow: var(--shadow); }
.react b { font-size: 12px; color: var(--ink-2); }
.react.on { border-color: var(--accent); background: var(--accent-soft); }
.seen { display: inline-flex; align-items: center; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.seen .icon { width: 13px; height: 13px; margin-right: -5px; }
.seen .icon:last-of-type { margin-right: 3px; }
.msg-tools { display: flex; gap: 2px; align-self: center; opacity: 0; transition: opacity .15s; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 2px; box-shadow: var(--shadow); }
.msg:hover .msg-tools, .msg:focus-within .msg-tools { opacity: 1; }
.msg-tools button { width: 28px; height: 28px; border: 0; background: none; border-radius: 7px; cursor: pointer; display: grid; place-items: center; color: var(--ink-2); font-size: 15px; }
.msg-tools button:hover { background: var(--hover); color: var(--ink); }
.msg-tools .icon { width: 16px; height: 16px; }
.msg.flash .bubble { animation: flash 1.2s var(--ease); }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--warn); } 100% { box-shadow: none; } }
.composer { border-top: 1px solid var(--line); padding: 8px 12px 6px; display: grid; gap: 6px; background: var(--surface); }
.comp-row { display: flex; align-items: flex-end; gap: 6px; }
.comp-row textarea { flex: 1; resize: none; min-height: 42px; max-height: 160px; padding: 10px 12px; line-height: 1.4; }
.comp-row .send { width: 42px; height: 42px; }
.comp-row label.btn { cursor: pointer; }
.emoji-btn { font-size: 18px; }
.comp-hint { padding-left: 4px; }
.comp-ctx { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--sunk); font-size: 13.5px; }
.comp-ctx .grow { display: grid; min-width: 0; }
.comp-ctx .grow span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comp-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.pop { position: fixed; z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lift); padding: 6px; }
.pop button { border: 0; background: none; border-radius: 8px; cursor: pointer; font-size: 21px; width: 38px; height: 38px; }
.pop button:hover { background: var(--hover); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 38px); }
.react-pick { display: flex; }
.pad { padding: 10px; }

/* ---------- podgląd zespołu (właściciel) ---------- */
.ov { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.ov-list { display: grid; padding: 6px; gap: 2px; max-height: calc(100dvh - 160px); overflow-y: auto; }
.ov-person { display: flex; align-items: flex-start; gap: 10px; padding: 10px; border: 0; background: none; border-radius: var(--radius-sm); text-align: left; cursor: pointer; color: var(--ink); }
.ov-person:hover { background: var(--hover); }
.ov-person[aria-current="true"] { background: var(--accent-soft); }
.ov-person > .grow { display: grid; gap: 1px; min-width: 0; }
.ov-stats { display: flex; gap: 10px; margin-top: 4px; color: var(--ink-2); }
.ov-stats > span { display: inline-flex; align-items: center; gap: 3px; }
.ov-stats .icon { width: 14px; height: 14px; }
.ov-detail { min-height: 420px; display: flex; flex-direction: column; }
.ov-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 14px 18px; }
.ov-kpis > div { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--sunk); }
.ov-kpis b { font: 700 1.5rem/1 var(--display); }
.ov-kpis span { font-size: 12.5px; color: var(--muted); }
.ov-kpis .bad { background: var(--bad-soft); color: var(--bad); }
.ov-tabs { margin: 0 18px; align-self: flex-start; }
.ov-body { padding: 12px 18px 18px; display: grid; gap: 4px; }
.ov-task { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); text-align: left; cursor: pointer; color: var(--ink); }
.ov-task:hover { border-color: var(--line-strong); }
.ov-task > .grow { display: grid; min-width: 0; }
.ov-task.late { border-left: 3px solid var(--bad); }
.ov-task.done { opacity: .6; }
.ov-task .st-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--s); flex: none; }
.ov-chat { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px; min-height: 380px; }
.ov-convos { display: grid; align-content: start; gap: 2px; }
.ov-thread { border: 1px solid var(--line); border-radius: var(--radius-sm); max-height: 60dvh; }

/* ---------- proste zgłaszanie braków (pracownicy) ---------- */
.need { display: grid; gap: 16px; max-width: 720px; }
.need-box { display: grid; gap: 14px; padding: 20px; }
.need-box h2 { font-size: 1.35rem; }
.need-box textarea { font-size: 18px; min-height: 110px; padding: 14px; line-height: 1.4; }
.need-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.need-pick { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 14px 6px 8px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 16px; font-weight: 600; cursor: pointer; color: var(--ink); }
.need-pick i { width: 30px; height: 30px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.need-pick[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.need-send { height: 60px; font-size: 19px; }
.need-list { display: grid; }
.need-row { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); font-size: 16px; }
.need-row:first-child { border-top: 0; }
.need-row .grow { display: grid; }
.need-row .pill { height: 30px; font-size: 14px; padding: 0 12px; }

@media (max-width: 860px) {
  .chat2 { grid-template-columns: 1fr; height: calc(100dvh - 150px); }
  .chat2.has-thread .chat-side, .chat2:not(.has-thread) .chat-pane { display: none; }
  .chat-head .back { display: inline-grid; }
  .msg-col { max-width: 82%; }
  .msg-tools { position: absolute; top: -30px; right: 0; }
  .msg.mine .msg-tools { right: auto; left: 0; }
  .comp-hint { display: none; }
  .ov, .ov-chat { grid-template-columns: 1fr; }
  .ov-list { max-height: 260px; }
  .ov-kpis { grid-template-columns: 1fr 1fr; }
}
.card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.card-foot > .btn { margin-left: auto; max-width: 100%; }
.danger-zone { grid-column: 1 / -1; border-color: #E9B8AF; }
.danger-zone .panel-head h2 .icon { color: var(--bad); }

/* ---------- czas pracy ---------- */
.today-body { display: grid; gap: 20px; align-content: start; min-width: 0; }
#clock-bar:empty { display: none; }
.clock { display: flex; align-items: center; gap: 16px; padding: 14px 16px 14px 20px; border-radius: var(--radius); background: var(--surface); border: 2px solid var(--line); box-shadow: var(--shadow); flex-wrap: wrap; }
.clock.on { border-color: var(--ok); background: var(--ok-soft); }
.clock-info { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 200px; }
.clock-info > div { display: grid; gap: 2px; }
.clock-info b { font: 700 1.15rem var(--display); }
.clock-run { font: 600 1.05rem var(--body); color: var(--ok); }
.clock-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--ok); flex: none; box-shadow: 0 0 0 0 rgba(63, 107, 69, .5); animation: pulse 1.8s infinite; }
.clock-dot.sm { width: 9px; height: 9px; display: inline-block; margin-right: 4px; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(63, 107, 69, .45); } 70% { box-shadow: 0 0 0 10px rgba(63, 107, 69, 0); } 100% { box-shadow: 0 0 0 0 rgba(63, 107, 69, 0); } }
.clock-btn { height: 64px; padding: 0 26px; font: 800 1.2rem var(--display); letter-spacing: .02em; border-radius: 14px; }
.clock-btn .icon { width: 22px; height: 22px; stroke-width: 2.5; }
.clock-btn.start { background: var(--ok); border-color: var(--ok); color: #fff; }
.clock-btn.start:hover { background: #335A39; }
.clock-btn.stop { background: var(--bad); border-color: var(--bad); color: #fff; }
.clock-btn.stop:hover { background: #8E1F17; }
.wt-dates .input { height: 32px; padding: 0 8px; width: 140px; }
.wt-table tr.wt-on td { background: #F3F8F1; }
.wt-table tr.wt-forgot td { background: #FFF5F3; }
.warn-kpi { border-color: #E9B8AF; background: #FFF8F6; }
.icon.xs { width: 13px; height: 13px; vertical-align: -2px; }
@media (max-width: 860px) {
  .clock { padding: 14px; }
  .clock-btn { width: 100%; height: 72px; font-size: 1.35rem; }
}
.wt-who { width: auto; min-width: 180px; max-width: 260px; }

/* konto w górnym pasku — tylko telefon (na komputerze jest w bocznym menu) */
.me-btn { display: none; border: 0; background: none; padding: 2px; border-radius: 50%; cursor: pointer; }
.me-btn:focus-visible { outline: 2px solid var(--accent); }
.popmenu .pm-h { display: block; padding: 8px 12px 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
@media (max-width: 860px) {
  .me-btn { display: inline-grid; }
  .me-btn .avatar { width: 36px; height: 36px; font-size: 13px; }
  .popmenu button { min-height: 46px; font-size: 16px; }
}

/* ---------- rozdzielnia — prosty widok (telefon najpierw) ---------- */
.sd-top { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.sd-top > div { display: grid; gap: 8px; }
.sd-h { font-size: 1.05rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip-btn b { margin-left: 4px; }
.chip-btn:disabled { opacity: .45; cursor: default; }
.sd-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.sd-list { display: grid; overflow: hidden; }
.sd-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-top: 1px solid var(--line); cursor: pointer; border-left: 4px solid transparent; transition: background .12s; -webkit-tap-highlight-color: transparent; }
.sd-row:first-child { border-top: 0; }
.sd-row:hover { background: var(--hover); }
.sd-row.st-gotowe { border-left-color: var(--stock-ready); }
.sd-row.st-uszyte { border-left-color: var(--stock-sewn); }
.sd-row.on { background: var(--accent-soft); }
.sd-check { width: 26px; height: 26px; flex: none; accent-color: var(--accent); cursor: pointer; }
.sd-main { display: grid; gap: 5px; flex: 1; min-width: 0; }
.sd-ref { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sd-ref b { font: 700 1.05rem var(--display); }
.sd-items { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.sd-item { display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; }
.note-inline { display: inline-flex; gap: 5px; align-items: center; color: var(--warn); }
.note-inline .icon { width: 14px; height: 14px; }
.sd-n { font: 700 1.3rem var(--display); white-space: nowrap; }
.sd-n small { font: 500 .8rem var(--body); color: var(--muted); }
.sd-who { position: sticky; top: 80px; padding: 16px; display: grid; gap: 12px; max-height: calc(100dvh - 100px); overflow-y: auto; }
.sd-close { display: none; }
.sd-day { justify-self: start; }
.sd-targets { display: grid; gap: 8px; }
.sd-target { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; cursor: pointer; color: var(--ink); transition: border-color .12s, background .12s; }
.sd-target > span:last-child { display: grid; gap: 1px; min-width: 0; }
.sd-target b { font-size: 15.5px; }
.sd-target:not(:disabled):hover { border-color: var(--accent); background: var(--accent-soft); }
.sd-target:disabled { opacity: .5; cursor: default; }
.sd-target .avatar { width: 40px; height: 40px; font-size: 14px; }
.sd-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--sunk); flex: none; }
.t-print .sd-ic { background: var(--stock-sewn-soft); color: var(--stock-sewn); }
.t-ship .sd-ic { background: var(--stock-ready-soft); color: var(--stock-ready); }
.sd-target.hint { border-color: var(--stock-ready); }
.text-warn { color: var(--warn); }
.sd-bar, .sd-scrim { display: none; }
.sd-done .sd-groups { display: grid; gap: 12px; padding: 14px 18px; }
.sd-refs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip-btn.sm { height: 30px; font-size: 13px; padding: 0 10px; }
@media (max-width: 860px) {
  .sd-top { align-items: stretch; }
  .sd-top > .btn { flex: 1; justify-content: center; }
  .sd-top .chips { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .sd-layout { grid-template-columns: 1fr; }
  .sd-row { padding: 14px 12px; gap: 12px; min-height: 72px; }
  .sd-check { width: 30px; height: 30px; }
  /* „Komu?” wysuwa się od dołu jak arkusz */
  .sd-who { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 40; max-height: 82dvh; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); transform: translateY(105%); transition: transform .28s var(--ease); box-shadow: var(--shadow-lift); }
  .sd-layout.picking .sd-who { transform: none; }
  .sd-close { display: inline-grid; position: absolute; right: 10px; top: 10px; }
  .sd-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(42, 33, 27, .4); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .sd-layout.picking .sd-scrim { opacity: 1; pointer-events: auto; }
  .sd-target { min-height: 66px; }
  .sd-bar { display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 30; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 14px; background: var(--ink); color: #F6EFE7; box-shadow: var(--shadow-lift); transform: translateY(160%); transition: transform .25s var(--ease); }
  .sd-bar.show { transform: none; }
  .sd-bar > span { display: grid; line-height: 1.2; }
  .sd-bar .small { opacity: .75; }
  .sd-go { height: 50px; padding: 0 20px; font-size: 17px; }
  .sd-list { margin-bottom: 70px; }
}
.sd-code { white-space: nowrap; font-weight: 600; }
.sd-item { flex-wrap: wrap; }

/* okienko „Ile sztuk?” — duże pod palec */
.qty-ask { display: grid; grid-template-columns: 64px 1fr 64px; gap: 10px; margin: 6px 0 12px; }
.qa-step { height: 64px; justify-content: center; }
.qa-step .icon { width: 26px; height: 26px; }
.qa-num { height: 64px; text-align: center; font: 700 2rem var(--display); -moz-appearance: textfield; }
.qa-num::-webkit-inner-spin-button, .qa-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qa-quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.qa-quick .chip-btn { min-width: 52px; height: 44px; justify-content: center; font-size: 17px; }
.qa-ok { height: 52px; padding: 0 24px; font-size: 17px; }

/* telefon: otwarta rozmowa na cały ekran, wysokość = widoczna część nad klawiaturą */
@media (max-width: 860px) {
  html.chat-full, html.chat-full body { overflow: hidden; overscroll-behavior: none; }
  .chat2.has-thread .chat-pane { position: fixed; left: 0; right: 0; top: var(--vvt, 0px); height: var(--vvh, 100dvh); z-index: 45; border: 0; border-radius: 0; box-shadow: none; }
  .chat2.has-thread .composer { padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .chat2.has-thread .comp-row textarea { font-size: 16px; }
  .chat2:not(.has-thread) { min-height: 0; }
}

/* ---------- stolarnia: cięcie (piła) i zbijanie ---------- */
.stile { display: flex; flex-direction: column; }
.stile > .cut-box, .stile > .actions:not(.cut-box ~ *) { margin-top: auto; }
.cut-box { display: grid; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--sunk); }
.cut-box.empty .cut-n { color: var(--bad); }
.cut-l { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; color: var(--muted); }
.cut-l .icon { width: 16px; height: 16px; }
.cut-n { font: 700 1.5rem/1 var(--display); margin-left: 8px; }
.cut-box .actions { margin-top: 2px; }
.cut-box .plus { background: var(--ink); border-color: var(--ink); }
.stile .actions { align-self: stretch; width: 100%; }
.cut-box.empty .cut-n { color: inherit; }
.cut-box.need .cut-n { color: var(--bad); }
.cut-top { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; min-width: 0; }
.cut-top .grow { flex: 1 0 0; }
.cut-top .pill { white-space: nowrap; }
