

/* ======================================================================
   Komponenty z projektu wyglądu (podgląd Xerpoo)
   ====================================================================== */
/* ---------- Dashboard ---------- */
.hello h1 { font-size: 30px; }
.dash { display: grid; gap: 20px; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "news news ai" "web web proj" "chp chr proj"; grid-template-rows: auto auto 1fr; }
.a-news { grid-area: news; } .a-ai { grid-area: ai; } .a-web { grid-area: web; } .a-proj { grid-area: proj; } .a-chp { grid-area: chp; } .a-chr { grid-area: chr; }
.news-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; }
.news-feat { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); text-decoration: none; display: flex; flex-direction: column; min-height: 252px; background: var(--bg-soft); }
.news-art { flex: 1; min-height: 130px; position: relative; overflow: hidden;
  background-image: linear-gradient(var(--line-2) 1px, transparent 1px), linear-gradient(90deg, var(--line-2) 1px, transparent 1px); background-size: 22px 22px; }
.news-art::after { content: ""; position: absolute; width: 260px; height: 260px; right: -60px; top: -90px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--brand) 40%, transparent), transparent 65%); }
.news-art::before { content: ""; position: absolute; width: 200px; height: 200px; left: 30px; bottom: -120px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--brand-2) 30%, transparent), transparent 65%); }
.news-feat .txt { padding: 14px 16px 16px; display: grid; gap: 6px; background: var(--card); border-top: 1px solid var(--line); }
.news-feat h3 { margin: 0; font-size: 17px; line-height: 1.3; letter-spacing: -.01em; text-wrap: balance; }
.news-meta { font-size: 12px; color: var(--subtle); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.news-list { display: grid; gap: 0; }
.news-item { display: grid; gap: 4px; padding: 12px 2px; border-bottom: 1px solid var(--line); text-decoration: none; }
.news-item:first-child { padding-top: 2px; }
.news-item:last-child { border-bottom: 0; }
.news-item h3 { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.35; }
.news-item:hover h3, .news-feat:hover h3 { color: var(--brand); }
.new-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); display: inline-block; }

.ai-body { display: grid; gap: 12px; }
.ai-hero { display: flex; gap: 12px; align-items: center; }
.ai-orb { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); flex: none; }
.ai-orb .i { stroke: #fff; }
.ai-hero b { display: block; font-size: 15px; }
.ai-hero span { font-size: 12.5px; color: var(--muted); }
.sugg { display: grid; gap: 8px; }
.sugg button { text-align: left; display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-soft); cursor: pointer; font-size: 13px; color: var(--fg); }
.sugg button:hover { border-color: color-mix(in srgb, var(--brand) 50%, transparent); }
.sugg button .i { color: var(--brand); }
.ask { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 14px; padding: 6px 6px 6px 14px; background: var(--card); }
.ask input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; height: 32px; }
.ask button { width: 34px; height: 34px; border-radius: 10px; border: 0; background: var(--btn); color: var(--btn-fg); display: grid; place-items: center; cursor: pointer; }

