/* Semtrix App — interfejs pracy.
   Styl: lekki, biele i jasne szarości, cienkie linie, jeden kolor akcentu.
   Całość opiera się na zmiennych poniżej; komponenty niżej korzystają tylko z nich. */

@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-Variable.d1bac27c388f.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-soft: #fafbfc;
  --line: #e7e9ee;
  --line-soft: #f0f2f5;
  --text: #101828;
  --text-2: #344054;
  --muted: #667085;
  --faint: #98a2b3;

  --accent: #5b47e0;
  --accent-strong: #4836c4;
  --accent-soft: #f2f0fd;
  --accent-line: #dcd6fa;

  --red: #b42318;    --red-bg: #fef3f2;    --red-line: #fecdca;
  --amber: #b54708;  --amber-bg: #fffaeb;  --amber-line: #fedf89;
  --orange: #c4320a; --orange-bg: #fff6ed; --orange-line: #f9dbaf;
  --blue: #175cd3;   --blue-bg: #eff8ff;   --blue-line: #b2ddff;
  --green: #067647;  --green-bg: #ecfdf3;  --green-line: #abefc6;
  --violet: #5925dc; --violet-bg: #f4f3ff; --violet-line: #d9d6fe;
  --gray: #475467;   --gray-bg: #f9fafb;   --gray-line: #eaecf0;

  --radius: 12px;
  --radius-sm: 8px;
  --sidebar: 232px;
  --topbar: 64px;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 14px/1.5 var(--font); letter-spacing: 0; word-spacing: 0.03em;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a.link, .link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent-line); }
a.link:hover { text-decoration-color: currentColor; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* --- układ -------------------------------------------------------------------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 22px 14px 16px; overflow-y: auto;
}
.logo { display: inline-flex; align-items: flex-start; padding: 2px 10px 22px; font-weight: 700; font-size: 23px; letter-spacing: -0.045em; line-height: 1; color: var(--text); }
.logo sup { font-size: 10px; font-weight: 600; letter-spacing: 0.02em; color: var(--accent); margin: -1px 0 0 3px; line-height: 1; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { margin: 18px 10px 6px; font-size: 11px; font-weight: 500; letter-spacing: 0.09em; text-transform: uppercase; color: var(--faint); }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 450; }
.nav a svg { color: var(--faint); }
.nav a:hover { background: var(--surface-soft); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 550; }
.nav a.active svg { color: var(--accent); }
.nav .count { margin-left: auto; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; font-size: 12px; color: var(--faint); }

