/* =========================================================================
   Portal testów przestrzeni Confluence — wspólne style
   ========================================================================= */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-2: #d1d5db;

  --brand: #1f4fd8;
  --brand-ink: #173ea9;
  --brand-soft: #eaf0ff;
  --navy: #0e1a33;

  --ok: #1f8f5f;
  --ok-soft: #e7f6ee;
  --partial: #c98a04;
  --partial-soft: #fdf4dc;
  --error: #c93b3b;
  --error-soft: #fdecec;
  --pending: #9aa3b2;

  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 4px 16px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .14);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; color: var(--ink); }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 650; }
h3 { font-size: 16px; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .92em; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }

/* ---------- Top bar ---------- */
.topbar {
  height: 60px;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 600; letter-spacing: -.01em; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #3b6cf6, #1f4fd8 55%, #10307f);
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}
.brand-mark svg { width: 17px; height: 17px; }
.brand small { display: block; font-weight: 400; font-size: 11.5px; color: #9fb0d4; margin-top: -2px; }
.topbar-right { display: flex; align-items: center; gap: 14px; font-size: 13.5px; color: #c9d3ea; }
.topbar .btn-ghost { color: #dfe6f5; border-color: rgba(255,255,255,.18); }
.topbar .btn-ghost:hover { background: rgba(255,255,255,.08); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px;
  border-radius: 8px; border: 1px solid transparent;
  font: inherit; font-weight: 550; font-size: 14px;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-ink); }
.btn-secondary { background: var(--surface); color: var(--ink-2); border-color: var(--line-2); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: #b9c0cc; }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-danger { background: var(--surface); color: var(--error); border-color: #efc4c4; }
.btn-danger:hover:not(:disabled) { background: var(--error-soft); }
.btn-success { background: var(--ok); color: #fff; }
.btn-success:hover:not(:disabled) { background: #187a50; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 7px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 7px; border: 1px solid transparent;
  background: transparent; display: inline-grid; place-items: center; cursor: pointer; color: var(--muted);
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.icon-btn.danger:hover { color: var(--error); background: var(--error-soft); border-color: #f2cccc; }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 550; color: var(--ink-2); }
.input, textarea.input, select.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface);
  font: inherit;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,79,216,.15); }
.input::placeholder { color: #a0a7b4; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.form-error {
  background: var(--error-soft); color: #8f2323; border: 1px solid #f3caca;
  padding: 10px 12px; border-radius: 8px; font-size: 13.5px; margin-bottom: 14px;
}
.form-hint { font-size: 12.5px; color: var(--muted); }

/* ---------- Cards / layout ---------- */
.container { max-width: 1120px; margin: 0 auto; padding: 32px 24px 64px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 22px 24px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 22px; border-bottom: 1px solid var(--line);
}
.card-head h3 { font-size: 15px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .01em;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-draft { background: #f1f2f5; color: #556070; border-color: #e1e4ea; }
.badge-active { background: var(--brand-soft); color: var(--brand-ink); border-color: #cfdcff; }
.badge-closed { background: #eef0f3; color: #3b4252; border-color: #dadde3; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: #c6ead6; }
.badge-error { background: var(--error-soft); color: var(--error); border-color: #f3caca; }
.badge-partial { background: var(--partial-soft); color: #9a6a03; border-color: #f2df9e; }
.badge-pending { background: #f2f3f6; color: #6b7280; border-color: #e3e5ea; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); background: var(--surface-2); padding: 10px 14px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #fafbfc; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Toast ---------- */
.toast-host { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast {
  background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow-lg);
  font-size: 14px; max-width: 380px; animation: toastIn .2s ease-out;
}
.toast.error { background: #7d1f1f; }
.toast.success { background: #145c3e; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(14, 26, 51, .45); display: grid; place-items: center;
  z-index: 50; padding: 20px; animation: fade .15s;
}
.modal {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column;
}
.modal.wide { max-width: 980px; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 20px 22px; overflow: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Empty state ---------- */
.empty {
  text-align: center; padding: 56px 24px; color: var(--muted);
}
.empty .empty-icon {
  width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 14px; background: var(--surface-2);
  border: 1px solid var(--line); display: grid; place-items: center; color: #8a93a3;
}
.empty .empty-icon svg { width: 26px; height: 26px; }
.empty h3 { color: var(--ink); margin-bottom: 6px; }

/* ---------- Progress ---------- */
.progress { height: 8px; background: #e9ecf1; border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .3s ease; }
.progress.ok > span { background: var(--ok); }

.spinner {
  width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid #d7dce5; border-top-color: var(--brand);
  animation: spin .7s linear infinite; margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================================
   STRONA TESTERA
   ========================================================================= */
.login-shell {
  min-height: calc(100vh - 60px);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.login-hero {
  background:
    radial-gradient(1200px 500px at -10% -10%, rgba(59,108,246,.35), transparent 60%),
    radial-gradient(800px 400px at 110% 110%, rgba(31,143,95,.18), transparent 60%),
    var(--navy);
  color: #e8edf8;
  padding: 72px 64px;
  display: flex; flex-direction: column; justify-content: center;
}
.login-hero .eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #8ea4d6; font-weight: 600; margin-bottom: 18px; }
.login-hero h1 { color: #fff; font-size: 36px; line-height: 1.15; max-width: 520px; }
.login-hero p { margin-top: 18px; color: #b8c4de; max-width: 480px; font-size: 15.5px; }
.hero-steps { margin-top: 40px; display: grid; gap: 14px; max-width: 460px; }
.hero-step { display: flex; gap: 14px; align-items: flex-start; }
.hero-step b {
  flex: 0 0 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  display: grid; place-items: center; font-size: 13px; color: #fff;
}
.hero-step span { color: #c6d0e6; font-size: 14px; padding-top: 3px; }
.login-panel { display: grid; place-items: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 400px; }
.login-card h2 { font-size: 24px; margin-bottom: 6px; }
.login-card .lead { color: var(--muted); margin-bottom: 26px; }

.welcome { margin-bottom: 28px; }
.welcome .eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); font-weight: 650; margin-bottom: 8px; }
.welcome h1 { font-size: 30px; }
.welcome p { color: var(--muted); margin-top: 8px; font-size: 15px; }

.summary-strip { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 26px; }
.summary-pill {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px;
  display: flex; gap: 10px; align-items: baseline;
}
.summary-pill b { font-size: 20px; font-variant-numeric: tabular-nums; }
.summary-pill span { color: var(--muted); font-size: 13px; }

.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; margin: 8px 0 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.tile {
  position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 20px 20px 18px; cursor: pointer; text-align: left; font: inherit; color: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .15s;
  display: flex; flex-direction: column; gap: 14px; min-height: 170px;
}
.tile:hover { border-color: #b8c8f3; box-shadow: var(--shadow); transform: translateY(-2px); }
.tile::before {
  content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand);
}
.tile.done { cursor: default; background: var(--surface-2); }
.tile.done:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--line); }
.tile.done::before { background: var(--ok); }
.tile-task { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; }
.tile-space { font-size: 18px; font-weight: 650; line-height: 1.3; }
.tile-key { font-family: var(--mono); font-size: 12px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); padding: 2px 7px; border-radius: 5px; display: inline-block; margin-top: 6px; }
.tile-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); }
.tile-cta { color: var(--brand); font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.tile-cta svg { width: 15px; height: 15px; }

/* ---------- Test runner ---------- */
.test-head {
  position: sticky; top: 60px; z-index: 10;
  background: rgba(244,245,247,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.test-head-inner { max-width: 820px; margin: 0 auto; padding: 16px 24px 14px; }
.test-head .crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.test-head .crumbs a { color: var(--muted); }
.test-head h1 { font-size: 22px; }
.test-head h1 .sep { color: #b5bcc8; font-weight: 400; margin: 0 6px; }
.test-head .meta { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 16px; }
.test-head .meta .progress { flex: 1; }
.test-head .meta span { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.test-body { max-width: 820px; margin: 0 auto; padding: 24px 24px 120px; }
.space-info {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px; font-size: 13.5px;
}
.space-info .k { color: var(--muted); }

.q {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 22px 24px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
  animation: qIn .25s ease-out;
  scroll-margin-top: 190px;
  transition: border-color .2s, box-shadow .2s, opacity .2s;
}
.q.current { border-color: #b7c7f5; box-shadow: 0 0 0 3px rgba(31,79,216,.08), var(--shadow); }
.q.answered:not(.current) { opacity: .92; }
@keyframes qIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.q-top { display: flex; gap: 14px; align-items: flex-start; }
.q-code {
  flex: 0 0 auto; font-family: var(--mono); font-size: 13px; font-weight: 600;
  background: var(--brand-soft); color: var(--brand-ink); padding: 4px 9px; border-radius: 6px; margin-top: 1px;
}
.q-text { font-size: 16px; font-weight: 550; line-height: 1.45; }
.q-hint { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.q-options { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.opt {
  flex: 1; min-width: 150px;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  height: 46px; border-radius: 10px; border: 1.5px solid var(--line-2); background: var(--surface);
  font: inherit; font-weight: 600; font-size: 14.5px; color: var(--ink-2); cursor: pointer;
  transition: all .15s;
}
.opt svg { width: 18px; height: 18px; }
.opt:hover { border-color: #9aa5b8; background: var(--surface-2); }
.opt.ok.sel { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.opt.partial.sel { border-color: var(--partial); background: var(--partial-soft); color: #946503; }
.opt.error.sel { border-color: var(--error); background: var(--error-soft); color: var(--error); }
.opt.ok:hover:not(.sel) { color: var(--ok); }
.opt.partial:hover:not(.sel) { color: #946503; }
.opt.error:hover:not(.sel) { color: var(--error); }
.q-desc { margin-top: 16px; animation: qIn .2s ease-out; }
.q-desc label { font-size: 13px; font-weight: 600; color: var(--ink-2); display: block; margin-bottom: 6px; }
.q-desc .row { justify-content: flex-end; margin-top: 10px; }

.submit-bar {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  box-shadow: var(--shadow); animation: qIn .25s ease-out; margin-top: 22px;
}
.submit-tally { display: flex; gap: 8px; flex-wrap: wrap; }

.success-screen { text-align: center; padding: 72px 24px; max-width: 520px; margin: 0 auto; }
.success-icon {
  width: 72px; height: 72px; border-radius: 50%; background: var(--ok-soft); color: var(--ok);
  display: grid; place-items: center; margin: 0 auto 20px; border: 1px solid #c6ead6;
}
.success-icon svg { width: 34px; height: 34px; }

/* =========================================================================
   PANEL ADMINA
   ========================================================================= */
.admin-shell { display: grid; grid-template-columns: 248px 1fr; min-height: calc(100vh - 60px); }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--line); padding: 20px 14px;
  position: sticky; top: 60px; height: calc(100vh - 60px); overflow: auto;
}
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #9aa1ad; font-weight: 650; padding: 0 12px; margin: 6px 0 8px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px;
  color: var(--ink-2); font-weight: 520; font-size: 14px; margin-bottom: 2px;
}
.nav a svg { width: 18px; height: 18px; color: #8a93a3; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.nav a.active svg { color: var(--brand); }
.sidebar-foot { margin-top: 28px; padding: 14px 12px; border-top: 1px solid var(--line); font-size: 13px; }
.sidebar-foot b { display: block; color: var(--ink); }

.main { padding: 30px 36px 70px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; }
.page-head p { color: var(--muted); margin-top: 4px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }

.folder-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.folder-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow-sm); cursor: pointer; transition: border-color .15s, box-shadow .15s;
  display: flex; flex-direction: column; gap: 14px;
}
.folder-card:hover { border-color: #b8c8f3; box-shadow: var(--shadow); }
.folder-card h3 { font-size: 16.5px; }
.folder-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.folder-meta div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.folder-meta b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.folder-meta span { font-size: 11.5px; color: var(--muted); }

/* ---------- Wizard ---------- */
.steps { display: flex; gap: 0; margin-bottom: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.step {
  flex: 1; display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer;
  border-right: 1px solid var(--line); font-size: 13.5px; color: var(--muted); background: var(--surface);
  transition: background .15s;
}
.step:last-child { border-right: none; }
.step:hover { background: var(--surface-2); }
.step .n {
  width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center;
  font-weight: 650; font-size: 12.5px; flex: 0 0 auto; background: var(--surface);
}
.step b { display: block; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.step.active { background: var(--brand-soft); color: var(--brand-ink); }
.step.active .n { background: var(--brand); border-color: var(--brand); color: #fff; }
.step.active b { color: var(--brand-ink); }
.step.complete .n { background: var(--ok); border-color: var(--ok); color: #fff; }

.q-edit-row { display: grid; grid-template-columns: 96px 1fr 30px; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.q-edit-row:last-child { border-bottom: none; }
.q-edit-row .input { height: 38px; }
.q-edit-row textarea.input { min-height: 38px; height: 38px; padding-top: 8px; }

.dropzone {
  border: 1.5px dashed #b9c3d6; border-radius: var(--radius); padding: 22px; text-align: center; background: var(--surface-2);
  color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.dropzone svg { width: 26px; height: 26px; margin-bottom: 6px; }
.dropzone b { color: var(--ink); }

.section-group { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.section-group-head { background: var(--surface-2); padding: 9px 14px; font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }
.section-group-item { padding: 9px 14px; display: flex; gap: 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.section-group-item:last-child { border-bottom: none; }

.person-card { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; background: var(--surface); }
.person-head { display: flex; align-items: center; gap: 14px; padding: 12px 16px; cursor: pointer; }
.person-head:hover { background: var(--surface-2); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 650; font-size: 13px;
  background: #e3e9fb; color: var(--brand-ink); flex: 0 0 auto;
}
.person-spaces { border-top: 1px solid var(--line); padding: 6px 16px 10px 66px; }
.space-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.space-row:last-child { border-bottom: none; }
.chev { width: 16px; height: 16px; color: var(--muted); transition: transform .15s; }
.open > .person-head .chev { transform: rotate(90deg); }

.check-list label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; cursor: pointer; }
.check-list label:hover { background: var(--surface-2); }
.check-list input { width: 16px; height: 16px; accent-color: var(--brand); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tab {
  padding: 10px 14px; border: none; background: none; font: inherit; font-weight: 550; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand-ink); border-bottom-color: var(--brand); }

.seg { display: inline-flex; background: #eceff3; border-radius: 9px; padding: 3px; gap: 2px; }
.seg button { border: none; background: none; font: inherit; font-size: 13px; font-weight: 550; padding: 6px 12px; border-radius: 7px; cursor: pointer; color: var(--ink-2); }
.seg button.active { background: var(--surface); box-shadow: var(--shadow-sm); color: var(--ink); }

/* ---------- KPI / statystyki ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.kpi .label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.kpi .value { font-size: 28px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .value small { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.kpi .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.kpi.accent-ok { border-top: 3px solid var(--ok); }
.kpi.accent-error { border-top: 3px solid var(--error); }
.kpi.accent-partial { border-top: 3px solid var(--partial); }
.kpi.accent-brand { border-top: 3px solid var(--brand); }

.chart-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; margin-bottom: 16px; }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 18px 20px; min-width: 0; }
.chart-card h3 { font-size: 14.5px; }
.chart-card .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; margin-bottom: 14px; }
.chart-box { position: relative; height: 280px; }
.chart-box.tall { height: 360px; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.stackbar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: #eceff3; min-width: 120px; }
.stackbar span { display: block; height: 100%; }
.sb-ok { background: var(--ok); } .sb-partial { background: var(--partial); } .sb-error { background: var(--error); } .sb-pending { background: #d5dae2; }

.health { font-weight: 650; font-variant-numeric: tabular-nums; }

.heatmap { border-collapse: separate; border-spacing: 3px; font-size: 12px; }
.heatmap th { font-weight: 600; color: var(--muted); padding: 4px 6px; white-space: nowrap; font-family: var(--mono); font-size: 11px; }
.heatmap th.rowh { text-align: right; font-family: var(--font); font-size: 12.5px; color: var(--ink-2); max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.heatmap td { width: 24px; height: 24px; border-radius: 5px; text-align: center; }
.hm-ok { background: #3aa877; } .hm-partial { background: #e5b52c; } .hm-error { background: #d65454; } .hm-none { background: #eceff3; }

.comment-list { display: grid; gap: 8px; }
.comment {
  border: 1px solid var(--line); border-left: 3px solid var(--line-2); border-radius: 8px; padding: 10px 14px; font-size: 13.5px; background: var(--surface);
}
.comment.error { border-left-color: var(--error); }
.comment.partial { border-left-color: var(--partial); }
.comment .who { font-size: 12px; color: var(--muted); margin-bottom: 3px; }

/* ---------- Raport do druku ---------- */
#printReport { display: none; }

@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff; font-size: 11px; }
  body.printing > *:not(#printReport) { display: none !important; }
  body.printing #printReport { display: block !important; }
  .print-page-break { page-break-before: always; }
  #printReport h1 { font-size: 20px; }
  #printReport h2 { font-size: 15px; margin: 18px 0 8px; border-bottom: 2px solid #111; padding-bottom: 4px; }
  #printReport .table th { background: #f1f3f6 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #printReport .table td, #printReport .table th { padding: 5px 7px; }
  #printReport img { max-width: 100%; }
  #printReport * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .avoid-break { page-break-inside: avoid; }
}
.rep-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 3px solid var(--navy); padding-bottom: 10px; margin-bottom: 14px; }
.rep-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 10px 0 14px; }
.rep-kpis div { border: 1px solid #d9dde4; border-radius: 6px; padding: 8px 10px; }
.rep-kpis b { display: block; font-size: 18px; }
.rep-kpis span { font-size: 10px; color: #555; text-transform: uppercase; letter-spacing: .05em; }
.rep-charts { display: grid; grid-template-columns: 1fr 1.6fr; gap: 14px; align-items: center; }

/* ---------- Responsywność ---------- */
@media (max-width: 1100px) {
  .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
}
@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-hero { padding: 40px 24px; }
  .login-hero h1 { font-size: 28px; }
  .hero-steps { display: none; }
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--line); }
  .sidebar .nav { display: flex; gap: 4px; overflow-x: auto; }
  .sidebar-foot, .nav-label { display: none; }
  .main { padding: 22px 16px 60px; }
  .steps { flex-direction: column; }
  .step { border-right: none; border-bottom: 1px solid var(--line); }
  .topbar { padding: 0 16px; }
  .brand small { display: none; }
}
@media (max-width: 560px) {
  .opt { min-width: 100%; }
  .q { padding: 18px; }
  .container, .test-body, .test-head-inner { padding-left: 16px; padding-right: 16px; }
  .q-edit-row { grid-template-columns: 70px 1fr 30px; }
}
.person-card:not(.open) > .person-spaces { display: none; }
#printReport img { max-width: 100%; height: auto; display: block; }