.web-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.web { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--card); }
.web.is-live { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); background: color-mix(in srgb, var(--bad) 5%, var(--card)); }
.web-when { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); }
.web-date { display: flex; align-items: center; gap: 8px; }
.web-day { width: 40px; height: 44px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; line-height: 1; text-align: center; background: var(--bg-soft); }
.web-day b { font-size: 16px; display: block; } .web-day small { font-size: 10px; text-transform: uppercase; color: var(--subtle); font-weight: 600; letter-spacing: .05em; }
.web h3 { margin: 0; font-size: 14.5px; line-height: 1.35; }
.web .who { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.web .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--subtle); }
.live-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--bad); }
.live-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 0 color-mix(in srgb, var(--bad) 60%, transparent); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.proj-list { display: grid; gap: 8px; padding: 0 12px 12px; }
.proj { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px; border-radius: 14px; border: 1px solid transparent; text-decoration: none; }
.proj:hover { background: var(--bg-soft); border-color: var(--line); }
.proj .tile { grid-row: span 2; width: 36px; height: 36px; font-size: 11.5px; }
.proj-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; }
.proj-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-due { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.proj-due b { color: var(--fg); font-weight: 600; }
.proj-prog { display: flex; align-items: center; gap: 10px; }
.proj-prog .bar { flex: 1; }
.proj-prog span.num { font-size: 12px; color: var(--muted); width: 34px; text-align: right; }
.proj .chev { grid-row: span 2; color: var(--subtle); }
.proj-alert { grid-column: 2 / 3; display: flex; align-items: flex-start; gap: 6px; font-size: 12px; font-weight: 500; margin-top: 4px; line-height: 1.4; }
.proj-alert .i { width: 14px; height: 14px; margin-top: 2px; }
.proj.is-bad { background: color-mix(in srgb, var(--bad) 7%, transparent); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.proj.is-bad .proj-due b, .proj.is-bad .proj-alert { color: var(--bad); }
.proj.is-warn { background: color-mix(in srgb, var(--warn) 6%, transparent); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.proj.is-warn .proj-alert { color: var(--warn); }
.proj-ok { font-size: 12px; color: var(--ok); font-weight: 600; display: flex; align-items: center; gap: 5px; grid-column: 2 / 3; margin-top: 2px; }
.proj-ok .i { width: 13px; height: 13px; }

.chat-list { display: grid; padding: 0 8px 10px; }
.chat-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 10px; border-radius: 12px; text-decoration: none; }
.chat-row:hover { background: var(--bg-soft); }
.chat-row .avatar, .chat-row .tile { grid-row: span 2; }
.chat-row .nm { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row .nm small { font-weight: 500; color: var(--subtle); font-size: 12px; margin-left: 4px; }
.chat-row .tm { font-size: 12px; color: var(--subtle); text-align: right; }
.chat-row .msg { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row .cnt { justify-self: end; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: var(--btn-fg); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
:root .chat-row .cnt { color: #fff; }
.chat-row.unread .msg { color: var(--fg); font-weight: 500; }
.mini-search { margin: 0 18px 8px; display: flex; align-items: center; gap: 8px; height: 36px; border-radius: 10px; border: 1px solid var(--line); padding: 0 10px; color: var(--subtle); background: var(--bg-soft); }
.mini-search input { border: 0; background: none; outline: 0; min-width: 0; flex: 1; font-size: 13px; }

/* ---------- Kanban ---------- */
.kan-wrap { overflow-x: auto; padding-bottom: 6px; }
.kan { display: grid; grid-template-columns: repeat(5, minmax(250px, 1fr)); gap: 14px; min-width: 1310px; }
.kcol { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.kcol-h { display: flex; align-items: center; gap: 8px; padding: 4px 6px 6px; }
.kcol-h b { font-size: 13.5px; }
.kcol-h .cnt { font-size: 12px; color: var(--subtle); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; }
.kcol-h .sum { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 600; }
.kcol-h .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--x); }
.kcard { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 8px; cursor: grab; text-decoration: none; }
.kcard:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.kcard .t { font-weight: 600; font-size: 13.5px; display: flex; justify-content: space-between; gap: 8px; }
.kcard .amt { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.kcard .meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--subtle); }
.kadd { border: 1px dashed var(--line-2); background: none; border-radius: 12px; padding: 9px; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; }
.kadd:hover { color: var(--fg); border-color: var(--brand); }

/* ---------- Karta klienta ---------- */
.client-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.client-logo { width: 60px; height: 60px; border-radius: 16px; font-size: 20px; }
.client-head h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.client-head .meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 4px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.stack { display: grid; gap: 20px; min-width: 0; }
.ul-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.ul-tabs button { background: none; border: 0; padding: 10px 0 12px; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.ul-tabs button[aria-selected="true"] { color: var(--fg); border-color: var(--brand); font-weight: 600; }
.ul-tabs .c { font-size: 11px; color: var(--subtle); background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; }
.dl { display: grid; gap: 12px; margin: 0; }
.dl div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; font-size: 13px; }
.dl dt { color: var(--subtle); } .dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.timeline { display: grid; gap: 0; }
.tl { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: start; }
.tl:last-child { border-bottom: 0; }
.tl .tile { width: 32px; height: 32px; border-radius: 10px; }
.tl .tile .i { width: 16px; height: 16px; }
.tl b { font-size: 13.5px; font-weight: 600; } .tl p { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.tl time { font-size: 12px; color: var(--subtle); white-space: nowrap; }
.contact { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.contact:last-child { border-bottom: 0; }
.contact b { font-size: 13.5px; display: block; } .contact small { color: var(--subtle); font-size: 12px; }
.contact .acts { margin-left: auto; display: flex; gap: 6px; }
.contact .icon-btn { width: 32px; height: 32px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mini-stats > div { padding: 16px 18px; border-right: 1px solid var(--line); display: grid; gap: 2px; }
.mini-stats > div:last-child { border-right: 0; }
.mini-stats .l { font-size: 12px; color: var(--subtle); } .mini-stats .v { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }

/* ---------- Dokumenty ---------- */
.docs { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; align-items: start; }
.with-sub { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 20px; align-items: start; }
.with-sub > .tree { position: sticky; top: 84px; max-height: calc(100dvh - 104px); overflow-y: auto; }
.sub-main { min-width: 0; display: grid; gap: 20px; container-type: inline-size; }
.tree { padding: 10px; display: grid; gap: 1px; align-content: start; }
.tree .lbl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree a .c.hot { color: var(--btn-fg); background: var(--brand); border-radius: 999px; padding: 0 7px; font-weight: 700; }
:root .tree a .c.hot { color: #fff; }
.tree a { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 9px; text-decoration: none; color: var(--muted); font-size: 13.5px; }
.tree a:hover { background: var(--bg-soft); color: var(--fg); }
.tree a.on { background: color-mix(in srgb, var(--brand) 11%, transparent); color: var(--fg); font-weight: 600; }
.tree a.on .i { color: var(--brand); }
.tree a .c { margin-left: auto; font-size: 11.5px; color: var(--subtle); }
.tree .sub { display: grid; gap: 1px; }
.tree a.onp { color: var(--fg); font-weight: 600; }
.tree a.onp .i { color: var(--brand); }
.tree h3 { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--subtle); margin: 10px 10px 4px; font-weight: 600; }
.ft { width: 34px; height: 38px; border-radius: 7px; display: grid; place-items: center; font-size: 9.5px; font-weight: 800; letter-spacing: .03em; color: var(--x); background: color-mix(in srgb, var(--x) 13%, transparent); border: 1px solid color-mix(in srgb, var(--x) 25%, transparent); flex: none; }
.ft.pdf { --x: var(--bad); } .ft.doc { --x: var(--c-blue); } .ft.xls { --x: var(--c-green); } .ft.ppt { --x: var(--c-amber); }
.fname { display: flex; align-items: center; gap: 12px; }
.fname b { display: block; font-weight: 600; font-size: 13.5px; } .fname small { color: var(--subtle); font-size: 12px; }
.sign-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 18px 18px; }
.sign { border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--line)); background: color-mix(in srgb, var(--warn) 6%, var(--card)); border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.sign .txt { min-width: 0; flex: 1; } .sign b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .sign small { color: var(--muted); font-size: 12px; }

/* ---------- Finanse ---------- */
.fin { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; }
.chart .cb > svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .cb { min-width: 0; overflow: hidden; }
.chart .ax { font-size: 11px; fill: var(--subtle); font-family: var(--font); }
.chart .gl { stroke: var(--line); stroke-width: 1; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; background: var(--x); display: inline-block; }
.hbars { display: grid; gap: 14px; }
.hb { display: grid; gap: 6px; }
.hb .row { display: flex; justify-content: space-between; font-size: 13px; gap: 10px; }
.hb .row span:last-child { color: var(--muted); }
.aging { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.age { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 6px; }
.age .l { font-size: 12px; color: var(--subtle); } .age .v { font-weight: 700; font-size: 16px; }
.age.bad { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); } .age.bad .v { color: var(--bad); }
.pay { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pay:last-child { border-bottom: 0; }
.pay .txt { flex: 1; min-width: 0; } .pay b { font-size: 13.5px; display: block; } .pay small { color: var(--subtle); font-size: 12px; }
.pay .amt { font-weight: 700; }

/* ---------- Kalendarz ---------- */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.cal-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cal-head h2 { margin: 0; font-size: 17px; }
.cal-head .nav2 { display: flex; gap: 6px; margin-left: auto; }
.cal-head .icon-btn { width: 34px; height: 34px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal .dow { padding: 10px; font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--subtle); border-bottom: 1px solid var(--line); }
.cal .day { min-height: 104px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal .day:nth-child(7n) { border-right: 0; }
.cal .day.out .d { color: var(--subtle); opacity: .6; }
.cal .day.we { background: color-mix(in srgb, var(--fg) 2%, transparent); }
.cal .d { font-size: 12.5px; font-weight: 600; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal .day.today .d { background: var(--btn); color: var(--btn-fg); }
.ev { --x: var(--brand); font-size: 11.5px; font-weight: 600; padding: 4px 7px; border-radius: 7px; background: color-mix(in srgb, var(--x) 13%, transparent); color: var(--x); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev.live { --x: var(--bad); } .ev.hr { --x: var(--c-cyan); }
.up-list { display: grid; }
.up { display: flex; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); align-items: center; }
.up .txt { min-width: 0; flex: 1; } .up b { display: block; font-size: 13.5px; } .up small { color: var(--subtle); font-size: 12px; }
.rec { display: flex; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); align-items: center; text-decoration: none; }
.rec .thumb { width: 64px; height: 40px; border-radius: 8px; background: var(--bg-soft); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); flex: none; }
.rec .txt { min-width: 0; flex: 1; } .rec b { display: block; font-size: 13.5px; } .rec small { color: var(--subtle); font-size: 12px; }

/* ---------- Komunikator ---------- */
.chat { display: grid; grid-template-columns: 320px minmax(0, 1fr) 280px; height: calc(100dvh / var(--z) - 180px); min-height: 520px; overflow: hidden; }
.chat > * { min-width: 0; min-height: 0; }
.chat-side { border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.chat-side .tabs { margin: 14px 14px 10px; }
.chat-side .scroll { overflow-y: auto; flex: 1; padding: 0 6px 10px; }
.chat-side h3 { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--subtle); margin: 12px 12px 4px; font-weight: 600; }
.chat-row.on { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.conv { display: flex; flex-direction: column; }
.conv-h { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.conv-h b { display: block; } .conv-h small { color: var(--subtle); font-size: 12px; }
.conv-h .acts { margin-left: auto; display: flex; gap: 6px; }
.msgs { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.daysep { align-self: center; font-size: 11.5px; color: var(--subtle); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.m { display: flex; gap: 10px; max-width: 78%; }
.m .bub { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 9px 12px; font-size: 13.5px; }
.m .who { font-size: 12px; color: var(--subtle); margin-bottom: 3px; } .m .who b { color: var(--fg); font-weight: 600; margin-right: 6px; }
.m.me { align-self: flex-end; flex-direction: row-reverse; }
.m.me .bub { background: var(--btn); color: var(--btn-fg); border-color: var(--btn); border-radius: 14px 4px 14px 14px; }
.m.me .who { text-align: right; }
.att { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); }
.att b { font-size: 13px; display: block; } .att small { color: var(--subtle); font-size: 11.5px; }
.composer { border-top: 1px solid var(--line); padding: 12px 14px; display: flex; gap: 8px; align-items: center; }
.composer .ask { flex: 1; }
.chat-info { border-left: 1px solid var(--line); overflow-y: auto; padding: 16px; display: grid; gap: 16px; align-content: start; }
.chat-info h3 { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--subtle); margin: 0 0 6px; font-weight: 600; }
.mem { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.mem small { color: var(--subtle); margin-left: auto; font-size: 12px; }

/* ---------- Ustawienia ---------- */
.settings { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; align-items: start; }
.set-nav { padding: 8px; display: grid; gap: 1px; }
.set-nav a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 9px; text-decoration: none; color: var(--muted); font-size: 13.5px; }
.set-nav a:hover { background: var(--bg-soft); color: var(--fg); }
.set-nav a.on { background: color-mix(in srgb, var(--brand) 11%, transparent); color: var(--fg); font-weight: 600; }
.set-nav a.on .i { color: var(--brand); }
.form-sec { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; padding: 22px; border-bottom: 1px solid var(--line); }
.form-sec:last-of-type { border-bottom: 0; }
.form-sec h3 { margin: 0; font-size: 14.5px; } .form-sec p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.fgrid .full { grid-column: 1 / -1; }
.drop { border: 1.5px dashed var(--line-2); border-radius: 14px; padding: 20px; display: flex; align-items: center; gap: 16px; }
.drop .brand-mark { width: 56px; height: 56px; border-radius: 14px; }
.drop .brand-mark svg { width: 28px; height: 28px; }
.save-bar { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--bg-soft); border-radius: 0 0 var(--r-lg) var(--r-lg); flex-wrap: wrap; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.switch b { font-size: 13.5px; font-weight: 600; display: block; } .switch small { color: var(--muted); font-size: 12.5px; }
.tgl { appearance: none; -webkit-appearance: none; width: 40px; height: 24px; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer; flex: none; transition: background .2s; }
.tgl::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.tgl:checked { background: var(--brand); } .tgl:checked::after { transform: translateX(16px); }


/* ---------- Dokumenty: podkategorie, lista / kafelki ---------- */
.icon-btn.sm { width: 32px; height: 32px; }
.row-acts { display: inline-flex; gap: 6px; }
.tabs button { display: inline-flex; align-items: center; gap: 6px; }
.tabs button[aria-pressed="true"] { background: var(--card); color: var(--fg); box-shadow: var(--shadow); font-weight: 600; }
.perm-bar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 12px 16px; }
.perm-bar > label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.perm-bar .select { width: auto; height: 36px; max-width: 100%; }
.perm-bar .more { margin-left: auto; white-space: nowrap; font-size: 12.5px; color: var(--muted); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.perm-bar .more:hover { color: var(--fg); }
.perm-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.dpath { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--subtle); min-width: 0; }
.dpath button { background: none; border: 0; padding: 4px 6px; border-radius: 6px; cursor: pointer; color: var(--muted); font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.dpath button:hover { background: var(--bg-soft); color: var(--fg); }
.dpath button:last-child { color: var(--fg); font-weight: 650; }
.folds { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; padding: 0 18px 18px; }
.fold { text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 14px; display: grid; gap: 6px; cursor: pointer; color: var(--fg); align-content: start; }
.fold:hover { border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); }
.fold .tile { width: 36px; height: 36px; margin-bottom: 4px; }
.fold b { font-size: 13.5px; } .fold small { font-size: 12px; color: var(--subtle); }
.fold .acc { font-size: 11.5px; color: var(--muted); display: flex; gap: 5px; align-items: center; }
.fold .acc .i { width: 13px; height: 13px; }
.fold.new { border-style: dashed; color: var(--muted); justify-items: center; align-content: center; text-align: center; min-height: 118px; font-weight: 500; }
.fold.new:hover { color: var(--fg); }
.ftiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; padding: 18px; }
.ftile { border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; background: var(--card); }
.ftile:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.ftile .prev { height: 96px; display: grid; place-items: center; background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.ftile .prev .ft { width: 46px; height: 54px; font-size: 11px; }
.ftile .body { padding: 12px; display: grid; gap: 6px; flex: 1; align-content: start; justify-items: start; }
.ftile b { font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ftile small { font-size: 12px; color: var(--subtle); }
.ftile .acts { display: flex; gap: 6px; padding: 0 12px 12px; align-items: center; flex-wrap: wrap; }
.empty { padding: 40px 20px; text-align: center; display: grid; gap: 10px; justify-items: center; color: var(--muted); }
.empty > .i { width: 28px; height: 28px; color: var(--subtle); }
.empty b { color: var(--fg); font-size: 15px; }

.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.btn.danger:hover { background: color-mix(in srgb, var(--bad) 8%, var(--card)); }
.btn.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.icon-btn.danger:hover { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.lockc { color: var(--subtle); display: inline-grid; place-items: center; cursor: help; }
.adm-lock { margin-left: auto; color: var(--subtle); display: inline-flex; }
.adm-lock .i { width: 13px; height: 13px; }
.tree a .adm-lock + .c { margin-left: 6px; }
.ed-head .btn.danger { margin-left: 4px; }
/* ---------- Okna dialogowe i komunikaty ---------- */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 16px; }
.modal-card { width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--card); color: var(--fg); border: 1px solid var(--line); border-radius: 20px; padding: 22px; display: grid; gap: 16px; box-shadow: var(--shadow); font-family: var(--font); font-size: 14px; }
.modal-card.wide { width: min(700px, 100%); }
.modal-card h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; }
legend { font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 0; margin-bottom: 8px; }
.radio, .cbx { display: flex; gap: 8px; align-items: center; font-size: 13.5px; cursor: pointer; }
.radio input { accent-color: var(--brand); width: 16px; height: 16px; }
.cb-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); }
.type-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.type-pick label { position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; cursor: pointer; align-items: center; }
.type-pick input { position: absolute; opacity: 0; pointer-events: none; }
.type-pick label:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, transparent); }
.type-pick label:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.type-pick .i { grid-row: span 2; color: var(--brand); }
.type-pick small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.toast { position: fixed; right: max(20px, env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 120; background: var(--btn); color: var(--btn-fg); padding: 11px 16px; border-radius: 12px; font: 600 13.5px var(--font); display: flex; gap: 8px; align-items: center; box-shadow: var(--shadow); max-width: calc(100vw - 40px); }

/* ---------- Panel uprawnień ---------- */
.kbtn { text-align: left; cursor: pointer; color: var(--fg); font: inherit; }
.kbtn:hover { border-color: var(--line-2); }
.kbtn.on { border-color: var(--brand); }
.adm { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 20px; align-items: start; }
.slist-card { position: sticky; top: 84px; }
.slist { display: grid; gap: 2px; padding: 0 8px 8px; max-height: calc(100dvh / var(--z) - 250px); overflow-y: auto; }
.srow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 10px; border-radius: 12px; border: 1px solid transparent; background: none; text-align: left; cursor: pointer; color: var(--fg); width: 100%; font: inherit; }
.srow:hover { background: var(--bg-soft); }
.srow[aria-current="true"] { background: color-mix(in srgb, var(--brand) 10%, transparent); border-color: color-mix(in srgb, var(--brand) 28%, transparent); }
.srow .avatar, .srow .tile { grid-row: span 2; }
.srow .tile { width: 34px; height: 34px; }
.srow b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow small { grid-column: 2 / 4; font-size: 12px; color: var(--subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.type-pills { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 10px; }
.tp { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; color: var(--muted); font-family: inherit; }
.tp[aria-pressed="true"] { background: var(--btn); color: var(--btn-fg); border-color: var(--btn); }
.pill.t-pra { --x: var(--brand); } .pill.t-akc { --x: var(--c-cyan); } .pill.t-kli { --x: var(--c-green); } .pill.t-par { --x: var(--c-amber); }
.editor { min-width: 0; }
.ed-head { display: flex; gap: 14px; align-items: center; padding: 18px 20px; flex-wrap: wrap; }
.ed-head h2 { margin: 0; font-size: 19px; letter-spacing: -.01em; }
.ed-head > .pill { margin-left: auto; }
.ed-head .avatar { width: 44px; height: 44px; font-size: 15px; }
.ed-sec { padding: 18px 20px; border-top: 1px solid var(--line); display: grid; gap: 14px; min-width: 0; }
.ed-sec h3 { margin: 0; font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.ed-sec h3 .muted { font-weight: 500; font-size: 12.5px; }
.ed-h { margin: 0 0 8px !important; font-size: 12.5px !important; font-weight: 600; color: var(--muted); }
.ed-row { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.hint { margin: 0; font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 3px 3px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-soft); font-size: 12.5px; font-weight: 500; }
.chip button { width: 22px; height: 22px; border-radius: 50%; border: 0; background: none; cursor: pointer; display: grid; place-items: center; color: var(--subtle); }
.chip button:hover { background: var(--line); color: var(--fg); }
.chip .avatar.xs { width: 20px; height: 20px; font-size: 9px; }
.dotc { width: 8px; height: 8px; border-radius: 50%; background: var(--x); }
.add-sel { height: 30px; border-radius: 999px; border: 1px dashed var(--line-2); background: var(--card); padding: 0 10px; font-size: 12.5px; color: var(--muted); cursor: pointer; max-width: 100%; }
.mx-wrap { border: 1px solid var(--line); border-radius: 12px; }
table.mx { min-width: 660px; }
.mx th { font-size: 10.5px; }
.mx th.c, .mx td.c { text-align: center; width: 84px; padding-left: 4px; padding-right: 4px; }
.mx td { padding-top: 8px; padding-bottom: 8px; }
.mx tr.secrow td { background: var(--bg-soft); }
.mx .exp { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer; font-weight: 600; padding: 0; color: var(--fg); font: inherit; font-weight: 600; }
.mx .exp .i { transition: transform .2s; color: var(--subtle); }
.mx .exp[aria-expanded="false"] .i { transform: rotate(-90deg); }
.mx td.subl { padding-left: 40px; color: var(--muted); }
.inh { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: color-mix(in srgb, var(--brand) 20%, transparent); color: var(--brand); cursor: help; vertical-align: middle; }
.inh .i { width: 13px; height: 13px; stroke-width: 2.4; }
.xgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.xrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.xrow label { cursor: pointer; min-width: 0; }
.xrow b { font-size: 13.5px; font-weight: 500; display: block; }
.xrow small { font-size: 12px; color: var(--subtle); }
.xr { display: flex; align-items: center; gap: 10px; flex: none; }
.xlock { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; color: var(--brand); font-weight: 600; white-space: nowrap; }
.lim { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.lim .input { width: 104px; height: 32px; }
.log-row { display: flex; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); align-items: flex-start; }
.log-row:first-child { border-top: 0; }
.log-row p { margin: 0; font-size: 13.5px; } .log-row small { color: var(--subtle); font-size: 12px; }
@container (max-width: 900px) {
  .adm { grid-template-columns: minmax(0, 1fr); }
  .slist-card { position: static; } .slist { max-height: 330px; }
  .xgrid { grid-template-columns: minmax(0, 1fr); }
}
@container (max-width: 620px) { .pgrid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 680px) { .type-pick, .cb-list { grid-template-columns: minmax(0, 1fr); } .perm-bar .more { margin-left: 0; } }


/* ---------- AI Xerpoo ---------- */
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--muted); text-decoration: none; white-space: nowrap; }
.tabs a[aria-current="page"] { background: var(--card); color: var(--fg); box-shadow: var(--shadow); font-weight: 600; }
.ai { display: grid; grid-template-columns: 272px minmax(0, 1fr); height: calc(100dvh / var(--z) - 190px); min-height: 580px; overflow: hidden; }
.ai-side { border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; padding: 14px; min-height: 0; background: var(--bg-soft); }
.ai-new { width: 100%; }
.ai-side .mini-search { margin: 0; background: var(--card); }
.ai-hist { flex: 1; overflow-y: auto; display: grid; align-content: start; gap: 1px; margin: 0 -6px; padding: 0 6px; }
.ai-hist h3 { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--subtle); margin: 12px 8px 4px; font-weight: 600; }
.ai-h { display: flex; gap: 9px; align-items: center; width: 100%; text-align: left; background: none; border: 1px solid transparent; padding: 8px 9px; border-radius: 10px; color: var(--muted); cursor: pointer; font: inherit; font-size: 13px; }
.ai-h span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-h:hover { background: color-mix(in srgb, var(--fg) 5%, transparent); color: var(--fg); }
.ai-h[aria-current="true"] { background: var(--card); color: var(--fg); border-color: var(--line); box-shadow: var(--shadow); font-weight: 600; }
.ai-lib { display: flex; gap: 8px; align-items: center; text-decoration: none; color: var(--muted); font-size: 13px; padding: 12px 8px 2px; border-top: 1px solid var(--line); }
.ai-lib:hover { color: var(--fg); }
.ai-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.ai-top { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.ai-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ai-top .icon-btn { margin-left: auto; }
.ai-scroll { flex: 1; overflow-y: auto; padding: 28px 20px 12px; }
.ai-col { max-width: 780px; margin: 0 auto; width: 100%; display: grid; gap: 26px; }
.ai-bottom .ai-col { gap: 0; }
.am.u { display: flex; justify-content: flex-end; }
.ub { background: var(--bg-soft); border: 1px solid var(--line); padding: 10px 15px; border-radius: 20px 20px 6px 20px; max-width: 80%; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; display: grid; gap: 8px; }
.am.a { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 14px; }
.ai-mark { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-2)); flex: none; }
.ai-mark .i { stroke: #fff; width: 17px; height: 17px; }
.ai-mark.lg { width: 56px; height: 56px; border-radius: 18px; }
.ai-mark.lg .i { width: 28px; height: 28px; }
.ab { font-size: 15px; line-height: 1.7; min-width: 0; padding-top: 3px; }
.ab p { margin: 0 0 12px; max-width: 70ch; }
.ab ol, .ab ul { margin: 0 0 12px; padding-left: 22px; }
.ab li { margin: 5px 0; }
.ab li::marker { color: var(--subtle); }
.ab h4 { margin: 0 0 8px; font-size: 15px; }
.ab .pill { vertical-align: 1px; }
.ab.fresh > * { animation: rise .4s both; }
.ab.fresh > *:nth-child(2) { animation-delay: .07s; } .ab.fresh > *:nth-child(3) { animation-delay: .14s; } .ab.fresh > *:nth-child(4) { animation-delay: .21s; }
.ab.fresh > *:nth-child(5) { animation-delay: .28s; } .ab.fresh > *:nth-child(n+6) { animation-delay: .35s; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.ai-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; margin: 4px 0 14px; }
.ai-table table { min-width: 520px; font-size: 13.5px; }
.ai-table td { white-space: normal; padding: 10px 14px; line-height: 1.45; }
.ai-src { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 2px; font-size: 12px; color: var(--subtle); }
.ai-src a { display: inline-flex; gap: 5px; align-items: center; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--muted); line-height: 1.6; }
.ai-src a:hover { color: var(--fg); border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); }
.ai-src a .i { width: 12px; height: 12px; }
.ai-acts { display: flex; gap: 2px; margin-top: 8px; margin-left: -6px; }
.ai-acts button { width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; color: var(--subtle); cursor: pointer; display: grid; place-items: center; }
.ai-acts button:hover { background: var(--bg-soft); color: var(--fg); }
.ai-acts button[aria-pressed="true"] { color: var(--brand); }
.flip { transform: rotate(180deg); }
.ai-think { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 14px; padding-top: 4px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.ai-btns { display: flex; gap: 8px; flex-wrap: wrap; margin: 2px 0 12px; }
.draft { border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; background: var(--bg-soft); margin: 4px 0 14px; font-size: 14px; }
.draft p:last-child, .draft ol:last-child { margin-bottom: 0; }
.ai-bottom { padding: 8px 20px 14px; }
.ai-comp { border: 1px solid var(--line-2); background: var(--card); border-radius: 22px; padding: 12px 12px 10px 16px; box-shadow: var(--shadow); display: grid; gap: 8px; text-align: left; }
.ai-comp:focus-within { border-color: color-mix(in srgb, var(--brand) 60%, var(--line)); }
.ai-comp textarea { border: 0; outline: 0; resize: none; background: none; font-size: 15px; line-height: 1.5; min-height: 26px; max-height: 200px; width: 100%; padding: 2px 0; }
.ai-comp textarea::placeholder { color: var(--subtle); }
.ai-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: -4px; }
.ai-tools .sp { flex: 1; }
.ai-sel { height: 32px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); padding: 0 10px; font-size: 12.5px; color: var(--muted); max-width: 100%; cursor: pointer; }
.ai-send { width: 36px; height: 36px; border-radius: 12px; border: 0; background: var(--btn); color: var(--btn-fg); display: grid; place-items: center; cursor: pointer; }
.ai-send:disabled { opacity: .4; cursor: default; }
.ai-note { text-align: center; font-size: 11.5px; color: var(--subtle); margin: 8px 0 0; }
.ai-atts { display: flex; gap: 6px; flex-wrap: wrap; }
.ai-empty { flex: 1; overflow-y: auto; display: grid; align-content: center; justify-items: center; gap: 12px; padding: 32px 20px; text-align: center; }
.ai-empty h2 { margin: 8px 0 0; font-size: 28px; letter-spacing: -.02em; text-wrap: balance; }
.ai-empty p { margin: 0 0 8px; color: var(--muted); }
.ai-empty .ai-comp { width: min(740px, 100%); }
.ai-sugg { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 740px; margin-top: 6px; }
.ai-sugg button { display: inline-flex; gap: 7px; align-items: center; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 13px; cursor: pointer; color: var(--fg); }
.ai-sugg button .i { color: var(--brand); }
.ai-sugg button:hover { border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); }
.plib { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.pcard { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.pcard .top { display: flex; gap: 12px; align-items: center; }
.pcard .top b { font-size: 14px; } .pcard small { color: var(--subtle); font-size: 12px; }
.pcard p { margin: 0; color: var(--muted); font-size: 13px; flex: 1; }
.pcard .btn { align-self: flex-start; }
@media (max-width: 900px) {
  .ai { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; }
  .ai-side { display: none; }
  .ai-scroll { max-height: 62vh; padding-inline: 14px; }
  .ai-bottom { padding-inline: 12px; }
  .ub { max-width: 92%; }
  .am.a { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}


/* ---------- Przegląd spraw ---------- */
.pill.cy { --x: var(--c-cyan); }
.nav-badge { margin-left: auto; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0; display: inline-grid; place-items: center; }
.nav-badge + .i { margin-left: 4px; }
.tree a .c.hot.bad { background: var(--bad); }
.cstats { display: flex; gap: 8px; flex-wrap: wrap; }
.cstat { display: inline-flex; align-items: center; gap: 10px; padding: 7px 12px 7px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); text-decoration: none; color: var(--fg); }
.cstat b { font-size: 15px; }
.cstat:hover { border-color: var(--line-2); }
.cstat.on { border-color: var(--brand); }
.pills2 { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.ctable { min-width: 780px; }
.ctable td { white-space: normal; }
.ctable tr.late td { background: color-mix(in srgb, var(--bad) 5%, transparent); }
.case-t { min-width: 260px; }
.case-t button { text-align: left; background: none; border: 0; font: inherit; font-weight: 600; cursor: pointer; color: var(--fg); padding: 0; font-size: 14px; }
.case-t button:hover { color: var(--brand); }
.case-t small { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; color: var(--subtle); font-size: 12px; margin-top: 2px; }
.case-t small a { color: var(--muted); text-decoration: none; } .case-t small a:hover { color: var(--brand); }
.wait { display: inline-flex !important; gap: 5px; align-items: center; color: var(--warn) !important; font-weight: 500; font-size: 12px; }
.wait .i { width: 13px; height: 13px; }
.stage { display: grid; gap: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.dots5 { display: flex; gap: 3px; }
.dots5 i { width: 14px; height: 4px; border-radius: 2px; background: var(--line-2); }
.dots5 i.done { background: var(--brand); }
.dots5 i.cur { background: var(--brand-2); }
.who-sel { display: flex; align-items: center; gap: 6px; }
.who-sel select { height: 30px; border: 1px solid transparent; background: none; border-radius: 8px; padding: 0 4px; color: var(--fg); font: inherit; font-size: 13px; cursor: pointer; max-width: 170px; }
.who-sel select:hover, .who-sel select:focus { border-color: var(--line); }
.who-sel.none select { color: var(--warn); font-weight: 600; }
.none-av { --av: var(--warn); }
.due { white-space: nowrap; }
.due > span { display: block; }
.due-n { font-size: 12px; color: var(--subtle); display: flex !important; gap: 4px; align-items: center; }
.due-n.bad { color: var(--bad); font-weight: 600; } .due-n.warn { color: var(--warn); font-weight: 600; }
.due-n .i { width: 13px; height: 13px; }
.ccard { text-align: left; font: inherit; color: var(--fg); width: 100%; cursor: pointer; }
.ccard .t { font-size: 13.5px; }
.ccard.late { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.cdue { display: inline-flex; gap: 4px; align-items: center; } .cdue.bad { color: var(--bad); font-weight: 600; }
.modal:has(.drawer) { place-items: stretch; justify-items: end; padding: 0; }
.drawer { width: min(580px, 100%); height: 100dvh; background: var(--card); border-left: 1px solid var(--line); display: flex; flex-direction: column; font-family: var(--font); font-size: 14px; color: var(--fg); box-shadow: var(--shadow); animation: slidein .25s ease-out; }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
.dr-head { padding: 18px 20px; padding-top: calc(18px + env(safe-area-inset-top, 0px)); border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.dr-head h2 { margin: 0; font-size: 19px; letter-spacing: -.01em; line-height: 1.3; text-wrap: balance; }
.dr-body { flex: 1; overflow-y: auto; padding: 18px 20px; display: grid; gap: 20px; align-content: start; }
.dr-foot { padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; background: var(--bg-soft); }
.dr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stepper { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.stepper button { display: grid; gap: 7px; font: inherit; font-size: 11.5px; color: var(--subtle); text-align: center; background: none; border: 0; padding: 0; cursor: pointer; }
.stepper button::before { content: ""; height: 5px; border-radius: 3px; background: var(--line-2); }
.stepper button.done::before { background: var(--brand); }
.stepper button.cur { color: var(--fg); font-weight: 650; }
.stepper button.cur::before { background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.stepper button:hover { color: var(--fg); }
.dr-comment { margin-bottom: 4px; }
.urgent { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); background: color-mix(in srgb, var(--bad) 4%, var(--card)); }
.urgent .ch h2 .i { color: var(--bad); }
.urgent.ok { border-color: var(--line); background: var(--card); } .urgent.ok .ch h2 .i { color: var(--ok); }
.urg-list { display: grid; gap: 6px; padding: 0 12px 12px; }
.urg { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); text-align: left; font: inherit; color: var(--fg); cursor: pointer; width: 100%; }
.urg:hover { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.urg-t b { display: block; font-size: 14px; } .urg-t small { color: var(--subtle); font-size: 12px; }
.urg-m { display: flex; gap: 6px; }
@media (max-width: 680px) { .urg { grid-template-columns: minmax(0, 1fr); gap: 6px; } .dr-grid { grid-template-columns: minmax(0, 1fr); } }


/* ---------- Logowanie i rejestracja ---------- */
.logout { margin-left: auto; width: 34px; height: 34px; }
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--bg); }
.auth-brand { position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding-block: 32px; padding-left: max(40px, env(safe-area-inset-left, 0px)); padding-right: 40px; border-right: 1px solid var(--line); background: var(--bg-soft); }
.auth-brand::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 48px 48px; opacity: .7; -webkit-mask-image: radial-gradient(ellipse 80% 70% at 30% 40%, #000 10%, transparent 75%); mask-image: radial-gradient(ellipse 80% 70% at 30% 40%, #000 10%, transparent 75%); }
.auth-brand::after { content: ""; position: absolute; z-index: -1; width: 520px; height: 520px; right: -180px; bottom: -200px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--brand) 30%, transparent), transparent 65%); }
.auth-brand .brand { padding: 0; }
.ab-mid h1 { font-size: clamp(32px, 3.4vw, 48px); line-height: 1.07; letter-spacing: -.03em; margin: 0 0 18px; text-wrap: balance; max-width: 15ch; }
.ab-mid p { color: var(--muted); max-width: 44ch; font-size: 16px; margin: 0 0 30px; }
.ab-mid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.ab-mid li { display: flex; gap: 12px; align-items: center; font-weight: 500; }
.auth-brand small a { color: inherit; }
.auth-main { display: flex; flex-direction: column; align-items: center; min-width: 0; padding-block: 20px 24px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.auth-top { width: 100%; display: flex; align-items: center; gap: 10px; }
.auth-top .sp { flex: 1; }
.sm-brand { display: none; align-items: center; gap: 10px; padding: 0; }
.auth-card { width: min(440px, 100%); margin-block: auto; padding: 32px; border-radius: 22px; box-shadow: var(--shadow); }
.auth-card.reg { width: min(540px, 100%); margin-block: 24px auto; }
.auth-form { display: grid; gap: 16px; }
.auth-form h2 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.auth-form h2 + p { margin: 6px 0 0; }
.auth-form a:not(.btn) { color: var(--brand); font-weight: 600; text-decoration: none; }
.auth-form a:not(.btn):hover { text-decoration: underline; }
.auth .input { height: 46px; font-size: 15px; }
.btn.wide { width: 100%; height: 48px; font-size: 15px; }
.pw { position: relative; }
.pw .input { padding-right: 48px; }
.pw-eye { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: none; border-radius: 8px; color: var(--subtle); cursor: pointer; display: grid; place-items: center; }
.pw-eye:hover { color: var(--fg); background: var(--bg-soft); }
.pw-eye[aria-pressed="true"] { color: var(--brand); }
.err { color: var(--bad); font-size: 12.5px; font-weight: 500; }
.err:empty { display: none; }
.input[aria-invalid="true"] { border-color: var(--bad); }
.hint2 { font-size: 12.5px; color: var(--subtle); display: flex; gap: 6px; align-items: center; }
.hint2:empty { display: none; }
.hint2 .i { width: 14px; height: 14px; flex: none; }
.hint2.ok { color: var(--ok); } .hint2.bad { color: var(--bad); }
.lbl-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--brand); font-weight: 600; cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }
.meter { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 4px; align-items: center; }
.meter i { height: 4px; border-radius: 2px; background: var(--line-2); }
.meter span { font-size: 12px; color: var(--subtle); margin-left: 8px; min-width: 76px; text-align: right; }
.meter.s1 i:nth-child(-n+1), .meter.s0 i:nth-child(-n+1) { background: var(--bad); }
.meter.s2 i:nth-child(-n+2) { background: var(--warn); }
.meter.s3 i:nth-child(-n+3) { background: var(--c-cyan); }
.meter.s4 i { background: var(--ok); }
.rules { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; font-size: 12.5px; color: var(--subtle); }
.rules li { display: flex; gap: 6px; align-items: center; }
.rules li .i { width: 13px; height: 13px; opacity: .35; }
.rules li.ok { color: var(--ok); } .rules li.ok .i { opacity: 1; }
.cbx-top { align-items: flex-start; line-height: 1.45; }
.field .cbx { font-size: 13.5px; font-weight: 400; color: var(--fg); }
.cbx-top input { margin-top: 2px; flex: none; }
.or { display: flex; align-items: center; gap: 12px; color: var(--subtle); font-size: 12.5px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-alt { text-align: center; margin: 0; font-size: 13px; color: var(--muted); }
.auth-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.auth-ico .i { width: 26px; height: 26px; }
.auth-ico.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.otp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; border: 0; padding: 0; margin: 0; }
.auth .otp-i { text-align: center; font-size: 22px; font-weight: 700; height: 58px; padding: 0; font-variant-numeric: tabular-nums; }
.sum { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--bg-soft); display: grid; gap: 8px; font-size: 13.5px; }
.sum div { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sum span { color: var(--subtle); }
.auth-foot { font-size: 12px; margin: 16px 0 0; text-align: center; }
@media (max-width: 960px) { .auth { grid-template-columns: minmax(0, 1fr); } .auth-brand { display: none; } .sm-brand { display: flex; } .auth-card { padding: 24px 20px; } }
@media (max-width: 480px) { .auth .fgrid, .rules { grid-template-columns: minmax(0, 1fr); } .otp { gap: 6px; } .auth .otp-i { height: 52px; } }

/* ---------- Placeholder / Mapa ---------- */
.ph-card { padding: 28px; display: grid; gap: 18px; max-width: 760px; }
.ph-card h2 { margin: 0; font-size: 18px; }
.ph-card p { margin: 0; color: var(--muted); max-width: 62ch; }
.tpl-box { display: flex; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--bg-soft); flex-wrap: wrap; }
.tpl-letter { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 18px; color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); flex: none; }
.tpl-box .txt { flex: 1; min-width: 200px; } .tpl-box b { display: block; } .tpl-box small { color: var(--muted); font-size: 12.5px; }
.tpl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tpl-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 8px; text-decoration: none; background: var(--card); align-content: start; }
.tpl-card:hover { border-color: var(--brand); }
.tpl-card b { font-size: 14px; } .tpl-card small { color: var(--muted); font-size: 12.5px; }

