/* Ergy Rozmowy rozwojowe: design system przeniesiony z makiety mockup/feedback_app_makieta.html.
   Zasada: kolory tylko przez zmienne z :root, status zawsze z kropką i etykietą, zero stylów inline poza szerokością pasków. */
:root {
  --page: #f4f5f2;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #6b6a65;
  --line: #e1e0d9;
  --border: rgba(11, 11, 11, 0.10);
  --brand: #0e7a5a;
  --brand-600: #0b6047;
  --brand-100: #dcf2ea;
  --good: #0ca30c;
  --good-text: #006300;
  --warn: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --neutral: #a8a69e;
  --bar: var(--brand);
  --bar-track: #e9eef5;
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.04), 0 4px 16px rgba(11, 11, 11, 0.04);
  --on-brand: #ffffff;
  --subtle: #f0efec;
  --subtle-2: #f7f7f4;
  --field: #ffffff;
  --warn-text: #8a5a00;
  --warn-bg: #fff4d6;
  --warn-bg-hover: #ffedbf;
  --warn-border: #f3dc9c;
  --danger-bg: #fbe9e9;
  --critical-text: #a12a2a;
  --toast-bg: #0b0b0b;
  --toast-ink: #ffffff;
  --toast-accent: #9fe3c8;
  --backdrop: rgba(11, 11, 11, 0.35);
  --shadow-strong: rgba(0, 0, 0, 0.15);
  --logo-bg: transparent;
  --on-warn: #3b2a00;
}
/* Ciemny motyw: wybrany w Ustawieniach albo systemowy (gdy użytkownik nie wybrał jasnego) */
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #121412;
  --surface: #1b1d1b;
  --ink: #ecebe6;
  --ink-2: #c2c0b8;
  --muted: #a09e95;
  --line: #30332f;
  --border: rgba(255, 255, 255, 0.10);
  --brand: #3fbf92;
  --brand-600: #7adbb4;
  --brand-100: #183d30;
  --good: #45c252;
  --good-text: #7ad785;
  --warn: #f2b540;
  --serious: #f0956f;
  --critical: #ef6a6a;
  --neutral: #7b7971;
  --bar: var(--brand);
  --bar-track: #2a3240;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);
  --on-brand: #06140f;
  --subtle: #272a26;
  --subtle-2: #212421;
  --field: #151715;
  --warn-text: #f2c66d;
  --warn-bg: #3a2f12;
  --warn-bg-hover: #463816;
  --warn-border: #5c4a1c;
  --danger-bg: #3b1d1d;
  --critical-text: #f3a3a3;
  --toast-bg: #ecebe6;
  --toast-ink: #0b0b0b;
  --toast-accent: #0b6047;
  --backdrop: rgba(0, 0, 0, 0.6);
  --shadow-strong: rgba(0, 0, 0, 0.5);
  --logo-bg: #f4f5f2;
  --on-warn: #3b2a00;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #121412;
    --surface: #1b1d1b;
    --ink: #ecebe6;
    --ink-2: #c2c0b8;
    --muted: #a09e95;
    --line: #30332f;
    --border: rgba(255, 255, 255, 0.10);
    --brand: #3fbf92;
    --brand-600: #7adbb4;
    --brand-100: #183d30;
    --good: #45c252;
    --good-text: #7ad785;
    --warn: #f2b540;
    --serious: #f0956f;
    --critical: #ef6a6a;
    --neutral: #7b7971;
    --bar: var(--brand);
    --bar-track: #2a3240;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);
    --on-brand: #06140f;
    --subtle: #272a26;
    --subtle-2: #212421;
    --field: #151715;
    --warn-text: #f2c66d;
    --warn-bg: #3a2f12;
    --warn-bg-hover: #463816;
    --warn-border: #5c4a1c;
    --danger-bg: #3b1d1d;
    --critical-text: #f3a3a3;
    --toast-bg: #ecebe6;
    --toast-ink: #0b0b0b;
    --toast-accent: #0b6047;
    --backdrop: rgba(0, 0, 0, 0.6);
    --shadow-strong: rgba(0, 0, 0, 0.5);
    --logo-bg: #f4f5f2;
    --on-warn: #3b2a00;
  --on-warn: #3b2a00;
  }
}
/* Logo ma czarny napis: w ciemnym motywie na jasnym tle */
.logo img { background: var(--logo-bg); border-radius: 6px; }
:root[data-theme="dark"] .logo img { padding: 2px 6px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo img { padding: 2px 6px; } }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--page);
  display: grid;
  grid-template-rows: 56px 1fr;
  grid-template-columns: 236px 1fr;
  grid-template-areas: "top top" "nav main";
  min-height: 100vh;
}
body.bare { display: block; }
body.no-nav { grid-template-columns: 1fr; grid-template-areas: "top" "main"; }
/* Treść 904 px na środku, a .main na całą szerokość: pasek przewijania przy krawędzi okna i przewijanie kółkiem także nad marginesami */
body.no-nav .main { padding-inline: max(28px, calc((100% - 904px) / 2)); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Górny pasek */
.top { grid-area: top; display: flex; align-items: center; gap: 16px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 50; }
/* z-index 50: pasek z menu konta nad treścią strony. view-transition-name robi z paska osobną warstwę, bez tego rozwinięte menu
   chowało się pod treścią i nie dało się w nie kliknąć. Panel wysuwany (60/61) i komunikaty (70) zostają nad paskiem. */
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo img { height: 34px; width: auto; display: block; }
.logo .product { font-weight: 600; font-size: 15px; color: var(--ink-2); padding-left: 10px; border-left: 1px solid var(--line); line-height: 1; }
.login .logo img { height: 48px; }
.login .logo .product { font-size: 18px; }
.top .spacer { margin-left: auto; }
.user { display: flex; align-items: center; gap: 10px; padding-left: 16px; border-left: 1px solid var(--line); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-100); color: var(--brand-600); display: grid; place-items: center; font-weight: 600; font-size: 12px; flex: none; }
.user .name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.user .meta { color: var(--muted); font-size: 12px; }
.user form { margin: 0 0 0 6px; }

