/* Conlaro – panel */
:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --border: #e3e7ef;
  --text: #172033;
  --muted: #667085;
  --primary: #1f3a8a;
  --primary-hover: #182e6f;
  --primary-soft: #e8edfb;
  --sidebar: #101a33;
  --sidebar-text: #b9c2d8;
  --sidebar-strong: #ffffff;       /* tekst aktywny / po najechaniu */
  --sidebar-muted: #6f7a96;
  --sidebar-hover: rgba(255,255,255,.07);
  --sidebar-line: rgba(255,255,255,.08);
  --nav-active: rgba(99,125,255,.22);
  --brand-mark: #3b5bdb;
  --ring: rgba(31,58,138,.15);
  --auth-glow: #dfe6fb;
  --info: var(--primary); --info-bg: var(--primary-soft);
  --success: #12715b; --success-bg: #e3f5ef;
  --warning: #915b00; --warning-bg: #fdf1dc;
  --danger: #b42318;  --danger-bg: #fdeceb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .6em; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; margin: 0; }
.muted { color: var(--muted); }
small { font-size: 12px; }

/* Logo */
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo-mark { width: 32px; height: 32px; border-radius: 8px; background: var(--primary); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 18px; }
.logo-text { font-weight: 700; font-size: 19px; letter-spacing: .2px; }

/* Układ panelu: menu zwinięte do ikon, rozwijane po najechaniu albo przypięte */
:root { --nav-w: 64px; --nav-open: 236px; }
.nav-pinned { --nav-w: 236px; }
.app { display: block; min-height: 100vh; }
.sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 40; width: var(--nav-w);
  background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column;
  overflow: hidden; transition: width .18s ease, box-shadow .18s ease; }
.sidebar:hover, .sidebar:focus-within { width: var(--nav-open); transition-delay: .15s; }
html:not(.nav-pinned) .sidebar:hover, html:not(.nav-pinned) .sidebar:focus-within { box-shadow: 8px 0 30px rgba(16,24,40,.25); }
.brand { display: block; padding: 18px 14px 16px; color: var(--sidebar-strong); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .logo-mark { background: var(--brand-mark); flex-shrink: 0; width: 36px; height: 36px; }
.sidebar nav { flex: 1; padding: 4px 10px; overflow-y: auto; overflow-x: hidden; }
.nav-item { display: flex; align-items: center; gap: 14px; padding: 10px 12px; margin-bottom: 2px;
  border-radius: 8px; color: var(--sidebar-text); font-weight: 500; white-space: nowrap; }
.nav-item:hover { background: var(--sidebar-hover); color: var(--sidebar-strong); text-decoration: none; }
.nav-item.active { background: var(--nav-active); color: var(--sidebar-strong); }
.nav-item .ico { width: 20px; height: 20px; }
.nav-sep { margin: 14px 12px 6px; height: 14px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--sidebar-muted); white-space: nowrap; border-top: 1px solid var(--sidebar-line); padding-top: 10px; box-sizing: content-box; }
.sidebar-foot { padding: 10px; border-top: 1px solid var(--sidebar-line); display: flex; flex-direction: column; gap: 6px; }
.nav-pin { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 12px; border: 0; border-radius: 8px;
  background: none; color: var(--sidebar-text); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; text-align: left; }
.nav-pin:hover { background: var(--sidebar-hover); color: var(--sidebar-strong); }
.nav-pin .ico { transform: rotate(180deg); transition: transform .18s; }
.nav-pin.is-pinned .ico { transform: none; }
.sidebar-foot .ver { font-size: 11px; color: var(--sidebar-muted); padding: 0 12px; white-space: nowrap; }
/* Etykiety chowają się, gdy menu jest zwinięte */
.sidebar .logo-text, .nav-item span, .nav-pin span, .nav-sep, .sidebar-foot .ver { transition: opacity .12s; }
html:not(.nav-pinned) .sidebar:not(:hover):not(:focus-within) .logo-text,
html:not(.nav-pinned) .sidebar:not(:hover):not(:focus-within) .nav-item span,
html:not(.nav-pinned) .sidebar:not(:hover):not(:focus-within) .nav-pin span,
html:not(.nav-pinned) .sidebar:not(:hover):not(:focus-within) .sidebar-foot .ver { opacity: 0; }
html:not(.nav-pinned) .sidebar:not(:hover):not(:focus-within) .nav-sep { color: transparent; }
.ico { flex-shrink: 0; }

