/* Program biurowy — biel, błękit do granatu, akcenty tylko dla stanów. Bez zaokrągleń. */
:root {
  --white: #ffffff;
  --navy: #0f2747;
  --navy-2: #173a6b;
  --blue: #1d4f91;
  --blue-2: #2f6fc0;
  --sky: #e6eefa;
  --sky-2: #f3f7fd;
  --line: #b9c7dc;
  --line-soft: #dde5f0;
  --text: #16233a;
  --muted: #54647d;
  --green: #1a7f37;
  --green-bg: #e7f4ea;
  --red: #b3261e;
  --red-bg: #fbe9e7;
  --amber: #8a5a00;
  --amber-bg: #fdf3d7;
  --gray-bg: #eef1f5;
}

*, *::before, *::after { box-sizing: border-box; border-radius: 0 !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}
a { color: var(--blue); }
a:hover { color: var(--navy); }

/* ---------- pasek górny ---------- */
.top {
  background: var(--navy);
  color: var(--white);
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  border-bottom: 4px solid var(--blue-2);
}
.top .brand {
  padding: 14px 22px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--navy-2);
  white-space: nowrap;
}
.top nav { display: flex; flex-wrap: wrap; flex: 1; }
.top nav a {
  color: #cfdcf0;
  text-decoration: none;
  padding: 14px 10px;
  font-size: 14px;
  border-left: 1px solid rgba(255, 255, 255, .08);
}
.top nav a:hover { background: var(--navy-2); color: var(--white); }
.top nav a.active { background: var(--white); color: var(--navy); font-weight: 700; }
.top .side { display: flex; align-items: center; gap: 4px; padding: 0 14px; margin-left: auto; }
.top .side a { color: #cfdcf0; text-decoration: none; padding: 14px 8px; }
.top .side a:hover { color: var(--white); }
.top .who { padding: 0 8px; font-weight: 600; }
.top .who small { font-weight: 400; color: #a9bddb; }
.top form { margin: 0; }
.linkbtn {
  background: none; border: 1px solid #6f8bb5; color: var(--white);
  font: inherit; padding: 5px 12px; cursor: pointer;
}
.linkbtn:hover { background: var(--white); color: var(--navy); }

/* ---------- treść ---------- */
main { max-width: 1220px; margin: 0 auto; padding: 26px 22px 60px; }
main.narrow { max-width: 620px; }

h1 {
  font-size: 23px; color: var(--navy); margin: 0 0 22px;
  padding-bottom: 10px; border-bottom: 3px solid var(--navy);
}

/* sekcja: wyraźna ramka z granatowym nagłówkiem */
.block { border: 1px solid var(--line); margin: 0 0 26px; background: var(--white); }
.block > h2 {
  margin: 0; padding: 10px 16px;
  background: var(--navy-2); color: var(--white);
  font-size: 15px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.block > h2 .right { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 13px; }
.block > h2 a { color: var(--white); }
.block > .body { padding: 16px; }
.block > .body > :first-child { margin-top: 0; }
.block > .body > :last-child { margin-bottom: 0; }
.block > table { border: 0; }
.block > table th:first-child, .block > table td:first-child { border-left: 0; }
.block > table th:last-child, .block > table td:last-child { border-right: 0; }
.block > table tr:last-child td { border-bottom: 0; }
.block.slim { max-width: 640px; }

/* podsekcja: błękitny pasek z lewą krawędzią */
h3, .sub {
  margin: 22px 0 10px; padding: 7px 12px;
  background: var(--sky); border-left: 5px solid var(--blue);
  color: var(--navy); font-size: 14px; font-weight: 700;
}
.body > h3:first-child { margin-top: 0; }

.note-line { color: var(--muted); font-size: 13px; margin: 10px 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.empty { padding: 14px 16px; color: var(--muted); background: var(--sky-2); border: 1px dashed var(--line); margin: 0 0 16px; }
.block > .empty { border: 0; margin: 0; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.neg { color: var(--red); font-weight: 700; }
.pos { color: var(--green); font-weight: 700; }
.zero { color: var(--muted); font-weight: 700; }

/* ---------- tabele ---------- */
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--white); border: 1px solid var(--line); }
th, td { border: 1px solid var(--line-soft); padding: 8px 10px; text-align: left; vertical-align: top; }
th {
  background: var(--sky); color: var(--navy); font-size: 13px; font-weight: 700;
  border-bottom: 2px solid var(--navy-2); white-space: nowrap;
}
th a { color: inherit; text-decoration: none; display: block; }
th a:hover { text-decoration: underline; }
tbody tr:hover td { background: var(--sky-2); }
td.center, th.center { text-align: center; }
td.actions { white-space: nowrap; }

/* delikatne tła wierszy — stały kolor dla danej osoby, z paskiem po lewej */
tr.p0 td { background: #f6f9ff; } tr.p0 td:first-child { box-shadow: inset 4px 0 0 #2f6fc0; }
tr.p1 td { background: #f3faf5; } tr.p1 td:first-child { box-shadow: inset 4px 0 0 #2e8b57; }
tr.p2 td { background: #fdf8ee; } tr.p2 td:first-child { box-shadow: inset 4px 0 0 #c98a1b; }
tr.p3 td { background: #f9f3fb; } tr.p3 td:first-child { box-shadow: inset 4px 0 0 #8a4fa8; }
tr.p4 td { background: #f0f9fb; } tr.p4 td:first-child { box-shadow: inset 4px 0 0 #1f8a9c; }
tr.p5 td { background: #fdf3f1; } tr.p5 td:first-child { box-shadow: inset 4px 0 0 #c4553f; }
tr.p6 td { background: #f4f5fb; } tr.p6 td:first-child { box-shadow: inset 4px 0 0 #4b5bb5; }
tr.p7 td { background: #f7f8f2; } tr.p7 td:first-child { box-shadow: inset 4px 0 0 #7a8a2c; }
tr.sel td { border-top: 2px solid var(--navy); border-bottom: 2px solid var(--navy); }
i.sw { width: 14px; height: 14px; display: inline-block; border: 1px solid var(--line); vertical-align: -2px; }
i.sw.p0 { background: #2f6fc0; } i.sw.p1 { background: #2e8b57; } i.sw.p2 { background: #c98a1b; } i.sw.p3 { background: #8a4fa8; }
i.sw.p4 { background: #1f8a9c; } i.sw.p5 { background: #c4553f; } i.sw.p6 { background: #4b5bb5; } i.sw.p7 { background: #7a8a2c; }

/* ---------- etykiety stanów ---------- */
.badge {
  display: inline-block; padding: 1px 8px; font-size: 12px; font-weight: 700; white-space: nowrap;
  border-left: 4px solid currentColor; background: var(--gray-bg); color: var(--muted);
}
.b-done { background: var(--green-bg); color: var(--green); }
.b-pending { background: var(--sky); color: var(--blue); }
.b-late { background: var(--red-bg); color: var(--red); }
.b-err { background: var(--amber-bg); color: var(--amber); }
.b-skip, .b-cancel { background: var(--gray-bg); color: var(--muted); }

/* ---------- komunikaty ---------- */
.flash, .banner { padding: 11px 15px; margin: 0 0 16px; border: 1px solid; border-left-width: 6px; overflow-wrap: anywhere; }
.flash.ok { background: var(--green-bg); color: #14532d; border-color: var(--green); }
.flash.err, .banner.red { background: var(--red-bg); color: #7f1d1d; border-color: var(--red); }
.flash.info { background: var(--sky); color: var(--navy); border-color: var(--blue); }
.banner { background: var(--amber-bg); color: #5c3d00; border-color: var(--amber); }

/* ---------- formularze ---------- */
label { display: block; margin: 12px 0 4px; font-weight: 700; color: var(--navy); font-size: 13px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=datetime-local],
input[type=search], input[type=file], select, textarea {
  width: 100%; max-width: 480px; padding: 8px 10px;
  border: 1px solid #8fa3c0; background: var(--white); color: var(--text); font: inherit;
}
textarea { min-height: 96px; max-width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--blue-2); outline-offset: 1px; }
.checks { display: flex; gap: 6px 16px; flex-wrap: wrap; margin: 6px 0; }
.checks label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; font-size: 14px; color: var(--text); }
.checks.boxed { border: 1px solid var(--line); padding: 10px; max-height: 230px; overflow: auto; }
label.plain { font-weight: 400; color: var(--text); font-size: 14px; display: flex; align-items: center; gap: 6px; }
.filters { display: flex; gap: 12px 14px; flex-wrap: wrap; align-items: flex-end; }
.filters label { margin-top: 0; }
.filters input, .filters select { width: auto; min-width: 130px; }
.filters input[type=radio], .filters input[type=checkbox] { min-width: 0; width: auto; }
.filters label.plain { margin: 2px 0; }
.filters .grow { flex: 1; min-width: 240px; }
.filters .grow textarea, .filters .grow input { width: 100%; max-width: none; }
form.inline { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0; vertical-align: middle; }
form.inline input, form.inline select { width: auto; max-width: 200px; padding: 4px 8px; }
.actions-row { margin: 18px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
[hidden] { display: none !important; }

.btn {
  display: inline-block; background: var(--navy); color: var(--white); border: 1px solid var(--navy);
  cursor: pointer; font: inherit; font-weight: 600; padding: 8px 18px; text-decoration: none; line-height: 1.3;
}
.btn:hover { background: var(--blue); border-color: var(--blue); color: var(--white); }
.btn.green { background: var(--green); border-color: var(--green); }
.btn.green:hover { background: #14632b; }
.btn.red { background: var(--white); color: var(--red); border-color: var(--red); }
.btn.red:hover { background: var(--red); color: var(--white); }
.btn.gray, .btn.ghost { background: var(--white); color: var(--navy); border-color: var(--navy); }
.btn.gray:hover, .btn.ghost:hover { background: var(--sky); color: var(--navy); }
.btn.small { padding: 3px 10px; font-size: 13px; font-weight: 600; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.big { font-size: 19px; padding: 14px 52px; }
.btn.done-state { background: var(--green); border-color: var(--green); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 16px; }

/* ---------- kafle liczb ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; margin: 0 0 26px; border: 1px solid var(--line); }
.stat { padding: 14px 18px; border-right: 1px solid var(--line-soft); border-top: 5px solid var(--navy-2); background: var(--white); }
.stat:last-child { border-right: 0; }
.stat .n { font-size: 32px; font-weight: 700; color: var(--navy); line-height: 1.1; }
.stat .l { color: var(--muted); font-size: 13px; margin-top: 4px; }
.stat.green { border-top-color: var(--green); } .stat.green .n { color: var(--green); }
.stat.blue { border-top-color: var(--blue-2); } .stat.blue .n { color: var(--blue); }
.stat.red { border-top-color: var(--red); } .stat.red .n { color: var(--red); }
.stat.amber { border-top-color: var(--amber); } .stat.amber .n { color: var(--amber); }

/* ---------- legenda, zakładki ---------- */
.legend { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.legend a, .legend span.it { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--muted); padding: 2px 6px; border: 1px solid transparent; }
.legend a:hover { border-color: var(--line); }
.legend a.on { color: var(--navy); font-weight: 700; border-color: var(--navy); background: var(--sky); }
.chips { display: flex; gap: 0; flex-wrap: wrap; margin: 0 0 18px; border-bottom: 3px solid var(--navy-2); }
.chips a {
  padding: 8px 14px; text-decoration: none; color: var(--navy); background: var(--sky);
  border: 1px solid var(--line); border-bottom: 0; margin-right: -1px; font-size: 14px;
}
.chips a:hover { background: var(--white); }
.chips a.on { background: var(--navy-2); color: var(--white); font-weight: 700; border-color: var(--navy-2); }
.chips .cnt { margin-left: 6px; padding: 0 6px; background: var(--white); color: var(--navy); font-size: 12px; font-weight: 700; border: 1px solid var(--line); }
.chips .cnt.hot { background: var(--red); color: var(--white); border-color: var(--red); }

/* ---------- strona wejścia: kafle ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 20px; max-width: 800px; }
.tile { display: block; text-decoration: none; color: var(--text); border: 1px solid var(--line); border-top: 8px solid var(--navy-2); padding: 26px 24px; background: var(--white); }
.tile:hover { background: var(--sky-2); border-color: var(--blue); border-top-color: var(--blue-2); color: var(--text); }
.tile h2 { margin: 0 0 8px; color: var(--navy); font-size: 20px; }
.tile p { margin: 0; color: var(--muted); font-size: 14px; }
.tile .go { display: inline-block; margin-top: 14px; color: var(--blue); font-weight: 700; }

/* ---------- tablica informacyjna ---------- */
.post { border: 1px solid var(--line); border-left: 6px solid var(--navy-2); padding: 12px 16px; margin: 0 0 12px; background: var(--white); }
.post.p0 { border-left-color: #2f6fc0; } .post.p1 { border-left-color: #2e8b57; } .post.p2 { border-left-color: #c98a1b; } .post.p3 { border-left-color: #8a4fa8; }
.post.p4 { border-left-color: #1f8a9c; } .post.p5 { border-left-color: #c4553f; } .post.p6 { border-left-color: #4b5bb5; } .post.p7 { border-left-color: #7a8a2c; }
.post .head { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; padding-bottom: 6px; margin-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
.post .head b { color: var(--navy); }
.post .head .sp { flex: 1; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: start; margin: 0 0 16px; }
.cards .post { margin: 0; }
.cards .empty { grid-column: 1 / -1; margin: 0; }
.post .comments { margin-top: 12px; border-top: 2px solid var(--line-soft); padding-top: 8px; }
.post .comment { background: var(--sky-2); border-left: 4px solid var(--blue-2); padding: 6px 10px; margin: 0 0 6px; font-size: 14px; }
.post .comment .who { display: block; margin-bottom: 2px; }
.post .comments details > summary { cursor: pointer; color: var(--blue); font-size: 13px; font-weight: 700; padding: 4px 0; }
.post .comments details form { margin: 6px 0 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.post .comments textarea { min-height: 56px; }

/* ---------- notatki ---------- */
.searchbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0 0 18px; padding: 12px; background: var(--sky-2); border: 1px solid var(--line); }
.searchbar form { display: flex; gap: 8px; margin: 0; flex-wrap: wrap; }
.searchbar form.grow { flex: 1; min-width: 260px; }
.searchbar form.grow input { flex: 1; max-width: none; }
.searchbar input[type=text] { width: auto; max-width: 200px; }
details.section { border: 1px solid var(--line); margin: 0 0 16px; background: var(--white); }
details.section > summary {
  list-style: none; cursor: pointer; padding: 10px 14px; background: var(--navy-2); color: var(--white);
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-weight: 600;
}
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary::before { content: "▸"; font-size: 13px; }
details.section[open] > summary::before { content: "▾"; }
details.section > summary .sp { flex: 1; }
details.section > summary .muted { color: #b9cbe6; font-weight: 400; }
details.section > .sec-body { padding: 14px; }
.sec-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 8px 10px; margin: 0 0 12px; background: var(--sky-2); border: 1px solid var(--line-soft); }
.sec-tools input, .sec-tools select { width: auto; max-width: 220px; padding: 4px 8px; }
details.note { border: 1px solid var(--line); border-left: 6px solid var(--blue-2); margin: 0 0 10px; background: var(--white); }
details.note.prio-high { border-left-color: var(--red); }
details.note.prio-low { border-left-color: #9aa7ba; }
details.note > summary { list-style: none; cursor: pointer; padding: 9px 12px; font-weight: 600; color: var(--navy); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
details.note > summary::-webkit-details-marker { display: none; }
details.note > summary::before { content: "▸"; color: var(--blue); font-size: 12px; }
details.note[open] > summary { background: var(--sky); border-bottom: 1px solid var(--line-soft); }
details.note[open] > summary::before { content: "▾"; }
details.note .meta { padding: 8px 12px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line-soft); background: var(--sky-2); }
details.note .text { padding: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
details.note .ops { padding: 10px 12px; border-top: 1px solid var(--line-soft); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
details.note .ops .more { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding-left: 10px; margin-left: 4px; border-left: 2px solid var(--line); }

/* ---------- strona przycisku z maila ---------- */
.center-card { max-width: 540px; margin: 7vh auto 0; border: 1px solid var(--line); border-top: 8px solid var(--navy-2); padding: 34px; text-align: center; }
.center-card h1 { border: 0; padding: 0; margin: 0 0 10px; font-size: 22px; }
.center-card p { color: var(--muted); }
.center-card .mark { font-size: 15px; font-weight: 700; display: inline-block; padding: 4px 14px; margin-bottom: 14px; }
.center-card .mark.ok { background: var(--green-bg); color: var(--green); border-left: 5px solid var(--green); }
.center-card .mark.info { background: var(--sky); color: var(--blue); border-left: 5px solid var(--blue); }
.center-card .mark.bad { background: var(--red-bg); color: var(--red); border-left: 5px solid var(--red); }

dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

@media (max-width: 720px) {
  main { padding: 18px 12px 50px; }
  .top .brand { width: 100%; }
  .top .side { margin-left: 0; width: 100%; padding: 6px 12px; border-top: 1px solid rgba(255,255,255,.12); }
  input[type=text], input[type=email], input[type=password], select { max-width: none; }
}
@media print {
  .top, .toolbar, form, .btn { display: none !important; }
  .block > h2 { background: none; color: #000; border-bottom: 2px solid #000; }
}

/* ---------- uwaga / nowe ---------- */
.block.attention { border-color: var(--amber); }
.block.attention > h2 { background: var(--amber); }
.post.fresh { box-shadow: inset 0 3px 0 var(--red); }
.transfer { color: var(--muted); }

/* ---------- kalendarz urlopów ---------- */
table.cal { table-layout: fixed; min-width: 900px; }
table.cal th, table.cal td { padding: 4px 2px; text-align: center; font-size: 12px; }
table.cal thead th { line-height: 1.15; }
table.cal thead th small { font-weight: 400; color: var(--muted); }
table.cal thead th:first-child, table.cal th.name { width: 130px; text-align: left; padding-left: 8px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.cal th.name { background: var(--white); border-bottom: 1px solid var(--line-soft); }
table.cal td { height: 26px; }
table.cal .off { background: #eef1f5; }
table.cal thead th.off { background: #d9e0ea; }
table.cal thead th.today { box-shadow: inset 0 -4px 0 var(--red); }
table.cal td.vac { background: var(--blue); }
table.cal td.vac.off { background: #7fa3d6; }
table.cal td.prop { background: repeating-linear-gradient(135deg, #f0c85a 0 5px, #fdf3d7 5px 10px); }
table.cal tbody tr:hover td { filter: brightness(.96); }
i.sw.k-vac { background: var(--blue); }
i.sw.k-prop { background: repeating-linear-gradient(135deg, #f0c85a 0 4px, #fdf3d7 4px 8px); }
i.sw.k-off { background: #d9e0ea; }

.plainlist { margin: 0; padding-left: 20px; }
.plainlist li { margin: 3px 0; overflow-wrap: anywhere; }

.center-card form label { text-align: left; }
.center-card form textarea { max-width: none; min-height: 60px; margin-bottom: 14px; }
