/* Strategia Bardo – style (WCAG 2.1 AA: kontrast ≥ 4.5:1, widoczny fokus) */
:root {
  --bg: #f6f7f9; --surface: #ffffff; --text: #1a1d21; --muted: #545b64; --line: #d7dbe0;
  --accent: #1f4e79; --accent-text: #ffffff; --accent-soft: #e6eef6;
  --ok: #1d6b3a; --ok-bg: #e6f4ea; --err: #a1261d; --err-bg: #fbeaea; --warn: #7a4b00; --warn-bg: #fff4dc;
  --focus: #b35c00; --radius: 8px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="jasny"]) {
    --bg: #14171b; --surface: #1d2126; --text: #e8eaed; --muted: #a9b0b8; --line: #343a41;
    --accent: #8cb8e6; --accent-text: #0e1a26; --accent-soft: #1f2d3b;
    --ok: #8fd1a4; --ok-bg: #16301f; --err: #f2a59d; --err-bg: #3a1a17; --warn: #f0c46b; --warn-bg: #362a10; --focus: #ffb35c;
  }
}
:root[data-theme="ciemny"] {
  --bg: #14171b; --surface: #1d2126; --text: #e8eaed; --muted: #a9b0b8; --line: #343a41;
  --accent: #8cb8e6; --accent-text: #0e1a26; --accent-soft: #1f2d3b;
  --ok: #8fd1a4; --ok-bg: #16301f; --err: #f2a59d; --err-bg: #3a1a17; --warn: #f0c46b; --warn-bg: #362a10; --focus: #ffb35c;
}

* { box-sizing: border-box; }
html { font-size: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.pilot { background: var(--warn-bg); color: var(--warn); text-align: center; font-size: .9rem; padding: 6px 16px; border-bottom: 1px solid var(--line); }
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.brand { text-decoration: none; color: var(--text); display: flex; align-items: center; gap: 12px; }
.brand-txt { display: flex; flex-direction: column; }
.herb { width: 40px; height: 48px; flex: none; }
.brand-main { font-weight: 700; font-size: 1.1rem; }
.brand-sub { color: var(--muted); font-size: .85rem; }
.menu { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; align-items: center; }
.menu a[aria-current="page"] { font-weight: 700; text-decoration: none; border-bottom: 2px solid var(--accent); }
.menu form { margin: 0; }
.linklike { background: none; border: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }

main { padding-top: 24px; padding-bottom: 48px; min-height: 60vh; }
h1 { font-size: 1.6rem; margin: 0 0 12px; }
h2 { font-size: 1.2rem; margin: 24px 0 8px; }
h3 { font-size: 1.05rem; margin: 0 0 4px; }
.lead { font-size: 1.05rem; }
.muted, .hint { color: var(--muted); font-size: .92rem; }
.hint { margin: -4px 0 8px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 0 0 16px; }
.card > h2:first-child, .card > .head-row h2 { margin-top: 0; }
.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.prose { max-width: 760px; }

.form { display: flex; flex-direction: column; gap: 6px; max-width: 520px; }
.form.inline { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
label { font-weight: 600; }
textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--muted); border-radius: 6px; padding: 9px 10px; resize: vertical; }
input, select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--muted); border-radius: 6px; padding: 9px 10px; min-height: 44px; }
input[readonly] { background: var(--bg); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 8px 0; }
legend { font-weight: 600; padding: 0 4px; }
.form fieldset { display: flex; flex-direction: column; gap: 6px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; min-height: 32px; }
.check input { min-height: 0; width: 18px; height: 18px; }