/* Menu boczne */
.nav { grid-area: nav; background: var(--surface); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav .group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--ink-2); font-size: 13.5px; }
.nav a:hover { background: var(--subtle); text-decoration: none; }
.nav a.on { background: var(--brand-100); color: var(--brand-600); font-weight: 600; }
.nav a .ico { width: 18px; text-align: center; opacity: .8; }
.nav a .cnt { margin-left: auto; font-size: 11px; background: var(--subtle); color: var(--ink-2); padding: 1px 7px; border-radius: 999px; }
.nav .foot { margin-top: auto; font-size: 11px; color: var(--muted); padding: 10px; line-height: 1.5; border-top: 1px solid var(--line); }

/* Treść */
.main { grid-area: main; padding: 24px 28px 40px; overflow: auto; }
.ph { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.ph h1 { margin: 0 0 4px; font-size: 22px; font-weight: 700; }
.ph p { margin: 0; color: var(--ink-2); }
.ph .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ph .actions form { margin: 0; display: inline; }
.scope { display: inline-block; line-height: 1.5; font-size: 12px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; margin-bottom: 16px; }
.scope b { color: var(--ink); font-weight: 600; }
.scope .lock { color: var(--muted); margin-right: 6px; }

.grid { display: grid; gap: 16px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g21 { grid-template-columns: 2fr 1fr; }
.g12 { grid-template-columns: 1fr 2fr; }
.mt { margin-top: 16px; }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g3, .g21, .g12, .g2 { grid-template-columns: 1fr; } }
@media (max-width: 800px) {
  body { grid-template-columns: 1fr; grid-template-rows: 56px auto 1fr; grid-template-areas: "top" "nav" "main"; }
  body.no-nav { grid-template-rows: 56px 1fr; grid-template-areas: "top" "main"; }
  .top { padding: 0 12px; gap: 10px; min-width: 0; }
  .top .role-chip, .user .meta { display: none; }
  .user { padding-left: 10px; gap: 8px; min-width: 0; }
  .user .name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .logo img { height: 28px; }
  .logo .product { font-size: 13px; padding-left: 8px; }
  .btn { min-height: 40px; }
  .ph h1 { font-size: 20px; }
  .nav { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .nav .group, .nav .foot { display: none; }
  .main, body.no-nav .main { padding: 16px; }
  .g4 { grid-template-columns: 1fr; }
}

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 12px; font-size: 14px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card h2 .more { margin-left: auto; font-size: 12px; font-weight: 500; }
.card + .card { margin-top: 16px; }
/* W siatce odstęp daje gap. Bez tego każda karta poza pierwszą była 16 px niżej (kafelki KPI, „Wymaga uwagi”) */
.grid > .card { margin-top: 0; }
.kpi .v { font-size: 30px; font-weight: 700; line-height: 1.1; margin: 4px 0 2px; }
.kpi .v small { font-size: 16px; font-weight: 500; color: var(--muted); }
.kpi .l { font-size: 12px; color: var(--muted); }
.kpi .d { font-size: 12px; color: var(--ink-2); margin-top: 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kpi.warn .v { color: var(--warn-text); }
.kpi.crit .v { color: var(--critical); }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13.5px; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.nowrap { white-space: nowrap; width: 1%; }
td.wide { min-width: 200px; }
input.compact, select.compact { padding: 5px 8px; font-size: 12.5px; }
input[type=number].compact { width: 64px; }
.btn-row.nowrap { flex-wrap: nowrap; }
tr.row:hover td { background: var(--subtle-2); }
.who { display: flex; align-items: center; gap: 10px; }
.who .avatar { width: 28px; height: 28px; font-size: 11px; }
.who .n { font-weight: 600; }
.who .s { font-size: 12px; color: var(--muted); }
.table-wrap { overflow-x: auto; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--subtle); color: var(--ink-2); white-space: nowrap; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--neutral); flex: none; }
.chip.good .dot { background: var(--good); }
.chip.warn .dot { background: var(--warn); }
.chip.serious .dot { background: var(--serious); }
.chip.crit .dot { background: var(--critical); }
.chip.brand { background: var(--brand-100); color: var(--brand-600); }
.chip.brand .dot { background: var(--brand); }

.btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; padding: 8px 12px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; line-height: 1.2; }
.btn:hover { background: var(--subtle); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-600); }
.btn.sm { padding: 5px 9px; font-size: 12px; }
.btn.danger { color: var(--critical); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.wide { width: 100%; justify-content: center; }
.inline-form { display: inline; margin: 0; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.bar { height: 8px; border-radius: 4px; background: var(--bar-track); overflow: hidden; min-width: 80px; flex: 1; }
.bar > span { display: block; height: 100%; border-radius: 4px; background: var(--bar); }
.bar.brand > span { background: var(--brand); }
.pbar { display: flex; align-items: center; gap: 10px; }
.pbar .pct { font-size: 12px; color: var(--ink-2); min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.hrow { display: grid; grid-template-columns: 190px 1fr 56px; align-items: center; gap: 12px; padding: 7px 0; }
.hrow .lbl { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hrow .val { font-size: 13px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.hrow .bar { height: 12px; }

.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .t { font-weight: 600; font-size: 13.5px; }
.item .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.item .right { margin-left: auto; display: flex; gap: 6px; align-items: center; flex: none; }
.date { min-width: 52px; text-align: center; border-radius: 8px; background: var(--subtle); padding: 6px 4px; flex: none; }
.date .d { font-weight: 700; font-size: 16px; line-height: 1; }
.date .m { font-size: 11px; color: var(--muted); text-transform: uppercase; }

/* Formularze: domyślne widgety Django dziedziczą wygląd po selektorach elementów */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.field .hint, .helptext { font-size: 11.5px; color: var(--muted); font-weight: 400; }
input[type=text], input[type=search], input[type=email], input[type=password], input[type=date], input[type=datetime-local], input[type=number], select, textarea {
  font: inherit; font-size: 13.5px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); color: var(--ink); width: 100%;
}
input:disabled, select:disabled, textarea:disabled { background: var(--subtle-2); color: var(--ink-2); }
textarea { min-height: 84px; resize: vertical; }
select.auto, input.auto { width: auto; }
.check, .field ul { display: flex; flex-direction: column; gap: 4px; list-style: none; margin: 0; padding: 0; }
.field ul li label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 400; color: var(--ink); padding: 4px 0; }
.field ul li input { width: 16px; height: 16px; }
.errorlist { list-style: none; margin: 0; padding: 0; color: var(--critical); font-size: 12px; }
.note { font-size: 12px; color: var(--ink-2); background: var(--subtle-2); border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px; line-height: 1.5; }
.note b { color: var(--ink); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs button { border: 0; background: transparent; font: inherit; font-size: 13px; padding: 8px 12px; cursor: pointer; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--brand-600); border-bottom-color: var(--brand); font-weight: 600; }
.tabpane { display: none; }
.tabpane.on { display: block; }

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl { position: relative; padding: 0 0 18px; }
.tl::before { content: ""; position: absolute; left: -20px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); border: 2px solid var(--surface); }
.tl.future::before { background: var(--surface); border-color: var(--warn); }
.tl .h { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.tl .h b { font-size: 13.5px; }
.tl .h span { font-size: 12px; color: var(--muted); }
.tl p { margin: 4px 0 0; color: var(--ink-2); font-size: 13px; line-height: 1.5; white-space: pre-line; }

.stat-head { display: flex; gap: 20px; align-items: center; }
.stat-head .avatar { width: 56px; height: 56px; font-size: 18px; }
.stat-head h1 { margin: 0; font-size: 20px; }
.stat-head .meta { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

.delta-up { color: var(--good-text); font-weight: 600; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.ro-note { margin-top: 10px; font-size: 12px; color: var(--ink-2); }

.tree { font-size: 13px; line-height: 1.9; }
.tree ul { list-style: none; margin: 0; padding-left: 18px; border-left: 1px dashed var(--line); }
.tree > ul { border-left: 0; padding-left: 0; }
.tree li > span { display: block; line-height: 1.4; padding: 3px 0; }
.tree .tag { display: block; font-size: 12px; color: var(--muted); }

/* Wysuwany panel z prawej (formularze „Nowy cel”, „Nowa propozycja”) */
.drawer-backdrop { position: fixed; inset: 0; background: var(--backdrop); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 60; }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(540px, 100%); background: var(--surface); box-shadow: -8px 0 32px var(--shadow-strong); transform: translateX(100%); transition: transform .25s; z-index: 61; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 16px; font-weight: 600; }
.drawer-head .close { margin-left: auto; }
.drawer-body { padding: 18px 20px 28px; overflow: auto; flex: 1; }
.drawer-body .btn-row { margin-top: 6px; }

.toast { position: fixed; right: 24px; bottom: 24px; max-width: 440px; z-index: 70; display: flex; flex-direction: column; gap: 8px; }
.toast .msg { background: var(--toast-bg); color: var(--toast-ink); padding: 12px 14px; border-radius: 10px; font-size: 13px; line-height: 1.45; box-shadow: 0 8px 24px var(--shadow-strong); opacity: 0; transform: translateY(8px); transition: all .2s; }
.toast .msg.show { opacity: 1; transform: none; }
.toast .msg.error { background: var(--critical); }
.toast .msg b { color: var(--toast-accent); }

.banner { font-size: 12px; color: var(--muted); text-align: center; margin-top: 28px; }

/* Logowanie */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login { width: 100%; max-width: 420px; }
.login .logo { justify-content: center; margin-bottom: 18px; }
.login .demo { margin-top: 14px; }
.login .demo button { width: 100%; justify-content: space-between; margin-top: 6px; }

@media (max-width: 480px) {
  .who-am-i { display: none; }
  .logo .product { font-size: 12px; }
}

/* Fokus klawiatury: jeden, wyraźny styl w całej aplikacji */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.main:focus { outline: none; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 80; background: var(--toast-bg); color: var(--toast-ink); padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { top: 8px; text-decoration: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Pomocnicze */
/* Atrybut hidden wygrywa z display ustawionym w klasach (np. .btn { display: inline-flex }) */
[hidden] { display: none !important; }
.flush { margin: 0; }
.prewrap { margin: 0; white-space: pre-line; line-height: 1.55; }
.field .label { font-size: 12px; color: var(--ink-2); font-weight: 600; }

/* Komentarz pracownika na ekranie rozmowy */
.comment-card { border-left: 4px solid var(--brand); }

/* Moje rozmowy */
.session-card { scroll-margin-top: 72px; }
.session-card h2 { flex-wrap: wrap; }
.session-card.is-awaiting { border-left: 4px solid var(--warn); }
.session-card:target { box-shadow: 0 0 0 3px var(--brand-100), var(--shadow); }
.session-meta { margin: -6px 0 12px; }

/* Widok pracownika: podsumowanie rozmowy i cele */
.scope + .card, .scope + .session-card { margin-top: 0; }
.summary { margin: 0 0 16px; padding: 12px 14px; background: var(--subtle-2); border-radius: 10px; }
.summary h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--ink); }
.summary-list { margin: 0; display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; font-size: 13.5px; }
.summary-list dt { color: var(--ink-2); font-weight: 600; font-size: 12.5px; }
.summary-list dd { margin: 0; }
@media (max-width: 800px) { .summary-list { grid-template-columns: 1fr; gap: 2px; } .summary-list dd { margin-bottom: 8px; } }
.goal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.goal-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.section-title { font-size: 15px; font-weight: 600; margin: 28px 0 0; }
.check-field label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink); }
.check-field input { width: 16px; height: 16px; }
.visibility { font-size: 12px; color: var(--ink-2); margin: -6px 0 12px; }
.visibility.visible-to-employee { color: var(--brand-600); font-weight: 600; }

/* Wnioski o delegację na pulpicie */
.delegation-item .s { max-width: 640px; }
@media (max-width: 800px) { .delegation-item { flex-wrap: wrap; } .delegation-item .right { margin-left: 0; } }

/* Druga linia pod tytułem: wezwanie do działania */
.ph .ph-alert { margin: 6px 0 0; }
.ph-alert a { display: inline-flex; align-items: center; gap: 8px; color: var(--warn-text); font-weight: 600; background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: 999px; padding: 4px 12px; font-size: 13px; }
.ph-alert a::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.ph-alert a:hover { text-decoration: none; background: var(--warn-bg-hover); }

/* Akordeon podsumowania: jedna sekcja otwarta naraz */
.accordion { display: flex; flex-direction: column; gap: 6px; }
.acc-item { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.acc-item > summary { cursor: pointer; list-style: none; padding: 10px 12px; font-size: 13px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.acc-item > summary::-webkit-details-marker { display: none; }
.acc-item > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(-45deg); transition: transform .15s; flex: none; }
.acc-item[open] > summary::before { transform: rotate(45deg); }
.acc-item[open] > summary { border-bottom: 1px solid var(--line); }
.acc-body { padding: 10px 12px 12px; font-size: 13.5px; }

/* Rozwijane sekcje: zakończone cele, wcześniejsze rozmowy */
.disclosure > summary { cursor: pointer; list-style: none; font-size: 13.5px; font-weight: 600; color: var(--brand-600); display: inline-flex; align-items: center; gap: 8px; padding: 6px 0; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.disclosure[open] > summary::before { transform: rotate(45deg); }
.card .disclosure { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.past-sessions > summary { font-size: 15px; color: var(--ink); margin-top: 12px; }

/* Lista celów pracownika: bez postępu, tylko cel, miara sukcesu i termin */
.goal-rows { list-style: none; margin: 0; padding: 0; }
.goal-rows li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.goal-rows li:last-child { border-bottom: 0; }
.goal-main { display: flex; flex-direction: column; gap: 2px; }
.goal-title { font-weight: 600; font-size: 13.5px; }
.goal-meta { text-align: right; flex: none; }
@media (max-width: 800px) { .goal-rows li { flex-direction: column; gap: 4px; } .goal-meta { text-align: left; } }

/* Logowanie */
.login-lead { margin: 4px 0 14px; color: var(--ink-2); text-align: center; }
.login-foot { margin: 18px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
.login-error { margin: 0 0 14px; padding: 10px 12px; border-radius: 8px; background: var(--danger-bg); color: var(--critical-text); font-size: 13px; }

/* Ekran rozmowy: trzy kroki */
.steps-card { padding-top: 6px; }
.tabs.steps button { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 10px 14px; }
.step-no { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--subtle); color: var(--ink-2); }
.tabs.steps button.on .step-no { background: var(--brand); color: var(--on-brand); }
.step-done { color: var(--good-text); font-weight: 700; }
.howto { margin: 0 0 14px; padding-left: 20px; color: var(--ink-2); font-size: 13.5px; line-height: 1.6; }
.schedule-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.schedule-row .field { margin-bottom: 0; min-width: 260px; }
.close-box { border-top: 1px solid var(--line); padding-top: 14px; }
.close-box h3 { margin: 0 0 10px; font-size: 14px; }
.draft-alert { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn-text); font-size: 13px; font-weight: 600; }

/* Mój zespół: kafelki osób */
.kpi-row .kpi .v { font-size: 24px; }
.person-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.person-card { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.card + .person-card { margin-top: 0; }
.person-head { display: flex; align-items: flex-start; gap: 10px; }
.person-head .chip { margin-left: auto; }
.person-id { min-width: 0; }
.person-name { font-weight: 600; color: var(--ink); }
.person-facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; }
.person-facts dt { color: var(--muted); }
.person-facts dd { margin: 0; text-align: right; }
.person-card footer { margin-top: auto; }
.team-section > summary { font-size: 14px; color: var(--ink); }

/* Karta pracownika */
.pending-alert { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: var(--warn-bg); border: 1px solid var(--warn-border); color: var(--warn-text); }
.pending-icon { width: 22px; height: 22px; border-radius: 50%; background: var(--warn); color: var(--on-warn); display: grid; place-items: center; font-weight: 700; flex: none; }
.freq-form { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 0; }

/* Menu konta pod awatarem */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; border-radius: 10px; padding: 4px 6px; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover { background: var(--subtle); }
.who-am-i { display: flex; flex-direction: column; }
.caret { width: 7px; height: 7px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: rotate(45deg); margin: 0 4px 3px 2px; }
.user-dropdown { position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px var(--shadow-strong); padding: 6px; z-index: 70; display: flex; flex-direction: column; }
.user-dropdown a, .user-dropdown button { display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 8px; color: var(--ink); font: inherit; font-size: 13.5px; background: none; border: 0; cursor: pointer; }
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--subtle); text-decoration: none; }
.user-dropdown form { margin: 0; border-top: 1px solid var(--line); padding-top: 4px; margin-top: 4px; }

/* Ustawienia i Pomoc */
.theme-options { display: flex; gap: 10px; flex-wrap: wrap; border: 0; margin: 0 0 12px; padding: 0; }
.theme-options label { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 13.5px; }
.theme-options input { width: 16px; height: 16px; }
.theme-options label:has(input:checked) { border-color: var(--brand); background: var(--brand-100); color: var(--brand-600); font-weight: 600; }
.help h2 { margin-top: 0; }
.help ol, .help ul { margin: 0; padding-left: 20px; line-height: 1.65; font-size: 13.5px; color: var(--ink-2); }
.help li + li { margin-top: 4px; }
.help b { color: var(--ink); }

/* Karta pracownika: akcje pod wartością w podsumowaniu */
.dd-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* Krok „Termin”, gdy data jest już zapisana */
.schedule-set { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: 10px; background: var(--brand-100); color: var(--brand-600); }
.schedule-set b { font-size: 16px; }
.schedule-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.schedule-row .btn { min-height: 42px; }
.steps-card .disclosure { margin-top: 14px; }

/* Cele: lista statusu zapisuje się sama */
.status-select { min-width: 150px; }
[data-goal-cell] .small { margin-top: 4px; }
td.saved { animation: saved-flash 1.4s ease-out; }
tr.leaving { opacity: 0; transition: opacity .35s ease; }
@keyframes saved-flash { from { background: var(--brand-100); } to { background: transparent; } }

/* Mój zespół: wyszukiwarka i filtr statusu */
.team-filter { display: flex; gap: 10px 14px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.team-filter input[type=search] { max-width: 280px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 10px; background: var(--subtle); }
.seg button { border: 0; background: transparent; font: inherit; font-size: 13px; color: var(--ink-2); padding: 7px 11px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px var(--shadow-strong); }
.seg .cnt { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.filter-empty { margin: 0; flex-basis: 100%; }
.person-card[hidden], .team-section[hidden], .section-title[hidden] { display: none; }

/* Przyciski wysyłające formularz: stan „w toku”, żeby nie klikać dwa razy (przycisk nie jest blokowany, bo zgubiłby name/value) */
.btn.is-busy { pointer-events: none; opacity: .8; }
.btn.is-busy::after { content: ""; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Wskaźnik aktywnej zakładki przesuwany płynnie (JS ustawia położenie i szerokość) */
.tabs { position: relative; }
.tab-ind { position: absolute; left: 0; bottom: -1px; height: 2px; width: var(--ind-w, 0); transform: translateX(var(--ind-x, 0)); background: var(--brand); border-radius: 2px; pointer-events: none; }
.tabs.has-ind button.on { border-bottom-color: transparent; }

/* Płynność: przejścia między ekranami, zakładkami i sekcjami. Wyłączone, gdy system ma „ogranicz ruch”. */
@media (prefers-reduced-motion: no-preference) {
  /* Przejście między ekranami (Edge, Chrome): pasek górny i menu stoją, zmienia się tylko treść */
  @view-transition { navigation: auto; }
  .top { view-transition-name: top; }
  .nav { view-transition-name: nav; }
  .main { view-transition-name: main; scroll-behavior: smooth; }
  ::view-transition-group(top), ::view-transition-group(nav) { animation-duration: 0s; }
  ::view-transition-old(main) { animation: vt-out .12s ease-in both; }
  ::view-transition-new(main) { animation: vt-in .26s cubic-bezier(.2, .8, .2, 1) both; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .12s; }

  /* Zakładki: treść wjeżdża z kierunku kliknięcia, wskaźnik przesuwa się pod etykietami */
  .tabpane.on { animation: pane-in .24s cubic-bezier(.2, .8, .2, 1) both; }
  [data-tab-dir="next"] > .tabpane.on { animation-name: pane-in-next; }
  [data-tab-dir="prev"] > .tabpane.on { animation-name: pane-in-prev; }
  .tab-ind { transition: transform .28s cubic-bezier(.2, .8, .2, 1), width .28s cubic-bezier(.2, .8, .2, 1); }

  /* Rozwijane sekcje otwierają się płynnie (Edge i Chrome od 131, starsze otwierają od razu) */
  :root { interpolate-size: allow-keywords; }
  details:not(.user-menu)::details-content { block-size: 0; overflow: clip; overflow-clip-margin: 10px; transition: block-size .28s cubic-bezier(.2, .8, .2, 1), content-visibility .28s allow-discrete; }
  details:not(.user-menu)[open]::details-content { block-size: auto; }
  .user-menu[open] .user-dropdown { animation: pop-in .16s cubic-bezier(.2, .8, .2, 1) both; transform-origin: top right; }

  /* Drobne reakcje na wskazanie i kliknięcie */
  .btn, .seg button, .nav a, .acc-item > summary, .theme-options label { transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s; }
  .btn:active, .seg button:active { transform: translateY(1px); }
  .person-card { transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s; }
  .person-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -8px var(--shadow-strong); }
  .bar > span { animation: bar-grow .8s cubic-bezier(.2, .8, .2, 1) backwards; transform-origin: left; }
  /* backwards: po animacji nie trzyma transform, więc nie blokuje uniesienia kafelka przy wskazaniu */
  .person-card { animation: rise-in .32s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(min(var(--i, 0), 12) * 25ms); }
}
@keyframes vt-out { to { opacity: 0; transform: translateY(-4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes pane-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes pane-in-next { from { opacity: 0; transform: translateX(14px); } }
@keyframes pane-in-prev { from { opacity: 0; transform: translateX(-14px); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes bar-grow { from { transform: scaleX(0); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(6px); } }

/* Telefon i wąskie okno. Na końcu, żeby wygrać z regułami wyżej (np. .who-am-i) */
@media (max-width: 800px) {
  .g4 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi .v, .kpi-row .kpi .v { font-size: 24px; }
  .btn { min-height: 44px; }
  .nav a { min-height: 44px; }
  .user-dropdown a, .user-dropdown button { padding: 13px 12px; }
  .card h2 .more { padding: 8px 0; }
  .item { flex-wrap: wrap; }
  .item .right { margin-left: 0; flex-basis: 100%; flex-wrap: wrap; }
  .item .date ~ .right { padding-left: 64px; }
  .tabs.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
  .tabs.steps button { flex-direction: column; justify-content: center; gap: 4px; padding: 8px 4px 10px; font-size: 12.5px; text-align: center; }
  .tabs.steps .step-done { display: none; }
  .tabs.steps button:has(.step-done):not(.on) .step-no { background: var(--brand-100); color: var(--brand-600); }
  .team-filter input[type=search] { max-width: none; }
  .seg { width: 100%; }
  .seg button { flex: 1 1 auto; justify-content: center; min-height: 40px; }
  .hrow { grid-template-columns: 1fr 48px; gap: 4px 12px; }
  .hrow .bar { grid-column: 1 / -1; grid-row: 2; }
  .schedule-row .field { min-width: 0; flex: 1 1 100%; }
}
@media (max-width: 600px) {
  .who-am-i { display: none; }
  .top .role-chip { display: none; }
}

/* Na końcu arkusza, żeby wygrać z bazową regułą pól (13,5 px): iPhone nie powiększa strony przy polach od 16 px */
@media (max-width: 800px) {
  input[type=text], input[type=search], input[type=email], input[type=password], input[type=date], input[type=datetime-local], input[type=number], select, textarea { font-size: 16px; }
}