.topbar {
  position: sticky; top: 0; z-index: 5; height: var(--topbar); margin-left: var(--sidebar);
  background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 40px;
}
.crumbs { display: flex; gap: 8px; align-items: center; font-weight: 550; min-width: 0; margin-right: auto; }
.crumbs .sep { color: var(--faint); font-weight: 400; }
.crumbs a { color: var(--muted); font-weight: 450; }
.crumbs a:hover { color: var(--text); }
.userbox { position: relative; }
.userbox summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 6px 8px; border-radius: var(--radius-sm); }
.userbox summary::-webkit-details-marker { display: none; }
.userbox summary:hover { background: var(--surface-soft); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.userbox .who { line-height: 1.25; }
.userbox .who b { display: block; font-weight: 550; }
.userbox .who span { font-size: 12px; color: var(--muted); }

.main { margin-left: var(--sidebar); padding: 32px 40px 64px; }
.wrap { max-width: 1560px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { font-size: 30px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.15; }
.page-sub { margin-top: 8px; color: var(--muted); font-size: 13.5px; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* --- przyciski i pola ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
  font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-soft); border-color: #d8dce3; }
.btn svg.icon { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--line-soft); border-color: transparent; }
.btn-danger { color: var(--red); }
.btn-danger:hover { background: var(--red-bg); border-color: var(--red-line); }
.btn-icon { width: 30px; height: 30px; padding: 0; border-radius: 7px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.input, .select, .textarea {
  height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); min-width: 0;
}
.textarea { height: auto; padding: 10px 12px; width: 100%; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select { padding-right: 32px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23667085' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 10px; color: var(--faint); }
.search .input { padding-left: 38px; width: 240px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 500; font-size: 13px; }
.field .hint { font-size: 12px; color: var(--muted); }

/* --- etykiety statusu ---------------------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 1px 7px; border-radius: 6px;
  font-size: 12px; font-weight: 500; line-height: 18px; white-space: nowrap;
  border: 1px solid var(--gray-line); background: var(--gray-bg); color: var(--gray);
}
.tone-red { color: var(--red); background: var(--red-bg); border-color: var(--red-line); }
.tone-amber { color: var(--amber); background: var(--amber-bg); border-color: var(--amber-line); }
.tone-orange { color: var(--orange); background: var(--orange-bg); border-color: var(--orange-line); }
.tone-blue { color: var(--blue); background: var(--blue-bg); border-color: var(--blue-line); }
.tone-green { color: var(--green); background: var(--green-bg); border-color: var(--green-line); }
.tone-violet { color: var(--violet); background: var(--violet-bg); border-color: var(--violet-line); }
.tone-gray { color: var(--gray); background: var(--gray-bg); border-color: var(--gray-line); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.spinner { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* --- karty liczników ------------------------------------------------------------------ */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 28px; }
.kpi {
  display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: start;
  padding: 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
}
.kpi .ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgb(255 255 255 / 0.7); border: 1px solid currentColor; border-color: color-mix(in srgb, currentColor 22%, transparent); }
.kpi .value { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .label { margin-top: 8px; font-weight: 500; color: var(--text); }
.kpi .desc { margin-top: 4px; font-size: 12.5px; color: var(--muted); min-height: 19px; }
.kpi > div { display: flex; flex-direction: column; align-items: flex-start; height: 100%; min-width: 0; }
.kpi .more { margin-top: auto; padding-top: 14px; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 550; }
.kpi .more svg.icon { width: 15px; height: 15px; }
.kpi .more:hover { text-decoration: underline; text-underline-offset: 3px; }
.kpi.tone-red { background: var(--red-bg); border-color: var(--red-line); color: inherit; }
.kpi.tone-amber { background: var(--amber-bg); border-color: var(--amber-line); color: inherit; }
.kpi.tone-orange { background: var(--orange-bg); border-color: var(--orange-line); color: inherit; }
.kpi.tone-blue { background: var(--blue-bg); border-color: var(--blue-line); color: inherit; }
.kpi.tone-violet { background: var(--violet-bg); border-color: var(--violet-line); color: inherit; }
.kpi.tone-red .value, .kpi.tone-red .ico, .kpi.tone-red .more { color: var(--red); }
.kpi.tone-amber .value, .kpi.tone-amber .ico, .kpi.tone-amber .more { color: var(--amber); }
.kpi.tone-orange .value, .kpi.tone-orange .ico, .kpi.tone-orange .more { color: var(--orange); }
.kpi.tone-blue .value, .kpi.tone-blue .ico, .kpi.tone-blue .more { color: var(--blue); }
.kpi.tone-violet .value, .kpi.tone-violet .ico, .kpi.tone-violet .more { color: var(--violet); }
.kpi.tone-plain { background: var(--surface); }
.kpi.tone-plain .ico, .kpi.tone-plain .more { color: var(--green); }
.kpi.tone-plain .ico { background: var(--green-bg); }
.kpi.is-active { box-shadow: 0 0 0 2px var(--accent-soft), inset 0 0 0 1px var(--accent-line); }

/* --- karta i tabela ---------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 20px; }
.card-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
.toolbar .filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.table-scroll { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 600; font-size: 13.5px; padding: 14px 16px; background: var(--surface-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 15px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-soft); }
.table tbody tr.is-done td { background: var(--surface-soft); }
.table tbody tr.is-done .title-cell a { color: var(--muted); }
.table th:first-child, .table td:first-child { padding-left: 24px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table .title-cell { font-weight: 500; max-width: 460px; }
.table .title-cell a:hover { color: var(--accent-strong); }
.table .sub { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions form { display: inline; }
.table-foot { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; border-top: 1px solid var(--line); color: var(--text-2); }
.pager { display: flex; }
.pager a, .pager span { min-width: 36px; height: 36px; padding: 0 10px; display: grid; place-items: center; border: 1px solid var(--line); margin-left: -1px; background: var(--surface); font-variant-numeric: tabular-nums; }
.pager > :first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.pager > :last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.pager .current { color: var(--accent-strong); background: var(--accent-soft); font-weight: 600; }
.pager a:hover { background: var(--surface-soft); }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); font-weight: 600; margin-bottom: 4px; font-size: 15px; }

/* menu „…” w wierszu */
.menu { position: relative; display: inline-block; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 200px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 28px -8px rgb(16 24 40 / 0.16); text-align: left; }
.menu-list a, .menu-list button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; border-radius: 6px; cursor: pointer; text-align: left; color: var(--text-2); }
.menu-list a:hover, .menu-list button:hover { background: var(--line-soft); color: var(--text); }
.menu-list .danger { color: var(--red); }
.menu-list hr { border: 0; border-top: 1px solid var(--line-soft); margin: 6px 0; }

/* --- komunikaty --------------------------------------------------------------------------- */
#flash { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
#flash:empty { display: none; }
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid var(--blue-line); background: var(--blue-bg); color: var(--blue); font-weight: 450; }
.flash.success { border-color: var(--green-line); background: var(--green-bg); color: var(--green); }
.flash.error { border-color: var(--red-line); background: var(--red-bg); color: var(--red); }
.flash.warning { border-color: var(--amber-line); background: var(--amber-bg); color: var(--amber); }
.banner { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-weight: 450; border: 1px solid var(--violet-line); background: var(--violet-bg); color: var(--violet); }
.banner.error { border-color: var(--red-line); background: var(--red-bg); color: var(--red); }
.banner a { text-decoration: underline; text-underline-offset: 3px; }
.banner code { white-space: nowrap; font-size: 0.92em; background: rgb(255 255 255 / 0.7); padding: 1px 6px; border-radius: 4px; border: 1px solid currentColor; }