.btn { display: inline-block; background: var(--accent); color: var(--accent-text); border: 1px solid var(--accent); border-radius: 6px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 44px; }
.btn.secondary { background: transparent; color: var(--accent); }
.btn.danger { background: transparent; color: var(--err); border-color: var(--err); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.form .btn { align-self: flex-start; margin-top: 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.actions form { margin: 0; }
.inline-reason { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.alert { background: var(--err-bg); color: var(--err); border-radius: 6px; padding: 10px 14px; }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.alert ul { margin: 0; padding-left: 18px; }
.ok { background: var(--ok-bg); color: var(--ok); border-radius: 6px; padding: 10px 14px; }
code.secret { word-break: break-all; background: var(--accent-soft); padding: 2px 6px; border-radius: 4px; }
.qr img { background: #fff; padding: 8px; border-radius: 6px; }

.head-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.table-wrap { position: relative; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--accent-soft); font-weight: 600; }
.status { font-size: .85rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); white-space: nowrap; }
.s-aktywne { background: var(--ok-bg); color: var(--ok); }
.s-wylaczone { background: var(--err-bg); color: var(--err); }
.s-zaproszone, .s-przygotowanie { background: var(--warn-bg); color: var(--warn); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 8px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 16px 0; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; }
.tile-num { font-size: 1.8rem; font-weight: 700; }
.tile-lbl { color: var(--muted); }
.modules { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.module { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.module p { margin: 4px 0 10px; color: var(--muted); font-size: .93rem; }
.badge { display: inline-block; font-size: .8rem; background: var(--accent-soft); color: var(--accent); padding: 2px 8px; border-radius: 999px; }

.foot { border-top: 1px solid var(--line); background: var(--surface); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 12px; padding-bottom: 12px; color: var(--muted); font-size: .9rem; }

/* awatary: inicjały na 12 kolorach (biały tekst, kontrast ≥ 4.5:1) albo zdjęcie */
.av { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 700; flex: none; object-fit: cover; line-height: 1; }
.av-s { width: 28px; height: 28px; font-size: .75rem; }
.av-m { width: 40px; height: 40px; font-size: .95rem; }
.av-l { width: 72px; height: 72px; font-size: 1.6rem; }
.av-c0 { background: #1f4e79; } .av-c1 { background: #8a2d1e; } .av-c2 { background: #1d6b3a; } .av-c3 { background: #6a3d9a; }
.av-c4 { background: #7a4b00; } .av-c5 { background: #0f6464; } .av-c6 { background: #a1261d; } .av-c7 { background: #4b5563; }
.av-c8 { background: #7a3e65; } .av-c9 { background: #2c5f2d; } .av-c10 { background: #4f3f8f; } .av-c11 { background: #6b4f2a; }
.av-row { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.swatch { display: inline-flex; align-items: center; gap: 4px; font-weight: 400; cursor: pointer; }
.swatch input { width: 18px; height: 18px; min-height: 0; }
.me { display: inline-flex; align-items: center; gap: 8px; }
.who { display: inline-flex; align-items: center; gap: 8px; }

/* komunikaty, listy, posiedzenia */
.flash { margin: 0 0 16px; }
.pre { white-space: pre-line; }
.small { font-size: .9rem; }
.spaced { margin-top: 14px; }
.plain { list-style: none; padding: 0; margin: 0; }
.todo { margin: 0; padding-left: 20px; }
.todo li { margin: 4px 0; }
.todo li.late a { color: var(--err); }
.next-when { font-size: 1.1rem; margin: 0 0 4px; }
a.tile { text-decoration: none; color: var(--text); }
a.tile:hover { border-color: var(--accent); }
details.more { margin-top: 12px; }
details.more summary { cursor: pointer; color: var(--accent); font-weight: 600; min-height: 32px; }
.agenda { padding-left: 24px; margin: 0; }
.agenda li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.agenda-row, .pending { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.pending { padding: 10px 0; border-bottom: 1px solid var(--line); }
.row-actions { display: flex; gap: 6px; flex: none; }
.row-actions form { margin: 0; }
.icon-btn { min-width: 36px; min-height: 36px; border: 1px solid var(--line); background: var(--surface); color: var(--accent); border-radius: 6px; cursor: pointer; font: inherit; }
.icon-btn.danger { color: var(--err); }
.icon-btn { font-size: 1.1rem; }
#porzadek h3 { margin-top: 18px; }
a.icon-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.edit-form { flex: 1; max-width: 640px; background: var(--accent-soft); padding: 12px; border-radius: var(--radius); }
.edit-form .actions { margin-top: 6px; }
.res { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.res:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.vote input { width: 90px; }
.filters { margin: 0 0 16px; max-width: none; }
.filters input#q { width: 220px; }
tr.withdrawn td { color: var(--muted); }
code.hash { font-size: .85rem; }
.m-planowane, .r-projekt { background: var(--accent-soft); color: var(--accent); }
.m-zwolane, .m-w_toku { background: var(--warn-bg); color: var(--warn); }
.m-odbyte, .r-podjeta { background: var(--ok-bg); color: var(--ok); }
.m-odwolane, .r-niepodjeta, .r-wycofana { background: var(--err-bg); color: var(--err); }
h1 .status { font-size: .9rem; vertical-align: middle; font-weight: 600; }

/* harmonogram, postęp, zadania */
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px 14px; }
.grid2 > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
select, input, textarea { max-width: 100%; }
@media (max-width: 600px) { .g-row { grid-template-columns: 42% minmax(0, 1fr); } .g-months span { font-size: .65rem; } .areas { grid-template-columns: 1fr; } }
.edit-form.wide { max-width: none; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: .9rem; color: var(--muted); }
.lg { display: inline-block; width: 18px; height: 10px; border-radius: 2px; }
.lg-plan { background: var(--plan); } .lg-fakt { background: var(--accent); } .lg-today { background: var(--err); width: 3px; } .lg-ev { background: var(--warn); width: 6px; }
:root { --plan: #b7c9dc; --grid: #e3e7ec; }
:root[data-theme="ciemny"] { --plan: #3c5874; --grid: #2b3138; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="jasny"]) { --plan: #3c5874; --grid: #2b3138; } }
.gantt { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.g-row { display: grid; grid-template-columns: minmax(150px, 34%) minmax(0, 1fr); border-bottom: 1px solid var(--line); align-items: center; }
.g-row:last-child { border-bottom: 0; }
.g-name { padding: 6px 10px; font-size: .9rem; border-right: 1px solid var(--line); }
.g-head { background: var(--accent-soft); font-weight: 600; font-size: .85rem; }
.g-months { display: flex; }
.g-months span { flex: 1; min-width: 0; text-align: center; padding: 6px 0; font-size: .78rem; border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.g-bars { position: relative; overflow: hidden; height: 34px; }
.g-bars svg { display: block; width: 100%; height: 100%; }
.g-ev .g-bars { height: 24px; }
.g-ev .g-name { font-size: .82rem; }
.g-grid { stroke: var(--grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
.g-today { stroke: var(--err); stroke-width: 2; vector-effect: non-scaling-stroke; }
.g-plan { fill: var(--plan); } .g-fakt { fill: var(--accent); }
.g-span { fill: var(--grid); } .g-evm { fill: var(--warn); } .g-evok { fill: var(--ok); } .g-evbad { fill: var(--err); }
.meter { width: 100%; max-width: 160px; height: 6px; margin-top: 4px; }
.meter.big { max-width: none; height: 8px; margin-top: 8px; }
.meter svg { display: block; width: 100%; height: 100%; border-radius: 3px; }
.m-bg { fill: var(--grid); } .m-fg { fill: var(--accent); }
.st-zakonczony, .ts-zrobione, .el-gotowy, .ev-wykonano { background: var(--ok-bg); color: var(--ok); }
.st-w_toku, .ts-w_toku, .ts-do_weryfikacji, .el-w_opracowaniu, .el-projekt, .ev-plan { background: var(--warn-bg); color: var(--warn); }
.st-wstrzymany, .ts-wstrzymane { background: var(--err-bg); color: var(--err); }
.st-planowany, .ts-do_zrobienia, .el-brak, .ev-czeka { background: var(--accent-soft); color: var(--accent); }
tr.row-bad td { background: var(--err-bg); }
.err { color: var(--err); }
.terms input[type=date] { min-height: 40px; }
.terms input:not([type]) { width: 100%; min-height: 36px; margin-top: 4px; font-size: .9rem; }
.card-like { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 16px 0; }
.sfera { margin-top: 20px; }
.areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.area { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.area h4 { margin: 0 0 4px; font-size: 1rem; }
.area .facts { grid-template-columns: max-content 1fr; }
.menu a.me[aria-current="page"] { border-bottom: 0; }
.menu .me[aria-current="page"] .av { outline: 2px solid var(--accent); outline-offset: 2px; }

/* wydruki: porządek obrad i lista obecności */
.print-page { background: #fff; color: #000; }
.sheet { max-width: 800px; margin: 0 auto; padding: 24px 16px; }
.sheet-head { display: flex; gap: 16px; align-items: center; border-bottom: 2px solid #000; padding-bottom: 10px; margin-bottom: 20px; }
.sheet-head p { margin: 0; }
.sheet-org { font-weight: 700; font-size: 1.1rem; }
.sheet-basis { font-size: .9rem; }
.print-agenda li { margin: 6px 0; }
.print-table { border: 1px solid #000; margin-bottom: 16px; }
.print-table th, .print-table td { border: 1px solid #000; background: #fff; color: #000; }
.print-table td.sign { width: 35%; height: 34px; }
@media print {
  .no-print, .skip, .pilot { display: none !important; }
  .sheet { padding: 0; max-width: none; }
  @page { margin: 18mm 15mm; }
}

@media (max-width: 600px) { .facts { grid-template-columns: 1fr; } .facts dt { margin-top: 6px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
