/* FiveWhy – style aplikacji (na bazie zatwierdzonej makiety 5 Why, motyw jasny w stylu Fluent). */
:root {
  --accent: #0f6cbd; --accent-2: #115ea3; --accent-light: #ebf3fc;
  --text: #242424; --text-2: #616161; --text-3: #8a8a8a;
  --border: #e0e0e0; --bg: #f5f5f5; --card: #fff;
  --danger: #c4314b; --warn: #bc4b09; --ok: #107c10;
  --shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 2px rgba(0,0,0,.06);
  --line: #c4c4c4; --occ: #ca5010; --det: #038387; --ai: #6b2fbf;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); }
h1:focus { outline: none; }
.sp { flex: 1; }
.note { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* ---------- start ---------- */
.boot { height: 100vh; display: grid; place-content: center; gap: 14px; justify-items: center; }
.boot-logo, .brand { font-weight: 800; letter-spacing: -.5px; }
.boot-logo { font-size: 34px; color: var(--accent); }
.boot-logo span { color: var(--text); }
.boot-bar { width: 160px; height: 4px; background: #e3e3e3; border-radius: 2px; overflow: hidden; }
.boot-bar div { width: 40%; height: 100%; background: var(--accent); animation: boot 1.1s ease-in-out infinite; }
@keyframes boot { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
#blazor-error-ui { background: #fff4ce; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

/* ---------- przyciski i drobne elementy ---------- */
.btn { border: 1px solid #d1d1d1; background: #fff; padding: 5px 12px; border-radius: 4px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; justify-content: center; color: var(--text); cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: #f5f5f5; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.sm { padding: 3px 9px; font-size: 13px; }
.btn.lg { padding: 10px 20px; font-size: 15.5px; border-radius: 6px; }
.btn.full { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.ibtn { border: 0; background: none; width: 28px; height: 28px; border-radius: 4px; display: inline-grid; place-items: center; cursor: pointer; color: var(--text-2); position: relative; }
.ibtn:hover { background: #f0f0f0; color: var(--text); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: transparent; padding: 4px 11px; cursor: pointer; white-space: nowrap; font-size: 13px; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--accent); color: #fff; }
.st { font-size: 11px; font-weight: 600; border-radius: 9px; padding: 0 7px; line-height: 18px; white-space: nowrap; }
.st.hyp { color: #8a5a00; background: #fff4ce; }
.st.ok { color: #0e5a0e; background: #e7f6e7; }
.st.rej { color: var(--text-2); background: #ececec; }
.cat { display: inline-flex; gap: 4px; align-items: center; font-size: 11px; color: var(--text-2); background: #f3f3f3; border-radius: 9px; padding: 0 7px; line-height: 18px; white-space: nowrap; }
.cat.none { color: var(--text-3); background: none; border: 1px dashed #ccc; }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid #d8c4f5; border-top-color: var(--ai); border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
kbd { font: 11px Consolas, monospace; background: #f0f0f0; border: 1px solid #ddd; border-bottom-width: 2px; border-radius: 3px; padding: 0 4px; }
.banner { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; border-radius: 6px; font-size: 13px; margin: 8px 0; }
.banner.warn { background: #fff4ec; border: 1px solid #f4c8a8; color: #8a3707; }
.banner.err { background: #fde7e9; border: 1px solid #f1b0bb; color: #8a1c2f; }

/* ---------- pasek górny ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; padding: 8px 20px; background: #fff; border-bottom: 1px solid var(--border); }
.brand { font-size: 20px; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 2px; }
.brand-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: linear-gradient(135deg, var(--accent), #038387); color: #fff; font-size: 16px; margin-right: 4px; }
.topnav { display: flex; gap: 4px; }
.topnav .tn { padding: 6px 10px; border-radius: 4px; color: var(--text-2); text-decoration: none; font-weight: 600; font-size: 13.5px; }
.topnav .tn:hover { background: #f3f3f3; color: var(--text); }
.topnav .tn.active { color: var(--accent); background: var(--accent-light); }
.plan-badge { font-size: 12px; font-weight: 600; color: #0e5a0e; background: #e7f6e7; border-radius: 10px; padding: 2px 10px; white-space: nowrap; }
.page { min-height: calc(100vh - 49px); }

/* ---------- strona analizy ---------- */
.work { padding: 16px 20px 28px; max-width: 1800px; margin: 0 auto; }
.work-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 12px; }
.work-head h1 { margin: 0; font-size: 22px; }
.notice { font-size: 12.5px; color: #5c4a00; background: #fffbe6; border: 1px solid #f3e9b5; border-radius: 6px; padding: 5px 10px; display: flex; gap: 6px; align-items: center; }

/* opis problemu */
.prob { background: #fff; border-radius: 6px; box-shadow: var(--shadow); margin-bottom: 14px; }
.prob-h { display: flex; gap: 8px; align-items: center; padding: 9px 14px; font-weight: 600; cursor: pointer; user-select: none; }
.prob-h > i.l { color: var(--danger); }
.prob-h .stmt-mini { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.prob-h .stmt-mini.empty { color: var(--danger); font-weight: 400; font-style: italic; }
.prob-b { padding: 4px 14px 14px; border-top: 1px solid #f3f3f3; }
.w5 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px 12px; margin-top: 8px; }
.w5 .f { margin: 0; }
.w5 .f.full { grid-column: 1 / -1; }
.w5 .f > label { display: flex; gap: 5px; align-items: center; }
.w5 .f > label b { font-weight: 700; color: var(--text); font-size: 11px; background: #eee; border-radius: 3px; padding: 0 4px; }
.w5 textarea { min-height: 32px !important; resize: none !important; overflow: hidden; padding: 5px 9px !important; line-height: 1.35; field-sizing: content; }
.w5 .stmt textarea { font-weight: 600; font-size: 14.5px; border-color: #e8b4bd; }
.stmt-bar { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.stmt-bar .note { margin: 0; }

/* formularze */
.f { margin-bottom: 10px; }
.f > label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 3px; }
.f input[type=text], .f input[type=date], .f select, .f textarea { width: 100%; border: 1px solid #d1d1d1; border-radius: 4px; padding: 6px 9px; font-size: 13.5px; background: #fff; }
.f textarea { resize: vertical; min-height: 56px; }
.f input:focus, .f select:focus, .f textarea:focus { outline: none; border-color: var(--accent); box-shadow: inset 0 -1px 0 var(--accent); }
.f .ro { font-size: 13px; color: var(--text-2); background: #fafafa; border: 1px solid #ececec; border-radius: 4px; padding: 6px 9px; }
.help-link { color: var(--accent); cursor: pointer; margin-left: 4px; font-size: 11.5px; }
.chk { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin: 8px 0; cursor: pointer; line-height: 1.4; }
.chk input { margin-top: 3px; }

/* obszar 5 Why */
.fw { background: #fff; border-radius: 6px; box-shadow: var(--shadow); }
.tbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid #eee; }
.tbar .hint { font-size: 12px; color: var(--text-3); }
.zoom { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; color: var(--text-2); }
.fw-body { display: grid; grid-template-columns: minmax(0,1fr) 340px; min-height: 560px; }
.canvas { overflow: auto; padding: 22px 20px 120px; background-color: #fafafa; background-image: radial-gradient(#e2e2e2 1px, transparent 1px); background-size: 16px 16px; border-right: 1px solid #eee; max-height: calc(100vh - 160px); min-height: 560px; }
.tree { display: inline-flex; min-width: max-content; }

/* drzewo – łączniki CSS */
.t-node { display: flex; align-items: center; }
.t-kids { display: flex; flex-direction: column; margin-left: 26px; position: relative; }
.t-kids::before { content: ""; position: absolute; left: -26px; top: 50%; width: 26px; border-top: 1.5px solid var(--line); }
.t-kids > .t-node { position: relative; padding: 7px 0 7px 22px; }
.t-kids > .t-node::before { content: ""; position: absolute; left: 0; top: 50%; width: 22px; border-top: 1.5px solid var(--line); }
.t-kids > .t-node::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 1.5px solid var(--line); }
.t-kids > .t-node:first-child::after { top: 50%; }
.t-kids > .t-node:last-child::after { bottom: 50%; }
.t-kids > .t-node:only-child::after { display: none; }
.t-kids > .t-node.rej::before { border-top-style: dashed; }

/* karta „Dlaczego?” */
.wc { width: 262px; background: #fff; border: 1px solid #d8d8d8; border-left: 4px solid var(--lane, #999); border-radius: 6px; box-shadow: var(--shadow); padding: 7px 10px 5px; cursor: pointer; position: relative; }
.wc:hover { box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.wc.sel { outline: 2px solid var(--accent); outline-offset: 1px; }
.wc.occ { --lane: var(--occ); }
.wc.det { --lane: var(--det); }
.wc.rej { background: #f7f7f7; }
.wc.rej textarea { text-decoration: line-through; color: var(--text-3); }
.wc.root { border-color: #e8a0ad; border-left-color: var(--danger); background: #fff7f8; }
.rootbadge { position: absolute; top: -10px; right: 10px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; padding: 0 8px; border-radius: 9px; display: flex; gap: 4px; align-items: center; line-height: 18px; }
.wc-h { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: 11.5px; }
.wc-h .lvl { font-weight: 700; color: var(--lane); white-space: nowrap; }
.wc-h .lvl.deep { color: var(--warn); }
.wc-q { font-size: 11.5px; color: var(--text-3); margin: 4px 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc textarea { width: calc(100% + 8px); border: 1px solid transparent; border-radius: 4px; resize: none; font-size: 13.5px; line-height: 1.35; padding: 3px 4px; margin: 0 -4px; background: transparent; overflow: hidden; display: block; field-sizing: content; min-height: 26px; }
.wc textarea:hover { border-color: #e3e3e3; }
.wc textarea:focus { outline: none; border-color: var(--accent); background: #fff; }
.wc-root { font-size: 12px; margin-top: 4px; padding: 4px 6px; border-radius: 4px; background: #fff; border: 1px solid #f0d0d6; display: flex; gap: 6px; align-items: flex-start; }
.wc-root i { color: var(--danger); }
.wc-root.miss { color: var(--danger); font-weight: 600; }
.wc-f { display: flex; align-items: center; margin-top: 3px; opacity: 0; transition: opacity .12s; }
.wc:hover .wc-f, .wc.sel .wc-f, .wc:focus-within .wc-f { opacity: 1; }
.wc-f .ibtn { width: 26px; height: 24px; font-size: 13px; }
.wc-f .ibtn.add { width: auto; padding: 0 6px; gap: 4px; display: inline-flex; font-size: 12px; color: var(--accent); font-weight: 600; }
.wc-f .ibtn.add:hover { background: var(--accent-light); }
.wc-f .ibtn.rootbtn.on { color: var(--danger); }
.ibtn.locked { color: var(--ai); opacity: .55; }
.ibtn.locked .lk { position: absolute; right: 1px; bottom: 1px; font-size: 8px; color: var(--text-2); }
.collapse { position: absolute; right: -13px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%; border: 1px solid #ccc; background: #fff; font-size: 11px; font-weight: 700; color: var(--text-2); display: grid; place-items: center; cursor: pointer; z-index: 2; padding: 0; }
.collapse:hover { border-color: var(--accent); color: var(--accent); }

/* karta problemu */
.pc { width: 280px; background: #fff; border: 1px solid #e8b4bd; border-top: 4px solid var(--danger); border-radius: 6px; box-shadow: 0 2px 6px rgba(0,0,0,.08); padding: 9px 12px 10px; cursor: pointer; }
.pc-h { display: flex; gap: 6px; align-items: center; font-weight: 700; font-size: 12px; color: var(--danger); text-transform: uppercase; letter-spacing: .3px; }
.pc .stmt-view { font-size: 14px; font-weight: 600; margin: 5px 0 2px; line-height: 1.35; }
.pc .stmt-view.empty { color: var(--text-3); font-weight: 400; font-style: italic; }
.pc-add { display: flex; flex-direction: column; gap: 5px; margin-top: 9px; }
.pc-add .btn { justify-content: flex-start; font-size: 12.5px; padding: 4px 9px; white-space: normal; text-align: left; }
.swc { width: 9px; height: 9px; border-radius: 2px; flex: none; }
.swc.occ { background: var(--occ); } .swc.det { background: var(--det); }
.empty-hint { margin-left: 30px; max-width: 300px; color: var(--text-2); font-size: 13px; display: flex; gap: 10px; align-items: flex-start; }
.empty-hint i { font-size: 22px; color: var(--accent); }

/* lista */
.outline { min-width: 560px; max-width: 980px; }
.outline .pc { width: 100%; max-width: 640px; }
.ol-lane { margin: 14px 0 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; display: flex; gap: 8px; align-items: center; }
.ol-lane.occ { color: var(--occ); } .ol-lane.det { color: var(--det); }
.ol-row { display: grid; grid-template-columns: 80px minmax(0,1fr) auto auto auto; gap: 8px; align-items: center; background: #fff; border: 1px solid #e3e3e3; border-left: 4px solid var(--lane); border-radius: 5px; padding: 5px 8px; margin: 4px 0 4px calc(var(--d) * 26px); cursor: pointer; }
.ol-row.occ { --lane: var(--occ); } .ol-row.det { --lane: var(--det); }
.ol-row.sel { outline: 2px solid var(--accent); }
.ol-row.root { background: #fff7f8; border-color: #e8a0ad; border-left-color: var(--danger); }
.ol-row.rej .ol-t { text-decoration: line-through; color: var(--text-3); }
.ol-row .lvl { font-size: 11px; font-weight: 700; color: var(--lane); }
.ol-row input.ol-t { border: 1px solid transparent; border-radius: 3px; font-size: 13.5px; padding: 3px 5px; background: transparent; min-width: 0; }
.ol-row input.ol-t:focus { outline: none; border-color: var(--accent); background: #fff; }
.ol-row .rootmark { color: var(--danger); font-size: 14px; width: 16px; }

/* panel boczny */
.side { background: #fff; overflow: auto; max-height: calc(100vh - 160px); }
.side-h { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-bottom: 1px solid #f0f0f0; font-weight: 600; position: sticky; top: 0; background: #fff; z-index: 1; }
.side-h i.l { color: var(--accent); }
.side-h .ibtn { margin-left: auto; }
.c-occ { color: var(--occ); } .c-det { color: var(--det); }
.side-b { padding: 12px 14px 120px; }
.sec { margin-bottom: 16px; }
.sec-t { font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .3px; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.sec-t.danger { color: var(--danger); }
.row-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips button { border: 1px solid #d6d6d6; background: #fff; border-radius: 14px; padding: 3px 10px; font-size: 12.5px; cursor: pointer; display: inline-flex; gap: 5px; align-items: center; }
.chips button.on { background: var(--accent-light); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.segf { display: flex; border: 1px solid #d1d1d1; border-radius: 4px; overflow: hidden; }
.segf button { flex: 1; border: 0; background: #fff; padding: 6px 4px; font-size: 12.5px; cursor: pointer; }
.segf button + button { border-left: 1px solid #d1d1d1; }
.segf button.on.hyp { background: #fff4ce; color: #8a5a00; font-weight: 600; }
.segf button.on.ok { background: #e7f6e7; color: #0e5a0e; font-weight: 600; }
.segf button.on.rej { background: #ececec; color: #424242; font-weight: 600; }
.toggle { display: flex; gap: 10px; align-items: center; cursor: pointer; font-size: 13.5px; }
.toggle .tr { width: 36px; height: 20px; border-radius: 10px; background: #c8c8c8; position: relative; flex: none; transition: background .15s; }
.toggle .tr::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .15s; }
.toggle.on .tr { background: var(--danger); }
.toggle.on .tr::after { left: 19px; }
.toggle.dis { opacity: .5; cursor: not-allowed; }
.actbox { border: 1px solid #f0d0d6; background: #fff9fa; border-radius: 6px; padding: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.done-link { display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 6px 8px; background: #e7f6e7; border-radius: 4px; color: #0e5a0e; }
.stepper { display: flex; gap: 3px; margin-bottom: 4px; }
.stepper div { flex: 1; height: 6px; border-radius: 3px; background: #e6e6e6; }
.stepper div.done { background: var(--ok); }
.steplbl { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); }
.qc { list-style: none; margin: 0; padding: 0; }
.qc li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; padding: 5px 6px; border-radius: 4px; }
.qc li.click { cursor: pointer; }
.qc li.click:hover { background: #f5f5f5; }
.qc li i { margin-top: 1px; }
.qc li.err i { color: var(--danger); } .qc li.warn i { color: var(--warn); } .qc li.ok i { color: var(--ok); }
.rc { display: flex; gap: 8px; align-items: flex-start; padding: 7px 8px; border: 1px solid #f0d0d6; background: #fff9fa; border-radius: 5px; margin-bottom: 6px; cursor: pointer; font-size: 13px; }
.rc:hover { border-color: var(--danger); }
.rc i { color: var(--danger); }
.rc small { display: block; color: var(--text-2); margin-top: 2px; }

/* asystent */
.asst { position: fixed; right: 20px; bottom: 20px; width: 370px; max-width: calc(100vw - 24px); max-height: min(620px, calc(100vh - 90px)); background: #fff; border-radius: 10px; box-shadow: 0 10px 34px rgba(0,0,0,.2); border: 1px solid #e3d8f5; display: flex; flex-direction: column; z-index: 40; }
.asst-h { display: flex; gap: 8px; align-items: center; padding: 9px 12px; border-bottom: 1px solid #eee; color: var(--ai); }
.asst-h b { color: var(--text); }
.ai-dot { font-size: 10.5px; font-weight: 700; border-radius: 8px; padding: 0 6px; background: #ececec; color: var(--text-2); }
.ai-dot.on { background: #f1e8fd; color: var(--ai); }
.asst-next { display: flex; gap: 8px; align-items: flex-start; margin: 10px 12px 4px; padding: 8px 10px; background: var(--accent-light); border-radius: 6px; font-size: 13px; font-weight: 600; }
.asst-next i { color: var(--accent); font-size: 16px; }
.asst-next small { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .3px; color: var(--accent); }
.asst-msgs { flex: 1; overflow-y: auto; padding: 6px 12px; display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.msg { font-size: 13px; line-height: 1.45; padding: 7px 10px; border-radius: 8px; max-width: 94%; white-space: pre-line; }
.msg.tip { background: #f6f6f6; border-left: 3px solid var(--accent); }
.msg.tip.warn { border-left-color: var(--warn); background: #fff7f0; }
.msg.tip.success { border-left-color: var(--ok); background: #f0f8f0; }
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; }
.msg.ai { background: #f7f2ff; border: 1px solid #e4d6f8; }
.msg .who { display: block; font-size: 10.5px; font-weight: 700; color: var(--ai); margin-bottom: 2px; }
.msg .lnk { border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 12px; padding: 2px 0 0; cursor: pointer; }
.asst-quick { display: flex; flex-wrap: wrap; gap: 5px; padding: 6px 12px; border-top: 1px solid #f3f3f3; }
.asst-quick button { flex: 0 1 auto; max-width: 100%; border: 1px solid #d9cdf0; background: #fbf9ff; border-radius: 12px; padding: 3px 9px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.asst-quick button:hover { border-color: var(--ai); }
.asst-in { display: flex; gap: 6px; align-items: flex-end; padding: 6px 12px; }
.asst-in textarea { flex: 1; border: 1px solid #d1d1d1; border-radius: 6px; padding: 6px 9px; resize: none; max-height: 110px; field-sizing: content; min-height: 34px; }
.asst-in textarea:focus { outline: none; border-color: var(--ai); }
.asst-live { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--text-2); padding: 0 12px 4px; cursor: pointer; }
.asst-foot { font-size: 11.5px; color: var(--text-3); padding: 4px 12px 9px; display: flex; gap: 5px; }
.asst-fab { position: fixed; right: 22px; bottom: 22px; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--ai); color: #fff; font-size: 24px; box-shadow: 0 6px 20px rgba(107,47,191,.4); cursor: pointer; z-index: 40; }
.asst-fab .badge { position: absolute; top: -2px; right: -2px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; border-radius: 10px; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; }

/* modal */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.3); display: grid; place-items: start center; padding: 50px 16px; z-index: 50; overflow: auto; }
.popup { width: 720px; max-width: 100%; background: #fff; border-radius: 8px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.popup.narrow { width: 520px; }
.popup-h { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid #eee; font-weight: 600; font-size: 16px; }
.popup-h .ibtn { margin-left: auto; }
.popup-b { padding: 14px 16px; max-height: 68vh; overflow: auto; }
.popup-f { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid #eee; }
.lead-s { margin: 0 0 10px; color: var(--text-2); font-size: 13.5px; }
.bt { border: 1px solid #eee; border-radius: 6px; padding: 10px 12px; margin-bottom: 10px; }
.bt-chain { font-size: 13.5px; line-height: 1.5; }
.bt-chain .bt-s { padding: 2px 0 2px 10px; border-left: 3px solid #eee; }
.bt-chain .bt-s.first { border-left-color: var(--danger); font-weight: 600; }
.bt-chain .bt-s.last { border-left-color: #888; font-weight: 600; }
.bt-chain .th { color: var(--accent); font-weight: 700; font-size: 11.5px; text-transform: uppercase; margin: 1px 0 1px 10px; }
.bt label { display: flex; gap: 8px; align-items: center; margin-top: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.help h4 { margin: 14px 0 6px; font-size: 14px; }
.help h4:first-child { margin-top: 0; }
.help p { margin: 4px 0; font-size: 13.5px; line-height: 1.45; }
.help table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 4px 0; }
.help td, .help th { text-align: left; padding: 5px 8px; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
.help th { color: var(--text-2); font-weight: 600; background: #fafafa; }
.help ol { margin: 4px 0; padding-left: 20px; font-size: 13.5px; line-height: 1.5; }

/* toasty */
.toasts { position: fixed; left: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: #fff; border-left: 4px solid var(--ok); border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.18); padding: 10px 14px; font-size: 13.5px; max-width: 400px; display: flex; gap: 8px; animation: tin .2s ease-out; }
.toast.err { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--accent); }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }

/* ---------- landing ---------- */
.hero { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,1fr); gap: 40px; align-items: center; max-width: 1180px; margin: 0 auto; padding: 56px 24px 48px; }
.eyebrow { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 600; color: var(--ai); background: #f1e8fd; border-radius: 12px; padding: 3px 11px; }
.hero h1 { font-size: 44px; line-height: 1.1; letter-spacing: -1px; margin: 16px 0 14px; }
.hero .lead { font-size: 17px; line-height: 1.55; color: var(--text-2); margin: 0 0 22px; max-width: 560px; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.mini { background: #fff; border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.1); padding: 18px; display: grid; gap: 12px; }
.mini-pc { border: 1px solid #e8b4bd; border-top: 4px solid var(--danger); border-radius: 6px; padding: 8px 12px; font-weight: 600; font-size: 14px; }
.mini-pc small, .mini-c small { display: block; font-size: 11px; color: var(--text-3); font-weight: 600; }
.mini-pc small { color: var(--danger); }
.mini-chain { display: grid; gap: 8px; padding-left: 18px; border-left: 2px solid var(--line); margin-left: 10px; }
.mini-c { border: 1px solid #ddd; border-left: 4px solid var(--occ); border-radius: 6px; padding: 6px 10px; font-size: 13.5px; background: #fff; }
.mini-c.root { border-color: #e8a0ad; border-left-color: var(--danger); background: #fff7f8; }
.mini-c.root small { color: var(--danger); }
.okc { color: #0e5a0e; }
.mini-tip { display: flex; gap: 8px; font-size: 13px; background: #f7f2ff; border: 1px solid #e4d6f8; border-radius: 8px; padding: 8px 10px; }
.mini-tip i { color: var(--ai); font-size: 16px; }
.band { padding: 56px 24px; max-width: 1180px; margin: 0 auto; }
.band.alt { max-width: none; background: #fff; }
.band.alt > * { max-width: 1132px; margin-left: auto; margin-right: auto; }
.band h2 { font-size: 30px; margin: 0 0 8px; text-align: center; letter-spacing: -.5px; }
.sub-c { text-align: center; color: var(--text-2); margin: 0 0 26px; }
.steps4, .feats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 20px; margin-top: 26px; }
.steps4 > div, .feats > div { background: #fff; border-radius: 10px; padding: 18px; box-shadow: var(--shadow); }
.band.alt .feats > div { background: var(--bg); box-shadow: none; }
.steps4 h3, .feats h3 { margin: 10px 0 6px; font-size: 16px; }
.steps4 p, .feats p { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; }
.feats i { font-size: 24px; color: var(--ai); }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; align-items: stretch; }
.plan { background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 24px; display: flex; flex-direction: column; position: relative; border: 1px solid var(--border); }
.plan.hl { border: 2px solid var(--accent); }
.plan h3 { margin: 0; font-size: 19px; }
.price { font-size: 32px; font-weight: 800; margin: 10px 0 4px; }
.price small { font-size: 13px; font-weight: 500; color: var(--text-3); }
.pdesc { color: var(--text-2); margin: 0 0 14px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; flex: 1; align-content: start; }
.plan li { display: flex; gap: 8px; font-size: 14px; line-height: 1.4; }
.plan li::before { font-family: "bootstrap-icons"; flex: none; }
.plan li.y::before { content: "\f26e"; color: var(--ok); }
.plan li.n { color: var(--text-3); }
.plan li.n::before { content: "\f62a"; color: var(--text-3); }
.ribbon-tag { position: absolute; top: 16px; right: 16px; font-size: 11.5px; font-weight: 700; color: var(--accent); background: var(--accent-light); border-radius: 10px; padding: 1px 9px; }
.ribbon-tag.soon { color: #8a4b00; background: #fff4ce; display: inline-flex; gap: 5px; align-items: center; }
.plan.soon { background: #fcfcfc; }
.plan.soon h3, .plan.soon .pdesc { color: var(--text-2); }
.plan.soon li.y::before { color: #9bbf9b; }
.price-soon { font-size: 20px; font-weight: 700; color: var(--text-3); margin: 14px 0 10px; letter-spacing: .2px; }
.plans-note { display: flex; gap: 8px; max-width: 860px; margin: 22px auto 0; color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
.faq details { background: var(--bg); border-radius: 8px; padding: 12px 16px; margin: 0 auto 10px; max-width: 860px; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq details p { color: var(--text-2); line-height: 1.5; margin: 8px 0 0; }
.foot { display: flex; gap: 20px; justify-content: center; padding: 24px; color: var(--text-3); font-size: 13px; }
.doc { max-width: 820px; margin: 0 auto; padding: 40px 24px; line-height: 1.55; }
.doc h1 { font-size: 30px; }
.doc h2 { font-size: 18px; margin-top: 26px; }

/* ---------- responsywność ---------- */
@media (max-width: 1250px) {
  .fw-body { grid-template-columns: 1fr; }
  .canvas { border-right: 0; border-bottom: 1px solid #eee; max-height: none; }
  .side { max-height: none; }
  .side-b { padding-bottom: 14px; }
  .w5 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 32px; }
  .hero h1 { font-size: 34px; }
  .steps4, .feats, .plans { grid-template-columns: 1fr; }
  .topnav .tn:not(.active) { display: none; }
  .tbar .hint { display: none; }
}
@media (max-width: 640px) {
  .topbar { padding: 8px 12px; gap: 8px; }
  .topbar .btn:not(.ubtn), .plan-badge { display: none; }
  .work { padding: 12px; }
  .w5 { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .asst { right: 8px; bottom: 8px; }
}

/* blokady planu i „Zwiększ plan” */
.btn.upg { background: linear-gradient(90deg, #6b2fd6, #0f6cbd); color: #fff; border-color: transparent; white-space: nowrap; flex: none; text-decoration: none; }
.btn.upg:hover { filter: brightness(1.08); color: #fff; }
.btn.upg.sm { padding: 2px 9px; font-size: 12px; }
.lockrow { display: flex; align-items: center; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
.notice > span { flex: 1; }
.asst-foot { align-items: center; justify-content: space-between; flex-wrap: wrap; }
.btn.locked, .pc-add .btn.locked { color: var(--text-3); }
.btn .lk { font-size: 10px; margin-left: 4px; color: var(--text-3); }
.toast.upgrade { border-left-color: #6b2fd6; }
.toast.upgrade > .bi { color: #6b2fd6; }
.toast-act, .msg-act { margin-top: 6px; }
.brand-logo { height: 26px; width: auto; display: block; }

/* prezentacja (samouczek) */
.tour-block { position: fixed; inset: 0; z-index: 90; background: transparent; }
.tour-hl { position: fixed; z-index: 91; pointer-events: none; border-radius: 10px; box-shadow: 0 0 0 3px #ffb900, 0 0 0 9999px rgba(15, 23, 42, .55); transition: left .25s, top .25s, width .25s, height .25s; }
.tour-cap { position: fixed; z-index: 92; left: 50%; bottom: 20px; transform: translateX(-50%); width: min(620px, calc(100vw - 32px)); background: #fff; border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.35); padding: 12px 16px; }
.tour-cap.top { bottom: auto; top: 70px; }
.tour-h { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.tour-h > .bi { color: var(--accent); font-size: 17px; }
.tour-n { font-size: 12px; color: var(--text-3); }
.tour-t { margin: 8px 0 10px; font-size: 15px; line-height: 1.5; }
.tour-bar { height: 4px; background: #eef1f5; border-radius: 2px; overflow: hidden; margin-bottom: 10px; }
.tour-bar > div { height: 100%; background: linear-gradient(90deg, var(--accent), #038387); transition: width .3s; }
.tour-c { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tour-novoice { font-size: 11px; color: var(--text-3); border: 1px dashed #ccc; border-radius: 10px; padding: 1px 8px; }
.tour-top { background: #fff4ce; border-color: #f2c94c; color: #5c4a00; font-weight: 600; }
.tour-top:hover { background: #ffeaa0; }
.tour-top .bi { color: #c27c00; }
/* okno powitalne */
.popup.welcome { width: min(640px, 100%); }
.welcome .lead { margin: 0 0 12px; }
.wsteps { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 9px; }
.wsteps li { display: flex; gap: 10px; align-items: flex-start; }
.wsteps li > .bi { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: #eef4fb; color: var(--accent); font-size: 15px; }
.wsteps b, .wtour b { display: block; font-size: 14px; }
.wsteps span, .wtour span { font-size: 13px; color: var(--text-2); }
.wtour { display: flex; gap: 10px; align-items: center; background: #f5f0fc; border: 1px solid #e3d8f5; border-radius: 10px; padding: 10px 12px; }
.wtour > .bi { font-size: 24px; color: var(--ai); }
.welcome .popup-f { align-items: center; flex-wrap: wrap; }
.welcome .popup-f .note { flex: 1; margin: 0; }

/* cennik: zaproszenie na prezentację pełnego systemu */
.qms-cta { display: flex; align-items: center; gap: 18px; margin-top: 22px; padding: 20px 22px; border-radius: 12px; background: linear-gradient(120deg, #eef4fb, #f5f0fc); border: 1px solid #d7e3f3; }
.qms-ic { flex: none; width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; background: #fff; color: var(--accent); font-size: 24px; box-shadow: var(--shadow); }
.qms-txt { flex: 1; min-width: 0; }
.qms-txt h3 { margin: 0 0 4px; font-size: 18px; }
.qms-txt p { margin: 0 0 6px; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.qms-txt small { color: var(--text-3); font-size: 12.5px; }
.qms-cta .btn { flex: none; white-space: nowrap; }
@media (max-width: 760px) { .qms-cta { flex-direction: column; align-items: flex-start; } }

/* raport: pobieranie w środowisku testowym */
.testdl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding: 9px 12px; border: 1px dashed #c9a227; border-radius: 8px; background: #fffbea; font-size: 13px; }
.testdl > span:nth-child(2) { flex: 1; min-width: 160px; }
.tag-test { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: #7a5d00; }

/* konta: logowanie, firma, zespół */
.acc-page { max-width: 760px; margin: 28px auto; padding: 0 16px; display: grid; gap: 16px; }
.acc-card { background: #fff; border-radius: 10px; box-shadow: var(--shadow); padding: 20px 22px; }
.acc-card.narrow { max-width: 460px; width: 100%; justify-self: center; }
.acc-card.attn { border: 1px solid #f2c94c; background: #fffdf3; }
.acc-card h1 { font-size: 21px; margin: 0 0 6px; display: flex; gap: 8px; align-items: center; }
.acc-card h1 .bi, .acc-card h2 .bi { color: var(--accent); }
.acc-card h2 { font-size: 16px; margin: 0 0 8px; display: flex; gap: 8px; align-items: center; }
.acc-card .sub { color: var(--text-2); margin: 0 0 14px; font-size: 14px; line-height: 1.5; }
.acc-card .f { margin-bottom: 12px; }
.acc-card .opt { color: var(--text-3); font-weight: 400; }
.acc-card fieldset { border: 0; padding: 0; margin: 0; }
.acc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.acc-head h1 { margin: 0; }
.acc-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.btn.full { width: 100%; justify-content: center; margin-top: 4px; }
.domain-box { display: flex; gap: 10px; align-items: center; background: #eef4fb; border-radius: 8px; padding: 9px 12px; margin-bottom: 14px; }
.domain-box .bi { font-size: 20px; color: var(--accent); }
.domain-box small, .facts small { display: block; color: var(--text-3); font-size: 11.5px; }
.trial-note { background: #f2f9f2; border: 1px solid #cfe8cf; color: #0b5a0b; border-radius: 8px; padding: 8px 12px; font-size: 13px; margin: 10px 0; display: flex; gap: 8px; align-items: center; }
.facts { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 10px; }
.facts b { font-size: 15px; }
.trial { margin-left: 8px; font-size: 11.5px; background: #f2f9f2; color: #0b5a0b; border-radius: 10px; padding: 1px 8px; }
.trial.off { background: #fdf3f5; color: var(--danger); }
.recent { margin-top: 18px; border-top: 1px solid #eee; padding-top: 12px; }
.recent-h, .sub-h { font-size: 12px; text-transform: uppercase; letter-spacing: .3px; color: var(--text-3); margin: 6px 0 8px; }
.recent-u { display: flex; align-items: center; gap: 4px; }
.recent-u.cur .recent-b { background: #eef4fb; }
.recent-b { flex: 1; display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 7px 8px; border-radius: 8px; cursor: pointer; text-align: left; min-width: 0; }
.recent-b:hover { background: #f5f5f5; }
.av { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #dce9f7; color: var(--accent); font-weight: 700; font-size: 13px; }
.av.sm { width: 24px; height: 24px; font-size: 10.5px; }
.av.muted { background: #f0f0f0; color: var(--text-3); }
.who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.who b { font-size: 14px; }
.who small { color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-cur { font-size: 11px; color: var(--accent); font-weight: 600; }
.row-i { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #f2f2f2; }
.row-i:last-child { border-bottom: 0; }
.role { font-size: 11.5px; border-radius: 10px; padding: 2px 9px; background: #f0f0f0; color: var(--text-2); }
.role.owner { background: #eef4fb; color: var(--accent); font-weight: 600; }
.invite { display: flex; gap: 8px; flex-wrap: wrap; }
.invite input { flex: 1; min-width: 220px; border: 1px solid #d1d1d1; border-radius: 4px; padding: 6px 9px; font-size: 13.5px; }
.plan-badge.paid { background: #eef4fb; color: var(--accent); border-color: #c7dcf3; }
.umenu { position: relative; }
.ubtn { gap: 6px; }
.uname { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.umenu-bg { position: fixed; inset: 0; z-index: 35; }
.umenu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 36; background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); min-width: 250px; padding: 6px; display: flex; flex-direction: column; }
.umenu-h { padding: 8px 10px 10px; border-bottom: 1px solid #eee; margin-bottom: 4px; display: flex; flex-direction: column; }
.umenu-h small { color: var(--text-3); font-size: 12px; }
.umenu-pop a, .umenu-pop button { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 6px; color: var(--text); text-decoration: none; border: 0; background: none; font-size: 13.5px; cursor: pointer; text-align: left; }
.umenu-pop a:hover, .umenu-pop button:hover { background: #f5f5f5; }
@media (max-width: 760px) { .uname { display: none; } }

/* strona Firma: nagłówek, zakładki, dane */
.acc-page.wide { max-width: 900px; }
.co-head { display: flex; align-items: center; gap: 14px; }
.co-head h1 { margin: 0; font-size: 22px; }
.co-head small { color: var(--text-3); }
.co-logo { width: 48px; height: 48px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tabs a { display: flex; align-items: center; gap: 6px; padding: 9px 14px; color: var(--text-2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 14px; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tabs .cnt { background: var(--danger); color: #fff; border-radius: 9px; font-size: 11px; padding: 0 6px; font-weight: 700; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; margin: 6px 0 0; font-size: 14px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; }
.kv .muted { color: var(--text-3); font-size: 12.5px; }
.lnk-sm { margin-left: 8px; font-size: 12.5px; }
.plan-now { display: flex; align-items: center; gap: 4px; font-size: 16px; margin-bottom: 10px; flex-wrap: wrap; }
.plan-feat { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; font-size: 14px; }
.plan-feat li { display: flex; gap: 8px; }
.plan-feat li::before { font-family: "bootstrap-icons"; }
.plan-feat li.y::before { content: "\f26e"; color: var(--ok); }
.plan-feat li.n { color: var(--text-3); }
.plan-feat li.n::before { content: "\f62a"; }
@media (max-width: 600px) { .kv { grid-template-columns: 1fr; gap: 2px; } .kv dd { margin-bottom: 8px; } .tabs a { padding: 8px 9px; font-size: 13px; } }

/* zapis analiz: pasek zapisu i lista */
.savebar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff; border-radius: 6px; box-shadow: var(--shadow); padding: 7px 12px; margin-bottom: 12px; font-size: 13.5px; }
.savebar.unsaved { background: #f7f9fc; box-shadow: none; border: 1px dashed #c7d3e3; color: var(--text-2); }
.savebar.closed { background: #f4f4f4; }
.sb-code { font-weight: 700; color: var(--accent); background: #eef4fb; border-radius: 5px; padding: 1px 7px; }
.sb-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46%; }
.sb-st { color: var(--text-3); display: inline-flex; gap: 5px; align-items: center; white-space: nowrap; }
.sb-st.ok { color: #0b6a0b; }
.sb-st.err { color: var(--danger); font-weight: 600; }
.sb-closed { color: var(--text-2); font-weight: 600; }
.list-page .acc-head { margin-bottom: 0; }
.acc-page.wide.list-page { max-width: 1120px; }
.grid-card { padding: 10px; }
.an-code { font-weight: 700; color: var(--accent); background: #eef4fb; border-radius: 5px; padding: 1px 7px; font-size: 12.5px; }
.an-title { font-weight: 600; }

/* tabela danych (DataGrid) */
.dg { display: flex; flex-direction: column; min-width: 0; }
.dg-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 4px 12px; }
.dg-filter { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); border: 1px solid #d1d1d1; border-radius: 6px; padding: 0 4px 0 10px; background: #fff; }
.dg-filter.on { border-color: var(--accent); background: var(--accent-light); color: var(--accent); }
.dg-filter select { border: 0; background: transparent; padding: 6px 4px; font-weight: 600; cursor: pointer; outline: none; max-width: 180px; }
.dg-search { position: relative; display: flex; align-items: center; width: 300px; max-width: 100%; }
.dg-search > .bi-search { position: absolute; left: 10px; color: var(--text-3); pointer-events: none; }
.dg-search input { width: 100%; border: 1px solid #d1d1d1; border-radius: 6px; padding: 7px 32px 7px 32px; background: #fff; outline: none; }
.dg-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15,108,189,.12); }
.dg-search input::-webkit-search-cancel-button { display: none; }
.dg-clear { position: absolute; right: 4px; border: 0; background: none; width: 26px; height: 26px; border-radius: 4px; color: var(--text-3); cursor: pointer; display: grid; place-items: center; font-size: 12px; }
.dg-clear:hover { background: #f0f0f0; color: var(--text); }
.dg-scroll { overflow-x: auto; border: 1px solid #ececec; border-radius: 8px; }
.dg-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.dg-table th { position: sticky; top: 0; background: #fafafa; border-bottom: 1px solid #e6e6e6; text-align: left; font-size: 12.5px; font-weight: 600; color: var(--text-2); padding: 0; white-space: nowrap; }
.dg-table th.c, .dg-table td.c { text-align: center; }
.dg-table th.r, .dg-table td.r { text-align: right; }
.dg-th { display: block; padding: 9px 10px; }
.dg-sort { all: unset; box-sizing: border-box; width: 100%; display: inline-flex; align-items: center; gap: 6px; padding: 9px 10px; cursor: pointer; }
.dg-table th.c .dg-sort { justify-content: center; }
.dg-table th.r .dg-sort { justify-content: flex-end; }
.dg-sort span { overflow: hidden; text-overflow: ellipsis; }
.dg-sort .bi { font-size: 11px; color: #b5b5b5; opacity: 0; transition: opacity .12s; }
.dg-sort:hover { color: var(--text); background: #f2f2f2; }
.dg-sort:hover .bi, .dg-sort.on .bi { opacity: 1; }
.dg-sort.on { color: var(--accent); }
.dg-sort.on .bi { color: var(--accent); }
.dg-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.dg-table td { padding: 9px 10px; border-bottom: 1px solid #f0f0f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.dg-table tbody tr:last-child td { border-bottom: 0; }
.dg-table tbody tr:not(.dg-info):hover td { background: #f7faff; }
.dg-table tr.clickable { cursor: pointer; }
.dg-table tr.clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.dg-table td .row-actions { opacity: .55; transition: opacity .12s; }
.dg-table tr:hover td .row-actions, .dg-table tr:focus-within td .row-actions { opacity: 1; }
.dg-info td { white-space: normal; padding: 0; }
.dg-info .grid-empty .btn { margin-left: 6px; }
.dg-loading { display: flex; gap: 8px; align-items: center; justify-content: center; padding: 30px; color: var(--text-2); }
.dg-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 4px 2px; font-size: 13px; color: var(--text-2); }
.dg-pager { display: inline-flex; align-items: center; gap: 2px; }
.dg-pg { border: 0; background: none; min-width: 28px; height: 28px; border-radius: 4px; cursor: pointer; font-weight: 600; color: var(--text-2); }
.dg-pg:hover { background: #f0f0f0; color: var(--text); }
.dg-pg.on { background: var(--accent); color: #fff; }
.dg-gap { padding: 0 4px; color: var(--text-3); }
.dg-pager .ibtn:disabled { opacity: .35; cursor: default; background: none; }
@media (max-width: 640px) { .dg-search { width: 100%; } }
.st-pill { font-size: 12px; border-radius: 10px; padding: 1px 9px; white-space: nowrap; }
.st-pill.open { background: #eef4fb; color: var(--accent); }
.st-pill.closed { background: #e7f6e7; color: #0e5a0e; }
.warn-num { color: #bc4b09; font-weight: 700; }
.muted { color: var(--text-3); }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.grid-empty { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 30px; color: var(--text-2); text-align: left; }
.grid-empty .bi { font-size: 30px; color: var(--accent); }

.grid-card { overflow-x: auto; min-width: 0; }

/* plan Rozszerzony: zespoły, działy, przełącznik planu, przypisania, pliki z dowodami */
.cnt-lim { font-size: 12px; font-weight: 600; color: var(--text-3); background: #f0f0f0; border-radius: 9px; padding: 1px 8px; }
.edit-box { border: 1px solid #d7e3f3; background: #f7faff; border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; }
.edit-box select, .edit-box input[type=number] { width: 100%; border: 1px solid #d1d1d1; border-radius: 4px; padding: 6px 9px; font-size: 13.5px; background: #fff; }
.pick { display: flex; flex-wrap: wrap; gap: 6px; }
.pick label { display: flex; gap: 5px; align-items: center; border: 1px solid #ddd; border-radius: 14px; padding: 3px 10px; font-size: 13px; cursor: pointer; background: #fff; }
.pick label.on { border-color: var(--accent); background: #eef4fb; }
.team-row { border-top: 1px solid #f0f0f0; padding: 10px 0; }
.team-h { display: flex; align-items: center; gap: 10px; }
.team-d { font-size: 13px; color: var(--text-2); margin-top: 3px; }
.chips-ro { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip-u { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; background: #f5f5f5; border-radius: 14px; padding: 2px 9px 2px 3px; }
.chip-u.lead { background: #eef4fb; color: var(--accent); font-weight: 600; }
.tabs .lk { font-size: 10px; color: var(--text-3); }
.dev-plan { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding: 8px 12px; border: 1px dashed #c9a227; border-radius: 8px; background: #fffbea; font-size: 13px; }
.dev-plan .seg { display: inline-flex; }
.sb-sel { border: 1px solid #d1d1d1; border-radius: 4px; padding: 2px 6px; font-size: 12.5px; background: #fff; max-width: 170px; }
.ev { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.ev-f { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.ev-f > .bi { color: var(--accent); }
.ev-n { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; text-align: left; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.ev-n:hover { text-decoration: underline; }
.ev-f small { color: var(--text-3); white-space: nowrap; }
.ev-add { position: relative; display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; border: 1px dashed #b9cde6; border-radius: 6px; padding: 4px 10px; font-size: 12.5px; color: var(--accent); cursor: pointer; background: #f7faff; }
.ev-add input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ev-add.busy { opacity: .7; }
.popup.wide { width: min(900px, 100%); }
.ev-img { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; border-radius: 6px; }

/* plan i płatności */
.offers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.offer { background: #fff; border-radius: 10px; box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 6px; border: 2px solid transparent; }
.offer.hl { border-color: #c7dcf3; }
.offer.cur { border-color: var(--ok); }
.offer h3 { margin: 0; font-size: 17px; }
.offer .price b { font-size: 24px; }
.offer .price small, .price-g { color: var(--text-3); font-size: 12.5px; }
.offer .plan-feat { flex: 1; margin: 6px 0 10px; font-size: 13px; }
.offer-cur { display: flex; align-items: center; justify-content: center; gap: 6px; color: #0b6a0b; font-weight: 600; font-size: 13.5px; padding: 6px; background: #f2f9f2; border-radius: 6px; }
.offer-cur.sched { color: #7a5d00; background: #fffbea; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.st-pill.err { background: #fdf3f5; color: var(--danger); }
.warn-list { margin: 0; padding-left: 18px; }
.trial-hint { text-align: center; font-size: 12px; color: var(--text-3); margin: 6px 0 0; }
.banner.warn .btn { margin-left: auto; }
@media (max-width: 760px) { .offers { grid-template-columns: 1fr; } }
.tabs { overflow-x: auto; white-space: nowrap; scrollbar-width: thin; }
.tabs a { flex: none; }
.tabs { overflow-y: hidden; }

/* Podpowiedź przyczyn przez AI */
.ibtn.ai { color: var(--ai); }
.ibtn.ai:hover { background: #f3eefc; color: var(--ai); }
.sg-q { font-weight: 600; margin: 0 0 10px; }
.sg-busy { display: flex; align-items: center; gap: 8px; color: var(--text-2); padding: 12px 0; }
.sg-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.sg-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; border: 1px solid var(--line, #e0e0e0); border-radius: 6px; padding: 8px 10px; }
.sg-list li.added { background: #f4faf4; }
.sg-t { grid-column: 1; }
.sg-cat { grid-column: 1; font-size: 12px; color: var(--text-2); }
.sg-list li .btn { grid-column: 2; grid-row: 1 / span 2; white-space: nowrap; }
@media (max-width: 560px) { .sg-list li { grid-template-columns: 1fr; } .sg-list li .btn { grid-column: 1; grid-row: auto; justify-self: start; } }
.note.warn { color: #8a5300; background: #fff8e6; border-radius: 4px; padding: 6px 8px; font-size: 13px; }
.trial-badge { display: inline-flex; align-items: center; gap: 6px; background: #e8f5e9; color: #1b6e20; font-weight: 700; font-size: 13px; border-radius: 999px; padding: 3px 10px; margin: 0 0 6px; }
.h-tag { display: inline-block; vertical-align: middle; font-size: 12px; font-weight: 600; color: var(--ai); background: #f3eefc; border-radius: 999px; padding: 2px 10px; margin-left: 6px; }