.main { margin-left: var(--nav-w); min-width: 0; display: flex; flex-direction: column; transition: margin-left .18s ease; }
.topbar { height: 60px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 28px; }
.org-name { font-weight: 600; }
.user-menu { display: flex; align-items: center; gap: 14px; }
.user-menu form { margin: 0; }
.user-chip { display: flex; align-items: center; gap: 10px; color: var(--text); }
.user-chip:hover { text-decoration: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta small { color: var(--muted); }
.content { padding: 26px 28px 48px; max-width: 1280px; width: 100%; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.section-title { margin: 26px 0 12px; }

/* Karty i siatki */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px; }
.card-flush { padding: 0; overflow-x: auto; }
.card.narrow { max-width: 620px; }
.muted-card { background: #fafbfd; box-shadow: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid .card { margin: 0; }
.integration { display: flex; flex-direction: column; gap: 6px; }
.integration p { flex: 1; margin: 4px 0 10px; }
.integration-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.onboarding { border-left: 4px solid var(--primary); }
.onboarding p { color: var(--muted); max-width: 640px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; color: var(--text); }
.stat:hover { border-color: #c3cbe0; text-decoration: none; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { font-size: 28px; font-weight: 700; margin-top: 4px; }

/* Tabele */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); background: #fafbfd; padding: 10px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafbff; }
.card:not(.card-flush) .table th, .card:not(.card-flush) .table td { padding-left: 0; }
.num { text-align: right; }

/* Zakładki i pasek narzędzi */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; background: #e9ecf3; padding: 4px; border-radius: 9px; }
.tab { padding: 6px 12px; border-radius: 7px; color: var(--muted); font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.count { background: rgba(16,24,40,.08); border-radius: 10px; padding: 0 7px; font-size: 12px; }
.tab.active .count { background: var(--primary-soft); color: var(--primary); }
.search { display: flex; gap: 6px; }
.search input { width: 300px; }

/* Odznaki */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-neutral { background: #eef0f4; color: #475467; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger, .badge-claim { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }

/* Formularze */
.form { display: flex; flex-direction: column; gap: 14px; }
.form fieldset { border: 0; padding: 0; margin: 0 0 4px; display: flex; flex-direction: column; gap: 14px; }
.form legend { font-weight: 650; margin-bottom: 10px; padding: 0; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-weight: 550; font-size: 13px; }
.hint { color: var(--muted); }
input, select, textarea { font: inherit; color: inherit; background: #fff; border: 1px solid #cfd5e1;
  border-radius: 8px; padding: 9px 11px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
input:disabled { background: #f3f5f9; color: var(--muted); }
textarea { resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; }
.form-actions { display: flex; gap: 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600;
  border-radius: 8px; padding: 9px 16px; border: 1px solid transparent; cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: #fff; color: var(--text); border-color: #cfd5e1; }
.btn-ghost:hover { background: #f5f7fb; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.btn-block { width: 100%; padding: 11px 16px; }

/* Komunikaty */
.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; font-weight: 500; }
.flash ul { margin: 0; padding-left: 18px; }
.flash-success { background: var(--success-bg); color: var(--success); }
.flash-error { background: var(--danger-bg); color: var(--danger); }
.flash-info { background: var(--info-bg); color: var(--info); }
.empty { text-align: center; padding: 56px 20px; background: var(--surface); border: 1px dashed #cfd5e1; border-radius: var(--radius); }
.empty-title { font-weight: 650; font-size: 16px; margin-bottom: 4px; }
.empty p { color: var(--muted); max-width: 480px; margin: 0 auto 14px; }
ul.plain { margin: 0; padding-left: 18px; color: var(--muted); }
ul.plain li { margin-bottom: 4px; }

/* Ekrany logowania */
.auth { min-height: 100vh; display: grid; place-items: center;
  background: radial-gradient(1200px 600px at 10% -10%, var(--auth-glow) 0%, transparent 60%), var(--bg); }
.auth-wrap { width: 100%; max-width: 440px; padding: 32px 18px; }
.auth-brand { display: flex; justify-content: center; margin-bottom: 22px; }
.auth-brand .logo-text { font-size: 24px; }
.auth-brand .logo-mark { width: 40px; height: 40px; font-size: 22px; }
.auth-card { padding: 28px 30px; }
.auth-title { font-size: 20px; margin-bottom: 14px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 18px; }

@media (max-width: 860px) {
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
  .user-meta { display: none; }
  .search input { width: 100%; }
}

/* ---- Zamówienia ---- */
.c-2563eb{--c:#2563eb;}
.c-0891b2{--c:#0891b2;}
.c-16a34a{--c:#16a34a;}
.c-65a30d{--c:#65a30d;}
.c-f59e0b{--c:#f59e0b;}
.c-ea580c{--c:#ea580c;}
.c-dc2626{--c:#dc2626;}
.c-db2777{--c:#db2777;}
.c-8b5cf6{--c:#8b5cf6;}
.c-4f46e5{--c:#4f46e5;}
.c-64748b{--c:#64748b;}
.c-111827{--c:#111827;}
.c-64748b{--c:#64748b;}

.content.wide { max-width: none; }
.orders-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; align-items: start; }
.orders-side { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 10px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.orders-side > .btn { margin-bottom: 12px; }
.st-link { display: flex; align-items: center; gap: 9px; padding: 5px 8px; border-radius: 7px; color: var(--text); font-size: 13.5px; }
.st-link:hover { background: #f3f5fa; text-decoration: none; }
.st-link.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.st-count { min-width: 26px; height: 20px; padding: 0 6px; border-radius: 5px; font-size: 12px; font-weight: 700;
  display: inline-grid; place-items: center; color: #fff; background: var(--c, #64748b); }
.st-plain { background: #e9ecf3; color: var(--text); }
.st-group { margin-top: 10px; }
.st-group summary { list-style: none; cursor: pointer; padding: 4px 8px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; }
.st-group summary::-webkit-details-marker { display: none; }
.st-group summary::before { content: "▾"; color: var(--muted); margin-right: 6px; }
.st-group:not([open]) summary::before { content: "▸"; }
.st-group-name { color: var(--text); }
.st-group-name.active { color: var(--primary); }
.st-manage { display: block; margin-top: 14px; padding: 8px; font-size: 13px; border-top: 1px solid var(--border); }
.orders-main { min-width: 0; }
.orders-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.orders-head h2 { margin: 0; font-size: 18px; }
.orders-tools { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.filters { position: relative; }
.filters summary { list-style: none; }
.filters summary::-webkit-details-marker { display: none; }
.filters-form { position: absolute; right: 0; top: 44px; z-index: 5; width: 300px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(16,24,40,.15);
  padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.bulkbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 10px; }
.bulkbar select { width: auto; padding: 6px 9px; }
.pager { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.orders-table td { vertical-align: top; }
.orders-table tbody tr { cursor: pointer; }
.orders-table th small { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--primary); }
.orders-table .sel { width: 52px; white-space: nowrap; padding-right: 0; }
.orders-table .sel input { width: auto; vertical-align: middle; }
.star { background: none; border: 0; cursor: pointer; font-size: 17px; color: #b0b8c9; padding: 0 2px; vertical-align: middle; }
.star.on { color: #f59e0b; }
.order-no { font-weight: 700; }
.items { font-size: 13px; min-width: 260px; }
.item-line { line-height: 1.45; }
.item-line em { color: var(--muted); font-style: italic; }
.more-items summary { color: var(--primary); cursor: pointer; font-size: 12.5px; }
.dates { white-space: nowrap; font-size: 13px; }
.unpaid { color: var(--danger); font-weight: 600; }
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 5px; font-size: 12px; font-weight: 700;
  color: #fff; background: var(--c, #64748b); white-space: nowrap; text-transform: uppercase; letter-spacing: .02em; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.inline-form select { width: auto; }
.order-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.order-head .inline-form { margin-left: auto; }
.order-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.card-title { padding: 18px 22px 4px; }
.table tfoot td { border-bottom: 0; padding-top: 6px; padding-bottom: 6px; color: var(--muted); }
.table tfoot tr.total td { color: var(--text); font-weight: 700; font-size: 15px; border-top: 1px solid var(--border); padding-top: 10px; padding-bottom: 14px; }
.dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; word-break: break-word; }
.callout { border-left: 4px solid var(--warning); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.timeline li:last-child { border-bottom: 0; }
.input-table td { padding: 6px 8px; }
.input-table td:first-child { width: 40%; }
.input-table input { padding: 7px 9px; }
.row2 { display: grid; grid-template-columns: 140px 1fr; gap: 10px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn.danger { color: var(--danger); }
.nowrap { white-space: nowrap; }
/* Statusy */
.status-group-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.status-group-head h2 { margin: 0; }
.group-name { font-weight: 650; width: 260px; }
.status-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.status-edit { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; flex-wrap: wrap; margin: 0; }
.status-edit input[name=name] { width: 220px; }
.status-edit select { width: 170px; }
.status-dot { width: 14px; height: 14px; border-radius: 4px; background: var(--c); flex-shrink: 0; }
.color-pop { position: relative; }
.color-pop summary { list-style: none; }
.color-pop summary::-webkit-details-marker { display: none; }
.color-pop .swatches { position: absolute; z-index: 5; top: 36px; left: 0; background: var(--surface); padding: 10px;
  border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 30px rgba(16,24,40,.15); width: 196px; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatch span { display: block; width: 24px; height: 24px; border-radius: 6px; background: var(--c); cursor: pointer;
  border: 2px solid transparent; box-shadow: inset 0 0 0 2px #fff; }
.swatch input:checked + span { border-color: var(--text); }
.swatch input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (max-width: 1100px) {
  .orders-layout, .order-grid { grid-template-columns: 1fr; }
  .orders-side { position: static; max-height: none; }
}

.table th.num { text-align: right; }
.content.wide { max-width: none; padding-top: 20px; }
.orders-table th, .orders-table td { padding: 9px 12px; }
.orders-table .buyer { min-width: 180px; }
.orders-table .ext { font-size: 11.5px; white-space: nowrap; }

/* Integracje */
.table td.actions { text-align: right; white-space: nowrap; }
.table td.actions .inline-form, .table td.actions > a { margin-left: 4px; }
.connect-card { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.connect-card > div { flex: 1; min-width: 280px; }
.connect-card p { margin: 0; max-width: 620px; }
.connect-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.connect-form select { width: auto; }
ol.steps { margin: 0 0 18px; padding-left: 20px; }
ol.steps li { margin-bottom: 6px; }
.user-code { font-size: 34px; font-weight: 700; letter-spacing: .12em; text-align: center; padding: 18px;
  margin: 8px 0 16px; background: var(--primary-soft); color: var(--primary); border-radius: var(--radius);
  font-variant-numeric: tabular-nums; }
.wait { text-align: center; margin: 16px 0 6px; color: var(--muted); }
.wait::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px;
  border: 2px solid #c3cbe0; border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
p.small { font-size: 12.5px; text-align: center; }

/* ---- Motywy kolorystyczne (propozycje) ---- */
.theme-morski {
  --primary: #0f766e; --primary-hover: #0b5f58; --primary-soft: #e0f2ef;
  --sidebar: #17201f; --sidebar-text: #b6c6c3; --sidebar-muted: #6e807c;
  --nav-active: rgba(45,212,191,.16); --brand-mark: #0f766e; --ring: rgba(15,118,110,.18); --auth-glow: #d5efe9;
}
.theme-indygo {
  --primary: #4f46e5; --primary-hover: #4338ca; --primary-soft: #eef0ff;
  --sidebar: #ffffff; --sidebar-text: #4b5565; --sidebar-strong: #111827; --sidebar-muted: #9aa3b2;
  --sidebar-hover: #f3f4f8; --sidebar-line: #eceef3; --nav-active: #eef0ff; --brand-mark: #4f46e5;
  --ring: rgba(79,70,229,.18); --auth-glow: #e4e3ff; --bg: #f6f7fb;
}
.theme-indygo .sidebar { border-right: 1px solid var(--border); }
.theme-indygo .nav-item.active { color: var(--primary); }
.theme-grafit {
  --primary: #c2410c; --primary-hover: #9a3412; --primary-soft: #fff1e8;
  --sidebar: #1f1f22; --sidebar-text: #c4c4c9; --sidebar-muted: #7c7c84;
  --nav-active: rgba(251,146,60,.16); --brand-mark: #ea580c; --ring: rgba(194,65,12,.18); --auth-glow: #fde6d6;
  --bg: #f5f5f4; --border: #e5e4e2;
}
.theme-szmaragd {
  --primary: #047857; --primary-hover: #065f46; --primary-soft: #e3f6ee;
  --sidebar: #ffffff; --sidebar-text: #4b5563; --sidebar-strong: #0f172a; --sidebar-muted: #9ca3af;
  --sidebar-hover: #f1f5f3; --sidebar-line: #e8ece9; --nav-active: #e3f6ee; --brand-mark: #047857;
  --ring: rgba(4,120,87,.18); --auth-glow: #d9f2e6; --bg: #f5f7f6;
}
.theme-szmaragd .sidebar { border-right: 1px solid var(--border); }
.theme-szmaragd .nav-item.active { color: var(--primary); }

/* Wybór motywu */
.theme-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.theme-picker > div { grid-column: 1 / -1; }
.theme-option { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; background: var(--surface); }
.theme-option:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.theme-option input { width: auto; }
.theme-sample { display: flex; width: 64px; height: 44px; border-radius: 8px; overflow: hidden; flex-shrink: 0;
  border: 1px solid var(--border); background: #f4f6fa; }
.theme-sample i { width: 18px; background: var(--s1); }
.theme-sample b { flex: 1; position: relative; }
.theme-sample b::after { content: ""; position: absolute; left: 8px; right: 8px; top: 14px; height: 12px; border-radius: 4px; background: var(--s2); }
.ts-granat { --s1: #101a33; --s2: #1f3a8a; }
.ts-morski { --s1: #17201f; --s2: #0f766e; }
.ts-indygo { --s1: #ffffff; --s2: #4f46e5; }
.ts-grafit { --s1: #1f1f22; --s2: #c2410c; }
.ts-szmaragd { --s1: #ffffff; --s2: #047857; }
.ts-indygo i, .ts-szmaragd i { border-right: 1px solid #e3e7ef; }
.theme-text { display: flex; flex-direction: column; line-height: 1.35; }
.theme-text small { color: var(--muted); }
.form > .btn { align-self: flex-start; }
.form > .btn-block { align-self: stretch; }
.grid { margin-bottom: 18px; }

/* ---- Komunikator (układ jak w Helpdesk-Xpressio) ---- */
.content.flush { padding: 0; max-width: none; }
.flash-warn { background: var(--warning-bg); color: var(--warning); }
.msg-app { display: flex; height: calc(100vh - 60px); min-height: 480px; background: var(--surface); }
.msg-folders { width: 300px; border-right: 1px solid var(--border); display: flex; flex-direction: column; flex: none; }
.msg-search { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.msg-search input { padding: 8px 11px; }
.msg-folders .fl { overflow-y: auto; padding: 12px 12px 20px; flex: 1; }
.msg-folders h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 6px 6px; }
.msg-folders a.f { display: flex; align-items: center; padding: 8px 12px; border-radius: 8px; color: var(--text); font-size: 14px; gap: 2px; }
.msg-folders a.f:hover { background: #f4f5fb; text-decoration: none; }
.msg-folders a.f.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.msg-folders .fi { width: 24px; font-size: 12px; display: inline-block; }
.msg-folders .fsep { border-top: 1px solid var(--border); margin: 8px 10px; }
.msg-folders .cnt { margin-left: auto; background: #eef0f5; color: var(--text); border-radius: 999px; padding: 0 9px; font-size: 12px; font-weight: 600; }
.msg-folders .cnt.ml6 { margin-left: 6px; }
.msg-folders .cnt.hot { background: #ef4444; color: #fff; }
.msg-folders a.f.on .cnt:not(.hot) { background: #fff; }
.msg-folders a.f.acc { font-size: 13.5px; padding: 6px 12px; }
.msg-folders .gname { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 10px 12px 4px; }
.msg-folders .pad { padding: 0 12px; }
.msg-side-links { border-top: 1px solid var(--border); padding: 10px 14px; display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.alg { color: #ff5a00; font-weight: 800; font-size: 16px; line-height: 1; font-family: Arial, sans-serif; margin-right: 6px; }
.cdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); vertical-align: middle; }
.msg-list { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.msg-tbar { height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 24px; border-bottom: 1px solid var(--border); flex: none; }
.msg-tbar .t { font-weight: 700; font-size: 16px; }
.fchips { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.fchip { background: var(--primary-soft); color: var(--primary); border-radius: 999px; padding: 3px 12px; font-size: 13px; font-weight: 500; }
.fchip.clear { background: #fff; border: 1px solid var(--border); color: var(--text); }
.msg-alert { margin: 10px 24px 0; }
.msg-note { padding: 10px 24px; background: #f8f9fc; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.msg-bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 24px 0; padding: 8px 12px;
  border-radius: 10px; background: var(--primary-soft); border: 1px solid var(--border); }
.msg-bulk[hidden] { display: none; }
.msg-scroll { flex: 1; overflow-y: auto; }
.tt { width: 100%; border-collapse: collapse; }
.tt th { padding: 12px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1;
  text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.tt th.w30 { width: 30%; } .tt th.w90 { width: 90px; } .tt th.w230 { width: 230px; }
.tt td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tt .ck { width: 34px; padding-right: 0; } .tt .ck input { width: 17px; height: 17px; cursor: pointer; }
.tt tr.r { cursor: pointer; } .tt tr.r:hover td { background: #f7f8fc; } .tt tr.r.picked td { background: var(--primary-soft); }
.sorth { color: inherit; display: inline-flex; gap: 6px; align-items: center; }
.sorth .sa { font-size: 11px; opacity: .45; } .sorth.on { color: var(--primary); } .sorth.on .sa { opacity: 1; }
.req { display: flex; gap: 12px; align-items: center; }
.req .nm { display: flex; align-items: center; font-weight: 600; font-size: 14.5px; }
.req .nm a { color: inherit; } .req .sub { color: var(--muted); font-size: 13px; }
.ttl { min-width: 0; } .ttl .h { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; }
.ttl .n { border: 1px solid var(--text); border-radius: 3px; font-size: 11px; padding: 0 5px; font-weight: 500; line-height: 16px; }
.ttl .snip { color: #3b4054; margin: 2px 0 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 640px; }
tr.unread .ttl .snip { font-weight: 600; color: #111; }
.lastm { color: #5d6377; white-space: nowrap; font-size: 13.5px; }
.wbar { height: 6px; border-radius: 3px; margin-top: 6px; max-width: 220px; }
.wb-g { background: #22c993; } .wb-y { background: #f6b800; } .wb-r { background: #ff5a5f; }
.w1 { width: 10%; } .w2 { width: 20%; } .w3 { width: 30%; } .w4 { width: 40%; } .w5 { width: 50%; }
.w6 { width: 60%; } .w7 { width: 70%; } .w8 { width: 80%; } .w9 { width: 90%; } .w10 { width: 100%; }
.msg-pager { display: flex; gap: 8px; align-items: center; padding: 10px 24px; border-top: 1px solid var(--border); flex: none; }
.msg-pager .info { border: 1px solid var(--border); border-radius: 8px; padding: 5px 12px; font-size: 13px; }
.push { margin-left: auto; }
.emptybox { padding: 60px 20px; text-align: center; color: var(--muted); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 11.5px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.p-nowe { background: var(--primary); color: #fff; } .p-odpowiedziane { background: #f6b800; color: #3a2c00; }
.p-zamkniete { background: #e4e6ec; color: #5d6377; } .pill-custom { background: var(--c); color: #fff; }
.p-urgent { background: #ff5a5f; color: #fff; } .p-disp { background: #fde8d7; color: #9a3412; } .p-msg { background: #eef0f5; color: #5d6377; }
.p-unread { background: #e0e7ff; color: #3730a3; } .p-allegro { background: #ffe9db; color: #c2410c; }
.p-ok { background: #d9f7ec; color: #0e7a57; } .p-warn { background: #fff3cc; color: #7a5600; }
.av { width: 34px; height: 34px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; color: #fff; font-size: 12.5px; }
.av.lg { width: 40px; height: 40px; font-size: 14px; }
.av.av-empty { background: #fff; border: 1.5px dashed #b9bdf7; color: var(--primary); font-size: 16px; }
.av0 { background: #2f8f4e; } .av1 { background: #5b5fe0; } .av2 { background: #c2410c; } .av3 { background: #9d174d; }
.av4 { background: #0f766e; } .av5 { background: #7c3aed; } .av6 { background: #b45309; } .av7 { background: #1d4ed8; }
.av8 { background: #8b1a1a; } .av9 { background: #d48fbf; } .av-auto { background: #4338ca; } .av-allegro { background: #ff5a00; }
/* karta ticketu */
.ticket .tk-main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.tk-bar { display: flex; align-items: center; gap: 8px; padding: 10px 24px; border-bottom: 1px solid var(--border); background: var(--surface); flex: none; }
.tk-bar .sp { flex: 1; }
.btn-green { background: #22c993; color: #fff; } .btn-green:hover { background: #1bb381; }
.btn-ogreen { background: #fff; color: #16a87a; border-color: #22c993; } .btn-ogreen:hover { background: #ecfbf5; }
.btn-oind { background: #fff; color: var(--primary); border-color: var(--primary); } .btn-oind:hover { background: var(--primary-soft); }
.quick { position: relative; } .quick summary { list-style: none; } .quick summary::-webkit-details-marker { display: none; }
.quick .menu { position: absolute; right: 0; top: 44px; background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(20,24,40,.12); padding: 6px; min-width: 250px; z-index: 5; }
.quick .menu button { display: flex; width: 100%; background: none; border: 0; padding: 9px 12px; font: inherit; color: var(--text);
  cursor: pointer; border-radius: 6px; text-align: left; }
.quick .menu button:hover { background: #f4f5fb; } .quick .menu .sep { border-top: 1px solid var(--border); margin: 4px 0; }
.quick .menu form { margin: 0; }
.tk-scroll { flex: 1; overflow-y: auto; padding: 20px 24px; }
.tk-head { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; margin-bottom: 14px; }
.tk-head .tt2 { font-weight: 700; font-size: 17px; margin-bottom: 6px; } .mt6 { margin-top: 6px; } .mt0 { margin-top: 0 !important; } .mt12 { margin-top: 12px; }
.mc { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; margin-bottom: 12px; display: flex; gap: 14px; }
.mc.our { background: #fbfbff; } .mc .bd { flex: 1; min-width: 0; }
.mc .hd { display: flex; align-items: baseline; gap: 8px; } .mc .who { font-weight: 600; } .mc .who .muted { font-weight: 400; }
.mc .dt { margin-left: auto; color: #5d6377; white-space: nowrap; font-size: 12.5px; }
.mc .tx { margin-top: 4px; word-wrap: break-word; } .mc .att { margin-top: 8px; font-size: 13px; } .mc .subj { font-weight: 600; margin-top: 4px; }
.ev { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 12.5px; margin: 12px 30px; }
.ev::before, .ev::after { content: ""; flex: 1; border-top: 1px solid var(--border); } .ev b { color: #5d6377; font-weight: 500; }
.tk-reply { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-top: 6px; }
.tk-reply [hidden] { display: none; }
.tk-reply textarea { min-height: 130px; }
.tk-reply .bar { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.tk-reply .bar select { width: auto; max-width: 220px; }
.tk-side { width: 430px; background: #fff; border-left: 1px solid var(--border); overflow-y: auto; padding: 0 22px 24px; flex: none; }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--border); margin-bottom: 18px; position: sticky; top: 0; background: #fff; padding-top: 14px; z-index: 2; }
.tabs a { padding: 8px 0; color: var(--text); font-weight: 600; border-bottom: 3px solid transparent; }
.tabs a.on { color: var(--primary); border-bottom-color: var(--primary); } .tabs a:hover { text-decoration: none; }
.tabpane { display: none; } .tabpane.on { display: block; }
.sect { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--primary); font-weight: 600; margin: 20px 0 10px; }
.box { border: 1px solid var(--border); border-radius: 10px; padding: 0 14px; margin-bottom: 12px; }
.box summary { list-style: none; cursor: pointer; padding: 12px 4px; display: flex; justify-content: space-between; font-size: 12px;
  letter-spacing: .1em; text-transform: uppercase; color: #5d6377; font-weight: 600; }
.box summary::-webkit-details-marker { display: none; } .box[open] .chev { transform: rotate(180deg); } .box .inner { padding: 0 0 12px; }
.ui { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.grid2 .k { color: #5d6377; font-size: 13px; } .grid2 .v { margin-top: 2px; word-break: break-word; }
.order { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-top: 8px; font-size: 13px; }
.order.linked { border-color: var(--primary); background: var(--primary-soft); }
.order .oh { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.order ul { margin: 6px 0; padding-left: 16px; } .order-open { display: inline-block; margin-top: 6px; font-weight: 600; }
.lk-row { margin: 4px 0 10px; } .lk-row .k { color: #5d6377; font-size: 13px; } .lk-row .v { margin-top: 4px; word-break: break-word; }
.lk-row .v div { margin: 3px 0; }
.lk-case { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin: 6px 0; font-size: 13px; }
.lk-case.cur { border-color: var(--primary); background: var(--primary-soft); }
.lk-case .lt { display: flex; justify-content: space-between; gap: 8px; } .lk-case .la { margin-top: 4px; display: flex; gap: 14px; flex-wrap: wrap; }
.sig { white-space: pre-wrap; background: #f8f9fc; border: 1px dashed #d9dce6; padding: 8px 10px; border-radius: 8px; font-size: 13px; color: #5d6377; }
.small { font-size: 12.5px; } .break { word-break: break-all; } .pre { white-space: pre-wrap; max-width: 640px; }
.tpl-grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 18px; align-items: start; }
.align-start { align-items: start; }
.status-add { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.status-add input[name=name] { width: 240px; }
.acc-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.acc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
@media (max-width: 1200px) { .tk-side { width: 360px; } .msg-folders { width: 250px; } }
@media (max-width: 900px) { .msg-app { flex-direction: column; height: auto; } .msg-folders, .tk-side { width: 100%; } .tpl-grid { grid-template-columns: 1fr; } }
@media print { .sidebar, .topbar, .tk-bar, .tk-reply, .tk-side { display: none !important; } .main { margin: 0; } .msg-app { height: auto; } }

/* ---- Magazyn ---- */
.thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: #f1f3f7; border: 1px solid var(--border);
  display: inline-grid; place-items: center; font-size: 18px; vertical-align: middle; }
.thumb.lg { width: 96px; height: 96px; }
.thumb-cell { width: 56px; }
.products-table tbody tr, .js-rows tbody tr[data-href] { cursor: pointer; }
.stock { font-weight: 700; } .stock.low { color: var(--danger); }
.plus { color: var(--success); font-weight: 700; } .minus { color: var(--danger); font-weight: 700; }
.row2b { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.product-top { display: flex; gap: 18px; align-items: stretch; flex-wrap: wrap; margin-bottom: 18px; }
.product-top .card { margin: 0; }
.stock-card { flex: 1; min-width: 320px; }
.stock-big { font-size: 40px; font-weight: 800; line-height: 1; margin-bottom: 8px; }
.stock-big small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 8px; }
.stock-big.low { color: var(--danger); }
.stock-form { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.stock-form select { width: auto; } .stock-form input[name=qty] { width: 110px; } .stock-form input[name=note] { flex: 1; min-width: 160px; }
.gallery { display: flex; gap: 8px; flex-wrap: wrap; align-content: flex-start; max-width: 460px; }
.pad-card { padding: 0 22px 18px; }
.pager-row { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: -6px; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px 16px; }
.preview { overflow-x: auto; } .preview td, .preview th { white-space: nowrap; font-size: 12.5px; }
code { background: #eef1f5; padding: 1px 6px; border-radius: 4px; font-size: 12.5px; }

/* Reguły statusów */
.rule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
tr.inactive td { opacity: .55; }
.st-manage2 { border-top: 0; margin-top: 0; padding-top: 0; }

.auth-link { text-align: center; margin: 14px 0 0; font-size: 13.5px; }

/* ---- Statystyki ---- */
.stats-filter { display: flex; gap: 8px; flex-wrap: wrap; }
.stats-filter input, .stats-filter select { width: auto; }
.period { margin: -4px 0 14px; }
.stat .delta { font-size: 12.5px; margin-top: 4px; font-weight: 600; }
.delta.up { color: var(--success); } .delta.down { color: var(--danger); } .delta.flat { color: var(--muted); }
.delta .muted { font-weight: 400; }
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--primary); }
.chart .bar:has(+ .hit:hover) { opacity: .75; }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: rgba(16, 24, 40, .04); }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .base { stroke: #c9ced9; stroke-width: 1; }
.chart .ax { fill: var(--muted); font-size: 12px; font-family: var(--font); }
.share { white-space: nowrap; }
.sharebar { display: inline-block; width: 90px; height: 8px; border-radius: 4px; background: #eef0f5; margin-right: 8px; vertical-align: middle; overflow: hidden; }
.sharebar i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }

/* --- Uprawnienia użytkownika --- */
.perm-box { border: 1px solid var(--border, #e3e7ee) !important; border-radius: 10px; padding: 14px 16px !important; }
.perm-box legend { font-weight: 600; padding: 0 6px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 24px; }
.perm-group h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #6b7280); }
.perm-group .check { font-weight: 400; align-items: flex-start; margin-bottom: 6px; }
.perm-box.perm-off .perm-grid { opacity: .55; }

/* --- Weryfikacja dwuetapowa --- */
.twofa-setup .steps { margin: 0 0 18px; padding-left: 20px; display: grid; gap: 6px; }
.twofa-grid { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: start; }
.qr-wrap { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 8px; line-height: 0; }
.qr-wrap svg { width: 220px; height: 220px; }
.secret-key code { font-size: 17px; letter-spacing: .06em; background: var(--bg, #f4f6fa); padding: 6px 10px; border-radius: 6px; display: inline-block; }
.code-input { font-size: 22px !important; letter-spacing: .25em; text-align: center; max-width: 220px; }
.recovery-box { border: 1px dashed var(--border); border-radius: 10px; padding: 16px; margin: 14px 0; }
.recovery-box h3 { margin: 0 0 6px; }
.recovery-codes { columns: 2; font-size: 16px; margin: 12px 0; }
.recovery-codes li { margin-bottom: 6px; }
@media (max-width: 720px) { .twofa-grid { grid-template-columns: 1fr; } }
@media print { .sidebar, .topbar, .btn, .flash { display: none !important; } }
.shop-connect summary { cursor: pointer; padding: 2px 0; }
.shop-connect[open] summary { margin-bottom: 10px; }
.shop-connect .form { margin-top: 10px; }
.erl { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 4px;
       background: #00a1e0; color: #fff; font-weight: 800; font-size: 11px; line-height: 1; font-family: Arial, sans-serif;
       margin-right: 6px; vertical-align: -2px; }
.p-erli { background: #e0f4fb; color: #007bb0; }
.break { word-break: break-all; }
.form.tight { gap: 10px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sect-label { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 14px; text-transform: uppercase; letter-spacing: .03em; }
.qty { width: 70px; }
.assign-form label { display: flex; flex-direction: column; gap: 4px; padding: 6px 12px; font-size: 13px; }
.assign-form select { width: 100%; }
.msg-bulk select { max-width: 160px; }
/* --- Integracje: karty podłączania --- */
.connector { padding: 0 !important; margin-bottom: 10px; }
.connector > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 16px 20px; }
.connector > summary::-webkit-details-marker { display: none; }
.connector .conn-name { font-weight: 700; min-width: 170px; }
.connector .conn-add { margin-left: auto; color: var(--primary); font-weight: 600; white-space: nowrap; }
.connector[open] .conn-add { visibility: hidden; }
.connector .conn-body { padding: 0 20px 20px; border-top: 1px solid var(--border); }
.connector .conn-body > p:first-child { margin-top: 14px; }
.conn-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px 16px; }
.connector .conn-add.off { color: var(--muted); font-weight: 500; }
.perm-group .check span { line-height: 1.35; }
/* --- Oferty --- */
.ch-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ch-row:last-child { border-bottom: 0; }
.ch-row .muted { font-size: 13px; }
.ch-row form { margin-left: auto; }
.link-form { display: flex; gap: 6px; }
.link-form input { max-width: 170px; }
.flags { display: flex; gap: 10px; }
.linkbtn { background: none; border: 0; color: var(--primary); cursor: pointer; padding: 0; }
.search select { max-width: 200px; }
.narrow-wide { max-width: 900px; }
.cat-pick { display: flex; gap: 12px; align-items: center; border: 1px solid var(--border); border-radius: 10px; padding: 10px;
            margin-bottom: 8px; cursor: pointer; }
.cat-pick img { width: 56px; height: 56px; object-fit: contain; border-radius: 6px; background: #fff; }
.cat-pick input { width: auto; }
/* --- Wysyłka --- */
.shp { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.shp-acts { text-align: right; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ship-new { margin-top: 10px; }
.ship-new summary { list-style: none; display: inline-flex; }
.ship-new summary::-webkit-details-marker { display: none; }
.dims { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.danger { color: var(--danger); }
/* --- Faktura (wydruk) --- */
.invoice-doc { background: #fff; color: #111; max-width: 860px; padding: 40px 44px; border: 1px solid var(--border);
               border-radius: 10px; font-size: 13px; line-height: 1.45; }
.invoice-doc header { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid #111; padding-bottom: 14px; }
.invoice-doc h1 { margin: 0; font-size: 24px; }
.invoice-doc .inv-no { font-size: 16px; font-weight: 600; margin-top: 4px; }
.inv-dates { display: grid; grid-template-columns: auto auto; gap: 2px 12px; margin: 0; }
.inv-dates dt { color: #555; } .inv-dates dd { margin: 0; font-weight: 600; }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin: 20px 0; }
.inv-party h3 { margin: 0 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #555; }
.inv-items, .inv-vat { width: 100%; border-collapse: collapse; }
.inv-items th, .inv-items td, .inv-vat th, .inv-vat td { border: 1px solid #bbb; padding: 5px 7px; text-align: left; }
.inv-items th, .inv-vat th { background: #f2f2f2; font-size: 11px; }
.invoice-doc .num { text-align: right; white-space: nowrap; }
.inv-sum { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-top: 16px; }
.inv-vat { width: auto; }
.inv-total { margin-left: auto; text-align: right; font-size: 15px; }
.inv-total b { font-size: 20px; }
.inv-pay { margin-top: 16px; }
.inv-exempt { margin-top: 10px; font-style: italic; }
.invoice-doc footer { display: flex; justify-content: space-between; margin-top: 70px; color: #555; font-size: 11px; }
.invoice-doc footer div { border-top: 1px dotted #777; padding-top: 4px; width: 40%; text-align: center; }
@media print {
  .invoice-doc { border: 0; padding: 0; max-width: none; }
  .no-print, .page-head, .page-actions { display: none !important; }
  body, .main, .content { background: #fff !important; }
}

/* ---- Kompletacja i pakowanie (także kolektory Zebra TC27) ---- */
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-right: 16px; flex-wrap: wrap; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 16px; margin-bottom: 8px; }
.btn-lg { font-size: 18px; padding: 12px 22px; }
.scan-card .scan-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.scan-form { display: flex; gap: 8px; margin: 12px 0; }
.scan-input { flex: 1; font-size: 20px; padding: 12px 14px; min-width: 0; border: 2px solid var(--primary, #1e3a8a); border-radius: 10px; }
.scan-input:focus { outline: 3px solid rgba(37, 99, 235, .25); }
.progress { height: 12px; background: var(--line, #e5e7eb); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; background: #16a34a; border-radius: 99px; transition: width .2s; }
.progress-bar.w0 { width: 2%; }
.progress-text { font-size: 13px; color: var(--muted); margin-top: 4px; }
.pick-table td { vertical-align: middle; }
.pick-loc { font-size: 18px; font-weight: 700; white-space: nowrap; }
.pick-qty { font-size: 20px; font-weight: 700; white-space: nowrap; }
.pick-ctrl { white-space: nowrap; text-align: right; }
.pick-ctrl .inline-form { margin-left: 4px; }
.pick-done { opacity: .55; }
.pick-done .pick-qty { color: #16a34a; }
.basket { display: inline-block; min-width: 2em; padding: 2px 8px; border-radius: 8px; background: #fde68a; color: #78350f; font-weight: 800; text-align: center; }
.pack-info { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-bottom: 12px; }
.pack-info > div { display: flex; flex-direction: column; }
.pack-info .big { font-size: 26px; line-height: 1.1; }
.pack-img { width: 48px; height: 48px; object-fit: contain; border-radius: 6px; background: #fff; }
.scan-card .flash { margin: 10px 0 0; }
@media (max-width: 600px) {
  .content { padding: 10px 8px; }
  .page-head h1 { font-size: 18px; }
  .page-actions { flex-wrap: wrap; }
  .scan-input { font-size: 22px; }
  .pick-table th:nth-child(4), .pick-table td.pick-ctrl .inline-form:first-child { display: none; }
  .pick-table td, .pick-table th { padding: 8px 6px; }
  .card-title-row .btn { width: 100%; }
}
@media print {
  .scan-form, .no-print, .pick-ctrl, .progress { display: none !important; }
  .pick-done { opacity: 1; }
}

/* ---- Dokumenty publiczne, abonament ---- */
.doc-wrap { max-width: 860px; margin: 32px auto; padding: 0 16px; }
.doc-wrap .auth-brand { display: block; text-align: center; margin-bottom: 18px; text-decoration: none; }
.doc { padding: 28px 34px; line-height: 1.6; }
.doc h1 { font-size: 24px; margin: 0 0 14px; }
.doc h2 { font-size: 17px; margin: 22px 0 8px; }
.doc ol { padding-left: 22px; }
.doc li { margin-bottom: 6px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 8px 0 12px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
.plan-current { background: var(--primary-soft); }
.table.compact input { width: 72px; padding: 4px 6px; }
.table.compact th { white-space: normal; }
.help-toc { columns: 2; padding-left: 18px; }
.help h2 { margin-top: 0; }
.help section { scroll-margin-top: 80px; }
@media (max-width: 720px) { .help-toc { columns: 1; } .doc { padding: 18px; } }

/* ---- Telefon / kolektor (np. Zebra TC27): menu jako pasek ikon u góry ---- */
@media (max-width: 600px) {
  .sidebar, .sidebar:hover, .sidebar:focus-within { position: sticky; top: 0; bottom: auto; width: 100%; height: 50px;
    flex-direction: row; align-items: center; box-shadow: none; transition: none; }
  .brand { padding: 7px 8px; }
  .brand .logo-mark { width: 32px; height: 32px; }
  .sidebar .logo-text, .nav-item span, .nav-sep, .sidebar-foot { display: none !important; }
  .sidebar nav { display: flex; flex-direction: row; gap: 2px; overflow-x: auto; overflow-y: hidden; padding: 0 6px;
    scrollbar-width: none; }
  .sidebar nav::-webkit-scrollbar { display: none; }
  .nav-item { padding: 9px 10px; margin: 0; }
  .main, .nav-pinned .main { margin-left: 0; }
  .topbar { height: auto; padding: 6px 10px; }
  .org-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40vw; }
  .user-menu { gap: 6px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 8px; margin-bottom: 10px; }
  .page-actions { display: flex; flex-wrap: wrap; gap: 6px; }
  .page-actions .btn, .page-actions .inline-form { flex: 1 1 auto; }
  .page-actions .inline-form .btn { width: 100%; }
  .scan-form .btn { padding: 0 14px; }
  .pack-info .big { font-size: 22px; }
}

/* ---- Wydruk listy zbierania z kodami ---- */
.print-sheet { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px 22px; }
.print-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.print-head h1 { font-size: 20px; margin: 0; }
.print-sheet h2 { font-size: 15px; margin: 16px 0 6px; }
.print-table td { vertical-align: middle; }
.check-box { width: 26px; } .check-box::before { content: ""; display: inline-block; width: 16px; height: 16px; border: 1.5px solid #333; border-radius: 3px; }
.bc-cell { width: 1%; white-space: nowrap; } .barcode { display: block; }
@media print {
  .print-sheet { border: 0; padding: 0; }
  .print-table tr { break-inside: avoid; }
  .page-head { display: none !important; }
  .print-sheet .basket { border: 1px solid #000; }
}
.check-list { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 10px; }
.form-actions { flex-wrap: wrap; }

/* ---- KSeF na fakturze ---- */
.inv-ksef { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; margin: 14px 0 4px; }
.inv-qr svg { width: 120px; height: 120px; display: block; }
.inv-ksef-no { font-family: monospace; font-size: 12px; letter-spacing: .3px; }
.ksef-card .form-actions { margin-top: 10px; align-items: center; }
.mail-preview { white-space: pre-wrap; font-family: inherit; font-size: 13px; background: var(--bg, #f6f8fb); border-radius: 8px; padding: 12px; margin: 0; }
.input-sm { max-width: 7em; }
tr.current td { background: var(--hover, rgba(0,0,0,.03)); }
ul.diag { list-style: none; padding: 0; }
ul.diag li { padding: 8px 0; border-bottom: 1px solid var(--border, #e5e7eb); }
ul.diag li.ok b { color: var(--success, #15803d); }
ul.diag li.bad b { color: var(--danger, #b91c1c); }
.buyer-flag { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
.buyer-note { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 8px 10px; margin: 8px 0; }

/* ---- Telefon i skaner (0.15) ---- */
@media (max-width: 860px) {
  .orders-layout { grid-template-columns: 1fr; }
  .orders-side { position: static; max-height: none; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .card, .card-flush { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table th, .table td { padding: 8px 8px; font-size: 13.5px; }
  .btn { min-height: 40px; }
  .btn-sm { min-height: 34px; }
  input, select, textarea { font-size: 16px; }           /* iPhone nie powiększa strony przy wpisywaniu */
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-filter { flex-wrap: wrap; }
  .stats-filter > * { flex: 1 1 140px; }
  .bulkbar { flex-wrap: wrap; gap: 6px; }
  .msg-app .tk-reply textarea { min-height: 120px; }
  .order-head { flex-wrap: wrap; }
  td.items, th.items { min-width: 160px; }
}
@media (display-mode: standalone) {
  .topbar { padding-top: max(6px, env(safe-area-inset-top)); }
}
.hbars { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; align-items: end; height: 140px; }
.hbar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.hbar i { display: block; width: 100%; background: var(--primary); border-radius: 3px 3px 0 0; min-height: 2px; }
.hbar i.h0 { height: 2px; opacity: .3; } .hbar i.h1 { height: 10%; } .hbar i.h2 { height: 20%; } .hbar i.h3 { height: 30%; }
.hbar i.h4 { height: 40%; } .hbar i.h5 { height: 50%; } .hbar i.h6 { height: 60%; } .hbar i.h7 { height: 70%; }
.hbar i.h8 { height: 80%; } .hbar i.h9 { height: 90%; } .hbar i.h10 { height: 100%; }
.hbar span { font-size: 10px; color: var(--muted); margin-top: 3px; }
.first-steps .fs-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.first-steps .fs-head h2 { margin: 0; }
.first-steps .progress { margin: 10px 0 12px; }
.fs-list { list-style: none; padding: 0; margin: 0; columns: 2 320px; }
.fs-list li { padding: 5px 0; break-inside: avoid; }
.fs-list li.done { color: var(--muted); }
.fs-list .tick { display: inline-block; width: 22px; color: var(--muted); }
.fs-list li.done .tick { color: #16a34a; }
