:root {
  --bg: #f4f5f7; --panel: #fff; --col: #eceef1; --line: #dfe2e6;
  --text: #1d2228; --muted: #6b7380; --accent: #1f5eff; --accent-soft: #e8efff;
  --danger: #d93a3a; --won: #1a9a5b; --lost: #9aa1ab; --warn: #c2410c;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.4 Inter, system-ui, sans-serif; }
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 7px 14px; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: transparent; background: transparent; }

.logo { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.logo span { color: var(--muted); font-weight: 500; }

/* login */
.login { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.login-box { background: var(--panel); padding: 32px; border-radius: 14px; width: 100%; max-width: 340px;
  display: grid; gap: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.06); }
.login-box input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.err { color: var(--danger); min-height: 1em; font-size: 13px; }

/* top */
.top { display: flex; align-items: center; gap: 24px; padding: 12px 20px; background: var(--panel);
  border-bottom: 1px solid var(--line); flex-wrap: wrap; }
#tabs { display: flex; gap: 4px; }
#tabs button { border: 0; background: transparent; padding: 8px 14px; border-radius: 8px; color: var(--muted); font-weight: 500; }
#tabs button.active { background: var(--accent-soft); color: var(--accent); }
.badge { background: var(--warn); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12px; margin-left: 4px; }
.top-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
#search { padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; width: 200px; }

.toolbar { display: flex; align-items: center; gap: 16px; padding: 12px 20px; }
.toggle { display: flex; gap: 6px; align-items: center; color: var(--muted); }
.sortinfo { margin-left: auto; color: var(--muted); font-size: 13px; }

/* board */
.board { display: flex; gap: 10px; padding: 0 20px 20px; overflow-x: auto; min-height: calc(100vh - 130px); align-items: stretch; }
.col { flex: 0 0 260px; background: var(--col); border-radius: var(--radius); display: flex; flex-direction: column; }
.col-head { padding: 12px 12px 8px; }
.col-head h3 { margin: 0 0 2px; font-size: 14px; font-weight: 600; }
.col-head .meta { color: var(--muted); font-size: 12px; }
.col-body { flex: 1; padding: 4px 8px 12px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.col.drag-over { outline: 2px dashed var(--accent); outline-offset: -2px; }
.col.won .col-head h3 { color: var(--won); }
.col.lost .col-head h3 { color: var(--lost); }

.card { background: var(--panel); border-radius: 8px; padding: 10px 12px; box-shadow: 0 1px 2px rgba(0,0,0,.06);
  cursor: grab; border: 1px solid transparent; }
.card:hover { border-color: var(--line); }
.card.dragging { opacity: .4; }
.card .title { font-weight: 600; margin-bottom: 2px; word-break: break-word; }
.card .sub { color: var(--muted); font-size: 12.5px; }
.card .val { font-weight: 600; font-size: 13px; margin-top: 6px; }
.card .row { font-size: 12.5px; margin-top: 6px; color: var(--text); display: flex; gap: 6px; }
.card .row .lbl { color: var(--muted); }
.card .tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.tag { background: var(--col); color: var(--muted); font-size: 11.5px; padding: 1px 7px; border-radius: 6px; }

/* today */
.list { padding: 0 20px 20px; max-width: 900px; }
.list h2 { font-size: 15px; margin: 18px 0 8px; color: var(--muted); font-weight: 600; }
.item { background: var(--panel); border-radius: 8px; padding: 10px 14px; margin-bottom: 6px; display: flex;
  gap: 14px; align-items: center; cursor: pointer; border: 1px solid transparent; }
.item:hover { border-color: var(--line); }
.item .when { width: 90px; color: var(--muted); font-size: 13px; flex-shrink: 0; }
.item .when.late { color: var(--warn); font-weight: 600; }
.item .what { flex: 1; }
.item .kind { font-size: 12px; color: var(--muted); }
.empty { color: var(--muted); padding: 10px 0; }

/* stats */
.stats { padding: 16px 20px 30px; display: grid; gap: 16px; max-width: 1200px; }
.period { display: flex; gap: 6px; }
.period button { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 5px 12px; }
.period button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.tile { background: var(--panel); border-radius: var(--radius); padding: 14px 16px; }
.tile .k { color: var(--muted); font-size: 12.5px; }
.tile .v { font-size: 24px; font-weight: 700; margin-top: 4px; letter-spacing: -.02em; }
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; }
.panelbox { background: var(--panel); border-radius: var(--radius); padding: 14px 16px; }
.panelbox h3 { margin: 0 0 10px; font-size: 14px; }
.bar { display: grid; grid-template-columns: 130px 1fr 60px; gap: 10px; align-items: center; margin: 6px 0; font-size: 13px; }
.bar .track { background: var(--col); border-radius: 4px; height: 10px; overflow: hidden; }
.bar .fill { background: var(--accent); height: 100%; }
.bar .n { text-align: right; color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; }
td.r, th.r { text-align: right; }

/* modal */
dialog { border: 0; border-radius: 14px; padding: 0; width: min(640px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.2); }
dialog::backdrop { background: rgba(20,24,30,.35); }
#form { padding: 22px; }
#form h2 { margin: 0 0 14px; font-size: 18px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.field textarea { min-height: 90px; resize: vertical; }
.actions { display: flex; gap: 8px; margin-top: 18px; align-items: center; }
.spacer { flex: 1; }
.link { font-size: 12.5px; color: var(--accent); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(80px); background: #1d2228;
  color: #fff; padding: 10px 18px; border-radius: 8px; transition: transform .2s; z-index: 10; }
.toast.show { transform: translateX(-50%) translateY(0); }

@media (max-width: 700px) {
  .top { padding: 10px 16px; gap: 10px; }
  .top-right { margin-left: 0; width: 100%; }
  #search { flex: 1; width: auto; }
  .toolbar, .board, .list, .stats { padding-left: 16px; padding-right: 16px; }
  .grid { grid-template-columns: 1fr; }
  .sortinfo { display: none; }
  .bar { grid-template-columns: 100px 1fr 50px; }
}

.btn.won { background: var(--won); color: #fff; border-color: var(--won); font-weight: 600; }
.btn.lost { color: var(--danger); border-color: var(--line); }
.card .decide { display: flex; gap: 6px; margin-top: 10px; }
.card .decide button { flex: 1; padding: 5px 0; font-size: 12.5px; border-radius: 6px; }
.status { grid-column: 1 / -1; font-size: 13px; padding: 8px 10px; border-radius: 8px; background: var(--col); }
.status.lost { color: var(--danger); }
.back { margin: 12px 20px 0; }

/* klienci */
.clients { padding: 16px 20px 30px; max-width: 1200px; }
.clients-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.clients-head h2 { margin: 0; font-size: 18px; }
.ctable { background: var(--panel); border-radius: var(--radius); overflow-x: auto; }
.ctable tr.click { cursor: pointer; }
.ctable tr.click:hover td { background: var(--bg); }
.ctable td, .ctable th { padding: 10px 14px; }
.client { padding: 16px 20px 40px; max-width: 1200px; display: grid; gap: 14px; }
.client-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.client-head h2 { margin: 0; font-size: 20px; }
.client-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.box { background: var(--panel); border-radius: var(--radius); padding: 16px; }
.box h3 { margin: 0 0 12px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.box h3 .hint { color: var(--muted); font-weight: 400; font-size: 12px; }
.box .grid { margin-bottom: 12px; }
.nip-row { display: flex; gap: 6px; }
.nip-row input { flex: 1; }
.plist a, .flist a { color: var(--accent); text-decoration: none; }
.plist div, .flist .f { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; align-items: center; }
.flist .cat { color: var(--muted); font-size: 12px; margin: 10px 0 2px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.flist .f .acts { display: flex; gap: 10px; white-space: nowrap; }
.upload { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.upload select, .credform input { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; }
.mini { border: 0; background: none; color: var(--accent); padding: 0; font-size: 12.5px; }
.mini.del { color: var(--danger); }
.creds td { vertical-align: top; }
.creds .pw { font-family: ui-monospace, Menlo, monospace; }
.credform { display: grid; grid-template-columns: repeat(5, 1fr) auto; gap: 6px; margin-top: 12px; }
.lock { font-size: 12px; color: var(--muted); }
@media (max-width: 900px) {
  .client-grid { grid-template-columns: 1fr; }
  .credform { grid-template-columns: 1fr 1fr; }
  .clients, .client { padding-left: 16px; padding-right: 16px; }
}

.client-grid.one { grid-template-columns: 1fr; }
.acc { border-bottom: 1px solid var(--line); }
.acc-head { display: flex; gap: 8px; align-items: baseline; padding: 9px 0; cursor: pointer; }
.acc-head .sub { margin-left: auto; text-align: right; }
.acc-head .chev { color: var(--muted); transition: transform .15s; display: inline-block; width: 10px; }
.acc.open .acc-head .chev { transform: rotate(90deg); }
.acc-form { display: none !important; padding: 4px 0 14px 18px; }
.acc.open .acc-form { display: grid !important; }
.acc-actions { display: flex; align-items: center; gap: 8px; }

.stack { display: grid; gap: 14px; align-content: start; }

.repeat { display: inline-block; margin-top: 6px; font-size: 12px; color: var(--warn); background: #fff4ec; padding: 2px 7px; border-radius: 6px; margin-right: 4px; }
.repeat.client { color: var(--won); background: #e9f7ef; }
.repeat.full { display: block; grid-column: 1 / -1; font-size: 13px; padding: 8px 10px; margin: 0; }
.repeat a { color: inherit; font-weight: 600; }

/* karta klienta: wszystko po kolei, jeden pod drugim */
.client .client-grid { grid-template-columns: 1fr; }
#cform .grid { grid-template-columns: repeat(4, 1fr); }
#cform .grid .full { grid-column: span 2; }
@media (max-width: 900px) { #cform .grid { grid-template-columns: 1fr; } #cform .grid .full { grid-column: auto; } }

/* tabela leadów: ramki + kolory */
.grid-table { border-collapse: collapse; }
.grid-table th, .grid-table td { border: 1px solid var(--line); }
.grid-table th { background: var(--bg); }
.grid-table tr.row-won td { background: #dcf3e5; }
.grid-table tr.row-lost td { background: #fbe1e1; }
.grid-table tr.row-noans td { background: #fdf3c9; }
.grid-table tr.click:hover td { filter: brightness(.97); }
.legend { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
.legend .lg { width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--line); margin-left: 8px; }
.legend .lg:first-child { margin-left: 0; }
.legend .lg.won { background: #dcf3e5; } .legend .lg.lost { background: #fbe1e1; } .legend .lg.noans { background: #fdf3c9; }
.tag.noans { background: #fdf3c9; color: #8a6d00; }
.field.check label { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--text); margin-top: 22px; }

/* przyciski statusu w karcie leada — kolory jak w tabeli Leady */
#form .btn.lost { background: #fbe1e1; color: #b42323; border-color: #f3c4c4; font-weight: 600; }
#form .btn.noans { background: #fdf3c9; color: #7a5f00; border-color: #f1e1a0; font-weight: 600; }
#form .btn.noans.on { background: #f5d75a; border-color: #e6c536; color: #4d3c00; }
.card .decide .btn.lost { background: #fbe1e1; color: #b42323; border-color: #f3c4c4; }

/* proces realizacji na karcie klienta (strzałki jak w Pipedrive) */
.process { padding: 14px 16px; }
.process-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 10px; }
.process-head .sub { margin-left: auto; }
.steps { display: flex; overflow-x: auto; }
.step { flex: 1 0 auto; min-width: 110px; border: 0; padding: 9px 14px 9px 22px; font-size: 12.5px; background: var(--col); color: var(--muted);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%); margin-right: -6px; white-space: nowrap; }
.step:first-child { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); padding-left: 14px; border-radius: 6px 0 0 6px; }
.step.done { background: rgba(255,255,255,.75); color: var(--text); }
.step.cur { background: var(--accent); color: #fff; font-weight: 600; }
.step:hover:not(.cur) { filter: brightness(.95); }

/* Realizacja: etapy jako wiersze */
.board.rows { flex-direction: column; overflow-x: visible; min-height: 0; gap: 6px; }
.board.rows .col { flex: none; flex-direction: row; align-items: stretch; min-height: 52px; }
.board.rows .col-head { width: 210px; flex-shrink: 0; padding: 12px 14px; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; }
.board.rows .col-body { flex-direction: row; flex-wrap: wrap; align-items: flex-start; padding: 8px; min-height: 0; }
.board.rows .card { width: 260px; }
.board.rows .col:has(.card) .col-head h3 { color: var(--accent); }
@media (max-width: 700px) {
  .board.rows .col { flex-direction: column; }
  .board.rows .col-head { width: auto; border-right: 0; padding-bottom: 4px; }
  .board.rows .card { width: 100%; }
}

/* checklista */
.ck { background: var(--bg); border-radius: 8px; padding: 12px 14px; }
.ck-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.ck-bar { flex: 1 0 100%; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.ck-bar div { height: 100%; background: var(--won); }
.ck-group { font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; margin: 12px 0 4px; }
.ck-item { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.ck-item label { display: flex; gap: 8px; align-items: center; flex: 1; cursor: pointer; font-size: 13.5px; }
.ck-item.done label { color: var(--muted); text-decoration: line-through; }
.ck-item .del { opacity: 0; font-size: 16px; }
.ck-item:hover .del { opacity: 1; }
.ck-add { display: flex; gap: 6px; margin-top: 10px; }
.ck-add input { flex: 1; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; }
.acc-ck { display: none; margin: 0 0 14px 18px; }
.acc-ck > summary { list-style: none; cursor: pointer; font-weight: 600; font-size: 13.5px; padding: 8px 0; display: flex; gap: 8px; align-items: center; }
.acc-ck > summary::-webkit-details-marker { display: none; }
.acc-ck .arr { display: inline-block; transition: transform .15s; color: var(--muted); }
.acc-ck[open] .arr { transform: rotate(90deg); }
.acc.open .acc-ck { display: block; }
.acc-ck .ck-head b { display: none; }
.ckbadge { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--muted); background: var(--col); padding: 2px 8px; border-radius: 6px; }
.ckbadge.full { color: var(--won); background: #dcf3e5; }
#tplModal { width: min(720px, calc(100vw - 32px)); }
#tplForm { padding: 22px; } #tplForm h2 { margin: 0 0 4px; font-size: 18px; } #tplForm .sub { margin: 0 0 14px; }
#tplFields textarea { min-height: 0; font-size: 13px; }

/* okno projektu */
dialog#modal.wide { width: min(1100px, calc(100vw - 32px)); }
#formTitle .link { font-size: 13px; font-weight: 500; margin-left: 10px; }
#modal.wide .grid#formFields { display: block; }
.pm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.pm-box { background: var(--bg); border-radius: 10px; padding: 14px; }
.pm-box h4 { margin: 0 0 10px; font-size: 13.5px; }
.pm-box .grid { gap: 10px; }
.pm-box#ckWrap .ck { padding: 0; background: none; max-height: 420px; overflow-y: auto; }
@media (max-width: 800px) { .pm-row { grid-template-columns: 1fr; } }

/* zadania */
.tasks { display: grid; gap: 2px; }
.task { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: var(--panel); border-radius: 6px; }
.task label { display: flex; gap: 8px; align-items: center; flex: 1; cursor: pointer; font-size: 13.5px; }
.task.done label { color: var(--muted); text-decoration: line-through; }
.task .tdate { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.task .tdate.late { color: var(--warn); font-weight: 600; }
.task .del { opacity: 0; font-size: 16px; } .task:hover .del { opacity: 1; }
.tasks details { margin-top: 6px; font-size: 13px; } .tasks summary { cursor: pointer; color: var(--muted); padding: 4px 0; }
.field.newtask label::before { content: "+ "; }
.more { color: var(--muted); font-size: 11.5px; background: var(--col); padding: 0 5px; border-radius: 4px; }
.item .tdone { width: 18px; height: 18px; flex-shrink: 0; cursor: pointer; accent-color: var(--won); }
.item .tdone-sp { width: 18px; flex-shrink: 0; }
.item.fading { opacity: .4; transition: opacity .3s; }


/* ===== responsywność ===== */
.toolbar { flex-wrap: wrap; gap: 10px 16px; }
.actions { flex-wrap: wrap; }
.creds { display: block; overflow-x: auto; }
.client-head, .clients-head { flex-wrap: wrap; }
@media (max-width: 900px) {
  .top { gap: 10px 16px; }
  #tabs { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  #tabs::-webkit-scrollbar { display: none; }
  #tabs button { white-space: nowrap; flex-shrink: 0; }
  .top-right { margin-left: auto; }
}
@media (max-width: 700px) {
  body { font-size: 15px; }
  .top { padding: 10px 16px 6px; }
  .top-right { order: 2; width: 100%; }
  .toolbar { padding-top: 10px; padding-bottom: 10px; }
  .toolbar .btn { padding: 7px 12px; font-size: 13.5px; }
  .item { flex-wrap: wrap; gap: 6px 10px; padding: 12px; }
  .item .when { width: auto; order: 2; }
  .item .what { flex: 1 1 100%; order: 3; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .panels { grid-template-columns: 1fr; }
  .bar { grid-template-columns: 90px 1fr 44px; }
  dialog, dialog#modal.wide, #tplModal { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; }
  #form, #tplForm { padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .actions { position: sticky; bottom: -18px; background: #fff; padding: 12px 0; margin-bottom: -18px; border-top: 1px solid var(--line); }
  .actions .btn { flex: 1 1 auto; }
  .actions .spacer { display: none; }
  .field input, .field select, .field textarea { font-size: 16px; padding: 10px 12px; }
  .task .del, .ck-item .del { opacity: 1; }
  .step { min-width: 90px; font-size: 12px; padding: 8px 10px 8px 18px; }
  .client, .clients { gap: 12px; }
  .box { padding: 14px; }
  .acc-form, .acc-ck { padding-left: 0; margin-left: 0; }
  .grid-table th, .grid-table td { white-space: nowrap; }
  .credform { grid-template-columns: 1fr; }
  .board.rows .col-body { padding: 4px 8px 10px; }
}
#formTitle .link { white-space: nowrap; text-decoration: none; display: inline-block; }
#formTitle .link:hover { text-decoration: underline; }
a:focus:not(:focus-visible), button:focus:not(:focus-visible) { outline: none; }


#toClient:focus { outline: none; }
.pm-box#ckWrap .ck { padding: 0 2px; background: none; }

/* ===== menu boczne ===== */
.top { display: none; }
.side { position: fixed; inset: 0 auto 0 0; width: 232px; z-index: 20; display: flex; flex-direction: column; gap: 18px;
  padding: 22px 16px; background: #fff; border-right: 1px solid var(--line); }
.side .logo { font-size: 20px; padding: 0 8px 6px; }
.side #search { width: 100%; }
.side #tabs { display: flex; flex-direction: column; gap: 4px; }
.side #tabs button { display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 14px; font-size: 14.5px; width: 100%; }
.side #tabs button i { font-style: normal; width: 18px; text-align: center; opacity: .7; }
.side #tabs button.active i { opacity: 1; }
.side #tabs .badge { margin-left: auto; }
.side #logout { margin-top: auto; }
.main { margin-left: 232px; min-height: 100vh; }
.main .toolbar { padding-top: 20px; }
.mbar, .side-shade { display: none; }
.board { min-height: 0; }

@media (max-width: 900px) {
  .main { margin-left: 0; }
  .mbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 15; padding: 12px 16px;
    background: #fff; border-bottom: 1px solid var(--line); }
  .burger { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: #fff;
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; padding: 0; }
  .burger span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .2s, opacity .2s; }
  .side { width: min(280px, 82vw); transform: translateX(-100%); transition: transform .25s ease; }
  body.side-open .side { transform: none; box-shadow: 20px 0 60px rgba(40,30,80,.18); }
  .side-shade { display: block; position: fixed; inset: 0; z-index: 18; background: rgba(30,25,60,.35); opacity: 0; pointer-events: none; transition: opacity .25s; }
  body.side-open .side-shade { opacity: 1; pointer-events: auto; }
  body.side-open .burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  body.side-open .burger span:nth-child(2) { opacity: 0; }
  body.side-open .burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .side #tabs { width: auto; overflow: visible; order: 0; }
  .main .toolbar { padding-top: 14px; }
}
.side #search { flex: none; width: 100%; } .side #tabs button i { font-size: 15px; line-height: 1; }


/* ===== motyw: jasny admin (fiolet) ===== */
:root {
  --bg: #f4f3f9; --panel: #fff; --col: #f7f6fb; --line: #ebe9f3;
  --text: #24213a; --muted: #8a87a0; --accent: #7b4ae2; --accent-soft: #f1ebfd; --accent-mid: #d9c9fa;
  --won: #22a06b; --lost: #a19eb3; --danger: #e5484d; --warn: #f2994a;
  --radius: 16px; --shadow: 0 2px 10px rgba(60,40,120,.05);
}
body { background: var(--bg); font-family: Poppins, system-ui, sans-serif; color: var(--text); }
h2, h3, h4 { font-weight: 600; }
.clients-head h2, .client-head h2, #form h2, #tplForm h2 { font-size: 20px; font-weight: 600; }
.list h2 { font-size: 13px; font-weight: 600; color: var(--text); }

/* logo z kropkami jak w referencji */
.logo { font-weight: 700; font-size: 20px; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.logo::before { content: ""; width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #f6a5a5 0 28%, transparent 30%), radial-gradient(circle at 72% 32%, #8fc2ff 0 26%, transparent 28%), radial-gradient(circle at 45% 72%, #8b5cf6 0 34%, transparent 36%); }
.logo span { font-weight: 400; color: var(--muted); font-size: .8em; }

/* panel boczny */
.side { box-shadow: 4px 0 20px rgba(60,40,120,.04); gap: 22px; }
.side #tabs button { color: #6f6c86; font-weight: 500; border-radius: 10px; }
.side #tabs button svg { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.side #tabs button:not(.active):hover { background: var(--col); color: var(--text); }
.side #tabs button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.badge { background: var(--accent); }

/* karty / pudełka */
.card, .item, .tile, .panelbox, .box, .ctable, .login-box { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.card { border-radius: 14px; }
.card:hover { border-color: var(--accent-mid); box-shadow: 0 6px 18px rgba(123,74,226,.10); }
.item { border-radius: 14px; } .item:hover { border-color: var(--accent-mid); }
.col, .board.rows .col { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.board.rows .col-body { background: var(--col); border-radius: 0 var(--radius) var(--radius) 0; }
.board.rows .col-head h3 { font-size: 14px; }
.board.rows .col:has(.card) .col-head h3 { color: var(--accent); }
.board.rows .col .card { box-shadow: none; }
.tile { border-radius: var(--radius); } .tile .v { font-weight: 600; font-size: 26px; color: var(--text); }
.tile .k { color: var(--muted); }

/* przyciski */
.btn { border-radius: 10px; padding: 8px 16px; font-weight: 500; background: #fff; border: 1px solid var(--line); color: var(--text); transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--accent-mid); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 6px 14px rgba(123,74,226,.25); }
.btn.primary:hover { background: #6a3bd1; }
.btn.ghost { background: #fff; }
.btn.danger { background: transparent; border-color: transparent; color: var(--danger); }
.btn.won { background: var(--won); border-color: var(--won); color: #fff; }
.period button { border-radius: 10px; background: #fff; border-color: var(--line); }
.period button.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* pola */
.login-box input, .field input, .field select, .field textarea, #search, .ck-add input, .upload select, .credform input {
  background: #fff; border: 1px solid var(--line); border-radius: 10px; color: var(--text); }
#search { background: var(--col); border-radius: 10px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox] { accent-color: var(--accent); }

/* okna */
dialog { border-radius: 20px; background: #fff; color: var(--text); box-shadow: 0 30px 80px rgba(40,30,80,.2); border: 0; }
dialog::backdrop { background: rgba(30,25,60,.35); }
.pm-box, .ck { background: var(--col); border-radius: 14px; }
.task { background: #fff; border-radius: 10px; border: 1px solid var(--line); }

/* drobiazgi */
.tag, .ckbadge, .more { border-radius: 8px; background: var(--col); color: var(--muted); }
.ckbadge.full { background: #e3f6ec; color: var(--won); }
.ck-bar { background: var(--line); border-radius: 999px; } .ck-bar div { border-radius: 999px; background: var(--accent); }
.bar .track { background: var(--accent-soft); border-radius: 999px; } .bar .fill { background: var(--accent); border-radius: 999px; }
.step { background: var(--col); color: var(--muted); }
.step.done { background: var(--accent-soft); color: var(--accent); }
.step.cur { background: var(--accent); color: #fff; }
.link, .plist a, .flist a, .mini { color: var(--accent); }
.ctable tr.click:hover td { background: var(--col); }
.grid-table th { background: var(--col); }
.grid-table th, .grid-table td { border-color: var(--line); }
.toast { background: var(--text); border-radius: 10px; }
.status { background: var(--col); }
.login { background: var(--bg); }
.login-box { border-radius: 20px; }
.login-box .logo { justify-content: center; font-size: 24px; margin-bottom: 6px; }
.login-box .btn.primary { padding: 11px; }
@media (max-width: 700px) { .actions { background: #fff; } }
.main > #view > .stats, .main > #view > .clients, .main > #view > .client { padding-top: 20px; }

/* Dziś: powitanie + mini kalendarz */
.hello { padding: 22px 0 6px; }
.hello h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.hello-date { color: var(--muted); margin-top: 2px; }
.mcal { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; max-width: 380px; margin-bottom: 30px; }
.mcal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.mcal-head b { font-weight: 600; }
.mcal-head button { border: 1px solid var(--line); background: #fff; border-radius: 8px; width: 30px; height: 30px; font-size: 18px; line-height: 1; color: var(--text); }
.mcal-head button:hover { border-color: var(--accent-mid); color: var(--accent); }
.mcal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.mcal-grid em { font-style: normal; font-size: 11.5px; color: var(--muted); padding-bottom: 4px; }
.mcal-grid button { position: relative; border: 0; background: none; border-radius: 10px; aspect-ratio: 1; font-size: 13px; color: var(--text); }
.mcal-grid button:hover { background: var(--col); }
.mcal-grid button.has { font-weight: 600; }
.mcal-grid button.today { background: var(--accent); color: #fff; }
.mcal-grid button.sel:not(.today) { background: var(--accent-soft); color: var(--accent); }
.mcal-grid button i { position: absolute; left: 50%; bottom: 4px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--accent); }
.mcal-grid button i.dl { background: var(--warn); }
.mcal-grid button i.late { background: var(--danger); }
.mcal-grid button.today i { background: #fff; }
.mcal-day { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; display: grid; gap: 6px; }
.mcal-ev { font-size: 13px; padding: 7px 10px; background: var(--col); border-radius: 10px; cursor: pointer; }
.mcal-ev span { color: var(--muted); margin-right: 6px; }
.mcal-ev.deadline { background: #fff3e8; }
.mcal-ev:hover { background: var(--accent-soft); }
@media (max-width: 700px) { .mcal { max-width: none; } .hello h1 { font-size: 22px; } }
.mcal-ev { display: block !important; line-height: 1.4; } .mcal-ev b, .mcal-ev span { display: inline !important; }

/* kalendarz szeroki z podglądem */
.calwrap { padding: 0 20px 30px; }
.calwrap h2 { font-size: 13px; font-weight: 600; margin: 18px 0 8px; }
.mcal { max-width: none; }
.mcal-head { justify-content: flex-start; gap: 12px; }
.mcal-head b { font-size: 16px; min-width: 150px; text-align: center; }
.mcal-grid { gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.mcal-grid em { padding: 8px 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--col); font-weight: 500; }
.mcal-grid > span { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fcfcfe; }
.cal-cell { min-height: 108px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-width: 0; position: relative; }
.cal-cell:hover { background: var(--col); }
.cal-cell.sel { background: var(--accent-soft); }
.cal-num { font-size: 12.5px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); }
.cal-cell.has .cal-num { color: var(--text); font-weight: 600; }
.cal-cell.today .cal-num { background: var(--accent); color: #fff; font-weight: 600; }
.cal-chip { font-size: 11.5px; line-height: 1.3; padding: 3px 6px; border-radius: 6px; background: var(--accent-soft); color: #4a2d93;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--accent); }
.cal-chip b { font-weight: 600; }
.cal-chip span { color: var(--accent); font-weight: 600; }
.cal-chip.deadline { background: #fff1e4; color: #8a4b12; border-left-color: var(--warn); }
.cal-chip.late { background: #fdeaea; color: #8f2327; border-left-color: var(--danger); }
.cal-chip:hover { filter: brightness(.96); }
.cal-more { font-size: 11px; color: var(--muted); padding-left: 4px; }
.cal-cell .dot { display: none; }
@media (max-width: 900px) {
  .calwrap { padding: 0 16px 24px; }
  .cal-cell { min-height: 54px; align-items: center; padding: 4px 2px; }
  .cal-chip, .cal-more { display: none; }
  .cal-cell .dot { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
  .cal-cell .dot.dl { background: var(--warn); } .cal-cell .dot.late { background: var(--danger); }
}

/* wyraźniejsze etapy na tablicach */
.board.rows { gap: 10px; counter-reset: st; }
.board.rows .col { border: 1px solid #e2def0; box-shadow: 0 2px 8px rgba(60,40,120,.06); overflow: hidden; }
.board.rows .col-head { counter-increment: st; width: 230px; background: #f6f3fd; border-right: 1px solid #e2def0;
  display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-content: center; }
.board.rows .col-head::before { content: counter(st); grid-row: 1 / 3; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; border: 1.5px solid #d9d2f0; color: var(--muted); font-weight: 600; font-size: 13px; align-self: center; }
.board.rows .col-head h3 { font-size: 14.5px; font-weight: 600; color: var(--text); margin: 0; }
.board.rows .col-body { background: #fff; border-radius: 0; }
.board.rows .col:has(.card) { border-color: #cdbff3; }
.board.rows .col:has(.card) .col-head { background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent); }
.board.rows .col:has(.card) .col-head::before { background: var(--accent); border-color: var(--accent); color: #fff; }
.board.rows .col:has(.card) .col-head h3 { color: var(--accent); }
.board.rows .col .card { background: #fff; border: 1px solid #e6e2f2; box-shadow: 0 1px 4px rgba(60,40,120,.06); }
.board.rows .col .card:hover { border-color: var(--accent-mid); }
.board.rows .col.won .col-head::before { content: "✓"; }
.board.rows .col.lost .col-head::before { content: "✕"; }
@media (max-width: 700px) {
  .board.rows .col-head { width: auto; border-right: 0; border-bottom: 1px solid #e2def0; padding: 10px 12px; }
}

/* statystyki v2 + firma */
.tiles.t3 { grid-template-columns: repeat(3, 1fr); }
.tiles.t2 { grid-template-columns: repeat(2, 1fr); }
.tile .sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.goalbar { height: 8px; background: var(--accent-soft); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.goalbar div { height: 100%; background: var(--accent); border-radius: 999px; }
.firm { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.firm > summary { list-style: none; cursor: pointer; padding: 16px 18px; font-weight: 600; font-size: 15px; display: flex; gap: 10px; align-items: center; }
.firm > summary::-webkit-details-marker { display: none; }
.firm > summary .sub { margin-left: auto; font-weight: 500; color: var(--muted); font-size: 13px; }
.firm .arr { display: inline-block; transition: transform .15s; color: var(--accent); }
.firm[open] .arr { transform: rotate(90deg); }
.firm-body { padding: 0 18px 18px; display: grid; gap: 14px; }
.firm-body .tile, .firm-body .panelbox { background: var(--col); box-shadow: none; }
.warnbox { background: #fff6ea; color: #8a4b12; border: 1px solid #f6dcbc; border-radius: 12px; padding: 10px 14px; font-size: 13px; }
.panelbox h3 .sub { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 8px; }
.mchart { position: relative; height: 200px; display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; align-items: end; padding-top: 18px; margin-bottom: 22px; }
.mcol { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.mcbar { width: 100%; max-width: 38px; background: var(--accent-mid); border-radius: 8px 8px 3px 3px; min-height: 2px; }
.mcol.hit .mcbar { background: var(--won); }
.mcol.cur .mcbar { background: var(--accent); }
.mval { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.mlbl { position: absolute; bottom: -20px; font-size: 11.5px; color: var(--muted); }
.mcol.cur .mlbl { color: var(--accent); font-weight: 600; }
.goalline { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--warn); z-index: 1; pointer-events: none; }
.taxgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.taxbox { background: var(--col); border-radius: 14px; padding: 16px; display: grid; gap: 6px; }
.tb-title { font-weight: 600; }
.taxbox .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
.tb-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 3px 0; }
.tb-row.total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; font-size: 15px; }
.tb-row .ok { color: var(--won); }
.setgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.setgrid label { font-size: 12.5px; color: var(--muted); display: grid; gap: 4px; }
.setgrid input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; color: var(--text); background: #fff; }
.setform .actions .sub { font-size: 12px; color: var(--muted); max-width: 640px; }
@media (max-width: 800px) {
  .tiles.t3, .tiles.t2, .taxgrid { grid-template-columns: 1fr; }
  .setgrid { grid-template-columns: 1fr 1fr; }
  .mchart { gap: 3px; } .mval { display: none; }
}
.mchart { grid-template-rows: 100%; } .mcol { align-self: stretch; height: auto; }
.grid-table.costs tr.off td { color: var(--muted); text-decoration: line-through; background: var(--col); }
.grid-table.costs td.note { color: var(--muted); font-size: 12.5px; max-width: 240px; }
.grid-table.costs td.acts { white-space: nowrap; }
.costform .setgrid select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; background: #fff; color: var(--text); }
.setgrid label .link { float: right; font-size: 11.5px; }

/* statystyki: kręgi */
.rings { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.ring { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 10px 16px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.ring svg { width: 124px; height: 124px; }
.rg-bg { fill: none; stroke: #ece6fb; stroke-width: 10; }
.rg-fg { fill: #3f1f8f; fill-opacity: 0; stroke: #3f1f8f; stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray .6s; }
.rg-fg.full { stroke: #3f1f8f; }
.rg-val { position: absolute; top: 18px; left: 0; right: 0; height: 124px; display: grid; place-items: center; font-size: 25px; font-weight: 700; color: #3f1f8f; letter-spacing: -.02em; }
.rg-lbl { margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--text); }
.rg-sub { margin-top: 2px; font-size: 12px; color: var(--muted); }
@media (max-width: 1100px) { .rings { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .rings { grid-template-columns: repeat(2, 1fr); } .ring svg { width: 104px; height: 104px; } .rg-val { height: 104px; font-size: 21px; } }
.tb-title .link { float: right; font-size: 12.5px; font-weight: 500; }
.setgrid label.chk { display: flex; align-items: flex-end; } .setgrid label.chk span { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 13.5px; padding-bottom: 10px; }
.mcol.est .mcbar { background: repeating-linear-gradient(45deg, var(--accent-mid) 0 6px, #ece6fb 6px 12px); }
.ledger > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.ledger > summary::-webkit-details-marker { display: none; }
.ledger > summary::before { content: "▸"; color: var(--accent); transition: transform .15s; display: inline-block; }
.ledger[open] > summary::before { transform: rotate(90deg); }
.ledger > summary .sub { font-size: 12px; color: var(--muted); }
.ledger form { margin-top: 12px; }
.ledger td input { width: 100%; text-align: right; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; }
.ledger .actions .sub { font-size: 12px; color: var(--muted); }
.setwrap .setform { margin-top: 12px; }
/* logo boost4media */
.logo::before { content: none !important; display: none !important; }
.logo img { display: block; height: auto; width: 100%; max-width: 170px; }
.side .logo { padding: 4px 8px 8px; }
.mbar .logo img { max-width: 130px; }
.login-box .logo { justify-content: center; margin-bottom: 10px; }
.login-box .logo img { max-width: 220px; margin: 0 auto; }

/* prognoza */
.forecast h3 .sub { display: block; margin: 4px 0 0; }
.fc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.fc-card { background: var(--col); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.fc-m { font-weight: 600; text-transform: capitalize; }
.fc-m .sub { text-transform: none; font-weight: 400; color: var(--muted); font-size: 12px; }
.fc-sum { font-size: 24px; font-weight: 700; color: #3f1f8f; letter-spacing: -.02em; }
.fc-card .sub { font-size: 12px; color: var(--muted); }
.fc-items { margin-top: 8px; display: grid; gap: 6px; }
.fc-it { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font-size: 13px; cursor: pointer;
  display: grid; grid-template-columns: 1fr auto; gap: 0 8px; }
.fc-it:hover { border-color: var(--accent-mid); }
.fc-it em { grid-column: 1 / -1; font-style: normal; font-size: 11.5px; color: var(--muted); }
.fc-it.done { background: #eef8f2; border-color: #cfeadb; }
.fc-it.late em { color: var(--danger); font-weight: 600; }
.fc-later { margin-top: 10px; }
.forecast .warnbox { margin-top: 12px; }
.meta td input { width: 100%; text-align: right; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; }
.meta .actions .sub { font-size: 12px; color: var(--muted); }
@media (max-width: 800px) { .fc-grid { grid-template-columns: 1fr; } }
.rings { grid-template-columns: repeat(6, 1fr); }
.rg-val { font-size: 23px; }
@media (max-width: 1250px) { .rings { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .rings { grid-template-columns: repeat(2, 1fr); } }
.client > *, .clients > *, .stats > *, .firm-body > * { min-width: 0; } .main { min-width: 0; overflow-x: clip; }
.exp-btn { display: block; margin-top: 6px; font-size: 12.5px; font-weight: 500; }
textarea.full { resize: none; overflow: hidden; }

/* ===== kalendarz tygodnia ===== */
:root { --k-praca: #7b4ae2; --k-spotkanie: #2f80ed; --k-trening: #f2994a; --k-prywatne: #e5579a; --k-przerwa: #27ae60; --k-inne: #8a87a0; }
.k-praca { --kc: var(--k-praca); } .k-spotkanie { --kc: var(--k-spotkanie); } .k-trening { --kc: var(--k-trening); }
.k-prywatne { --kc: var(--k-prywatne); } .k-przerwa { --kc: var(--k-przerwa); } .k-inne { --kc: var(--k-inne); }
.kdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--kc); flex-shrink: 0; }
.week { padding: 20px 20px 30px; display: grid; gap: 12px; min-width: 0; }
.week-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.week-head h2 { margin: 0 0 0 8px; font-size: 18px; }
.legend-k { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend-k span { display: flex; gap: 5px; align-items: center; }
.wgrid-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.wgrid { display: grid; grid-template-columns: 52px repeat(7, minmax(110px, 1fr)); min-width: 820px; }
.wcorner, .wday-h { position: sticky; top: 0; background: #fff; z-index: 3; border-bottom: 1px solid var(--line); }
.wday-h { padding: 10px 6px; text-align: center; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.wday-h span { font-size: 12px; color: var(--muted); } .wday-h b { font-size: 18px; font-weight: 600; }
.wday-h.today b { background: var(--accent); color: #fff; border-radius: 50%; width: 32px; height: 32px; display: grid; place-items: center; margin: 0 auto; font-size: 15px; }
.whours { position: relative; }
.whours div { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--muted); }
.whours div:first-child { transform: none; }
.wcol { position: relative; border-left: 1px solid var(--line); cursor: crosshair; touch-action: none; user-select: none; }
.wcol.today { background: #faf8ff; }
.hline { position: absolute; left: 0; right: 0; border-top: 1px solid #f0eef6; }
.nowline { position: absolute; left: 0; right: 0; border-top: 2px solid var(--danger); z-index: 2; }
.nowline::before { content: ""; position: absolute; left: -5px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.wev { position: absolute; left: 3px; right: 3px; border-radius: 8px; padding: 4px 7px; font-size: 12px; line-height: 1.25; overflow: hidden; cursor: pointer; z-index: 1;
  background: color-mix(in srgb, var(--kc) 16%, #fff); border-left: 4px solid var(--kc); color: #241f35; }
.wev:hover { background: color-mix(in srgb, var(--kc) 26%, #fff); }
.wev b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wev span { color: #5d5873; font-size: 11px; }
.wtask { position: absolute; left: 3px; right: 3px; height: 18px; font-size: 11px; padding: 1px 6px; border: 1px dashed var(--accent-mid); border-radius: 6px; background: #fff; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; z-index: 1; }
.wghost { position: absolute; left: 3px; right: 3px; background: var(--accent-soft); border: 2px dashed var(--accent); border-radius: 8px; font-size: 11px; color: var(--accent); padding: 3px 6px; z-index: 2; pointer-events: none; }
.week-hint { font-size: 12px; color: var(--muted); }
#evModal { width: min(560px, calc(100vw - 32px)); }
#evForm { padding: 22px; } #evForm h2 { margin: 0 0 14px; font-size: 18px; }
.kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.kchip { cursor: pointer; } .kchip input { display: none; }
.kchip span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--line); font-size: 13px; color: var(--text); }
.kchip span::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--kc); }
.kchip input:checked + span { border-color: var(--kc); background: color-mix(in srgb, var(--kc) 14%, #fff); font-weight: 600; }
.chk-inline { display: flex !important; gap: 8px; align-items: center; margin-top: 26px; color: var(--text) !important; font-size: 13.5px !important; }
#evClientWrap.dim { opacity: .6; }
.meets { display: grid; gap: 6px; }
.meet { display: block; padding: 8px 10px; border-radius: 10px; background: var(--col); cursor: pointer; font-size: 13.5px; }
.meet .kdot { margin-right: 6px; } .meet.past { opacity: .6; } .meet:hover { background: var(--accent-soft); }
.meet .sub { font-size: 12px; color: var(--muted); margin: 2px 0 0 16px; }
.today-ev { display: grid; gap: 6px; margin-bottom: 6px; }
.tev { padding: 9px 12px; border-radius: 12px; background: color-mix(in srgb, var(--kc) 14%, #fff); border-left: 4px solid var(--kc); cursor: pointer; font-size: 14px; }
@media (max-width: 700px) { .week { padding: 14px 16px; } .legend-k { display: none; } .wgrid { grid-template-columns: 44px repeat(7, 96px); min-width: 0; } }
.field .chk-inline input { width: auto; } .field .chk-inline { justify-content: flex-start; }
.inv td, .inv th { padding: 7px 6px; } .inv .sub { color: var(--muted); font-size: 12px; } .box h3 b { font-size: 14px; }
.mcbar { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-start; }
.mc-online { display: block; width: 100%; background: #e5579a; }
.splitbar { height: 8px; border-radius: 999px; background: #e5579a; overflow: hidden; margin: 10px 0 6px; }
.splitbar i { display: block; height: 100%; background: var(--accent); }
.lg-p { color: var(--accent); } .lg-o { color: #e5579a; }
/* dane firmy: podgląd / edycja */
#cform:not(.editing) .cedit { display: none !important; }
#cform.editing .cview { display: none; }
#cform h3 { display: flex; align-items: center; gap: 8px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 24px; margin: 4px 0 0; }
.kv div { min-width: 0; }
.kv dt { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.kv dd { margin: 0; font-size: 14.5px; font-weight: 500; overflow-wrap: anywhere; }
.kv a { color: var(--accent); text-decoration: none; } .kv a:hover { text-decoration: underline; }
/* karta klienta: przyciski wyciszone jak „Edytuj” */
.client .btn.primary { background: #fff; color: var(--text); border-color: var(--line); box-shadow: none; font-weight: 500; }
.client .btn.primary:hover { background: #fff; border-color: var(--accent-mid); color: var(--accent); }
/* notatki z datą w projekcie */
.nlog { margin: 0 0 14px 18px; padding: 12px 14px; background: var(--col); border-radius: 14px; display: none; gap: 8px; }
.acc.open .nlog { display: grid; }
.nlog-h { display: flex; gap: 8px; align-items: baseline; } .nlog-h .sub { color: var(--muted); font-size: 12px; }
.nlog-add { display: flex; gap: 8px; align-items: flex-start; }
.nlog-add textarea, .nent textarea { flex: 1; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; resize: vertical; background: #fff; }
.nent { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; }
.nent-meta { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.nent-text { white-space: pre-wrap; font-size: 14px; overflow-wrap: anywhere; }
.nent-edit { display: flex; gap: 6px; margin-top: 6px; }
@media (max-width: 700px) { .nlog { margin-left: 0; } }