/* --- okno dialogowe ---------------------------------------------------------------------------- */
dialog.modal { border: 0; padding: 0; border-radius: 14px; width: min(520px, calc(100vw - 32px)); box-shadow: 0 24px 60px -12px rgb(16 24 40 / 0.3); color: var(--text); }
dialog.modal::backdrop { background: rgb(16 24 40 / 0.35); }
.modal-head { padding: 20px 24px 0; }
.modal-head h2 { font-size: 18px; font-weight: 650; letter-spacing: -0.02em; }
.modal-head p { margin-top: 4px; color: var(--muted); font-size: 13.5px; }
.modal-body { padding: 18px 24px 4px; }
.modal-foot { padding: 12px 24px 20px; display: flex; justify-content: flex-end; gap: 10px; }

/* --- silosy ------------------------------------------------------------------------------------- */
.sitebar { display: grid; grid-template-columns: minmax(240px, 320px) repeat(4, 1fr); align-items: center; margin-bottom: 16px; }
.sitebar > * { padding: 16px 24px; }
.sitebar > * + * { border-left: 1px solid var(--line-soft); }
.sitebar .select { width: 100%; font-weight: 550; height: 42px; }
.stat .value { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .label { color: var(--muted); font-size: 13px; }

.board { display: grid; grid-template-columns: repeat(3, minmax(200px, 0.85fr)) minmax(400px, 1.7fr); gap: 14px; align-items: start; }
.col { min-width: 0; overflow: hidden; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 12px 18px; border-bottom: 1px solid var(--line-soft); }
.col-head .lvl { font-weight: 700; letter-spacing: -0.02em; }
.col-head .name { font-weight: 550; }
.col-head .n { color: var(--faint); font-variant-numeric: tabular-nums; }
.col-head .btn { margin-left: auto; }
.col-list { list-style: none; margin: 0; padding: 6px; max-height: calc(100vh - 330px); min-height: 120px; overflow-y: auto; }
.col-item { display: flex; align-items: center; border-radius: var(--radius-sm); }
.col-item:hover { background: var(--surface-soft); }
.col-item a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border-radius: var(--radius-sm); color: var(--text-2); }
.col-item .t { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 450; }
.col-item .c { color: var(--faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.col-item a svg { color: var(--faint); width: 15px; height: 15px; }
.col-item .state { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--green-line); }
.col-item.is-proposed .state { background: #f79009; }
.col-item.is-rejected .state { background: var(--gray-line); }
.col-item.is-rejected .t { color: var(--faint); text-decoration: line-through; }
.col-item.active { background: var(--accent-soft); }
.col-item.active a { color: var(--accent-strong); }
.col-item.active .t { font-weight: 600; }
.col-item.active .c, .col-item.active a svg { color: var(--accent); }
.col-item .quick { margin: 0 6px 0 0; flex: none; }
.btn-accept { color: var(--green); border-color: var(--green-line); background: var(--green-bg); width: 28px; height: 28px; }
.btn-accept:hover { background: var(--green); border-color: var(--green); color: #fff; }
.col-bulk { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); background: var(--amber-bg); margin: 0; }
.col-bulk .btn { background: var(--surface); width: 100%; color: var(--amber); border-color: var(--amber-line); white-space: normal; height: auto; min-height: 30px; padding: 4px 10px; }
.col-empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 13px; }

.detail { min-width: 0; }
.detail-head { padding: 18px 22px 16px; border-bottom: 1px solid var(--line-soft); }
.detail-path { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.detail-path a:hover { color: var(--text); }
.detail-title { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.detail-title h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.25; }
.detail-body { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 18px; }
.note { display: flex; gap: 12px; padding: 14px 16px; border-radius: 10px; background: var(--accent-soft); color: var(--text-2); }
.note svg { color: var(--accent); margin-top: 1px; }
.note b { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px; }
.note.reason { background: var(--gray-bg); }
.note.reason svg { color: var(--gray); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.tile { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.tile .value { font-size: 20px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.tile .label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-actions form { display: contents; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form .input { flex: 1; height: 34px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-head h3 { font-size: 14.5px; font-weight: 650; }
.topic-list { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.topic-list li { display: flex; gap: 12px; align-items: center; padding: 11px 12px 11px 14px; border-bottom: 1px solid var(--line-soft); }
.topic-list li:last-child { border-bottom: 0; }
.topic-list .role { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint); width: 58px; flex: none; }
.topic-list .role.pillar { color: var(--accent); }
.topic-list .t { flex: 1; min-width: 0; font-weight: 450; }
.topic-list .t small { display: block; color: var(--muted); font-size: 12.5px; }
.topic-list .is-rejected .t { color: var(--faint); text-decoration: line-through; }
.topic-list .acts { display: flex; gap: 6px; align-items: center; flex: none; }
.topic-list .acts form { display: contents; }

/* --- formularze ------------------------------------------------------------------------------- */
.statbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 16px; }
.statbar > * { padding: 16px 24px; }
.statbar > * + * { border-left: 1px solid var(--line-soft); }
.form-stack { display: flex; flex-direction: column; gap: 16px; max-width: 1040px; }
.form-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 24px 14px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.form-head p { font-size: 13px; margin-top: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; padding: 20px 24px 22px; }
.form-grid .field { margin: 0; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .input, .form-grid .select { width: 100%; }
.field .req { color: var(--red); }
.field .err, .check .err { color: var(--red); font-size: 12.5px; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--red-line); }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-soft); color: var(--muted); }
.form-foot { display: flex; gap: 10px; align-items: center; }
@media (max-width: 900px) { .form-grid { grid-template-columns: 1fr; } }

/* --- karta artykułu ---------------------------------------------------------------------------- */
.meta-line { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.warn { color: var(--red); font-weight: 550; }
.banner.info { border-color: var(--blue-line); background: var(--blue-bg); color: var(--blue); }
.banner.ok { border-color: var(--green-line); background: var(--green-bg); color: var(--green); }
.head-actions form { display: contents; }
.article-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.prose-card { padding: 28px 36px 36px; min-width: 0; }
.art-figure { margin: 0 0 24px; }
.art-figure img { display: block; max-width: 100%; max-height: 460px; width: auto; height: auto; border-radius: 10px; }
.art-figure figcaption { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.prose { max-width: 760px; font-size: 16px; line-height: 1.7; color: var(--text-2); word-spacing: 0.02em; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 16px; }
.prose h2 { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.3; color: var(--text); margin: 32px 0 12px; }
.prose h3 { font-size: 18px; font-weight: 650; letter-spacing: -0.01em; color: var(--text); margin: 24px 0 8px; }
.prose h4 { font-size: 16px; font-weight: 650; color: var(--text); margin: 20px 0 6px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 24px; }
.prose li { margin: 4px 0; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose table { border-collapse: collapse; margin: 0 0 20px; font-size: 14.5px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-soft); font-weight: 600; color: var(--text); }
.prose blockquote { margin: 0 0 16px; padding-left: 16px; border-left: 3px solid var(--line); color: var(--muted); }
.prose code { font-size: 0.92em; background: var(--line-soft); padding: 1px 5px; border-radius: 4px; }
.prose-title { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.25; margin: 0 0 16px; }
.side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.side h3 { font-size: 14px; font-weight: 650; margin-bottom: 10px; }
.side .card-pad { padding: 16px 18px; }
.side-notes { background: var(--amber-bg); border-color: var(--amber-line); }
.side-notes ul { margin: 0; padding-left: 18px; color: var(--text-2); }
.side-notes li { margin: 4px 0; }
.side-hint { font-size: 12.5px; margin: 12px 0 6px; }
.stack { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.stack .textarea { width: 100%; }
.file { font-size: 13px; max-width: 100%; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; flex-direction: column; gap: 1px; padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.mini-list li:first-child { border-top: 0; padding-top: 0; }
.mini-list li:last-child { padding-bottom: 0; }
.mini-list a { font-weight: 500; }
.mini-list a:hover { color: var(--accent-strong); }
.mini-list .current a { color: var(--accent-strong); font-weight: 650; }
details > summary { cursor: pointer; }
.editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.editor-grid .input { width: 100%; }
.textarea.mono { font-family: ui-monospace, "SF Mono", Consolas, "Liberation Mono", monospace; font-size: 13.5px; line-height: 1.6; min-height: 60vh; }
.preview-pane { position: sticky; top: calc(var(--topbar) + 16px); max-height: calc(100vh - var(--topbar) - 32px); overflow-y: auto; }
.preview-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; font-weight: 500; }
.preview-meta.warn { color: var(--red); }
@media (max-width: 1180px) { .article-grid, .editor-grid { grid-template-columns: 1fr; } .preview-pane { position: static; max-height: none; } }

/* --- pulpit ----------------------------------------------------------------------------------------- */
.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line-soft); }
.list-plain li:first-child { border-top: 0; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.kv:first-of-type { border-top: 0; }
.kv b { font-variant-numeric: tabular-nums; font-weight: 600; }

/* --- logowanie ------------------------------------------------------------------------------------------ */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(400px, 100%); padding: 32px; }
.auth-card .logo { padding: 0 0 24px; }
.auth-card h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 4px; }
.auth-card .input { width: 100%; }
.auth-card .btn { width: 100%; margin-top: 6px; }
.errorlist { list-style: none; margin: 0 0 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--red-bg); color: var(--red); border: 1px solid var(--red-line); font-size: 13px; }

/* --- węższe ekrany ------------------------------------------------------------------------------------ */
@media (max-width: 1280px) {
  .board { grid-template-columns: repeat(3, minmax(200px, 1fr)); }
  .detail { grid-column: 1 / -1; }
  .sitebar { grid-template-columns: repeat(2, 1fr); }
  .sitebar > :first-child { grid-column: 1 / -1; border-bottom: 1px solid var(--line-soft); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { position: static; width: auto; border-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-group, .sidebar-foot { display: none; }
  .topbar, .main { margin-left: 0; padding-left: 16px; padding-right: 16px; }
  .board { grid-template-columns: 1fr; }
  .col-list { max-height: 320px; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
}

/* --- wyszukiwarka globalna ----------------------------------------------------------------------- */
.gsearch { position: relative; margin: 0 16px; }
.gsearch > svg { position: absolute; left: 12px; top: 10px; color: var(--faint); pointer-events: none; }
.gsearch .input { width: 300px; padding-left: 38px; padding-right: 58px; background: var(--surface-soft); }
.gsearch .input:focus { background: var(--surface); }
.gsearch .input::-webkit-search-cancel-button { display: none; }
.gsearch kbd { position: absolute; right: 8px; top: 8px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--faint); font: 500 11px/16px inherit; font-family: inherit; pointer-events: none; }
.gsearch .input:focus ~ kbd { display: none; }
.gsearch-results { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 520px; max-width: calc(100vw - 32px); max-height: min(70vh, 620px); overflow-y: auto; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 36px -10px rgb(16 24 40 / 0.2); }
.gsearch-hint { padding: 14px 12px; color: var(--muted); }
.gsearch-group h4 { margin: 0; padding: 10px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.gsearch-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.gsearch-item:hover, .gsearch-item.is-active { background: var(--accent-soft); }
.gsearch-item .t { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gsearch-item small { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.gsearch-item .chip { flex: none; }
.gsearch-page { padding: 8px; max-width: 860px; }
@media (max-width: 900px) { .gsearch .input { width: 180px; } .gsearch kbd { display: none; } }

/* --- ekrany systemowe ---------------------------------------------------------------------------- */
.role-box { border-top: 1px solid var(--line-soft); padding: 12px 0 2px; }
.role-box h3 { font-size: 14px; font-weight: 650; }
.role-box p { font-size: 13px; margin-top: 4px; }
.plain-notes { margin: 0; padding-left: 18px; color: var(--text-2); }
.plain-notes li { margin: 3px 0; }
pre.raw { margin: 8px 0 0; padding: 10px 12px; background: var(--surface-soft); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); font-size: 12px; line-height: 1.5; overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
