/* RTM CRM – nowoczesny wygląd, kolory RTM Opakowania (zielenie + krem), półprzezroczyste elementy, romby w tle */
:root {
  --navy: #004438; --blue: #00985F; --blue2: #007A4C; --soft: #DCEFE4; --soft2: #EEF7F1;
  --bg: #F4F5EE; --surface: #ffffff; --surface-2: #F7F8FA; --line: #E1E5EC; --line2: #CDD4DB;
  --text: #1C2A26; --muted: #6B7287; --orange: #E6643E; --red: #E94F37; --green: #2E9E6E; --yellow: #E2B700; --purple: #8E4EC6;
  --glass: rgba(255, 255, 255, .70); --glass-strong: rgba(255, 255, 255, .88); --glass-line: rgba(255, 255, 255, .75);
  --shadow: 0 6px 24px rgba(0, 68, 56, .07); --r: 8px;
  --c-red: #E94F37; --c-orange: #F28C28; --c-yellow: #E2B700; --c-green: #2E9E6E; --c-blue: #3b82f6; --c-purple: #8E4EC6;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #061A16; --surface: #0B2621; --surface-2: #10302A; --line: #1E4A40; --line2: #285A4E; --text: #E9F2EE; --muted: #9DB8AE;
    --soft: #174238; --soft2: #133A31; --navy: #7ED6AE; --glass: rgba(8, 36, 31, .70); --glass-strong: rgba(8, 36, 31, .9); --glass-line: rgba(120, 210, 170, .18);
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 13.5px/1.45 "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; color: var(--text); background: var(--bg); -webkit-text-size-adjust: 100%; }
/* tło: gradient + romby RTM (40% przezroczystości) */
body::before { content: ""; position: fixed; inset: 0; z-index: -2;
  background: radial-gradient(900px 520px at 88% 8%, rgba(0,152,95,.40), transparent 62%), radial-gradient(700px 480px at 30% 105%, rgba(0,68,56,.26), transparent 65%),
    radial-gradient(520px 380px at 62% 48%, rgba(247,219,167,.20), transparent 70%), linear-gradient(135deg, #E4F0E8 0%, #F4F5EE 45%, #F7EFDD 100%); }
body::after { content: ""; position: fixed; inset: 0; z-index: -1; opacity: .40; pointer-events: none;
  background: url(/brand/znak.svg) left 250px bottom 40px / 150px auto no-repeat, url(/brand/romby-1.svg) left 430px bottom 18px / 900px auto no-repeat,
    url(/brand/romby-2.svg) right -120px top 90px / 620px auto no-repeat; }
@media (prefers-color-scheme: dark) { html:not([data-theme]) body::before { background: radial-gradient(900px 520px at 88% 8%, rgba(0,152,95,.25), transparent 62%), linear-gradient(135deg, #04140F, #082520); } html:not([data-theme]) body::after { opacity: .22; } }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--blue2); }
[hidden] { display: none !important; }
.glass { background: var(--glass); backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%); border: 1px solid var(--glass-line); }
.glass-strong { background: var(--glass-strong); backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%); }
.m { color: var(--muted); } .small { font-size: 12px; } .center { text-align: center; } .pad { padding: 12px 14px; } .grow { flex: 1; min-width: 0; } .spacer { flex: 1; }
.mt { margin-top: 14px !important; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; max-width: 100%; vertical-align: bottom; }
.splash { display: grid; place-items: center; height: 100vh; }

/* ---------- przyciski i pola ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; justify-content: center; height: 32px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 7px;
  background: var(--glass); color: var(--text); cursor: pointer; white-space: nowrap; text-decoration: none; font-weight: 500; font-size: 13px; }
.btn:hover { border-color: var(--blue); }
.btn.pri { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.pri:hover { background: #0a3a96; }
@media (prefers-color-scheme: dark) { html:not([data-theme]) .btn.pri { background: #2f5fc4; border-color: #2f5fc4; } }
.btn.sm { height: 27px; padding: 0 9px; font-size: 12px; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--blue2); }
.btn.danger { color: var(--red); }
.btn.danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn.block { width: 100%; height: 40px; }
.btn:disabled { opacity: .6; cursor: default; }
.btn.upload { position: relative; overflow: hidden; } .btn.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.icon-btn { border: 0; background: transparent; cursor: pointer; padding: 3px 6px; border-radius: 6px; color: var(--muted); line-height: 1; font-size: 14px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); } .icon-btn.del:hover { color: var(--red); } .icon-btn.has { color: var(--blue2); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.link { border: 0; background: none; color: var(--blue2); cursor: pointer; padding: 0; text-align: left; font: inherit; display: inline-flex; gap: 6px; align-items: center; min-width: 0; }
input[type=text], input:not([type]), input[type=email], input[type=tel], input[type=password], input[type=search], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=month], select, textarea {
  width: 100%; border: 1px solid var(--line2); background: var(--glass-strong); border-radius: 7px; padding: 7px 10px; outline: none; min-width: 0; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,152,95,.2); }
input:disabled, select:disabled, textarea[readonly] { opacity: .8; background: transparent; }
textarea { resize: vertical; }
label.field { display: block; margin-bottom: 10px; } label.field > span, .field > .lbl { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; font-weight: 500; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
.grid4 { display: grid; grid-template-columns: 1.2fr 1fr 1fr .8fr auto; gap: 8px; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; } .btn-row.end { justify-content: flex-end; margin-top: 14px; }
.chk { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; white-space: nowrap; }
.chk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 12px; margin: 4px 0 8px; } .chk-grid label { display: flex; gap: 6px; align-items: center; }
.hint { background: var(--soft2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; color: var(--muted); }
.error { color: var(--red); font-size: 13px; min-height: 18px; }

/* ---------- znaczniki ---------- */
.pill { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 10px; font-size: 11px; font-weight: 600; white-space: nowrap; border: 0; cursor: default; }
button.pill { cursor: pointer; }
.pill.blue { background: var(--soft); color: var(--navy); } .pill.navy { background: var(--navy); color: #fff; } .pill.grey { background: rgba(140,150,170,.16); color: var(--muted); }
.pill.red { background: #FDE3E0; color: #B8321F; } .pill.orange { background: #FDE7DC; color: #B44A22; } .pill.green { background: #DDF2E7; color: #1d7a4f; }
.pill.yellow { background: #FFF4C9; color: #8a6d00; } .pill.purple { background: #EEE3F8; color: #6E36A5; }
.flag { display: inline-block; width: 10px; height: 10px; border-radius: 2px; flex: none; vertical-align: middle; } .flag.big { width: 16px; height: 16px; }
.av { width: 30px; height: 30px; border-radius: 50%; color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: 11px; flex: none; position: relative; vertical-align: middle; background: var(--navy); }
.av.s { width: 22px; height: 22px; font-size: 9px; } .av.grp { background: var(--purple); }
.av.on::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border-radius: 50%; background: var(--green); border: 2px solid var(--surface); }
.bok-t { color: #B44A22; }
.dot { flex: none; width: 13px; height: 13px; border-radius: 50%; border: 2px dashed var(--line2); background: transparent; padding: 0; cursor: pointer; display: inline-block; vertical-align: middle; }
.dot:disabled { cursor: default; } .dot:disabled:not([class*="c-"]) { visibility: hidden; }
.dot.c-red, li.col-red { --c: var(--c-red); } .dot.c-orange, li.col-orange { --c: var(--c-orange); } .dot.c-yellow, li.col-yellow { --c: var(--c-yellow); }
.dot.c-green, li.col-green { --c: var(--c-green); } .dot.c-blue, li.col-blue { --c: var(--c-blue); } .dot.c-purple, li.col-purple { --c: var(--c-purple); }
.dot[class*="c-"] { background: var(--c); border: 2px solid var(--c); }
.prog { width: 54px; height: 5px; border-radius: 3px; background: rgba(140,150,170,.2); display: inline-block; vertical-align: middle; overflow: hidden; } .prog i { display: block; height: 100%; background: var(--green); }

/* ---------- logowanie ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: 100%; max-width: 380px; border-radius: 14px; padding: 26px; box-shadow: var(--shadow); border-top: 4px solid var(--blue) !important; }
.auth-logo { display: block; height: 74px; margin: 0 auto 14px; } .auth-card h1 { font-size: 20px; margin: 0 0 2px; color: var(--navy); }

/* ---------- szkielet ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; border-width: 0 1px 0 0 !important; z-index: 30; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px 14px; border-bottom: 1px solid var(--glass-line); }
.brand img { height: 46px; } .brand .tag { font-size: 10px; font-weight: 700; color: var(--blue); letter-spacing: .14em; border-left: 1px solid var(--line2); padding-left: 9px; }
@media (prefers-color-scheme: dark) { html:not([data-theme]) .brand img, html:not([data-theme]) .auth-logo { filter: brightness(0) invert(1); } }
.navg { padding: 12px 18px 4px; font-size: 10.5px; font-weight: 700; color: #9aa1b3; letter-spacing: .1em; text-transform: uppercase; }
.nav a { display: flex; align-items: center; gap: 9px; padding: 7px 10px; margin: 1px 8px; border-radius: 6px; color: var(--text); text-decoration: none; font-weight: 500; position: relative; opacity: .88; }
.nav a:hover { background: rgba(0,152,95,.12); opacity: 1; }
.nav a .ic { width: 18px; text-align: center; color: var(--muted); } .nav a .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a .cnt { font-size: 11px; color: var(--muted); background: rgba(140,150,170,.15); border-radius: 9px; padding: 0 7px; } .nav a .cnt.red { background: #FDE3E0; color: #B8321F; }
.nav a.act { background: rgba(221,235,248,.85); color: var(--navy); font-weight: 600; opacity: 1; }
@media (prefers-color-scheme: dark) { html:not([data-theme]) .nav a.act { background: rgba(60,100,180,.35); } }
.nav a.act::before { content: ""; position: absolute; left: -8px; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: var(--navy); }
.nav a .grip { position: absolute; left: -3px; color: #b9bfcc; font-size: 10px; opacity: 0; cursor: grab; } .nav a:hover .grip { opacity: 1; }
.nav a.dragging { opacity: .4; }
.nav-add { margin: 4px 18px; border: 0; background: none; color: var(--blue2); font-weight: 600; cursor: pointer; text-align: left; padding: 4px 0; }
.side-bottom { margin-top: auto; border-top: 1px solid var(--glass-line); padding: 8px; position: relative; }
.me { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: none; padding: 6px; border-radius: 8px; cursor: pointer; text-align: left; }
.me:hover { background: rgba(0,152,95,.12); } .me b { display: block; font-size: 12.5px; } .me small { color: var(--muted); font-size: 11px; } .me span:nth-child(2) { flex: 1; } .me .dots { color: var(--muted); }
.menu { position: absolute; left: 8px; right: 8px; bottom: calc(100% - 4px); background: var(--glass-strong); backdrop-filter: blur(20px); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(0,20,60,.18); padding: 6px; display: none; z-index: 40; }
.menu.open { display: block; } .menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.menu button:hover { background: rgba(0,152,95,.12); }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 20px; border-width: 0 0 1px 0 !important; }
.top h1 { margin: 0; font-size: 17px; font-weight: 600; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top h1.editable { cursor: text; } .top h1.editable:hover::after { content: " ✎"; color: #a0a7b8; font-size: 12px; font-weight: 400; }
.burger { display: none; font-size: 20px; }
.search { margin-left: auto; width: 340px; display: flex; align-items: center; gap: 6px; border: 1px solid var(--line2); border-radius: 7px; padding: 0 10px; background: var(--glass-strong); }
.search span { color: #9aa1b3; } .search input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 7px 0; }
.ibtn { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 7px; display: grid; place-items: center; background: var(--glass); cursor: pointer; position: relative; flex: none; }
.ibtn .bd { position: absolute; top: -6px; right: -6px; background: var(--orange); color: #fff; font-size: 10px; font-weight: 700; border-radius: 9px; padding: 0 5px; border: 2px solid var(--surface); line-height: 14px; }
.ibtn .bd.blue { background: var(--blue); } .ibtn .bd.green { top: auto; bottom: -6px; background: var(--green); }
.view { padding: 16px 20px 40px; min-width: 0; }
.side-scrim { display: none; }

/* ---------- pasek narzędzi / filtry ---------- */
.toolbar { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 12px; position: relative; z-index: 6; }
.chip-sel { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 4px 0 10px; border: 1px solid var(--line2); border-radius: 7px; background: var(--glass); font-size: 12px; color: var(--muted); cursor: pointer; }
.chip-sel select, .chip-sel input { border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0 4px; height: 28px; font-size: 12.5px; color: var(--text); width: auto; max-width: 150px; }
.chip-sel input { width: 110px; }
.chip-sel.on { border-color: var(--blue); background: rgba(221,235,248,.85); color: var(--navy); font-weight: 600; }
.chip-sel.warn { color: #B8321F; font-weight: 600; padding-right: 10px; } .chip-sel.warn.on { background: #FFF0EC; border-color: var(--red); }
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 7px; overflow: hidden; background: var(--glass); }
.seg button, .seg label { border: 0; background: transparent; padding: 6px 11px; font-size: 12.5px; cursor: pointer; color: var(--muted); border-right: 1px solid var(--line2); white-space: nowrap; }
.seg > *:last-child { border-right: 0; } .seg .on, .seg label:has(input:checked) { background: var(--navy); color: #fff; }
.seg input { position: absolute; opacity: 0; pointer-events: none; } .seg.full { display: flex; margin-bottom: 12px; } .seg.full > * { flex: 1; text-align: center; } .seg.wrap { flex-wrap: wrap; }
.dd-wrap { position: relative; }
.dd { position: absolute; left: 0; top: 36px; width: 320px; border-radius: 9px; box-shadow: 0 12px 30px rgba(0,20,60,.18); padding: 6px; display: none; z-index: 30; background: var(--glass-strong) !important; }
.dd.open { display: block; } .dd-h { font-size: 10.5px; font-weight: 700; color: #9aa1b3; letter-spacing: .08em; padding: 4px 8px; text-transform: uppercase; }
.dd-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; } .dd-row:hover { background: rgba(0,152,95,.1); }
.dd-row span { flex: 1; } .dd-row b { color: #C43B25; font-size: 12px; } .mini-num { width: 52px !important; padding: 2px 5px !important; display: inline-block; }
.dd-f { display: flex; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }

/* ---------- karty / tabele ---------- */
.card { border-radius: var(--r); box-shadow: var(--shadow); }
.ch { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--glass-line); } .ch h3 { margin: 0; font-size: 13.5px; color: var(--navy); flex: 1; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.loading { padding: 14px; color: var(--muted); }
.tbl-wrap { overflow-x: auto; }
.tbl-topscroll { overflow-x: auto; overflow-y: hidden; position: sticky; top: 56px; z-index: 19; height: 16px; margin-bottom: 2px; border-radius: 8px; background: rgba(255,255,255,.75); backdrop-filter: blur(6px); }
.tbl-topscroll > div { height: 1px; }
.tbl-topscroll { scrollbar-width: auto; scrollbar-color: #8CC7A9 transparent; }
.tbl-topscroll::-webkit-scrollbar { height: 12px; } .tbl-topscroll::-webkit-scrollbar-thumb { background: #8CC7A9; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; } .tbl-topscroll::-webkit-scrollbar-thumb:hover { background-color: #00985F; }
.tbl-topscroll[hidden] { display: none; }
@media (prefers-color-scheme: dark) { html:not([data-theme]) .tbl-topscroll { background: rgba(11,24,56,.75); } }
@media (hover: none) { .tbl-topscroll { display: none; } }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.t th { position: sticky; top: 0; background: rgba(247,248,250,.75); color: var(--muted); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; cursor: pointer; user-select: none; }
@media (prefers-color-scheme: dark) { html:not([data-theme]) .t th { background: rgba(20,39,83,.8); } }
.t th.th-red { color: #B8321F; } .t th.th-bok { color: #B44A22; }
.t td { padding: 6px 10px; border-bottom: 1px solid rgba(205,212,219,.5); vertical-align: middle; white-space: nowrap; }
.t td .m.ellip { max-width: 230px; }
.t tr.r { cursor: pointer; } .t tr.r:hover td { background: rgba(255,255,255,.5); } .t tr.r.open td { background: rgba(238,245,252,.75); }
@media (prefers-color-scheme: dark) { html:not([data-theme]) .t tr.r:hover td { background: rgba(255,255,255,.04); } html:not([data-theme]) .t tr.r.open td { background: rgba(60,100,180,.15); } }
.t td.nm b { color: var(--navy); font-weight: 600; } .t td.nm small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
.w-ch { width: 22px; padding-right: 0 !important; } .chev { color: #9aa1b3; }
.t tr.exp > td { padding: 0; background: rgba(251,252,254,.65); white-space: normal; border-bottom: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { html:not([data-theme]) .t tr.exp > td { background: rgba(10,20,50,.4); } }
.list-foot { color: var(--muted); font-size: 12px; margin-top: 8px; }
.flash { animation: flash 1.8s ease; } @keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--blue) inset; } 100% { box-shadow: none; } }

/* ---------- szczegóły klienta ---------- */
.detail { display: grid; grid-template-columns: 1.1fr 1.1fr 1.1fr 1fr; gap: 16px; padding: 12px 14px 14px 32px; }
.blk { min-width: 0; } .blk h4 { margin: 0 0 7px; font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.owners { display: grid; gap: 4px; margin-bottom: 8px; }
.kv-row { display: grid; grid-template-columns: 110px 1fr; gap: 6px; align-items: center; font-size: 12px; } .kv-row > span { color: var(--muted); }
.kv-row input, .kv-row select { padding: 4px 7px; font-size: 12.5px; }
.collapse { border: 1px solid var(--line); border-radius: 7px; background: var(--glass); }
.collapse summary { cursor: pointer; padding: 7px 10px; font-weight: 600; color: var(--navy); font-size: 12.5px; list-style: none; display: flex; gap: 8px; align-items: baseline; }
.collapse summary::-webkit-details-marker { display: none; } .collapse summary::before { content: "▸"; color: var(--muted); } .collapse[open] summary::before { content: "▾"; }
.collapse summary .m { font-weight: 400; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv { display: grid; gap: 4px; padding: 4px 10px 8px; border-top: 1px solid var(--line); }
.tel { display: flex; gap: 4px; } .tel select { width: 92px; flex: none; }
.contacts { padding: 6px 10px 10px; border-top: 1px solid var(--line); } .sub-h { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.contact-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1.2fr auto auto; gap: 4px; margin-bottom: 4px; align-items: center; } .contact-row input { padding: 4px 6px; font-size: 12px; }
.note-add { display: flex; gap: 6px; align-items: flex-end; margin-bottom: 6px; } .note-add textarea { min-height: 38px; font-size: 12.5px; }
.notes { max-height: 340px; overflow-y: auto; }
.note { border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; margin-bottom: 6px; background: var(--glass-strong); font-size: 12.5px; }
.note.bok { border-left: 3px solid var(--orange); } .note .by { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); margin-bottom: 2px; } .note .by b { color: var(--text); }
.note .nb { white-space: pre-wrap; word-break: break-word; }
ul.tasks, ul.evs { list-style: none; margin: 0 0 6px; padding: 0; }
ul.tasks li { display: flex; align-items: center; gap: 6px; padding: 3px 0 3px 4px; flex-wrap: wrap; border-radius: 4px; }
ul.tasks li[class*="col-"] { border-left: 3px solid var(--c); padding-left: 5px; }
ul.tasks li.col-red { background: rgba(233,79,55,.06); } ul.tasks li.col-red:not(.done) .tx { font-weight: 600; }
ul.tasks li input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--green); flex: none; margin: 0; }
ul.tasks .tx { flex: 1; min-width: 80px; outline: none; border-radius: 4px; padding: 1px 3px; word-break: break-word; } ul.tasks .tx:focus { background: var(--surface); box-shadow: 0 0 0 1px var(--line2); }
ul.tasks li.done .tx { text-decoration: line-through; color: var(--muted); }
.tmeta { display: inline-flex; gap: 3px; align-items: center; flex-wrap: wrap; }
.item-note { width: calc(100% - 24px); margin-left: 24px; min-height: 40px; font-size: 12.5px; }
ul.evs li { display: flex; align-items: center; gap: 6px; padding: 3px 0; font-size: 12.5px; min-width: 0; } ul.evs li.done .grow { text-decoration: line-through; color: var(--muted); }
ul.evs li > a.ellip { flex: 1; }
.inline-add { display: flex; gap: 4px; flex-wrap: wrap; } .inline-add input[name=text] { flex: 1 1 140px; } .inline-add input, .inline-add select { padding: 5px 7px; font-size: 12.5px; width: auto; }
.inline-add input[type=datetime-local] { flex: 0 1 170px; } .inline-add select { flex: 0 1 140px; }
.inline-add.big input[name=text] { font-size: 17px; padding: 11px 13px; border-radius: 10px; } .inline-add.big .btn { width: 52px; height: auto; font-size: 22px; border-radius: 10px; }

/* ---------- karty klientów (telefon) ---------- */
.cards { display: grid; gap: 8px; }
.ccard { border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.cc-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; }
.cc-main { flex: 1; min-width: 0; } .cc-main b { color: var(--navy); font-size: 15px; display: block; } .cc-main small { color: var(--muted); display: block; }
.cc-meta { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; align-items: center; }
.cc-av { display: flex; gap: 2px; }
.ccard .detail-host { border-top: 1px solid var(--line); }

/* ---------- Pulpit ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.kpi { border-radius: var(--r); padding: 10px 14px; box-shadow: var(--shadow); } .kpi span { display: block; font-size: 11.5px; color: var(--muted); } .kpi b { font-size: 24px; color: var(--navy); }
.kpi.bad b { color: #C43B25; }
.dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; align-items: start; }
.dcol.red { border-color: #F4C4B8 !important; } .dcol.red .ch { background: rgba(255,240,236,.7); } .dcol.red h3 { color: #B8321F; }
.dcol-b { max-height: 520px; overflow-y: auto; }
.ev { display: flex; gap: 10px; padding: 8px 14px; border-bottom: 1px solid rgba(205,212,219,.45); cursor: pointer; } .ev:last-child { border: 0; } .ev:hover { background: rgba(255,255,255,.4); }
.ev .when { flex: none; width: 70px; font-size: 11.5px; font-weight: 600; color: var(--navy); } .ev .when small { display: block; color: var(--muted); font-weight: 400; }
.ev.over .when { color: #C43B25; } .ev-b { min-width: 0; flex: 1; } .ev-b b { display: block; font-weight: 600; font-size: 12.5px; } .ev-b > span { font-size: 11.5px; color: var(--muted); }

/* ---------- Kalendarz ---------- */
.cal-title { margin: 0 6px; font-size: 16px; text-transform: capitalize; color: var(--navy); }
.cal-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 12px; align-items: start; }
.cal-grid { display: grid; grid-template-columns: 38px repeat(7, minmax(0, 1fr)); }
.cal-dow { padding: 7px; font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; border-bottom: 1px solid var(--line); }
.cal-day { min-height: 98px; border-right: 1px solid rgba(205,212,219,.5); border-bottom: 1px solid rgba(205,212,219,.5); padding: 4px; cursor: pointer; min-width: 0; }
.cal-day:nth-child(8n) { border-right: 0; } .cal-day:hover { background: rgba(255,255,255,.45); } .cal-day.other { background: rgba(140,150,170,.07); color: var(--muted); }
.cal-day .num { font-size: 12px; font-weight: 600; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; }
.cal-day.today .num { background: var(--navy); color: #fff; }
.chip { display: block; font-size: 11px; border-radius: 4px; padding: 1px 5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--soft); color: var(--navy); }
.chip i { font-style: normal; } .chip.meet { background: var(--navy); color: #fff; } .chip.task { background: transparent; border: 1px solid var(--blue); } .chip.goal { background: #EEE3F8; color: #6E36A5; }
.chip.past { opacity: .55; } .chip.more { background: transparent; color: var(--muted); }
.cal-legend { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 12px; border-top: 1px solid var(--line); align-items: center; } .cal-legend .chip { display: inline-block; margin: 0; }
.agenda .ev .when { width: 74px; }

/* ---------- Zadania ---------- */
.wins { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; align-items: start; }
.win { border-radius: var(--r); box-shadow: var(--shadow); padding: 0 12px 12px; min-width: 0; }
.win.add { display: grid; place-items: center; min-height: 110px; border-style: dashed !important; color: var(--blue2); font-weight: 600; cursor: pointer; padding: 12px; }
.win-h { display: flex; align-items: center; gap: 6px; padding: 9px 0 8px; border-bottom: 1px solid var(--glass-line); margin-bottom: 6px; }
.win-title { border: 1px solid transparent !important; background: transparent !important; font-weight: 600; color: var(--navy); font-size: 14px; padding: 3px 5px !important; box-shadow: none !important; }
.win-title:hover, .win-title:focus { border-color: var(--line2) !important; background: var(--glass-strong) !important; }
.nb-area { min-height: 180px; background: var(--glass-strong); font-size: 13px; line-height: 1.55; } .nb-area.big { min-height: 60vh; font-size: 16px; }
.sec-h { display: flex; align-items: center; gap: 10px; margin: 22px 0 8px; flex-wrap: wrap; } .sec-h h3 { margin: 0; color: var(--navy); font-size: 15px; }
.meet-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.mcard { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r); cursor: pointer; box-shadow: var(--shadow); }
.mc-h { flex: 1; min-width: 0; } .mc-h b { display: block; color: var(--navy); } .mc-h .m { font-size: 12px; }

/* ---------- Pełny ekran / panel ---------- */
body.fs-open { overflow: hidden; }
.fs { position: fixed; inset: 0; z-index: 45; display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.fs.as-panel { left: auto; width: min(700px, 100%); box-shadow: -10px 0 40px rgba(0,0,0,.2); }
.fs-backdrop { position: fixed; inset: 0; background: rgba(10,15,35,.3); z-index: 44; }
.fs-head { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); border-bottom: 1px solid var(--line); border-top: 4px solid var(--blue); }
.fs-close { font-size: 22px; } .fs-title { flex: 1; min-width: 0; } .fs-title b { font-size: 19px; color: var(--navy); }
.fs-title-input { font-size: 19px !important; font-weight: 700; color: var(--navy); border-color: transparent !important; background: transparent !important; padding: 3px 6px !important; box-shadow: none !important; }
.fs-title-input:focus { border-color: var(--line2) !important; background: var(--surface) !important; }
.fs-details summary { cursor: pointer; font-size: 13px; color: var(--muted); padding: 3px 6px; list-style: none; } .fs-details summary::-webkit-details-marker { display: none; } .fs-details summary::after { content: " ▾"; }
.fs.as-panel .fs-details summary { display: none; }
.fs-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; } .fs-meta input, .fs-meta select { width: auto; padding: 5px 8px; font-size: 13px; }
.fs-body { flex: 1; overflow-y: auto; padding: 14px 16px 20px; width: 100%; max-width: 900px; margin: 0 auto; }
.tasks.big li { padding: 6px 0 6px 4px; font-size: 17px; } .tasks.big input[type=checkbox] { width: 22px; height: 22px; } .tasks.big .dot { width: 17px; height: 17px; }
.fs.as-panel .tasks.big li { font-size: 14px; } .fs.as-panel .tasks.big input[type=checkbox] { width: 16px; height: 16px; }
.fs-notes { margin-top: 16px; } .fs-notes summary { cursor: pointer; font-weight: 600; color: var(--navy); padding: 6px 0; } .fs-notes textarea { min-height: 160px; font-size: 15px; }
.fs-foot { border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); } .fs-foot .inline-add { max-width: 900px; margin: 0 auto; }

/* ---------- Reklamacje / Pliki ---------- */
.drop { display: block; border: 1.5px dashed var(--line2); border-radius: 8px; padding: 12px; text-align: center; color: var(--muted); cursor: pointer; position: relative; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; } .drop.big { padding: 22px; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.file { border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.file .th { height: 96px; display: grid; place-items: center; font-size: 24px; font-weight: 800; color: #fff; background: #8a94ab; text-decoration: none; overflow: hidden; }
.file .th img { width: 100%; height: 100%; object-fit: cover; } .file .th.k-pdf { background: #C43B25; } .file .th.k-xls { background: #2E9E6E; } .file .th.k-doc { background: #007A4C; }
.file .fb { padding: 8px 10px 10px; } .file .fb b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .file .fb small { display: block; color: var(--muted); font-size: 11px; }
.vis { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; margin-top: 5px; font-size: 11px; color: var(--muted); }
.pick { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }

/* ---------- Czat ---------- */
.chat { display: grid; grid-template-columns: 300px 1fr; height: calc(100vh - 56px - 56px); min-height: 420px; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.chat-list { border-right: 1px solid var(--glass-line); display: flex; flex-direction: column; min-height: 0; }
.chat-lh { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--glass-line); } .chat-lh b { font-size: 15px; color: var(--navy); }
.chat-scroll { overflow-y: auto; flex: 1; }
.contact { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 12px; border: 0; background: transparent; text-align: left; cursor: pointer; border-bottom: 1px solid rgba(205,212,219,.35); }
.contact:hover { background: rgba(255,255,255,.4); } .contact.active { background: rgba(221,235,248,.85); }
.c-main { flex: 1; min-width: 0; display: flex; flex-direction: column; } .c-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--orange); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.st { font-size: 11.5px; color: var(--muted); display: block; } .st.on { color: var(--green); font-weight: 600; }
.chat-conv { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-ch { display: flex; align-items: center; gap: 9px; padding: 9px 14px; border-bottom: 1px solid var(--glass-line); } .who { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.day-sep { align-self: center; font-size: 11.5px; color: var(--muted); background: var(--glass-strong); border: 1px solid var(--line); border-radius: 99px; padding: 1px 10px; margin: 6px 0; }
.msg { max-width: 72%; align-self: flex-start; display: flex; flex-direction: column; } .msg.me { align-self: flex-end; align-items: flex-end; }
.msg .mw { font-size: 11px; color: var(--muted); margin: 0 0 2px 2px; display: flex; gap: 5px; align-items: center; }
.bub { background: var(--glass-strong); border: 1px solid var(--line); padding: 7px 11px; border-radius: 12px 12px 12px 3px; white-space: pre-wrap; word-break: break-word; }
.msg.me .bub { background: var(--navy); border-color: var(--navy); color: #fff; border-radius: 12px 12px 3px 12px; }
.msg .meta { font-size: 10.5px; color: var(--muted); margin: 2px 4px 0; }
.chat-input { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--glass-line); }
.chat-input textarea { min-height: 40px; max-height: 140px; resize: none; border-radius: 20px; padding: 9px 14px; } .chat-input .btn { border-radius: 50%; width: 40px; height: 40px; padding: 0; flex: none; }
.chat-empty { flex: 1; display: grid; place-items: center; } .chat .back { display: none; font-size: 22px; }

/* ---------- Administracja ---------- */
.card.pad { padding: 14px 16px; } .card h3 { margin: 4px 0 6px; font-size: 14px; color: var(--navy); }
.adm-list { display: grid; gap: 4px; }
.adm-row { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 7px; background: var(--glass-strong); flex-wrap: wrap; }
.adm-row > input { flex: 1 1 160px; padding: 5px 8px; } .adm-row .ico { flex: 0 0 52px; text-align: center; } .adm-row select { width: auto; padding: 5px 8px; }
.adm-row .ord { display: inline-flex; flex-direction: column; } .adm-row .ord .icon-btn { padding: 0 4px; font-size: 10px; }
.adm-row .flt { display: flex; gap: 4px; flex-wrap: wrap; flex: 1 1 100%; padding-left: 30px; } .adm-row .flt select, .adm-row .flt input { width: auto; max-width: 180px; font-size: 12px; padding: 4px 6px; }
.matrix td, .matrix th { text-align: left; } .matrix select { padding: 3px 6px; font-size: 12px; } .matrix tr.grp td { background: rgba(221,235,248,.6); font-weight: 700; color: var(--navy); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.log-list { max-height: 420px; overflow-y: auto; } .log-row { display: flex; gap: 8px; padding: 6px 12px; font-size: 12.5px; border-bottom: 1px solid var(--line); } .log-row.bad { background: rgba(233,79,55,.07); }
.color-field { display: flex !important; align-items: center; gap: 8px; } .color-field .dot { margin: 0; cursor: default; }
.qr { text-align: center; margin: 10px 0; } .qr img { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 6px; }
.secret { font-size: 14px; background: var(--surface-2); padding: 3px 8px; border-radius: 6px; display: inline-block; user-select: all; }

/* ---------- okna dialogowe / toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(10,15,35,.32); display: grid; place-items: center; z-index: 60; padding: 14px; }
.modal { background: var(--glass-strong); backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%); border: 1px solid var(--glass-line);
  border-radius: 14px; width: 100%; max-width: 480px; max-height: 92vh; overflow: auto; padding: 18px 20px; box-shadow: 0 20px 60px rgba(0,20,60,.3); }
.modal.wide { max-width: 640px; } .modal.xwide { max-width: 900px; }
.modal-h { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; } .modal-h h2 { margin: 0; font-size: 17px; color: var(--navy); flex: 1; }
.modal h3 { font-size: 14px; margin: 14px 0 6px; color: var(--navy); } .modal .muted, .muted { color: var(--muted); }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; position: sticky; bottom: -18px; }
#toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: var(--navy); color: #fff;
  padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .2s; z-index: 70; max-width: 90vw; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); } #toast.err { background: var(--red); }

/* ================= Responsywność ================= */
@media (max-width: 1280px) { .detail { grid-template-columns: 1fr 1fr; } }
@media (max-width: 1100px) { .cal-wrap { grid-template-columns: 1fr; } .search { width: 240px; } }
@media (max-width: 900px) {
  body::after { background: url(/brand/znak.svg) left 14px bottom 24px / 96px auto no-repeat, url(/brand/romby-1.svg) left 120px bottom 10px / 600px auto no-repeat; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; transform: translateX(-105%); transition: transform .2s; box-shadow: 10px 0 40px rgba(0,0,0,.2); background: var(--glass-strong); }
  .shell.side-open .side { transform: none; }
  .shell.side-open .side-scrim { display: block; position: fixed; inset: 0; background: rgba(10,15,35,.3); z-index: 25; }
  .burger { display: inline-block; }
  .top { padding: 0 10px; padding-top: env(safe-area-inset-top); height: calc(54px + env(safe-area-inset-top)); gap: 6px; }
  .top h1 { font-size: 16px; flex: 1; }
  .search { position: absolute; left: 10px; right: 10px; top: calc(54px + env(safe-area-inset-top)); width: auto; display: none; }
  body[data-view="clients"] .search, body[data-view="leads"] .search, body[data-view="clientlist"] .search { display: flex; position: static; flex: 0 1 46%; margin-left: 0; }
  .view { padding: 10px 10px calc(40px + env(safe-area-inset-bottom)); }
  .toolbar { gap: 5px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .toolbar::-webkit-scrollbar { display: none; }
  .toolbar > * { flex: none; }
  .dd { position: fixed; left: 10px; right: 10px; top: auto; bottom: 10px; width: auto; }
  .detail { grid-template-columns: 1fr; padding: 10px 12px 12px; gap: 14px; }
  .kv-row { grid-template-columns: 105px 1fr; }
  .contact-row { grid-template-columns: 1fr 1fr; } .contact-row .icon-btn { justify-self: start; }
  .dash { grid-template-columns: 1fr; } .kpis { grid-template-columns: repeat(2, 1fr); }
  .cal-day { min-height: 62px; padding: 2px; } .chip i, .chip .cn { display: none; } .chip { text-align: center; font-size: 10px; font-weight: 600; padding: 1px 2px; }
  .wins, .meet-list { grid-template-columns: 1fr; }
  .grid2, .grid3 { grid-template-columns: 1fr; } .grid4 { grid-template-columns: 1fr; }
  .chat { grid-template-columns: 1fr; height: calc(100dvh - 54px - 30px - env(safe-area-inset-top)); }
  .chat.has-conv .chat-list { display: none; } .chat:not(.has-conv) .chat-conv { display: none; } .chat .back { display: inline-block; }
  .msg { max-width: 88%; }
  .modal-bg { place-items: end center; padding: 0; } .modal { border-radius: 16px 16px 0 0; max-height: 94vh; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .inline-add select, .inline-add input[type=datetime-local] { flex: 1 1 45%; }
  input, textarea, select { font-size: 16px !important; } /* iOS: bez powiększania */
  .chip-sel select, .chip-sel input { font-size: 14px !important; }
  .files { grid-template-columns: repeat(2, 1fr); }
  .fs.as-panel { width: 100%; }
}

/* ---------- Banery powiadomień (gdy CRM jest otwarty) ---------- */
#banners { position: fixed; top: calc(64px + env(safe-area-inset-top)); right: 16px; z-index: 80; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 24px)); pointer-events: none; }
.banner { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--glass-line); border-left: 4px solid var(--blue);
  box-shadow: 0 12px 34px rgba(0,20,60,.22); cursor: pointer; animation: banner-in .25s ease; transition: opacity .5s, transform .5s; }
.banner img { width: 34px; height: 34px; border-radius: 8px; flex: none; } .banner b { display: block; color: var(--navy); font-size: 13px; } .banner span { font-size: 12.5px; color: var(--muted); }
.banner.out { opacity: 0; transform: translateX(30px); }
@keyframes banner-in { from { opacity: 0; transform: translateX(40px); } }
@media (max-width: 900px) { #banners { right: 12px; left: 12px; width: auto; } }

/* ---------- Oznaczanie osób @ ---------- */
.mention { color: var(--blue2); background: rgba(0,152,95,.14); border-radius: 4px; padding: 0 2px; font-weight: 600; }
.mention-pop { position: fixed; z-index: 120; width: 260px; border-radius: 10px; padding: 4px; border: 1px solid var(--line); box-shadow: 0 12px 30px rgba(0,20,60,.2); }
.mention-pop .mp-h { font-size: 11px; color: var(--muted); padding: 4px 8px; }
.mention-pop button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 6px 8px; border-radius: 6px; cursor: pointer; text-align: left; }
.mention-pop button small { color: var(--muted); margin-left: auto; }
.mention-pop button.on, .mention-pop button:hover { background: var(--soft); }
.banners-clear { pointer-events: auto; align-self: flex-end; }

/* ---------- Zaznaczanie wielu klientów ---------- */
.w-sel { width: 30px; text-align: center; }
.w-sel input, .cc-sel { width: 17px; height: 17px; cursor: pointer; accent-color: var(--navy); }
tr.r.sel td { background: rgba(0,152,95,.13); }
.ccard.sel { outline: 2px solid var(--blue); }
.cc-sel { margin: 2px 10px 0 0; flex: none; }
.bulk-bar { position: fixed; z-index: 70; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 14px 40px rgba(0,20,60,.25); max-width: calc(100vw - 24px); width: max-content; }
.bulk-bar b { color: var(--navy); margin-right: 6px; }

/* ---------- Notatki BOK ---------- */
.notes-box + .notes-box { margin-top: 14px; }
.bok-box { border-top: 2px dashed rgba(230,100,62,.35); padding-top: 10px; }

/* ---------- Tablice z karteczkami ---------- */
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px 18px; padding: 8px 4px 22px; align-items: start; }
.bnote { position: relative; padding: 16px 14px 10px; min-height: 150px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; color: #2a2a2a;
  box-shadow: 0 10px 18px -8px rgba(0,0,0,.35), 0 2px 4px rgba(0,0,0,.08); transition: transform .15s, box-shadow .15s; outline: none; }
.bnote:hover, .bnote:focus-visible { transform: translateY(-3px) rotate(0deg) !important; box-shadow: 0 16px 26px -10px rgba(0,0,0,.4); z-index: 2; }
.bnote h4 { margin: 0; font-size: 15px; line-height: 1.25; }
.bnote .bn-body { white-space: pre-wrap; font-size: 13.5px; flex: 1; overflow-wrap: anywhere; }
.bnote .bn-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }
.bnote .bn-for { display: inline-flex; gap: 4px; align-items: center; }
.bnote footer { display: flex; justify-content: space-between; gap: 6px; align-items: center; font-size: 11px; color: rgba(0,0,0,.6); border-top: 1px solid rgba(0,0,0,.08); padding-top: 6px; }
.bnote .bn-done { display: inline-flex; gap: 4px; align-items: center; cursor: pointer; }
.bnote .bn-by { text-align: right; }
.bnote .bn-pin { position: absolute; right: 8px; top: 4px; }
.bnote.done { opacity: .55; } .bnote.done h4, .bnote.done .bn-body { text-decoration: line-through; }
/* swobodne układanie (przeciąganie myszą) */
.bgrid.free { display: block; position: relative; padding: 0; min-height: 200px; }
.bgrid.free .bnote { position: absolute; cursor: grab; }
.bgrid.free .bnote.bn-dragging { cursor: grabbing; transition: none; transform: rotate(0deg) scale(1.03) !important; box-shadow: 0 24px 40px -12px rgba(0,0,0,.45); user-select: none; }
.bnote.flash { animation: bn-flash 1s ease 3; }
@keyframes bn-flash { 50% { box-shadow: 0 0 0 6px var(--orange), 0 10px 18px -8px rgba(0,0,0,.35); } }
.bnote .mention { color: #0b3d91; background: rgba(255,255,255,.5); }
/* kolory kartek */
.nc-yellow { --nb: #FFF27A; --nb2: #FFE94D; } .nc-pink { --nb: #FFC7DD; --nb2: #FFB0CD; } .nc-green { --nb: #C9F2B5; --nb2: #B2EA98; }
.nc-blue { --nb: #C4E2FF; --nb2: #A9D3FF; } .nc-orange { --nb: #FFD2A6; --nb2: #FFC08A; } .nc-purple { --nb: #E3D0FF; --nb2: #D4B8FF; } .nc-white { --nb: #ffffff; --nb2: #F1F3F6; }
/* karteczka samoprzylepna – lekko przekrzywiona, z paskiem kleju */
.st-sticky { background: linear-gradient(180deg, var(--nb2) 0 20px, var(--nb) 20px); border-radius: 2px 2px 14px 2px; }
.bgrid .st-sticky:nth-child(3n+1) { transform: rotate(-1.4deg); } .bgrid .st-sticky:nth-child(3n+2) { transform: rotate(1.1deg); } .bgrid .st-sticky:nth-child(3n) { transform: rotate(-.4deg); }
/* kartka wyrwana z zeszytu – linie, margines, poszarpana góra */
.st-paper { background: linear-gradient(90deg, transparent 30px, rgba(233,79,55,.45) 30px 31.5px, transparent 31.5px), repeating-linear-gradient(180deg, var(--nb) 0 21px, rgba(87,140,210,.38) 21px 22px), var(--nb);
  padding-left: 40px; padding-top: 22px;
  -webkit-mask: radial-gradient(5px at 50% 0, transparent 98%, #000) 0 0 / 12px 100% repeat-x; mask: radial-gradient(5px at 50% 0, transparent 98%, #000) 0 0 / 12px 100% repeat-x; }
.st-paper .bn-body { line-height: 22px; }
.bgrid .st-paper:nth-child(2n) { transform: rotate(.6deg); }
/* kartka z pinezką */
.st-card { background: var(--nb); border-radius: 4px; padding-top: 22px; }
.st-card::before { content: ""; position: absolute; top: -7px; left: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff8a7a, #d02a14 60%, #8a1405); box-shadow: 0 3px 4px rgba(0,0,0,.35); }
.bgrid .st-card:nth-child(2n+1) { transform: rotate(.8deg); }
@media (prefers-color-scheme: dark) { html:not([data-theme]) .bnote { color: #222; } }
/* wybór wyglądu i koloru */
.style-pick, .color-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.style-pick label { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; font-size: 11px; color: var(--muted); }
.style-pick input, .color-pick input { position: absolute; opacity: 0; pointer-events: none; }
.sp-prev { position: relative; width: 70px; height: 56px; display: grid; place-items: center; font-weight: 700; color: #333; box-shadow: 0 4px 8px rgba(0,0,0,.18); }
.sp-prev.st-paper { padding: 0; } .sp-prev.st-card::before { top: -5px; width: 11px; height: 11px; margin-left: -5px; }
.style-pick input:checked + .sp-prev { outline: 3px solid var(--blue); outline-offset: 2px; }
.color-pick .sw { display: block; width: 30px; height: 30px; border-radius: 50%; background: var(--nb); border: 1px solid rgba(0,0,0,.15); cursor: pointer; }
.color-pick input:checked + .sw { outline: 3px solid var(--navy); outline-offset: 2px; }
/* kto jest w trasie (Tablica ogólna) */
.live-routes { display: grid; gap: 8px; margin-bottom: 12px; }
.live-r { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 12px; border-left: 4px solid var(--green); }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(46,158,110,.6); animation: live 1.6s infinite; flex: none; }
@keyframes live { 70% { box-shadow: 0 0 0 9px rgba(46,158,110,0); } 100% { box-shadow: 0 0 0 0 rgba(46,158,110,0); } }

/* ---------- Trasy i mapa ---------- */
.rt { display: grid; grid-template-columns: minmax(330px, 410px) 1fr; gap: 14px; height: calc(100vh - 120px); min-height: 520px; }
.rt-side { border-radius: 14px; padding: 12px; overflow: auto; }
.rt-map-wrap { border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.rt-map-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.rt-map-bar input[type=search] { flex: 1 1 180px; min-width: 140px; height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--surface); }
#rt-map { flex: 1; min-height: 300px; }
.pin-wrap { background: none; border: 0; }
.mpin { display: block; width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.45); }
.pin-num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; font-size: 12px; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.pin-num.st-done { background: var(--green); } .pin-num.st-here { background: var(--orange); } .pin-num.st-skipped { background: #9aa3b5; }
.pin-start { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); font-size: 14px; }
.pop { min-width: 200px; font-size: 13px; } .pop-b { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rt-list { display: grid; gap: 8px; margin-top: 10px; }
.rt-card { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; background: var(--glass-strong); border: 1px solid var(--line); cursor: pointer; }
.rt-card:hover { border-color: var(--blue); } .rt-card.active { border-left: 4px solid var(--green); }
.rt-date { display: flex; flex-direction: column; align-items: center; width: 44px; flex: none; line-height: 1.1; color: var(--navy); }
.rt-date b { font-size: 20px; } .rt-date small { font-size: 10.5px; color: var(--muted); }
.rt-acts { display: flex; gap: 2px; }
.rt-ed { display: grid; gap: 10px; }
.rt-ed-h { display: flex; align-items: center; gap: 8px; }
.rt-title { font-size: 18px; font-weight: 700; color: var(--navy); border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 4px 6px; }
.rt-title:hover:not(:disabled), .rt-title:focus { border-color: var(--line); background: var(--surface); }
.rt-start { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--soft2); }
.rt-live { padding: 10px; border-radius: 10px; background: rgba(46,158,110,.12); display: grid; gap: 6px; }
.rt-stops { list-style: none; margin: 0; padding: 0; display: grid; }
.rt-stops > li { display: grid; gap: 4px; }
.rt-leg { font-size: 11.5px; color: var(--muted); padding: 2px 0 2px 34px; border-left: 2px dashed var(--line2); margin-left: 12px; }
.rt-stop { display: flex; gap: 8px; align-items: center; padding: 8px; border-radius: 10px; background: var(--glass-strong); border: 1px solid var(--line); }
.rt-stop select { max-width: 92px; }
.rt-n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; font-size: 12px; flex: none; }
.st-done .rt-n { background: var(--green); } .st-here .rt-n { background: var(--orange); } .st-skipped .rt-n { background: #9aa3b5; }
.st-here .rt-stop { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(230,100,62,.25); }
.st-done .rt-stop, .st-skipped .rt-stop { opacity: .7; }
.rt-eta b { color: var(--navy); }
.rt-stop-acts { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 34px; }
.rt-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.rt-sum > div { padding: 8px 4px; border-radius: 10px; background: var(--soft2); display: grid; }
.rt-sum b { color: var(--navy); font-size: 14px; } .rt-sum small { color: var(--muted); font-size: 11px; }
.rt-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.btn.go { background: var(--green); color: #fff; border-color: var(--green); font-weight: 800; letter-spacing: .5px; padding-inline: 20px; }
.btn.full { width: 100%; justify-content: center; }
.btn-row.col { flex-direction: column; align-items: stretch; }
.big-chk { white-space: normal; display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 10px; background: var(--soft2); }
.big-chk input { width: 20px; height: 20px; margin-top: 2px; }
@media (max-width: 900px) {
  .rt { grid-template-columns: 1fr; height: auto; }
  .rt-map-wrap { order: -1; height: 52vh; min-height: 320px; }
  .bgrid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px 12px; }
}

/* ---------- Import z podglądem ---------- */
.imp-sum { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.imp-list { display: grid; gap: 6px; max-height: 46vh; overflow: auto; padding-right: 4px; }
.imp-row { display: grid; grid-template-columns: minmax(150px, 1fr) 2fr 200px; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(242,140,40,.10); border: 1px solid rgba(242,140,40,.3); }
.imp-n { display: grid; } .imp-w { font-size: 12px; display: grid; gap: 2px; }
.imp-row select.need { border-color: var(--orange); } .imp-row select.err { border-color: var(--red); box-shadow: 0 0 0 2px rgba(233,79,55,.25); }
@media (max-width: 700px) { .imp-row { grid-template-columns: 1fr; } }
.of-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 2px 10px; }

/* ---------- Edycja pozycji menu (każdy użytkownik) ---------- */
.nav a { position: relative; }
.nav-edit { margin-left: 4px; border: 0; background: transparent; color: var(--muted); width: 24px; height: 24px; border-radius: 6px; cursor: pointer; opacity: 0; flex: none; font-size: 13px; }
.nav a:hover .nav-edit, .nav a:focus-within .nav-edit, .nav a.act .nav-edit { opacity: 1; }
.nav-edit:hover { background: var(--soft); color: var(--navy); }
@media (hover: none) { .nav-edit { opacity: .7; } }
body:has(#bulk-bar) #view { padding-bottom: 90px; }
.rt > * { min-width: 0; }
.rt-ed input, .rt-ed select { max-width: 100%; min-width: 0; }
.rt-title { width: 100%; }
@media (max-width: 900px) { .rt { grid-template-columns: minmax(0, 1fr); } .rt-ed .grid2 { grid-template-columns: 1fr 1fr; gap: 8px; } }
.rt-ed { grid-template-columns: minmax(0, 1fr); }
.rt-ed > * { min-width: 0; }
.rt-stop select { width: auto; flex: none; }
.rt-stop .grow { min-width: 0; }
.rt-live .chk { white-space: normal; align-items: flex-start; }
.rt-start .grow { min-width: 0; }
#rt-map.placing, #rt-map.placing .leaflet-interactive { cursor: crosshair !important; }
.imp-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 6px 14px; margin-bottom: 8px; }
.imp-p { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; background: var(--soft2); }
.imp-p select { max-width: 170px; } .imp-p select.need { border-color: var(--orange); }
.rt-only { padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.rt-only.on { background: var(--soft); border-color: var(--blue); color: var(--navy); font-weight: 600; }
.leg-wrap { background: none; border: 0; }
.leg-lbl { display: inline-flex; flex-direction: column; align-items: center; transform: translate(-50%, -50%); padding: 2px 7px; border-radius: 8px; background: rgba(255,255,255,.95);
  border: 1.5px solid #007A4C; color: #004438; font-weight: 700; font-size: 12px; line-height: 1.15; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.leg-lbl small { font-weight: 500; font-size: 10.5px; color: #556; }
.la-q { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; background: var(--surface); margin-bottom: 8px; }
.la-list { max-height: 50vh; overflow: auto; display: grid; gap: 2px; }
.la-row { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.la-row:hover { background: var(--soft2); } .la-row input { width: 17px; height: 17px; }
.seg.full label { flex: 1; }
.wrap-chk { white-space: normal; align-items: flex-start; } .wrap-chk input { margin-top: 3px; }
/* ---------- Wspólne konto: „Kto pracuje?” ---------- */
.who-card { text-align: center; max-width: 560px; }
.who-card .auth-logo { height: 34px; margin-bottom: 8px; }
.who-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 18px 0; }
.who { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font: inherit; color: var(--text); transition: transform .12s, box-shadow .12s; }
.who:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,68,56,.15); border-color: var(--blue); }
.who .av { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 20px; }
.adm-row.member { margin-left: 28px; background: rgba(230,100,62,.05); }
.resolved-box { padding: 10px 12px; border-radius: 10px; background: rgba(46,158,110,.10); border: 1px solid rgba(46,158,110,.35); margin: 8px 0; display: grid; gap: 6px; }
.resolved-box .nb { white-space: pre-wrap; }
.btn.ok { background: var(--green); color: #fff; border-color: var(--green); }

/* ---------- Oferty ---------- */
.of { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 14px; align-items: start; }
.pp { border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; position: sticky; top: 8px; max-height: calc(100vh - 120px); }
.pp h3, .osel h3, .box h3 { margin: 0; font-size: 14px; color: var(--navy); }
.pp input[type=search] { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--surface); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.fchip { padding: 3px 9px; border-radius: 12px; font-size: 11.5px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--text); }
.fchip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.plist { display: grid; gap: 1px; overflow: auto; min-height: 120px; flex: 1; align-content: start; }
.pr { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; font-size: 12.5px; cursor: pointer; }
.pr:hover { background: var(--soft2); } .pr.on { background: rgba(0,152,95,.16); } .pr.in { color: var(--muted); }
.pr input { width: 16px; height: 16px; accent-color: var(--navy); flex: none; } .pr small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.osel { border-radius: 14px; padding: 14px; display: grid; gap: 12px; min-width: 0; }
.row3 { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; }
.f { display: grid; gap: 3px; font-size: 11.5px; color: var(--muted); }
.f input, .f select, .f textarea { min-height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
.f.inl { display: inline-flex; align-items: center; gap: 6px; } .f.inl select { min-height: 30px; padding: 2px 8px; }
.kv-pad { display: grid; gap: 8px; padding: 10px 2px; }
table.it { width: 100%; border-collapse: collapse; font-size: 13px; }
table.it th { text-align: left; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.it td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.it tr.g td { background: var(--soft2); color: var(--navy); font-weight: 700; font-size: 12px; }
table.it tr.off td { opacity: .45; }
.pin { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); height: 32px; width: 118px; }
.pin input { border: 0; width: 100%; min-width: 0; padding: 0 8px; text-align: right; background: transparent; font-weight: 600; height: 30px; }
.pin span { color: var(--muted); font-size: 12px; padding-right: 8px; } .pin.packin { width: 82px; margin-left: 6px; } .pin.qin { width: 96px; } .pin.pin-r { width: 104px; }
.useg { display: inline-flex; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; vertical-align: middle; }
.useg button { border: 0; padding: 6px 10px; font-size: 11.5px; font-weight: 600; color: var(--muted); border-right: 1px solid var(--line2); background: var(--surface); cursor: pointer; }
.useg button:last-child { border-right: 0; } .useg button.on { background: var(--navy); color: #fff; }
.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--soft2); font-size: 12.5px; }
.qty-toggle { padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; } .qty-toggle.on { border-color: var(--blue); background: var(--soft); color: var(--navy); font-weight: 600; }
.of-sum { display: flex; justify-content: flex-end; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.of-sum b { color: var(--text); } .of-sum .tt { color: var(--navy); } .of-sum .tt b { color: var(--navy); font-size: 16px; }
.xb { border-radius: 12px; border: 1px solid var(--line); background: var(--glass-strong); padding: 12px; display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 12px; margin-bottom: 10px; }
.xb.promo { border-left: 4px solid var(--orange); }
.xb-main { display: grid; gap: 8px; }
.xb .t { height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font-weight: 700; color: var(--navy); background: var(--surface); }
.xb textarea { min-height: 64px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--surface); resize: vertical; font: inherit; }
.ximg { position: relative; border: 2px dashed var(--line2); border-radius: 10px; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 11.5px; overflow: hidden; background: var(--surface); cursor: pointer; min-height: 120px; }
.ximg img { width: 100%; height: 100%; max-height: 150px; object-fit: contain; }
.ximg-rm { position: absolute; top: 4px; right: 4px; background: var(--surface); }
.xtools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 11.5px; color: var(--muted); }
.foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.of-acts { white-space: nowrap; } .of-acts .btn { margin-right: 4px; }
.imp2 { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: start; }
.imp2 .box { border-radius: 14px; padding: 14px; display: grid; gap: 12px; align-content: start; }
.imp-scroll { max-height: calc(100vh - 330px); overflow: auto; }
.drop2 { border: 2px dashed var(--blue); border-radius: 12px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; background: var(--soft2); }
.drop2 b { color: var(--navy); } .ok { color: var(--green); font-weight: 700; }
.genbig { display: grid; gap: 6px; } .genbig .btn { justify-content: center; height: 44px; font-size: 14px; }
.btn.orange { background: var(--orange); border-color: var(--orange); }
.onote { font-size: 11.5px; color: var(--muted); margin: 0 0 6px; }
.of-imp-start { max-width: 720px; display: grid; gap: 10px; }
.of-set { display: grid; gap: 14px; max-width: 1100px; }
.hero-pick { display: flex; gap: 16px; align-items: center; margin-top: 12px; padding: 12px; border-radius: 12px; background: linear-gradient(120deg, #EEF7F1, #C9DFF5); }
.hero-pick img { height: 110px; mix-blend-mode: multiply; margin-left: auto; }
@media (max-width: 1100px) { .of, .imp2 { grid-template-columns: minmax(0, 1fr); } .pp { position: static; max-height: 60vh; } .row3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .xb { grid-template-columns: 1fr; } .row3 { grid-template-columns: 1fr; } table.it th:nth-child(1), table.it td:nth-child(1) { display: none; } }
.imp2 .xb { grid-template-columns: 1fr; } .imp2 .ximg { min-height: 90px; } .imp2 .ximg img { max-height: 110px; }

/* ---------- Kalkulator kartonów + szybka oferta ---------- */
.qo { border-radius: 16px; padding: 16px; display: grid; gap: 12px; margin-bottom: 14px; }
.qo h3 { margin: 0; color: var(--navy); font-size: 15px; }
.cmd { display: flex; gap: 10px; align-items: stretch; }
.cmd textarea { flex: 1; min-height: 58px; border: 2px solid var(--blue); border-radius: 12px; padding: 10px 14px; font: inherit; font-size: 15px; background: var(--surface); resize: vertical; }
.cmd .btn { height: auto; min-height: 44px; padding: 0 18px; }
.btn.mic { font-weight: 700; } .btn.mic.on { background: #E94F37; color: #fff; border-color: #E94F37; animation: micpulse 1.2s infinite; }
@keyframes micpulse { 50% { box-shadow: 0 0 0 6px rgba(233,79,55,.25); } }
.pick2 { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--soft2); font-size: 13px; }
.pick2 > b { color: var(--navy); } .hint2 { font-size: 12px; color: var(--muted); flex: 1; min-width: 240px; }
.ms { position: relative; }
.msb { height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 0 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text); }
.msb b { color: var(--navy); } .msb.open { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,152,95,.2); }
.msp { position: absolute; z-index: 40; top: 42px; left: 0; width: min(460px, calc(100vw - 40px)); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,20,60,.22); padding: 10px; display: grid; gap: 6px; }
.msq { height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--surface); }
.mslist { max-height: 46vh; overflow: auto; display: grid; gap: 1px; }
.msh { display: flex; align-items: center; padding: 6px 6px 2px; font-size: 12px; color: var(--navy); } .msh .link { font-size: 11.5px; }
.msr { display: flex; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 7px; font-size: 12.5px; cursor: pointer; }
.msr:hover { background: var(--soft2); } .msr small { color: var(--muted); margin-left: auto; text-align: right; } .msr input { width: 16px; height: 16px; accent-color: var(--navy); flex: none; }
.msf { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.qo-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 13px; }
.qo-row b { color: var(--navy); } .qo-row select { width: auto; max-width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--surface); }
.qo-row select.need { border-color: #F28C28; background: #FFF4EC; }
.useg.ulg button { padding: 8px 13px; font-size: 13px; }
.und { border-radius: 12px; background: var(--soft2); padding: 12px 14px; display: grid; gap: 10px; }
.und.empty { color: var(--muted); font-size: 13px; }
.und h4 { margin: 0; font-size: 11.5px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.chips2 { display: flex; flex-wrap: wrap; gap: 6px; }
.c2 { display: inline-flex; gap: 6px; align-items: center; padding: 5px 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; }
.c2 b { color: var(--navy); } .c2.ok { border-color: rgba(46,158,110,.5); } .c2.warn { border-color: #F28C28; background: #FFF4EC; }
.c2 .x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 0 0 2px; font-size: 11px; } .c2 .x:hover { color: var(--red); }
.ambrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 10px; border-radius: 10px; background: #FFF4EC; font-size: 12.5px; }
.ctab td, .ctab th { white-space: nowrap; } .ctab .ov { color: #E6643E; font-weight: 700; } .ctab .was, .und .was { color: var(--muted); text-decoration: line-through; font-size: 11px; margin-left: 4px; }
.ctab .price { font-weight: 800; color: var(--navy); font-size: 14px; }
.und .go { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } .und .go .btn { height: 40px; }
.kcal { border-radius: 14px; padding: 14px; display: grid; gap: 10px; }
.kcal h3 { margin: 0; color: var(--navy); font-size: 14px; }
.ktool { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ktool input[type=search] { height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--surface); width: 220px; }
.ktool select { height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; background: var(--surface); }
.ktool .tin { width: 70px; height: 30px; border: 1px solid var(--line); border-radius: 7px; text-align: right; padding: 0 6px; background: var(--surface); font-weight: 700; }
.bulkset { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--glass-strong); }
.bulkset summary { cursor: pointer; font-weight: 600; color: var(--navy); font-size: 13px; }
.bgrid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 10px; align-items: end; }
.kscroll { max-height: 70vh; overflow: auto; }
table.kt { width: 100%; border-collapse: collapse; font-size: 12px; }
table.kt th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); font-size: 9.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.kt th:nth-child(-n+3) { text-align: left; } table.kt th.on { color: var(--navy); background: #DCE7F5; }
table.kt td { padding: 3px 4px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.kt td:nth-child(-n+3) { text-align: left; }
table.kt .kmk { width: 34px; white-space: nowrap; } table.kt tr.kmark td { background: #FFF8E6; }
table.kt tr.kbulk th { top: 27px; background: #FFF1CC; text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--navy); padding: 5px 4px; vertical-align: middle; }
table.kt tr.kbulk input.c { border-color: #E0B040; background: #fff; font-weight: 600; } table.kt tr.kbulk .kbh { font-weight: 400; font-size: 10.5px; color: var(--muted); }
table.kt input.c { width: 62px; height: 26px; border: 1px solid transparent; border-radius: 6px; background: transparent; text-align: right; font: inherit; padding: 0 4px; color: var(--text); }
table.kt tr:hover input.c, table.kt input.c:focus { border-color: var(--line); background: var(--surface); }
table.kt input.c.mod { border-color: #F28C28; background: #FFF4EC; }
table.kt td.kp { font-weight: 600; color: var(--muted); } table.kt td.kp.on { background: rgba(0,68,56,.07); color: var(--navy); font-weight: 800; }
table.kt tr.kpick td { background: rgba(0,152,95,.10); } table.kt tr.nadr td b { color: #8a4b00; }
@media (max-width: 700px) { .cmd { flex-wrap: wrap; } .cmd textarea { flex-basis: 100%; } .msp { position: fixed; left: 12px; right: 12px; top: 80px; width: auto; } }
.ktool select { width: auto; } .ktool .chk { white-space: nowrap; }

/* ---------- Zespół (widok prezesa) ---------- */
.tkpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tkpis .kpi { border-radius: 12px; padding: 12px 14px; display: grid; } .tkpis .kpi b { font-size: 22px; color: var(--navy); } .tkpis .kpi span { color: var(--muted); font-size: 12px; }
.tkpis .kpi.red b { color: var(--red); }
.team-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 14px; align-items: start; }
.tcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.tcard { border-radius: 14px; padding: 12px 14px; display: grid; gap: 10px; align-content: start; }
.tc-h { display: flex; gap: 10px; align-items: center; } .tc-h b { display: block; color: var(--navy); } .tc-h small { color: var(--muted); font-size: 11.5px; }
.tc-s { display: flex; flex-wrap: wrap; gap: 6px; } .tc-s span { display: grid; padding: 6px 8px; border-radius: 8px; background: var(--soft2); font-size: 10.5px; color: var(--muted); min-width: 66px; }
.tc-s b { font-size: 15px; color: var(--navy); }
.tc-m { display: grid; gap: 3px; } .tmeet { text-align: left; font-size: 12.5px; color: var(--text); }
.tc-f { display: flex; gap: 6px; }
.tfeed { border-radius: 14px; max-height: calc(100vh - 220px); overflow: auto; position: sticky; top: 8px; }
.tfeed .ch { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); } .tfeed .ch h3 { margin: 0; flex: 1; font-size: 14px; color: var(--navy); }
.tfeed .ch select { height: 30px; border: 1px solid var(--line); border-radius: 8px; padding: 0 6px; background: var(--surface); width: auto; }
.tf { display: flex; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 12.5px; cursor: pointer; } .tf:hover { background: var(--soft2); }
.tf-i { width: 20px; flex: none; } .tf-c { color: var(--navy); font-weight: 600; } .tf small { white-space: nowrap; }
.chip .ownr { font-size: 9px; background: rgba(255,255,255,.35); border-radius: 4px; padding: 0 3px; }
.pend { border: 1px solid #F28C28; background: #FFF4EC; border-radius: 12px; padding: 10px 12px; margin: 10px 0; } .pend h3 { margin: 0 0 6px; font-size: 14px; color: #B8441F; }
@media (max-width: 1100px) { .team-grid { grid-template-columns: minmax(0, 1fr); } .tfeed { position: static; max-height: none; } }
.mcard { position: relative; } .mchk { width: 18px; height: 18px; accent-color: var(--navy); flex: none; cursor: pointer; }
.mcard .mchk { margin-right: 8px; } .mcard.msel, .ev.msel { outline: 2px solid var(--red); outline-offset: -2px; background: rgba(233,79,55,.06); }
.agenda .ch .seg { margin: 0; } .agbulk { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--line); }
.agenda .ev { align-items: center; } .agenda .ev .mchk { margin-right: 6px; }
.agbulk { flex-wrap: wrap; } .agbulk .btn { white-space: nowrap; }
.red-hint { background: #FDECEA; color: #B3261E; }
.ntb { display: flex; flex-wrap: wrap; gap: 3px; padding: 6px; border: 1px solid var(--line); border-radius: 8px 8px 0 0; background: var(--soft2); margin-bottom: -6px; }
.ntb button { border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 3px 7px; cursor: pointer; font-size: 14px; line-height: 1.2; color: var(--text); }
.ntb button:hover { background: var(--surface); border-color: var(--line); } .ntb-sep { width: 1px; background: var(--line2); margin: 2px 4px; }
.bn-body ul { margin: 2px 0; padding-left: 18px; } .bn-body li { margin: 1px 0; }
.bnote .bn-body { white-space: normal; }
.warn-t { color: #B8441F; font-weight: 600; }
.kdsel { width: 100%; margin-top: 6px; min-height: 140px; } .kdsel optgroup { font-weight: 700; color: var(--muted, #667); } .kdsel option { font-weight: 400; color: var(--text, #222); padding: 3px 4px; }
.rt-pick { margin: 10px 0; }
.rt-pick input { width: 100%; }
.rt-sugg { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; max-height: 300px; overflow: auto; }
.rt-sugg:empty { display: none; }
.rt-sg { text-align: left; display: flex; flex-direction: column; padding: 8px 10px; border: 1px solid var(--line, #dde3ee); border-radius: 10px; background: var(--card, #fff); cursor: pointer; }
.rt-sg:hover { border-color: var(--pri, #1d4ed8); background: rgba(29, 78, 216, .06); }
/* Emotikony w czacie */
.chat-input .emo-btn { font-size: 20px; flex: none; align-self: flex-end; }
.chat-input .emo-btn.on { background: rgba(29, 78, 216, .12); }
.emo-pan { border-top: 1px solid var(--line, #dde3ee); background: var(--card, #fff); padding: 6px 10px 8px; max-height: 260px; display: flex; flex-direction: column; }
.emo-tabs { display: flex; gap: 2px; flex-wrap: wrap; margin-bottom: 4px; }
.emo-tabs button { border: 0; background: none; font-size: 18px; padding: 4px 8px; border-radius: 8px; cursor: pointer; font-weight: 700; color: var(--muted, #667); }
.emo-tabs button.on { background: rgba(29, 78, 216, .12); color: var(--pri, #1d4ed8); }
.emo-hint { margin: 0 0 4px; }
.emo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 2px; overflow: auto; }
.emo-grid.gg { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
.emo { border: 0; background: none; font-size: 22px; line-height: 1; padding: 6px 0; border-radius: 8px; cursor: pointer; }
.emo:hover { background: rgba(29, 78, 216, .08); }
.emo.gg { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.emo.gg small { font-size: 10px; color: var(--muted, #667); font-family: monospace; }
.msg .bub.big-emo { font-size: 40px; line-height: 1.15; background: none !important; box-shadow: none !important; padding: 0 4px; }
/* Czat w nagłówku: duża ikona-chmurka */
.ibtn.chatbtn { width: auto; height: 40px; padding: 0 12px 0 10px; gap: 6px; display: inline-flex; align-items: center; color: var(--blue, #1d4ed8); border-radius: 12px; font-weight: 700; }
.ibtn.chatbtn svg { width: 26px; height: 26px; }
.ibtn.chatbtn .cb-l { font-size: 14px; color: var(--text, #1b2a4a); }
.ibtn.chatbtn .bd.red { background: #E5484D; font-size: 12px; line-height: 16px; min-width: 20px; text-align: center; top: -7px; right: -7px; }
.ibtn.chatbtn .dot-on { position: absolute; left: 26px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--green, #22a35a); border: 2px solid var(--surface, #fff); }
@media (max-width: 700px) { .ibtn.chatbtn .cb-l { display: none; } .ibtn.chatbtn { padding: 0 8px; } }
/* Historia czatu, cofanie wysłania */
.msg { position: relative; }
.msg .msg-act { position: absolute; top: 2px; right: -26px; border: 0; background: none; color: var(--muted, #667); font-size: 18px; line-height: 1; padding: 2px 4px; border-radius: 6px; cursor: pointer; opacity: 0; }
.msg.me .msg-act { right: auto; left: -26px; }
.msg:hover .msg-act, .msg .msg-act:focus { opacity: 1; }
.msg .msg-act:hover { background: rgba(29, 78, 216, .1); }
@media (hover: none) { .msg .msg-act { opacity: .55; } }
.msg .bub.deleted { font-style: italic; opacity: .65; background: transparent !important; color: var(--muted, #667) !important; border: 1px dashed var(--line, #ccd); box-shadow: none !important; }
.hist-banner { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; margin: 0 0 10px; border-radius: 12px; background: rgba(29, 78, 216, .08); position: sticky; top: 0; z-index: 2; }
.hist-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; }
.hist-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line, #dde3ee); border-radius: 10px; }
.hist-row b::first-letter, .hist-banner b::first-letter { text-transform: uppercase; }
.hist-row b, .hist-banner b { display: inline-block; }
/* wybór klienta albo nazwa wpisana ręcznie */
.cpick { display: inline-flex; flex-direction: column; gap: 6px; min-width: 220px; max-width: 100%; }
.cpick .cpick-in { border: 1px solid var(--blue, #1d4ed8); }
.qo-row .cpick { vertical-align: middle; }
/* Mapa: pinezki w kolorze opiekuna + legenda */
.mpin.lead { background: #fff !important; border-width: 4px; border-style: solid; }
.rt-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 12px; border-top: 1px solid var(--line, #dde3ee); font-size: 13px; }
.rt-legend .lg-t { font-weight: 700; color: var(--muted, #667); }
.rt-legend .lg-i { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line, #dde3ee); background: var(--card, #fff); border-radius: 999px; padding: 3px 10px; cursor: pointer; font: inherit; color: inherit; }
.rt-legend .lg-i small { color: var(--muted, #667); }
.rt-legend .lg-i.on { border-color: var(--blue, #1d4ed8); background: rgba(29, 78, 216, .08); font-weight: 700; }
.rt-legend .lg-i.st { cursor: default; border-style: dashed; }
.rt-legend .lg-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); flex: none; }
.rt-legend .lg-dot.hollow { background: #fff; border: 3px solid #7A8699; box-shadow: none; }
.rt-legend .lg-num { position: static; width: 18px; height: 18px; font-size: 11px; display: inline-grid; place-items: center; }
.rt-legend .lg-sep { flex: 1; }
.chat-lh .snd { font-size: 16px; } .chat-lh .snd.off { opacity: .55; }
/* Załączniki i wiadomości głosowe w czacie */
.chat-att { display: block; margin: 2px 0 4px; max-width: 320px; }
.msg.me .chat-att { margin-left: auto; }
.chat-att.img img { display: block; max-width: 100%; max-height: 260px; border-radius: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.15); background: #eef1f6; }
.chat-att.vid video { max-width: 100%; max-height: 260px; border-radius: 14px; }
.chat-att.voice { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 18px; background: rgba(29, 78, 216, .08); }
.chat-att.voice audio { height: 34px; max-width: 230px; }
.chat-att.file { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; border: 1px solid var(--line, #dde3ee); background: var(--card, #fff); color: inherit; text-decoration: none; }
.chat-att.file:hover { border-color: var(--blue, #1d4ed8); }
.chat-att.file .fi { font-size: 26px; }
.chat-att.file .fn { display: flex; flex-direction: column; min-width: 0; }
.chat-att.file .fn b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.chat-input.hide { display: none; }
.chat-rec { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line, #dde3ee); }
.chat-rec .rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #E5484D; animation: recp 1s infinite; }
@keyframes recp { 50% { opacity: .25; } }
.chat-conv.drop { outline: 3px dashed var(--blue, #1d4ed8); outline-offset: -8px; }
/* Regiony */
.reg-regs { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 10px 0; }
.reg-r { display: flex; gap: 8px; align-items: flex-end; padding: 10px; border-radius: 12px; border: 2px solid var(--rc, #1F6FEB); }
.reg-r input { font-weight: 700; width: 130px; }
.reg-voiv { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; }
.reg-v { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--line, #dde3ee); }
.reg textarea { width: 100%; }
.reg-tbl { max-height: 40vh; overflow: auto; }
/* Kategorie asortymentu – podkategorie w zakładkach klientów */
.cat-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 10px; }
.cat-t { border: 1px solid var(--line, #dde3ee); background: var(--glass, #fff); border-radius: 999px; padding: 6px 14px; cursor: pointer; font: inherit; font-weight: 600; color: var(--text, #1b2a4a); }
.cat-t small { color: var(--muted, #667); font-weight: 600; margin-left: 2px; }
.cat-t.on { background: var(--navy, #004438); border-color: var(--navy, #004438); color: #fff; }
.cat-t.on small { color: rgba(255,255,255,.75); }
.cat-t.none { border-style: dashed; font-weight: 500; }
.cat-add { border: 1px dashed var(--blue, #1d4ed8); background: none; color: var(--blue, #1d4ed8); border-radius: 999px; padding: 6px 12px; cursor: pointer; font: inherit; font-weight: 600; }
.cat-pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: rgba(29, 78, 216, .1); color: var(--blue, #1d4ed8); vertical-align: middle; }
.cat-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.cat-row input[data-k=name] { flex: 1; }
.cat-row .cat-ic { width: 52px; text-align: center; }

/* Numery tygodni w kalendarzu */
.cal-wk { display: flex; align-items: flex-start; justify-content: center; padding-top: 7px; font-size: 11px; font-weight: 700; color: var(--blue, #1d4ed8); background: rgba(29, 78, 216, .05); border-right: 1px solid rgba(205,212,219,.7); border-bottom: 1px solid rgba(205,212,219,.5); }
.cal-wk.now { background: var(--navy, #004438); color: #fff; }
.cal-wkh { font-size: 10px; }
.cal-wkt { text-transform: none; font-size: 13px; font-weight: 500; color: var(--muted, #667); margin-left: 6px; }
@media (max-width: 700px) { .cal-grid { grid-template-columns: 24px repeat(7, minmax(0, 1fr)); } .cal-wk { font-size: 10px; padding-top: 4px; } .cal-wkh { font-size: 8px; } }
/* Wizualizacja 3D kartonu */
.viz { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.viz-stage { position: relative; height: calc(100vh - 190px); min-height: 420px; border-radius: 16px; overflow: hidden; background: linear-gradient(180deg, #a9aaab, #b9babb 55%, #a3a4a5); }
.viz-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.viz-stage.drop { outline: 3px dashed var(--blue, #1d4ed8); outline-offset: -10px; }
.viz-hint { position: absolute; left: 14px; top: 12px; font-size: 12px; color: #6b6760; pointer-events: none; z-index: 1; }
.viz-dims { position: absolute; right: 14px; bottom: 12px; font-size: 12px; color: #6b6760; text-align: right; pointer-events: none; z-index: 1; }
.viz-load { position: absolute; inset: 0; display: grid; place-items: center; color: #6b6760; }
.viz-side { display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 190px); overflow-y: auto; }
.viz-side h4 { margin: 0 0 8px; }
.viz .grid3 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.viz .hide { display: none; }
.viz-inks { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
.viz-inks button { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line, #ccd); cursor: pointer; padding: 0; }
.viz-inks button.on { box-shadow: 0 0 0 3px var(--navy, #004438); }
.viz-inks .orig { background: conic-gradient(#d23a2a, #e8b923, #2e8b57, #2759b8, #d23a2a); }
.viz-views { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.viz-shots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.viz-shot img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line, #dde3ee); display: block; }
.viz-shot .btn-row { gap: 4px; margin-top: 4px; }
@media (max-width: 900px) { .viz { grid-template-columns: minmax(0, 1fr); } .viz-stage { height: 58vh; } .viz-side { max-height: none; } }
.viz-orbit { position: absolute; right: 12px; top: 10px; z-index: 2; }
.viz-stage:not(.orbit) canvas { cursor: default; }
/* Mockup ze zdjęcia */
.viz-mode { margin-bottom: 12px; }
.mk-stage { display: grid; place-items: center; background: #b7b8b9; }
.mk-stage canvas { position: static !important; width: auto; height: auto; max-width: 100%; max-height: 100%; cursor: default; border-radius: 4px; }
.mk-empty { max-width: 460px; text-align: center; padding: 30px; color: #2b2b2b; }
.mk-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mk-th { border: 2px solid transparent; border-radius: 10px; padding: 4px; background: var(--card, #fff); cursor: pointer; text-align: left; }
.mk-th.on { border-color: var(--navy, #004438); }
.mk-th img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; display: block; }
.mk-th small { display: block; font-size: 11px; margin-top: 3px; }
.mk-ed { overflow: auto; margin: 8px 0; text-align: center; }
.mk-ed canvas { cursor: crosshair; border-radius: 6px; max-width: 100%; touch-action: none; }
.viz-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.viz-shot { position: relative; }
.viz-sel { position: absolute; top: 6px; left: 6px; z-index: 1; background: rgba(255,255,255,.85); border-radius: 6px; padding: 2px 4px; }
.viz-lbl { display: block; font-size: 11px; line-height: 1.25; margin-top: 2px; }
.vzm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px 10px; max-height: 50vh; overflow: auto; margin-top: 8px; }
/* oferta: warianty (wycena + wizualizacja 3D) */
.of-var{border:1px solid var(--line, #dfe5ee);border-radius:12px;padding:10px 12px;margin:8px 0;background:rgba(255,255,255,.5)}
.of-viz{display:flex;flex-wrap:wrap;gap:8px;align-items:flex-start;margin:6px 0}
.of-viz figure{margin:0;width:170px}.of-viz figure.net{width:200px}
.of-viz img{width:100%;border-radius:8px;display:block;background:#f3f4f6}
.of-viz figcaption{font-size:11px;color:#6b7287;line-height:1.3;margin-top:3px}
.viz-orbit-shot { position: absolute; right: 150px; top: 10px; z-index: 2; }
.of-lf{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end;margin-bottom:10px}.of-lf .grow{flex:1;min-width:220px}.of-lf .f{margin:0}
tr.of-row-ed{cursor:pointer}tr.of-row-ed:hover td{background:rgba(0,152,95,.08)}
/* oferta: drzewko kategorii produktów */
.otree{max-height:300px;overflow:auto;border:1px solid var(--line, #e3e8f0);border-radius:10px;padding:4px;margin:4px 0 6px;background:rgba(255,255,255,.6)}
.otn{display:flex;align-items:center;gap:6px;padding:5px 7px;border-radius:7px;cursor:pointer;user-select:none;font-size:13.5px}.otn:hover{background:rgba(0,152,95,.08)}
.otn.sel{background:rgba(0,152,95,.16);font-weight:700;color:var(--navy, #004438)}.otn .tw{width:14px;color:#8a93a8;font-size:11px}.otn .cnt{margin-left:auto;font-size:11px;color:#6b7287;background:rgba(0,0,0,.05);border-radius:9px;padding:0 7px}
.otn.l1{font-weight:700}.otn.l2{padding-left:22px}.otn.l3{padding-left:40px}
.crumb{margin:2px 0}
.plist .pr small{display:block;color:#6b7287;font-size:11px;margin-top:1px}
.ctnin input{width:46px}td.ctn{white-space:nowrap;font-size:12.5px}td.ctn b{color:var(--navy, #004438)}td.ctn small{display:block;color:#6b7287;font-size:11px}
/* drzewko nie może się ściskać – stała, czytelna wysokość; lista produktów pod nim przewija się osobno */
.pp .otree { flex: 0 0 auto; height: auto; max-height: clamp(220px, 40vh, 360px); min-height: 0; }
.pp .plist { min-height: 0; }
.pp { max-height: none; }
@media (max-width: 1100px) { .pp { max-height: none; } .pp .otree { max-height: 300px; } .pp .plist { max-height: 50vh; } }
.of-hint{padding:10px 6px;line-height:1.45}
.crumb{display:flex;flex-wrap:wrap;align-items:center;gap:4px}.crumb-a{color:var(--blue, #2f6fd1);cursor:pointer;text-decoration:none;font-weight:600}.crumb-a:hover{text-decoration:underline}.crumb .btn.sm{padding:2px 8px}
.ofconv{display:block;font-size:11px;margin-top:2px;white-space:nowrap}

.rt-peek { padding: 8px 10px; border-radius: 10px; background: var(--panel2, rgba(127,127,127,.08)); }
.rt-peek summary { cursor: pointer; font-weight: 600; }
.rt-peek ol { margin: 4px 0 8px; padding-left: 22px; }
.rt-peek li { margin: 2px 0; }
.rt-peek-h { margin-top: 8px; font-weight: 600; font-size: .92em; }

.cal-legend .caltype { cursor: pointer; font: inherit; }
.cal-legend .caltype.off { opacity: .4; text-decoration: line-through; filter: grayscale(1); }

/* załączniki przy notatkach / zadaniach */
.att-pick { position: relative; cursor: pointer; overflow: hidden; }
.att-pick input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.note-btns { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.att-chips, .att-pending { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; flex-basis: 100%; }
.att-pending:empty { display: none; }
.att-chip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 2px 4px 2px 8px; border-radius: 999px; font-size: 11.5px; background: rgba(30,80,170,.08); border: 1px solid rgba(30,80,170,.18); }
.att-chip a, .att-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; color: inherit; text-decoration: none; }
.att-chip a:hover { text-decoration: underline; }
.att-chip .x { border: 0; background: none; cursor: pointer; opacity: .5; font-size: 11px; padding: 0 3px; } .att-chip .x:hover { opacity: 1; color: #c0392b; }
.tasks li .att-chips { margin-left: 26px; }

/* podgląd plików */
#fviewer { position: fixed; inset: 0; z-index: 3000; background: rgba(10,18,35,.78); display: flex; flex-direction: column; backdrop-filter: blur(3px); }
#fviewer .fv-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top)); background: #fff; color: #1d2433; box-shadow: 0 2px 10px rgba(0,0,0,.2); }
#fviewer .fv-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
#fviewer .fv-body { flex: 1; overflow: auto; display: flex; flex-direction: column; align-items: center; padding: 12px; -webkit-overflow-scrolling: touch; }
#fviewer .fv-img { max-width: 100%; max-height: 100%; object-fit: contain; margin: auto; border-radius: 6px; background: #fff; }
#fviewer .fv-doc { width: min(1000px, 100%); flex: 1; min-height: 60vh; border: 0; border-radius: 8px; background: #fff; }
#fviewer .fv-pages { display: flex; flex-direction: column; gap: 10px; align-items: center; }
#fviewer .fv-pages canvas { background: #fff; border-radius: 4px; box-shadow: 0 2px 12px rgba(0,0,0,.35); max-width: 100%; height: auto; }
#fviewer .fv-msg { color: #fff; text-align: center; margin: 18px 0 0; }

/* panel klienta w tabeli: zawsze w widocznej szerokości (tabela bywa szersza od ekranu) */
.tbl-wrap tr.exp > td { padding: 0; }
.tbl-wrap .detail-host { position: sticky; left: 0; width: var(--tw, 100%); max-width: var(--tw, 100%); box-sizing: border-box; }

.cal-who { margin: 0 0 10px; padding: 7px 12px; border-radius: 10px; background: rgba(30,80,170,.07); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cal-who.other { background: #fff4d6; border: 1px solid #f0c75e; color: #5a4300; }

/* zaproszenia na spotkania */
.invite { margin-top: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.invite summary { cursor: pointer; font-weight: 600; }
.invite-q { width: 100%; margin: 6px 0; padding: 6px 8px; box-sizing: border-box; }
.invite-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 10px; max-height: 210px; overflow: auto; }
.invite-list .chk { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.invite-list .chk[hidden] { display: none; }
.meet-people { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; }
.mp-h { font-weight: 600; }
.mp-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: rgba(30,80,170,.08); }
.mp-chip.org { background: rgba(11,42,107,.12); } .mp-chip small { opacity: .6; }
.mp-chip.declined { opacity: .55; text-decoration: line-through; } .mp-chip.invited { background: #fff4d6; }
.mp-rsvp { display: inline-flex; gap: 4px; align-items: center; margin-left: auto; }
.meet-people b, .meet-people .mp-h { font-size: 12.5px; font-weight: 600; color: inherit; }
/* Kalkulator lita */
#lita { display: grid; gap: 12px; }
#lita .lhide { display: block; margin: 2px auto 0; border: 0; background: none; padding: 0; font: 600 9.5px/1.2 inherit; letter-spacing: .04em; color: var(--muted); cursor: pointer; text-transform: lowercase; opacity: .7; }
#lita .lhide:hover { color: var(--red); opacity: 1; text-decoration: underline; }
#lita .lhid { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0; }
#lita .lgrp .sec-h { flex-wrap: wrap; gap: 8px; }
#lita .lgn { font: inherit; font-weight: 700; font-size: 14px; color: var(--navy); border: 1px solid transparent; border-radius: 8px; padding: 5px 8px; background: transparent; width: 160px; }
#lita .lgt { font: inherit; font-size: 12.5px; color: var(--muted); border: 1px solid transparent; border-radius: 8px; padding: 5px 8px; background: transparent; width: 260px; }
#lita .lgn:hover, #lita .lgt:hover, #lita .lgn:focus, #lita .lgt:focus { border-color: var(--line); background: var(--surface); }
#lita .tin { width: 80px; } #lita .tin.sm { width: 52px; } #lita .ltrk { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; white-space: nowrap; flex-wrap: wrap; }
table.lt td:nth-child(-n+3), table.lt th:nth-child(-n+3) { text-align: right; }
table.lt td:first-child, table.lt th:first-child { text-align: left; }
table.lt tr.lhg th { text-align: center; color: var(--navy); background: #E8EEF7; border-left: 2px solid var(--surface); }
table.lt tr.lhg th:first-child { background: var(--surface-2); } table.lt tr.lhg th.lpln { right: 0; }
table.lt tr:nth-child(2) th { top: 24px; }
table.lt input.c { width: 56px; } table.lt input.cn { width: 92px; text-align: left; font-weight: 600; }
table.lt .lname { position: sticky; left: 0; z-index: 2; background: var(--surface); white-space: nowrap; } table.lt th.lname { z-index: 3; }
table.lt td.lname .del { opacity: 0; width: 18px; padding: 0; } table.lt tr:hover td.lname .del { opacity: 1; }
table.lt .lp { position: sticky; right: 0; z-index: 2; min-width: 82px; } table.lt .lpln { position: sticky; right: 82px; z-index: 2; min-width: 82px; box-shadow: -6px 0 8px -6px rgba(0,68,56,.25); }
table.lt th.lp, table.lt th.lpln { z-index: 3; } table.lt td.lp, table.lt td.lpln { background: #EAF4EE; }
table.lt input.c { padding: 0 3px; }
table.lt input.c, table.lt td.ls input.c { border-color: var(--line); background: var(--surface); }
table.lt td.lo { color: var(--muted); font-weight: 600; background: rgba(0,68,56,.035); }
table.lt td.ls input.c { border-style: dashed; border-color: #8FB3E0; background: #F4F8FD; color: var(--navy); font-weight: 600; }
table.lt th.ls { color: var(--navy); }
table.lt td.lmin input.c { border-color: #F2C27A; background: #FFF8EC; color: #9A5B00; font-style: italic; text-align: center; }
table.lt td.llow input.c { border-color: #E94F37; background: #FDECEA; color: #B3261E; }
table.lt th.lpc { background: #DCE7F5; color: var(--navy); }
table.lt td.lp input.c { font-weight: 800; color: var(--navy); border-color: #00985F; }
table.lt tfoot td { border-bottom: 0; padding-top: 8px; }
/* kalkulator kartonów: wąska kolumna KOD (długie nazwy pudełek łamią się w 2 linie zamiast rozpychać tabelę) */
table.kcalc th:nth-child(3), table.kcalc td:nth-child(3) { width: 1%; min-width: 120px; max-width: 210px; white-space: normal; line-height: 1.25; }
table.kcalc td:nth-child(3) b { font-weight: 600; }
table.kcalc .kdel { opacity: 0; padding: 1px 5px; margin-left: 2px; font-size: 12px; } table.kcalc tr:hover .kdel { opacity: .8; }
/* przyciski „Dodaj zaznaczone” także nad listą produktów oferty */
.pp .of-addtop { margin: 0; }
/* oferta: przeliczenia ceny (szt. / zgrzewka / 1000 szt.) w kilku liniach, własny produkt, pasek symulacji */
.ofconv { white-space: pre-line; line-height: 1.35; }
.ofcn { display: block; width: 100%; min-width: 180px; height: 30px; border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; font-weight: 700; background: var(--surface); }
.ofcn.sm { font-weight: 400; font-size: 12px; height: 26px; margin-top: 4px; }
.of-simbar { background: #F3ECFB; border: 1px solid #D9C6F0; color: #4B2A73; border-radius: 10px; padding: 9px 12px; font-size: 13px; line-height: 1.45; }
html[data-theme=night] .of-simbar { background: rgba(142, 78, 198, .18); border-color: rgba(142, 78, 198, .45); color: #E7D8F8; }
.pin.packin { width: 112px; } .pin.packin input { min-width: 44px; }
table.it td .ofcn { min-width: 220px; }
/* produkty dodane ręcznie w katalogu oferty – edycja / usunięcie */
.ofown { display: inline-flex; gap: 2px; vertical-align: middle; margin-left: 4px; } .ofown .icon-btn { width: 24px; height: 24px; font-size: 12px; }
.pp .sec-h { margin: 0; } .pp .sec-h .btn { white-space: nowrap; }
/* oferta: dodatkowe koszty */
.of-x { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.of-xr { display: grid; grid-template-columns: minmax(0, 1fr) 130px 170px 32px; gap: 8px; align-items: center; }
.of-xr > input { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: var(--surface); min-width: 0; }
@media (max-width: 700px) { .of-xr { grid-template-columns: 1fr 1fr 32px; } .of-xr > input[data-ofx=label] { grid-column: 1 / -1; } }
table.of-ct input { width: 100%; height: 32px; border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; background: var(--surface); }

/* ===== Panel centralny w CRM-ie: Pulpit, nieobecności, ogłoszenia ===== */
.hub-ann { display: flex; gap: 12px; align-items: center; padding: 12px 14px; margin-bottom: 10px; border-left: 4px solid var(--blue); background: var(--surface); }
.hub-ann .grow { flex: 1; min-width: 0; } .hub-ann.abs-b { border-left-color: #8a8f99; display: block; }
.hub-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-bottom: 14px; }
.hub-c .dcol-b { padding: 4px 12px 12px; }
.hub-req, .hub-task, .hub-goal { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.hub-req:last-child, .hub-task:last-child, .hub-goal:last-child { border-bottom: 0; }
.hub-req .btn-row { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.hub-items { display: grid; gap: 4px; margin-top: 6px; } .hub-items .chk { display: flex; gap: 8px; align-items: flex-start; }
.hub-items input:checked + span { text-decoration: line-through; color: var(--muted); }
.faded { opacity: .6; } .hub-sub { margin: 8px 0 2px; font-size: 12px; color: var(--muted); }
.prog.wide { display: block; width: 100%; margin-top: 4px; }
.pill.abs { background: #ECEDF1; color: #555b66; }
.cal-day.cal-off { background: repeating-linear-gradient(135deg, rgba(120,128,140,.13) 0 6px, transparent 6px 12px); }
.chip.abs { background: #ECEDF1; color: #555b66; font-style: italic; }
.abs-list { display: grid; gap: 6px; } .abs-row { position: relative; padding: 8px 34px 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.abs-row .icon-btn { position: absolute; right: 4px; top: 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- Mapa: większa, kropki, grupowanie, zwijany panel tras ---------- */
.rt { grid-template-columns: minmax(290px, 25%) minmax(0, 1fr); transition: grid-template-columns .2s; }
.rt.side-off { grid-template-columns: minmax(0, 1fr); }
.rt.side-off .rt-side { display: none; }
.mpin { width: 12px; height: 12px; border-width: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.18), 0 1px 3px rgba(0,0,0,.35); }
.mpin.lead { border-width: 3px; }
.mclu { display: grid; place-items: center; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.4); cursor: pointer; }
.mclu b { display: grid; place-items: center; min-width: 60%; height: 60%; padding: 0 3px; border-radius: 999px; background: rgba(255,255,255,.94); color: #1d2433; font-size: 12px; line-height: 1; }
.rt-tools { display: inline-flex; gap: 6px; margin-left: auto; }
.rt-map-wrap:fullscreen { border-radius: 0; background: var(--bg, #fff); }
.rt-map-wrap.rt-max { position: fixed; inset: 0; z-index: 2000; border-radius: 0; background: var(--bg, #fff); }
@media (max-width: 900px) {
  .rt, .rt.side-off { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .rt.side-off .rt-side { display: block; }
  .rt-map-wrap { height: 60vh; }
  [data-rt-side] { display: none; }
}