/* Układ zależny od szerokości obszaru treści (obok podmenu) */
@container (max-width: 1080px) {
  .split, .cal-layout, .fin { grid-template-columns: minmax(0, 1fr); }
  .chat { grid-template-columns: 280px minmax(0, 1fr); } .chat-info { display: none; }
  .form-sec { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}
@container (max-width: 1000px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 760px) {
  .kpis, .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini-stats > div:nth-child(2) { border-right: 0; } .mini-stats > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .chat { grid-template-columns: minmax(0, 1fr); } .chat-side { display: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1320px) {
  .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "news news" "ai proj" "web web" "chp chr"; }
  .chat { grid-template-columns: 300px minmax(0, 1fr); } .chat-info { display: none; }
  .tpl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .split, .cal-layout, .fin { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-sec { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .web-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .web-grid .web:nth-child(3) { display: none; }
}
@media (max-width: 900px) {
  .side { position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; height: auto; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow); padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .app.nav-open .side { transform: none; }
  .app.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.45); border: 0; }
  .menu-btn { display: inline-grid; }
  .date { display: none; }
  .search { width: auto; flex: 1; min-width: 0; } .search kbd { display: none; }
  .crumb { display: none; }
  .docs, .settings, .with-sub { grid-template-columns: minmax(0, 1fr); }
  .with-sub > .tree { position: static; max-height: none; }
  .tree a { white-space: nowrap; }
  .tree, .set-nav { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
  .tree .sub, .tree h3 { display: contents; }
  .tree h3 { display: none; }
  .chat { grid-template-columns: minmax(0, 1fr); height: auto; } .chat-side { display: none; } .msgs { max-height: 60vh; }
  .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mini-stats > div:nth-child(2) { border-right: 0; } .mini-stats > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 680px) {
  .top { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); gap: 8px; }
  .content { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 18px 40px; }
  .dash { grid-template-columns: minmax(0, 1fr); grid-template-areas: "news" "ai" "proj" "web" "chp" "chr"; }
  .news-grid, .web-grid, .sign-strip, .fgrid { grid-template-columns: minmax(0, 1fr); }
  .web-grid .web:nth-child(3) { display: flex; }
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .aging { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tpl-grid { grid-template-columns: minmax(0, 1fr); }
  .ph h1, .hello h1 { font-size: 24px; }
  .cal .day { min-height: 58px; padding: 4px; } .ev { font-size: 0; padding: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--x); }
  .m { max-width: 92%; }
  .theme-btn-wrap .avatar { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
